diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp index 8553babccf27..d0b4d7ae2a19 100644 --- a/engines/access/amazon/amazon_scripts.cpp +++ b/engines/access/amazon/amazon_scripts.cpp @@ -768,8 +768,43 @@ void AmazonScripts::setInactive() { mWhile(_game->_rawInactiveY); } -void AmazonScripts::PLOTPIT(int idx, const int *buf) { - warning("TODO: PLOTPIT"); +void AmazonScripts::plotTorchSpear(int indx, const int *buf) { + int idx = indx; + + ImageEntry ie; + ie._flags = 8; + ie._spritesPtr = _pObject[62]; + ie._frameNumber = buf[(idx / 2)]; + ie._position = Common::Point(_game->_pitPos.x + buf[(idx / 2) + 1], _game->_pitPos.y + buf[(idx / 2) + 2]); + ie._offsetY = 255; + _vm->_images.addToList(ie); +} + +void AmazonScripts::plotPit(int indx, const int *buf) { + int idx = indx; + ImageEntry ie; + ie._flags = 8; + ie._spritesPtr = _pObject[62]; + ie._frameNumber = buf[(idx / 2)]; + ie._position = Common::Point(_game->_pitPos.x, _game->_pitPos.y); + ie._offsetY = _game->_pitPos.y; + _vm->_images.addToList(ie); + + _vm->_player->_rawPlayer = _game->_pitPos; + if (_vm->_inventory->_inv[76]._value == 1) { + idx = _game->_torchCel; + buf = Amazon::TORCH; + _vm->_timers[14]._flag = 1; + idx += 6; + if (buf[idx / 2] == -1) + idx = 0; + _game->_torchCel = idx; + plotTorchSpear(idx, buf); + } else if (!_game->_stabFl && (_vm->_inventory->_inv[78]._value == 1)) { + idx = 0; + buf = Amazon::SPEAR; + plotTorchSpear(idx, buf); + } } int AmazonScripts::antHandleRight(int indx, const int *buf) { @@ -958,7 +993,7 @@ void AmazonScripts::ANT() { } } } - PLOTPIT(idx, buf); + plotPit(idx, buf); } if (!_game->_antDieFl) { diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h index fc6fb0a7e327..7e42c0ca3656 100644 --- a/engines/access/amazon/amazon_scripts.h +++ b/engines/access/amazon/amazon_scripts.h @@ -75,7 +75,8 @@ class AmazonScripts: public Scripts { void guardSee(); void setGuardFrame(); void guard(); - void PLOTPIT(int idx, const int *buf); + void plotTorchSpear(int indx, const int *buf); + void plotPit(int indx, const int *buf); int antHandleRight(int indx, const int *buf); int antHandleLeft(int indx, const int *buf); int antHandleStab(int indx, const int *buf);