aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-02-20 15:28:46 +0100
committeruruk2014-02-20 15:28:46 +0100
commitad9a8df66dafd2a44a3a9e3869b1ec6948a5dabf (patch)
tree05560054be88c62250d41f487fa3356881250717 /engines
parente03ccde6e9d13a56ca1b8e1264df1f936a234f40 (diff)
downloadscummvm-rg350-ad9a8df66dafd2a44a3a9e3869b1ec6948a5dabf.tar.gz
scummvm-rg350-ad9a8df66dafd2a44a3a9e3869b1ec6948a5dabf.tar.bz2
scummvm-rg350-ad9a8df66dafd2a44a3a9e3869b1ec6948a5dabf.zip
AVALANCHE: Implement ShootEmUp::escapeCheck().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/shootemup.cpp37
-rw-r--r--engines/avalanche/shootemup.h1
2 files changed, 37 insertions, 1 deletions
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index 70b26d267f..4224b7f2e7 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -88,6 +88,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_wasFacing = 0;
_score = 0;
_escapeStock = 0;
+ _gotOut = false;
}
void ShootEmUp::run() {
@@ -524,7 +525,41 @@ void ShootEmUp::hitPeople() {
}
void ShootEmUp::escapeCheck() {
- warning("STUB: ShootEmUp::escapeCheck()");
+ if (_count321 != 0)
+ return;
+
+ if (_escapeCount > 0) {
+ _escapeCount--;
+ return;
+ }
+
+ // Escape_count = 0; now what ?
+
+ if (_escaping) {
+ if (_gotOut) {
+ newEscape();
+ _escaping = false;
+ _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 4);
+ } else {
+ _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 5);
+ _escapeCount = 20;
+ _gotOut = true;
+ define(_escapeStock * 90 + 20, 50, 25, 0, 2, 17, false, true); // Escaped!
+ gain(-10);
+ _hasEscaped[_escapeStock] = true;
+
+ _howManyHaveEscaped++;
+
+ if (_howManyHaveEscaped == 7)
+ _time = 0;
+ }
+ } else {
+ _escapeStock = getStockNumber(_vm->_rnd->getRandomNumber(6));
+ _escaping = true;
+ _gotOut = false;
+ _vm->_graphics->seuDrawPicture(_escapeStock * 90 + 20, 30, kStocks + 2); // Smiling!
+ _escapeCount = 200;
+ }
}
void ShootEmUp::check321() {
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
index 9162282e65..9e9747bc8e 100644
--- a/engines/avalanche/shootemup.h
+++ b/engines/avalanche/shootemup.h
@@ -92,6 +92,7 @@ private:
bool _cp;
byte _wasFacing;
byte _escapeStock;
+ bool _gotOut;
bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y);
byte getStockNumber(byte index);