XEEN: Leave chests open after their contents are taken
This commit is contained in:
parent
9abcaecb0c
commit
057bf6ea92
2 changed files with 11 additions and 8 deletions
|
@ -322,7 +322,6 @@ public:
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
XeenEngine *_vm;
|
XeenEngine *_vm;
|
||||||
Common::Array<SpriteResourceEntry> _objectSprites;
|
|
||||||
Common::Array<SpriteResourceEntry> _monsterSprites;
|
Common::Array<SpriteResourceEntry> _monsterSprites;
|
||||||
Common::Array<SpriteResourceEntry> _monsterAttackSprites;
|
Common::Array<SpriteResourceEntry> _monsterAttackSprites;
|
||||||
Common::Array<SpriteResourceEntry> _wallItemSprites;
|
Common::Array<SpriteResourceEntry> _wallItemSprites;
|
||||||
|
@ -330,6 +329,7 @@ public:
|
||||||
Common::Array<MazeObject> _objects;
|
Common::Array<MazeObject> _objects;
|
||||||
Common::Array<MazeMonster> _monsters;
|
Common::Array<MazeMonster> _monsters;
|
||||||
Common::Array<MazeWallItem> _wallItems;
|
Common::Array<MazeWallItem> _wallItems;
|
||||||
|
Common::Array<SpriteResourceEntry> _objectSprites;
|
||||||
public:
|
public:
|
||||||
MonsterObjectData(XeenEngine *vm);
|
MonsterObjectData(XeenEngine *vm);
|
||||||
|
|
||||||
|
|
|
@ -216,20 +216,23 @@ int Scripts::checkEvents() {
|
||||||
MazeObject &selectedObj = map._mobData._objects[intf._objNumber];
|
MazeObject &selectedObj = map._mobData._objects[intf._objNumber];
|
||||||
|
|
||||||
if (selectedObj._spriteId == (ccNum ? 15 : 16)) {
|
if (selectedObj._spriteId == (ccNum ? 15 : 16)) {
|
||||||
for (int idx = 0; idx < MIN((int)map._mobData._objects.size(), 16); ++idx) {
|
// Treasure chests that were opened will be set to be in an open, empty state
|
||||||
MazeObject &obj = map._mobData._objects[idx];
|
for (uint idx = 0; idx < map._mobData._objectSprites.size(); ++idx) {
|
||||||
if (obj._spriteId == (ccNum ? 62 : 57)) {
|
MonsterObjectData::SpriteResourceEntry &e = map._mobData._objectSprites[idx];
|
||||||
|
if (e._spriteId == (ccNum ? 57 : 62)) {
|
||||||
selectedObj._id = idx;
|
selectedObj._id = idx;
|
||||||
selectedObj._spriteId = ccNum ? 62 : 57;
|
selectedObj._spriteId = ccNum ? 57 : 62;
|
||||||
|
selectedObj._sprites = &e._sprites;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (selectedObj._spriteId == 73) {
|
} else if (selectedObj._spriteId == 73) {
|
||||||
for (int idx = 0; idx < MIN((int)map._mobData._objects.size(), 16); ++idx) {
|
for (uint idx = 0; idx < map._mobData._objectSprites.size(); ++idx) {
|
||||||
MazeObject &obj = map._mobData._objects[idx];
|
MonsterObjectData::SpriteResourceEntry &e = map._mobData._objectSprites[idx];
|
||||||
if (obj._spriteId == 119) {
|
if (e._spriteId == 119) {
|
||||||
selectedObj._id = idx;
|
selectedObj._id = idx;
|
||||||
selectedObj._spriteId = 119;
|
selectedObj._spriteId = 119;
|
||||||
|
selectedObj._sprites = &e._sprites;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue