summaryrefslogtreecommitdiffhomepage
path: root/Stars45/FighterAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/FighterAI.cpp')
-rw-r--r--Stars45/FighterAI.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/Stars45/FighterAI.cpp b/Stars45/FighterAI.cpp
index 5292806..409a89b 100644
--- a/Stars45/FighterAI.cpp
+++ b/Stars45/FighterAI.cpp
@@ -211,7 +211,7 @@ FighterAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.launch"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.launch"));
return;
}
else {
@@ -226,7 +226,7 @@ FighterAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.takeoff"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.takeoff"));
return;
}
@@ -247,14 +247,14 @@ FighterAI::FindObjective()
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.inbound"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.inbound"));
return;
}
// final approach
else {
- ship->SetDirectorInfo(Game::GetText("ai.finals"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.finals"));
obj_w = deck->StartPoint();
if (inbound->Final()) {
@@ -427,7 +427,7 @@ FighterAI::ReturnToBase(Ship* controller)
// transform into camera coords:
objective = Transform(obj_w);
- ship->SetDirectorInfo(Game::GetText("ai.return-to-base"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.return-to-base"));
rtb_code = 1;
}
@@ -626,7 +626,7 @@ FighterAI::Navigator()
}
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
accumulator.Clear();
magnitude = 0;
@@ -716,7 +716,7 @@ FighterAI::HelmControl()
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.station-keeping"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.station-keeping"));
station_keeping = true;
// go into a slow orbit if airborne:
@@ -1121,7 +1121,7 @@ FighterAI::AvoidTerrain()
if (ship->AltitudeMSL() > 25e3) {
if (!navpt || (navpt->Region() == ship->GetRegion() && navpt->Location().z < 27e3)) {
terrain_warning = true;
- ship->SetDirectorInfo(Game::GetText("ai.too-high"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-high"));
// where will we be?
Point selfpt = ship->Location() + ship->Velocity() + Point(0, -15e3, 0);
@@ -1137,11 +1137,11 @@ FighterAI::AvoidTerrain()
// too low?
else if (ship->AltitudeAGL() < 2500) {
terrain_warning = true;
- ship->SetDirectorInfo(Game::GetText("ai.too-low"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-low"));
// way too low?
if (ship->AltitudeAGL() < 1500) {
- ship->SetDirectorInfo(Game::GetText("ai.way-too-low"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.way-too-low"));
target = 0;
drop_time = 5;
}
@@ -1189,7 +1189,7 @@ FighterAI::SeekTarget()
if (patrol) {
Steer result = Seek(objective);
- ship->SetDirectorInfo(Game::GetText("ai.seek-patrol-point"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-patrol-point"));
if (distance < 10 * self->Radius()) {
patrol = 0;
@@ -1209,7 +1209,7 @@ FighterAI::SeekTarget()
result.stop = 1;
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.seek-inbound"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-inbound"));
// approach legs:
if (inbound->Approach() > 0) {
@@ -1241,7 +1241,7 @@ FighterAI::SeekTarget()
}
else if (!inbound->Cleared() && distance < 2000) {
- ship->SetDirectorInfo(Game::GetText("ai.hold-final"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.hold-final"));
result = Steer();
result.brake = 1;
result.stop = 1;
@@ -1267,7 +1267,7 @@ FighterAI::SeekTarget()
}
else if (navpt && navpt->Action() == Instruction::LAUNCH) {
- ship->SetDirectorInfo(Game::GetText("ai.launch"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.launch"));
return Seek(objective);
}
@@ -1276,7 +1276,7 @@ FighterAI::SeekTarget()
if (element_index > 1)
return SeekFormationSlot();
- ship->SetDirectorInfo(Game::GetText("ai.seek-farcaster"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-farcaster"));
return Seek(objective);
}
@@ -1338,13 +1338,13 @@ FighterAI::SeekTarget()
return Steer();
}
- ship->SetDirectorInfo(Game::GetText("ai.seek-target"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
return Seek(objective);
}
}
if (navpt) {
- ship->SetDirectorInfo(Game::GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
}
return Seek(objective);
@@ -1414,7 +1414,7 @@ FighterAI::SeekFormationSlot()
}
seeking = 1;
- ship->SetDirectorInfo(Game::GetText("ai.seek-formation"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-formation"));
return s;
}
@@ -1497,7 +1497,7 @@ FighterAI::EvadeThreat()
}
// beam the missile
- ship->SetDirectorInfo(Game::GetText("ai.evade-missile"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-missile"));
Point beam_line = threat_missile->Velocity().cross(Point(0,1,0));
beam_line.Normalize();
@@ -1530,7 +1530,7 @@ FighterAI::EvadeThreat()
}
if (threat_dist <= threat_range) {
- ship->SetDirectorInfo(Game::GetText("ai.evade-threat"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-threat"));
if (ship->IsAirborne()) {
evading = true;
@@ -1553,7 +1553,7 @@ FighterAI::EvadeThreat()
}
if (!target) {
- ship->SetDirectorInfo(Game::GetText("ai.evade-starship"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-starship"));
// flee for three seconds:
if ((ship->MissionClock() & 3) != 3) {
@@ -1562,8 +1562,8 @@ FighterAI::EvadeThreat()
// jink for one second:
else {
- if (Game::GameTime() - jink_time > 1500) {
- jink_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - jink_time > 1500) {
+ jink_time = Game::GetInstance()->GameTime();
jink = Point(rand() - 16384,
rand() - 16384,
rand() - 16384) * 15e3;
@@ -1577,7 +1577,7 @@ FighterAI::EvadeThreat()
}
else {
- ship->SetDirectorInfo(Game::GetText("ai.evade-and-seek"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-and-seek"));
// seek for three seconds:
if ((ship->MissionClock() & 3) < 3) {
@@ -1586,8 +1586,8 @@ FighterAI::EvadeThreat()
// jink for one second:
else {
- if (Game::GameTime() - jink_time > 1000) {
- jink_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - jink_time > 1000) {
+ jink_time = Game::GetInstance()->GameTime();
jink = Point(rand() - 16384,
rand() - 16384,
rand() - 16384);
@@ -1622,9 +1622,9 @@ FighterAI::EvadeThreat()
}
if (target)
- ship->SetDirectorInfo(Game::GetText("ai.evade-and-seek"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-and-seek"));
else
- ship->SetDirectorInfo(Game::GetText("ai.random-evade"));
+ ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.random-evade"));
// beam the threat
Point beam_line = threat->Velocity().cross(Point(0,1,0));
@@ -1646,8 +1646,8 @@ FighterAI::EvadeThreat()
if (!target) {
DWORD jink_rate = 400 + 200 * (3-ai_level);
- if (Game::GameTime() - jink_time > jink_rate) {
- jink_time = Game::GameTime();
+ if (Game::GetInstance()->GameTime() - jink_time > jink_rate) {
+ jink_time = Game::GetInstance()->GameTime();
jink = Point(rand() - 16384,
rand() - 16384,
rand() - 16384) * 2000;
@@ -1776,7 +1776,7 @@ FighterAI::FireControl()
if (ship->FireSecondary()) {
missile_time = secondary->Design()->salvo_delay + extra_time;
- if (Game::GameTime() - last_call_time > 6000) {
+ if (Game::GetInstance()->GameTime() - last_call_time > 6000) {
// call fox:
int call = RadioMessage::FOX_3; // A2A
@@ -1787,7 +1787,7 @@ FighterAI::FireControl()
call = RadioMessage::FOX_2;
RadioTraffic::SendQuickMessage(ship, call);
- last_call_time = Game::GameTime();
+ last_call_time = Game::GetInstance()->GameTime();
}
}
}