mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 01:57:16 +00:00
KINGDOM: Move character death (repetitive) code to separate function
This commit is contained in:
parent
c4e54246a7
commit
19386a50d5
@ -115,12 +115,8 @@ void Logic::GPL4_991() {
|
||||
_vm->playMovie(194);
|
||||
_vm->_noIFScreen = true;
|
||||
_vm->fShowPic(107);
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
_vm->playSound(1);
|
||||
memset(_inventory, -1, 19);
|
||||
_statPlay = 994;
|
||||
|
||||
characterDeath();
|
||||
} else {
|
||||
_vm->_bTimer = 36;
|
||||
while(_vm->_bTimer) {
|
||||
@ -167,12 +163,8 @@ void Logic::GPL4_992() {
|
||||
_vm->playMovie(194);
|
||||
_vm->_noIFScreen = true;
|
||||
_vm->fShowPic(107);
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
_vm->playSound(1);
|
||||
memset(_inventory, -1, 19);
|
||||
_statPlay = 994;
|
||||
|
||||
characterDeath();
|
||||
} else {
|
||||
_vm->_bTimer = 36;
|
||||
while(_vm->_bTimer != 0) {
|
||||
@ -216,12 +208,8 @@ void Logic::GPL4_992_demo() {
|
||||
_vm->playMovie(194);
|
||||
_vm->_noIFScreen = true;
|
||||
_vm->fShowPic(107);
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
_vm->playSound(1);
|
||||
memset(_inventory, -1, 19);
|
||||
_statPlay = 994;
|
||||
|
||||
characterDeath();
|
||||
} else {
|
||||
_vm->_bTimer = 36;
|
||||
while(_vm->_bTimer != 0) {
|
||||
@ -264,12 +252,8 @@ void Logic::GPL4_993() {
|
||||
_vm->playMovie(194);
|
||||
_vm->_noIFScreen = true;
|
||||
_vm->fShowPic(107);
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
_vm->playSound(1);
|
||||
memset(_inventory, -1, 19);
|
||||
_statPlay = 994;
|
||||
|
||||
characterDeath();
|
||||
} else {
|
||||
_vm->_bTimer = 36;
|
||||
while (_vm->_bTimer != 0) {
|
||||
@ -317,12 +301,8 @@ void Logic::GPL4_993_demo() {
|
||||
_vm->playMovie(194);
|
||||
_vm->_noIFScreen = true;
|
||||
_vm->fShowPic(107);
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
_vm->playSound(1);
|
||||
memset(_inventory, -1, 19);
|
||||
_statPlay = 994;
|
||||
|
||||
characterDeath();
|
||||
} else {
|
||||
_vm->_bTimer = 36;
|
||||
while (_vm->_bTimer != 0) {
|
||||
|
@ -152,8 +152,7 @@ void Logic::initOpcodes() {
|
||||
if (_vm->isDemo())
|
||||
initOpcodesDemo();
|
||||
else
|
||||
initOpcodesFull();
|
||||
|
||||
initOpcodesFull();
|
||||
}
|
||||
|
||||
void Logic::initOpcodesDemo() {
|
||||
@ -404,12 +403,8 @@ void Logic::endCredits() {
|
||||
_vm->drawRect(4, 17, 228, 161, 0);
|
||||
_vm->playMovie(201);
|
||||
_vm->fShowPic(125);
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
memset(_inventory, 0xFF, 19);
|
||||
_statPlay = 994;
|
||||
_vm->_loopFlag = true;
|
||||
|
||||
characterDeath();
|
||||
}
|
||||
|
||||
void Logic::gameHelp_Sub43C() {
|
||||
@ -566,6 +561,15 @@ void Logic::switchAS() {
|
||||
_vm->_iconsClosed = _vm->_oldIconsClosed;
|
||||
}
|
||||
|
||||
void Logic::characterDeath() {
|
||||
_currMap = 3;
|
||||
dsAll();
|
||||
_pouch = false;
|
||||
memset(_inventory, -1, 19);
|
||||
_statPlay = 994;
|
||||
_vm->_loopFlag = true;
|
||||
}
|
||||
|
||||
void Logic::executeOpcode() {
|
||||
if (_opCodes.contains(_statPlay)) {
|
||||
Opcode op = _opCodes[_statPlay];
|
||||
|
@ -294,6 +294,7 @@ public:
|
||||
void executeOpcode();
|
||||
void initPlay();
|
||||
void switchAS();
|
||||
void characterDeath();
|
||||
void synchronize(Common::Serializer &s);
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user