コード例 #1
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
     index = 0;
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         ap.GotoVec(Eval(0), Cruise != AiGotoKind.GotoNoCruise, MaxThrottle);
     }
 }
コード例 #2
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
     if (obj.TryGetComponent <WeaponControlComponent>(out var weapons))
     {
         weapons.AimPoint = Vector3.Transform(Vector3.Zero, target.WorldTransform);
         weapons.FireAll();
     }
 }
コード例 #3
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
     t += time;
     if (t >= Duration)
     {
         ai.SetState(Next);
     }
 }
コード例 #4
0
ファイル: AiDockState.cs プロジェクト: Regenhardt/Librelancer
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap) &&
         target.TryGetComponent <SDockableComponent>(out var dock))
     {
         dock.StartDock(obj, 0);
         ap.StartDock(target);
     }
 }
コード例 #5
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         ap.GotoVec(Target, Cruise != AiGotoKind.GotoNoCruise, MaxThrottle, Range);
         if (Cruise == AiGotoKind.GotoCruise)
         {
             obj.GetComponent <ShipPhysicsComponent>().BeginCruise();
         }
     }
 }
コード例 #6
0
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         if (ap.CurrentBehaviour == AutopilotBehaviours.None)
         {
             ;
         }
         ai.SetState(Next);
     }
     else
     {
         ai.SetState(Next);
     }
 }
コード例 #7
0
 public override void Update(GameObject obj, SNPCComponent ai, double dt)
 {
     if (obj.TryGetComponent <AutopilotComponent>(out var ap))
     {
         if (ap.CurrentBehaviour == AutopilotBehaviours.None)
         {
             if (index + 1 < 4)
             {
                 index++;
                 //ap.GotoVec(Points[index], Cruise, MaxThrottle, Range);
                 ap.GotoVec(Eval(times[index]), Cruise != AiGotoKind.GotoNoCruise, MaxThrottle);
             }
             else
             {
                 ai.SetState(Next);
             }
         }
     }
     else
     {
         ai.SetState(Next);
     }
 }
コード例 #8
0
ファイル: AiDockState.cs プロジェクト: Regenhardt/Librelancer
 public override void Update(GameObject obj, SNPCComponent ai, double time)
 {
 }
コード例 #9
0
 public abstract void Update(GameObject obj, SNPCComponent ai, double dt);
コード例 #10
0
 public abstract void OnStart(GameObject obj, SNPCComponent ai);
コード例 #11
0
 public override void OnStart(GameObject obj, SNPCComponent ai)
 {
 }