summaryrefslogtreecommitdiffhomepage
path: root/Stars45/StarshipAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/StarshipAI.cpp')
-rw-r--r--Stars45/StarshipAI.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/Stars45/StarshipAI.cpp b/Stars45/StarshipAI.cpp
index 2209b09..19de0c6 100644
--- a/Stars45/StarshipAI.cpp
+++ b/Stars45/StarshipAI.cpp
@@ -65,7 +65,7 @@ StarshipAI::StarshipAI(SimObject* s)
tactical = new(__FILE__,__LINE__) StarshipTacticalAI(this);
}
- sub_select_time = Game::GameTime() + (DWORD) Random(0, 2000);
+ sub_select_time = Game::GetInstance()->GameTime() + (DWORD) Random(0, 2000);
point_defense_time = sub_select_time;
}
@@ -101,7 +101,7 @@ StarshipAI::FindObjective()
// if not the element leader, stay in formation:
if (form && element_index > 1) {
- ship->SetDirectorInfo(Game::GetText("ai.formation"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.formation"));
if (navpt && navpt->Action() == Instruction::LAUNCH) {
FindObjectiveNavPoint();
@@ -135,7 +135,7 @@ StarshipAI::FindObjective()
if (support) {
double d_support = Point(support->Location() - ship->Location()).length();
if (d_support > 35e3) {
- ship->SetDirectorInfo(Game::GetText("ai.regroup"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.regroup"));
FindObjectiveTarget(support);
objective = Transform(obj_w);
return;
@@ -144,7 +144,7 @@ StarshipAI::FindObjective()
// run away:
else if (threat && threat != target) {
- ship->SetDirectorInfo(Game::GetText("ai.retreat"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.retreat"));
obj_w = ship->Location() + Point(ship->Location() - threat->Location()) * 100;
objective = Transform(obj_w);
return;
@@ -154,44 +154,44 @@ StarshipAI::FindObjective()
// weapons hold:
if (hold) {
if (navpt) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.holding"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.holding"));
objective = Point();
}
}
// normal processing:
else if (target) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
FindObjectiveTarget(target);
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
}
else if (ward) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
FindObjectiveFormation();
}
else if (navpt) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
}
else if (rumor) {
- ship->SetDirectorInfo(Game::GetText("ai.search"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search"));
FindObjectiveTarget(rumor);
}
@@ -210,7 +210,7 @@ StarshipAI::Navigator()
{
// signifies this ship is a dead hulk:
if (ship && ship->Design()->auto_roll < 0) {
- ship->SetDirectorInfo(Game::GetText("ai.dead"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.dead"));
return;
}
@@ -226,11 +226,11 @@ StarshipAI::Navigator()
if (!ship->GetDirectorInfo()) {
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
else if (ship->GetWard())
- ship->SetDirectorInfo(Game::GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
else
- ship->SetDirectorInfo(Game::GetText("ai.patrol"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
}
if (farcaster && distance < 25e3) {
@@ -638,7 +638,7 @@ StarshipAI::FireControl()
System*
StarshipAI::SelectSubtarget()
{
- if (Game::GameTime() - sub_select_time < 2345)
+ if (Game::GetInstance()->GameTime() - sub_select_time < 2345)
return subtarget;
subtarget = 0;
@@ -655,7 +655,7 @@ StarshipAI::SelectSubtarget()
double dist = 50e3;
Point svec = ship->Location() - tgt_ship->Location();
- sub_select_time = Game::GameTime();
+ sub_select_time = Game::GetInstance()->GameTime();
// first pass: turrets
ListIter<WeaponGroup> g_iter = tgt_ship->Weapons();
@@ -726,7 +726,7 @@ StarshipAI::SelectSubtarget()
bool
StarshipAI::AssessTargetPointDefense()
{
- if (Game::GameTime() - point_defense_time < 3500)
+ if (Game::GetInstance()->GameTime() - point_defense_time < 3500)
return tgt_point_defense;
tgt_point_defense = false;
@@ -742,7 +742,7 @@ StarshipAI::AssessTargetPointDefense()
Weapon* subtgt = 0;
Point svec = ship->Location() - tgt_ship->Location();
- point_defense_time = Game::GameTime();
+ point_defense_time = Game::GetInstance()->GameTime();
// first pass: turrets
ListIter<WeaponGroup> g_iter = tgt_ship->Weapons();