Advertisement
Iridar51

Untitled

Aug 8th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class X2Action_FaceEnemy extends X2Action;
  2.  
  3. var vector ToTargetActor;
  4. var XComUnitPawn TargetPawn;
  5. var XComGameStateContext_Ability AbilityContext;
  6.  
  7. function Init()
  8. {
  9. AbilityContext = XComGameStateContext_Ability(StateChangeContext);
  10. TargetPawn = XGUnit(`XCOMHISTORY.GetGameStateForObjectID(AbilityContext.InputContext.PrimaryTarget.ObjectID).GetVisualizer()).GetPawn();
  11.  
  12.  
  13. ToTargetActor = TargetPawn.Location - UnitPawn.Location;
  14. ToTargetActor.Z = 0;
  15. ToTargetActor = Normal(ToTargetActor);
  16.  
  17. if( AbilityContext != none )
  18. {
  19. super.Init();
  20. }
  21. else
  22. {
  23. super.Init();
  24. AbilityContext = XComGameStateContext_Ability(StateChangeContext);
  25. }
  26. }
  27.  
  28. simulated state Executing
  29. {
  30. Begin:
  31. Unit.IdleStateMachine.ForceHeading(ToTargetActor);
  32. Sleep(0.1f);
  33. while(Unit.IdleStateMachine.IsEvaluatingStance())
  34. {
  35. Sleep(0.0f);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement