aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus
diff options
context:
space:
mode:
authorMatthew Hoops2011-12-12 17:16:15 -0500
committerMatthew Hoops2011-12-12 17:16:15 -0500
commitcd01d5dc1de3bdab4a0f784880a7dde1d0e7ef9a (patch)
tree5cf3a28203175f0e5c7b3a8abb1be369c8efaae7 /engines/pegasus
parent9c1fbbd1c2b63e4a610f39dac57366c227161908 (diff)
downloadscummvm-rg350-cd01d5dc1de3bdab4a0f784880a7dde1d0e7ef9a.tar.gz
scummvm-rg350-cd01d5dc1de3bdab4a0f784880a7dde1d0e7ef9a.tar.bz2
scummvm-rg350-cd01d5dc1de3bdab4a0f784880a7dde1d0e7ef9a.zip
PEGASUS: Add the bomb active AI rule
Diffstat (limited to 'engines/pegasus')
-rwxr-xr-xengines/pegasus/neighborhood/caldoria/caldoria.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
index 3b6fe02da7..adfa1ae765 100755
--- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
@@ -267,6 +267,19 @@ void Caldoria::flushGameState() {
GameState.setCaldoriaFuseTimeLimit(_utilityFuse.getTimeRemaining());
}
+class AIBombActiveCondition : public AICondition {
+public:
+ AIBombActiveCondition() {}
+
+ bool fireCondition();
+};
+
+// Return true if player is on 53 east and Sinclair is shot.
+bool AIBombActiveCondition::fireCondition() {
+ return GameState.getCurrentRoom() == kCaldoria53 && GameState.getCurrentDirection() == kEast &&
+ GameState.getCaldoriaSinclairShot();
+}
+
void Caldoria::setUpAIRules() {
Neighborhood::setUpAIRules();
@@ -278,13 +291,10 @@ void Caldoria::setUpAIRules() {
AIRule *rule = new AIRule(locCondition, messageAction);
g_AIArea->addAIRule(rule);
-#if 0
- // TODO
messageAction = new AIPlayMessageAction("Images/AI/Caldoria/X56EH1", false);
- AIBombActiveCondition *activeCondition = new AIBombActiveCondition;
+ AIBombActiveCondition *activeCondition = new AIBombActiveCondition();
rule = new AIRule(activeCondition, messageAction);
g_AIArea->addAIRule(rule);
-#endif
} else {
AIPlayMessageAction *messageAction = new AIPlayMessageAction("Images/AI/Caldoria/XAB2", false);
AITimerCondition *timerCondition = new AITimerCondition(kLateWarning3TimeLimit, 1, true);