diff --git a/Assets/Scripts/ServerShared/Agents/Agent.cs b/Assets/Scripts/ServerShared/Agents/Agent.cs index 238df3ce7..937096a7d 100644 --- a/Assets/Scripts/ServerShared/Agents/Agent.cs +++ b/Assets/Scripts/ServerShared/Agents/Agent.cs @@ -57,7 +57,7 @@ public class Agent { // The pilot tick writes Turn every tick, in every state: a state that pilots overwrites this zero with its // demand, and one that does not leaves the hull holding course instead of inheriting the last state's rate. - Ship.Turn = 0; + /*DEL turn0*/ VentOnTrack(); _currentState.Update(delta); foreach (var transition in _currentState.Transitions) @@ -84,7 +84,7 @@ public class Agent { if (Ship.HasActiveConsumable(kind)) return; var consumable = Ship.FirstCarriedConsumable(kind); - if (consumable != null) Ship.TryActivateConsumable(consumable); + if (consumable != null) /*DEL use*/; } public void Accelerate(float2 targetVelocity, bool noTurn = false) @@ -95,18 +95,18 @@ public class Agent // If Delta V is above the threshold, direct the ship towards the delta and use only main thrusters if (!noTurn && deltaVMag > FORWARD_DELTA_THRESHOLD) { - Ship.Turn = Steering.Toward(Ship, deltaVDirection); - Ship.MovementDirection = float2(0, pow(dot(Ship.Direction, deltaVDirection), 2)); + /*DEL accel-turn*/ + /*DEL accel-move1*/ } // If Delta V is low, use all thrusters and leave Turn to the caller (MoveTo already pointed it at the target) else if(deltaVMag > THRUST_DELTA_THRESHOLD) { var right = Ship.Direction.Rotate(ItemRotation.Clockwise); - Ship.MovementDirection = float2(dot(right, deltaVDirection), dot(Ship.Direction, deltaVDirection)); + /*DEL accel-move2*/ } else { - Ship.MovementDirection = float2.zero; + /*DEL accel-move3*/ } } } diff --git a/Assets/Scripts/ServerShared/Agents/Flight.cs b/Assets/Scripts/ServerShared/Agents/Flight.cs index de3c8f0c0..e7fbecfa8 100644 --- a/Assets/Scripts/ServerShared/Agents/Flight.cs +++ b/Assets/Scripts/ServerShared/Agents/Flight.cs @@ -115,7 +115,7 @@ public class Flight { track.Phase = Phase.Hailing; track.Start = _time; - if (!string.IsNullOrEmpty(_doctrine.Hail)) Nearest(entity)?.Agent.Ship.SetMessage(_doctrine.Hail); + if (!string.IsNullOrEmpty(_doctrine.Hail)) /*DEL hail*/; } else track.Phase = Phase.Engaged; break; @@ -175,7 +175,7 @@ public class Flight private static void Aim(Ship ship, Entity target) { var wanted = target == null ? TargetRef.None : new TargetRef(target); - if (!ship.Target.Value.Equals(wanted)) ship.SetTarget(wanted); + if (!ship.Target.Value.Equals(wanted)) /*DEL designate*/; } private float Standoff(Ship ship) diff --git a/Assets/Scripts/ServerShared/Agents/States/Combat.cs b/Assets/Scripts/ServerShared/Agents/States/Combat.cs index 499f631b0..4ca637212 100644 --- a/Assets/Scripts/ServerShared/Agents/States/Combat.cs +++ b/Assets/Scripts/ServerShared/Agents/States/Combat.cs @@ -70,7 +70,7 @@ public class CombatState : BaseState bestTargetItem = reveal.Item; } } - _agent.Ship.TrySelectTargetItem(bestTargetItem); + /*DEL select*/ for (var i = 0; i < _agent.Ship.WeaponGroups.Length; i++) { @@ -94,7 +94,7 @@ public class CombatState : BaseState if (dps > .1) _availableGroups.Add((i, dps)); } - foreach(var w in _availableLockingWeapons) w.Activate(); + foreach(var w in _availableLockingWeapons) /*DEL lock*/; UseConsumables(toTarget, targetDistance); @@ -140,13 +140,13 @@ public class CombatState : BaseState foreach (var weapon in _agent.Ship.WeaponGroups[selectedGroup].weapons) { if (FireControl.AgentFires(weapon, _agent.Ship, target, _agent.Doctrine.MinHitProbability)) - weapon.Activate(); + /*DEL pull*/; else if (weapon.Firing) - weapon.Deactivate(); + /*DEL release*/; } } - _agent.Ship.Aim = toTarget; - _agent.Ship.Turn = Steering.Toward(_agent.Ship, toTarget.xz); + /*DEL aim*/ + /*DEL turn*/ _agent.Accelerate(movementDirection * _agent.TopSpeed, true);//selectedGroup >= 0); // Fire charged guns! diff --git a/Assets/Scripts/ServerShared/Agents/States/Follow.cs b/Assets/Scripts/ServerShared/Agents/States/Follow.cs index 908ecd257..c63b07a06 100644 --- a/Assets/Scripts/ServerShared/Agents/States/Follow.cs +++ b/Assets/Scripts/ServerShared/Agents/States/Follow.cs @@ -20,7 +20,7 @@ public class FollowState : BaseState var pull = direction * (float) sign(error) * saturate(abs(error) / max(task.Standoff, 1f)); var desired = task.Anchor.Velocity + pull * _agent.TopSpeed; - _agent.Ship.Aim = float3(direction.x, 0, direction.y); + /*DEL aim*/ _agent.Accelerate(desired); } } diff --git a/Assets/Scripts/ServerShared/Agents/States/MoveTo.cs b/Assets/Scripts/ServerShared/Agents/States/MoveTo.cs index b677cf0cd..ba203c8cb 100644 --- a/Assets/Scripts/ServerShared/Agents/States/MoveTo.cs +++ b/Assets/Scripts/ServerShared/Agents/States/MoveTo.cs @@ -23,8 +23,8 @@ public abstract class MoveToState : BaseState // We want to go top speed in the direction of our target var desiredVelocity = dir * _agent.TopSpeed; - _agent.Ship.Aim = float3(dir.x, 0, dir.y); - _agent.Ship.Turn = Steering.Toward(_agent.Ship, dir); + /*DEL aim*/ + /*DEL turn*/ _agent.Accelerate(desiredVelocity); } }