diff options
author | Paul Gilbert | 2015-01-15 20:39:52 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-15 20:39:52 -0500 |
commit | ce3cb6f1dbc32ca682279a9021cbbc8da1a1f30a (patch) | |
tree | be8f079be7c22be42eab3d0714d313f0190e8532 | |
parent | 3e7163769d1a28721dc000a9ef0a142731705ad4 (diff) | |
download | scummvm-rg350-ce3cb6f1dbc32ca682279a9021cbbc8da1a1f30a.tar.gz scummvm-rg350-ce3cb6f1dbc32ca682279a9021cbbc8da1a1f30a.tar.bz2 scummvm-rg350-ce3cb6f1dbc32ca682279a9021cbbc8da1a1f30a.zip |
XEEN: Finished setIndoorsMonsters
-rw-r--r-- | engines/xeen/combat.cpp | 3 | ||||
-rw-r--r-- | engines/xeen/combat.h | 1 | ||||
-rw-r--r-- | engines/xeen/interface.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/interface_map.cpp | 216 | ||||
-rw-r--r-- | engines/xeen/map.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/map.h | 2 |
6 files changed, 212 insertions, 20 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 077205394e..98dff4c6d9 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -25,8 +25,7 @@ namespace Xeen { -Combat::Combat(XeenEngine *vm): _vm(vm), _attackMon1(_attackMonsters[0]), - _attackMon2(_attackMonsters[1]), _attackMon3(_attackMonsters[2]) { +Combat::Combat(XeenEngine *vm): _vm(vm) { Common::fill(&_attackMonsters[0], &_attackMonsters[26], 0); Common::fill(&_charsArray1[0], &_charsArray1[12], 0); Common::fill(&_monPow[0], &_monPow[12], 0); diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h index 4ead4047cf..c64741b59e 100644 --- a/engines/xeen/combat.h +++ b/engines/xeen/combat.h @@ -40,7 +40,6 @@ public: int _elemPow[12]; int _elemScale[12]; bool _shooting[6]; - int &_attackMon1, _attackMon2, _attackMon3; public: Combat(XeenEngine *vm); diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 4550dac6d8..eb607db7a2 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -631,7 +631,7 @@ void Interface::draw3d(bool updateFlag) { ds2._sprites = nullptr; if (combat._charsArray1[idx]) { - int posIndex= combat._attackMon2 && !combat._attackMon3 ? 1 : 0; + int posIndex= combat._attackMonsters[1] && !combat._attackMonsters[2] ? 1 : 0; --combat._charsArray1[idx]; if (combat._monPow[idx]) { @@ -671,7 +671,7 @@ void Interface::draw3d(bool updateFlag) { // Handle attacking monsters int monsterIndex = 0; - if (combat._attackMon1 != -1 && map._mobData._monsters[combat._attackMon1]._frame >= 0) { + if (combat._attackMonsters[0] != -1 && map._mobData._monsters[combat._attackMonsters[0]]._frame >= 0) { _indoorList[159] = _indoorList[156]; _indoorList[160] = _indoorList[157]; _indoorList[161] = _indoorList[158]; @@ -679,7 +679,7 @@ void Interface::draw3d(bool updateFlag) { _indoorList[156]._sprites = nullptr; _indoorList[157]._sprites = nullptr; monsterIndex = 1; - } else if (combat._attackMon2 != -1 && map._mobData._monsters[combat._attackMon2]._frame >= 0) { + } else if (combat._attackMonsters[1] != -1 && map._mobData._monsters[combat._attackMonsters[1]]._frame >= 0) { _indoorList[159] = _indoorList[150]; _indoorList[160] = _indoorList[151]; _indoorList[161] = _indoorList[152]; @@ -687,7 +687,7 @@ void Interface::draw3d(bool updateFlag) { _indoorList[151]._sprites = nullptr; _indoorList[150]._sprites = nullptr; monsterIndex = 2; - } else if (combat._attackMon3 != -1 && map._mobData._monsters[combat._attackMon3]._frame >= 0) { + } else if (combat._attackMonsters[2] != -1 && map._mobData._monsters[combat._attackMonsters[2]]._frame >= 0) { _indoorList[159] = _indoorList[153]; _indoorList[160] = _indoorList[154]; _indoorList[161] = _indoorList[155]; diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp index f4c0dc0845..ba5cdbc7d0 100644 --- a/engines/xeen/interface_map.cpp +++ b/engines/xeen/interface_map.cpp @@ -394,7 +394,7 @@ void InterfaceMap::setIndoorsMonsters() { // The following long sequence sets up monsters in the various positions if (monster._position.x == SCREEN_POSITIONING_X[dir][2] && monster._position.y == SCREEN_POSITIONING_Y[dir][2]) { - monster._field4 = 1; + monster._isAttacking = true; if (combat._attackMonsters[0] == -1) { combat._attackMonsters[0] = monsterIdx; setMonsterSprite(_indoorList[156], monster, sprites, frame, INDOOR_MONSTERS_Y[0]); @@ -409,7 +409,7 @@ void InterfaceMap::setIndoorsMonsters() { if (monster._position.x == SCREEN_POSITIONING_X[dir][7] && monster._position.y == SCREEN_POSITIONING_Y[dir][7]) { - monster._field4 = 1; + monster._isAttacking = true; if (!_wo[27]) { if (combat._attackMonsters[3] == -1) { combat._attackMonsters[3] = monsterIdx; @@ -423,6 +423,201 @@ void InterfaceMap::setIndoorsMonsters() { } } } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][5] && + monster._position.y == SCREEN_POSITIONING_Y[dir][5]) { + if (_wo[27] && _wo[25]) { + } else if (_wo[27] && _wo[28]) { + } else if (_wo[23] & _wo[25]) { + } else if (_wo[23] && _wo[28]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[12] == -1) { + combat._attackMonsters[12] = monsterIdx; + setMonsterSprite(_indoorList[128], monster, sprites, frame, INDOOR_MONSTERS_Y[1]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][9] && + monster._position.y == SCREEN_POSITIONING_Y[dir][9]) { + if (_wo[27] && _wo[26]) { + } else if (_wo[27] && _wo[29]) { + } else if (_wo[24] & _wo[26]) { + } else if (_wo[24] && _wo[29]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[13] == -1) { + combat._attackMonsters[13] = monsterIdx; + setMonsterSprite(_indoorList[129], monster, sprites, frame, INDOOR_MONSTERS_Y[1]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][14] && + monster._position.y == SCREEN_POSITIONING_Y[dir][14]) { + monster._isAttacking = true; + + if (!_wo[22] && !_wo[27]) { + if (combat._attackMonsters[6] == -1) { + combat._attackMonsters[6] = monsterIdx; + setMonsterSprite(_indoorList[106], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } else if (combat._attackMonsters[7] == -1) { + combat._attackMonsters[7] = monsterIdx; + setMonsterSprite(_indoorList[104], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } else if (combat._attackMonsters[8] == -1) { + combat._attackMonsters[8] = monsterIdx; + setMonsterSprite(_indoorList[105], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][12] && + monster._position.y == SCREEN_POSITIONING_Y[dir][12]) { + if (_wo[27]) { + } else if (_wo[22] && _wo[23]) { + } else if (_wo[22] & _wo[20]) { + } else if (_wo[23] && _wo[17]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[14] == -1) { + combat._attackMonsters[14] = monsterIdx; + setMonsterSprite(_indoorList[100], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } else if (combat._attackMonsters[20] == -1) { + combat._attackMonsters[20] = monsterIdx; + setMonsterSprite(_indoorList[101], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][16] && + monster._position.y == SCREEN_POSITIONING_Y[dir][16]) { + if (_wo[27]) { + } else if (_wo[22] && _wo[24]) { + } else if (_wo[22] & _wo[21]) { + } else if (_wo[24] && _wo[19]) { + } else if (_wo[21] && _wo[19]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[15] == -1) { + combat._attackMonsters[15] = monsterIdx; + setMonsterSprite(_indoorList[102], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } else if (combat._attackMonsters[21] == -1) { + combat._attackMonsters[21] = monsterIdx; + setMonsterSprite(_indoorList[103], monster, sprites, frame, INDOOR_MONSTERS_Y[2]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][27] && + monster._position.y == SCREEN_POSITIONING_Y[dir][27]) { + if (!_wo[27] && !_wo[22] && _wo[15]) { + monster._isAttacking = true; + + if (combat._attackMonsters[9] == -1) { + combat._attackMonsters[9] = monsterIdx; + setMonsterSprite(_indoorList[70], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[10] == -1) { + combat._attackMonsters[10] = monsterIdx; + setMonsterSprite(_indoorList[68], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[11] == -1) { + combat._attackMonsters[11] = monsterIdx; + setMonsterSprite(_indoorList[69], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][25] && + monster._position.y == SCREEN_POSITIONING_Y[dir][25]) { + if (_wo[27] || _wo[22]) { + } else if (_wo[15] && _wo[17]) { + } else if (_wo[15] && _wo[12]) { + } else if (_wo[12] && _wo[7]) { + } else if (_wo[17] && _wo[7]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[16] == -1) { + combat._attackMonsters[16] = monsterIdx; + setMonsterSprite(_indoorList[62], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[22] == -1) { + combat._attackMonsters[22] = monsterIdx; + setMonsterSprite(_indoorList[60], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[24] == -1) { + combat._attackMonsters[24] = monsterIdx; + setMonsterSprite(_indoorList[61], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][23] && + monster._position.y == SCREEN_POSITIONING_Y[dir][23]) { + if (_wo[27]) { + } else if (_wo[22] && _wo[20]) { + } else if (_wo[22] && _wo[23]) { + } else if (_wo[20] && _wo[17]) { + } else if (_wo[23] && _wo[17]) { + } else if (_wo[12] || _wo[8]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[18] == -1) { + combat._attackMonsters[18] = monsterIdx; + setMonsterSprite(_indoorList[66], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][29] && + monster._position.y == SCREEN_POSITIONING_Y[dir][29]) { + if (_wo[27] || _wo[22]) { + } else if (_wo[15] && _wo[19]) { + } else if (_wo[15] && _wo[14]) { + } else if (_wo[14] && _wo[9]) { + } else if (_wo[19] && _wo[9]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[17] == -1) { + combat._attackMonsters[17] = monsterIdx; + setMonsterSprite(_indoorList[65], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[23] == -1) { + combat._attackMonsters[23] = monsterIdx; + setMonsterSprite(_indoorList[63], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[25] == -1) { + combat._attackMonsters[25] = monsterIdx; + setMonsterSprite(_indoorList[64], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } + } + } + + if (monster._position.x == SCREEN_POSITIONING_X[dir][31] && + monster._position.y == SCREEN_POSITIONING_Y[dir][31]) { + if (_wo[27]) { + } else if (_wo[22] && _wo[21]) { + } else if (_wo[22] && _wo[24]) { + } else if (_wo[21] && _wo[19]) { + } else if (_wo[24] && _wo[19]) { + } else if (_wo[14] || _wo[10]) { + } else { + monster._isAttacking = true; + + if (combat._attackMonsters[19] == -1) { + combat._attackMonsters[19] = monsterIdx; + setMonsterSprite(_indoorList[67], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[23] == -1) { + combat._attackMonsters[23] = monsterIdx; + setMonsterSprite(_indoorList[63], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } else if (combat._attackMonsters[25] == -1) { + combat._attackMonsters[25] = monsterIdx; + setMonsterSprite(_indoorList[64], monster, sprites, frame, INDOOR_MONSTERS_Y[3]); + } + } + } } } @@ -431,21 +626,20 @@ void InterfaceMap::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster MonsterStruct &monsterData = _vm->_map->_monsterData[monster._spriteId]; bool flying = monsterData._flying; - _indoorList[156]._frame = frame; - _indoorList[156]._sprites = sprites; - _indoorList[156]._y = defaultY; + drawStruct._frame = frame; + drawStruct._sprites = sprites; + drawStruct._y = defaultY; if (flying) { - _indoorList[156]._x = COMBAT_FLOAT_X[_combatFloatCounter]; - _indoorList[156]._y = COMBAT_FLOAT_Y[_combatFloatCounter]; + drawStruct._x = COMBAT_FLOAT_X[_combatFloatCounter]; + drawStruct._y = COMBAT_FLOAT_Y[_combatFloatCounter]; } else { - _indoorList[156]._x = 0; + drawStruct._x = 0; } - _indoorList[156]._flags &= SPRFLAG_HORIZ_FLIPPED | SPRFLAG_4000 | SPRFLAG_2000; + drawStruct._flags &= SPRFLAG_HORIZ_FLIPPED | SPRFLAG_4000 | SPRFLAG_2000; if (monster._effect2) - _indoorList[156]._flags = MONSTER_EFFECT_FLAGS[monster._effect2][monster._effect3]; - + drawStruct._flags = MONSTER_EFFECT_FLAGS[monster._effect2][monster._effect3]; } void InterfaceMap::setIndoorObjects() { diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index c136dee534..abb2cf68f2 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -638,7 +638,7 @@ MazeMonster::MazeMonster() { _frame = 0; _id = 0; _spriteId = 0; - _field4 = 0; + _isAttacking = false; _hp = 0; _effect1 = _effect2 = 0; _effect3 = 0; diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 821922bd7f..6ac8b36973 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -250,7 +250,7 @@ struct MazeMonster { int _frame; int _id; int _spriteId; - int _field4; + bool _isAttacking; int _hp; int _effect1, _effect2; int _effect3; |