Skip to content

Commit

Permalink
Update 9
Browse files Browse the repository at this point in the history
  • Loading branch information
DivverGit committed Oct 9, 2019
1 parent 9c638f9 commit b30fdc6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Controllers/c_Modules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ public static void OffensePulse(Entity target)
if (module.IsValid && !module.IsActive && !module.IsReloadingAmmo)
{
double engageRange = missileLauncherObject.maxFlightRange;
Daedalus.DaedalusUI.newConsoleMessage("c_Modules: maxFlightRange=" + engageRange.ToString());
double distanceToTarget = f_Entities.GetDistanceBetween(target);
if (distanceToTarget < engageRange) module.Activate();
if (distanceToTarget < engageRange)
{
Daedalus.DaedalusUI.newConsoleMessage("c_Modules: MissileLauncher firing");
module.Activate();
}
}
}
else if (moduleObject is Module.Turret)
Expand All @@ -85,7 +90,12 @@ public static void OffensePulse(Entity target)
double? optimalRange = turretObject.optimalRange;
double? engageRange = (falloffRange + optimalRange);
double distanceToTarget = f_Entities.GetDistanceBetween(target);
if (distanceToTarget < engageRange) module.Activate();
Daedalus.DaedalusUI.newConsoleMessage("c_Modules: engageRange=" + engageRange.ToString() + " - distanceToTarget=" + distanceToTarget.ToString());
if (distanceToTarget < engageRange)
{
Daedalus.DaedalusUI.newConsoleMessage("c_Modules: Turret firing");
module.Activate();
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Functions/f_Modules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static List<IModule> LowPowerModules()

public static void GetAllModules()
{
c_Modules.modules = new List<Controllers.Module>();
GetAfterburnerModules();
GetArmorHardenerModules();
GetArmorRepairModules();
Expand Down
3 changes: 3 additions & 0 deletions Routines/r_Combat_Active.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,20 @@ public static void DoCombat()

if (primaryTarget.IsLockedTarget)
{
Daedalus.DaedalusUI.newConsoleMessage("r_Combat_Active: Primary is locked");
if (primaryTarget.IsActiveTarget)
{
if (orbitTargetID != primaryTarget.ID)
{
orbitTargetID = primaryTarget.ID;
f_Movement.Orbit(primaryTarget, Convert.ToInt32(UI.orbitRange));
}
Daedalus.DaedalusUI.newConsoleMessage("r_Combat_Active: OffensePulse()");
c_Modules.OffensePulse(primaryTarget);
}
else if (!primaryTarget.IsActiveTarget)
{
Daedalus.DaedalusUI.newConsoleMessage("r_Combat_Active: Making primary active");
primaryTarget.MakeActiveTarget();
}
}
Expand Down

0 comments on commit b30fdc6

Please sign in to comment.