summaryrefslogtreecommitdiffhomepage
path: root/Stars45/ShipAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/ShipAI.cpp')
-rw-r--r--Stars45/ShipAI.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/Stars45/ShipAI.cpp b/Stars45/ShipAI.cpp
index 71c1abe..892f41e 100644
--- a/Stars45/ShipAI.cpp
+++ b/Stars45/ShipAI.cpp
@@ -36,6 +36,7 @@
#include "Asteroid.h"
#include "Game.h"
+#include "ContentBundle.h"
#include "Random.h"
// +----------------------------------------------------------------------+
@@ -383,7 +384,7 @@ ShipAI::FindObjective()
// if not the element leader, stay in formation:
if (form && element_index > 1) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.formation"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.formation"));
if (navpt && navpt->Action() == Instruction::LAUNCH) {
FindObjectiveNavPoint();
@@ -411,7 +412,7 @@ ShipAI::FindObjective()
if (support) {
double d_support = Point(support->Location() - ship->Location()).length();
if (d_support > 35e3) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.regroup"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.regroup"));
FindObjectiveTarget(support);
objective = Transform(obj_w);
return;
@@ -420,7 +421,7 @@ ShipAI::FindObjective()
// run away:
else if (threat != target) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.retreat"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.retreat"));
obj_w = ship->Location() + Point(ship->Location() - threat->Location()) * 100;
objective = Transform(obj_w);
return;
@@ -429,31 +430,31 @@ ShipAI::FindObjective()
// normal processing:
if (target) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target"));
FindObjectiveTarget(target);
objective = AimTransform(obj_w);
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
objective = Transform(obj_w);
}
else if (ward) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-ward"));
FindObjectiveFormation();
objective = Transform(obj_w);
}
else if (navpt && form) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
objective = Transform(obj_w);
}
else if (rumor) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.search"));
FindObjectiveTarget(rumor);
objective = Transform(obj_w);
}
@@ -892,11 +893,11 @@ ShipAI::Navigator()
ship->SetFLCSMode(Ship::FLCS_HELM);
if (target)
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target"));
else if (rumor)
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-rumor"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-rumor"));
else
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.none"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.none"));
Accumulate(AvoidCollision());
Accumulate(AvoidTerrain());
@@ -1119,7 +1120,7 @@ ShipAI::AvoidCollision()
avoid = Avoid(obstacle, (float) (ship->Radius() + other->Radius() + avoid_dist * 0.9));
avoid.brake = brake;
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.avoid-collision"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.avoid-collision"));
}
}
@@ -1260,7 +1261,7 @@ ShipAI::AvoidCloseObject(SimObject* obj)
Steer avoid = Flee(obstacle);
avoid.brake = 0.3;
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.avoid-collision"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.avoid-collision"));
return avoid;
}