summaryrefslogtreecommitdiffhomepage
path: root/Stars45/StarshipAI.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-02-23 23:36:37 +0100
committerAki <please@ignore.pl>2022-02-23 23:36:37 +0100
commit0da933a0146a0689546b21231e14f2dfc2bc14e8 (patch)
treeb917762280e2094d77fae2a607d6ad3151174fce /Stars45/StarshipAI.cpp
parent8b778dda61c45f5d7a4dc416478c42ff4aa1de7f (diff)
downloadstarshatter-0da933a0146a0689546b21231e14f2dfc2bc14e8.zip
starshatter-0da933a0146a0689546b21231e14f2dfc2bc14e8.tar.gz
starshatter-0da933a0146a0689546b21231e14f2dfc2bc14e8.tar.bz2
Switched to use ContentBundle's GetText
Diffstat (limited to 'Stars45/StarshipAI.cpp')
-rw-r--r--Stars45/StarshipAI.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/Stars45/StarshipAI.cpp b/Stars45/StarshipAI.cpp
index 19de0c6..3057f1d 100644
--- a/Stars45/StarshipAI.cpp
+++ b/Stars45/StarshipAI.cpp
@@ -30,6 +30,7 @@
#include "QuantumDrive.h"
#include "Game.h"
+#include "ContentBundle.h"
#include "Random.h"
// +----------------------------------------------------------------------+
@@ -101,7 +102,7 @@ StarshipAI::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();
@@ -135,7 +136,7 @@ StarshipAI::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;
@@ -144,7 +145,7 @@ StarshipAI::FindObjective()
// run away:
else if (threat && 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;
@@ -154,44 +155,44 @@ StarshipAI::FindObjective()
// weapons hold:
if (hold) {
if (navpt) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
}
else {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.holding"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.holding"));
objective = Point();
}
}
// normal processing:
else if (target) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target"));
FindObjectiveTarget(target);
}
else if (patrol) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol"));
FindObjectivePatrol();
}
else if (ward) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-ward"));
FindObjectiveFormation();
}
else if (navpt) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt"));
FindObjectiveNavPoint();
}
else if (rumor) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.search"));
FindObjectiveTarget(rumor);
}
@@ -210,7 +211,7 @@ StarshipAI::Navigator()
{
// signifies this ship is a dead hulk:
if (ship && ship->Design()->auto_roll < 0) {
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.dead"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.dead"));
return;
}
@@ -226,11 +227,11 @@ StarshipAI::Navigator()
if (!ship->GetDirectorInfo()) {
if (target)
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target"));
else if (ship->GetWard())
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-ward"));
else
- ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol"));
+ ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol"));
}
if (farcaster && distance < 25e3) {