MADS: Phantom: Rewrite logic for Scene102
This commit is contained in:
parent
12a1393faf
commit
c275e304df
6 changed files with 94 additions and 44 deletions
|
@ -606,50 +606,86 @@ void Scene101::handleAnimation1() {
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
Scene102::Scene102(MADSEngine *vm) : Scene1xx(vm) {
|
Scene102::Scene102(MADSEngine *vm) : Scene1xx(vm) {
|
||||||
_animRunningFl = false;
|
_anim0RunningFl = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene102::synchronize(Common::Serializer &s) {
|
void Scene102::synchronize(Common::Serializer &s) {
|
||||||
Scene1xx::synchronize(s);
|
Scene1xx::synchronize(s);
|
||||||
|
|
||||||
s.syncAsByte(_animRunningFl);
|
s.syncAsByte(_anim0RunningFl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene102::setup() {
|
void Scene102::setup() {
|
||||||
//setPlayerSpritesPrefix();
|
setPlayerSpritesPrefix();
|
||||||
setAAName();
|
setAAName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene102::enter() {
|
void Scene102::enter() {
|
||||||
_animRunningFl = false;
|
_anim0RunningFl = false;
|
||||||
|
|
||||||
_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
|
_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
|
||||||
_globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RAL86");
|
_globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RAL86");
|
||||||
|
|
||||||
if (_globals[kCurrentYear] == 1993) {
|
if (_globals[kCurrentYear] == 1993) {
|
||||||
_globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
|
_globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
|
||||||
// TODO
|
_scene->drawToBackground(_globals._sequenceIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
|
||||||
//_scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
|
_scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
_scene->_hotspots.activate(NOUN_CHANDELIER, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_scene->_priorSceneId == 101) {
|
if (_scene->_priorSceneId == 101) {
|
||||||
_game._player._playerPos = Common::Point(97, 79);
|
_game._player._playerPos = Common::Point(97, 79);
|
||||||
_game._player._facing = FACING_SOUTHEAST;
|
_game._player._facing = FACING_SOUTHEAST;
|
||||||
// TODO
|
_globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
|
||||||
_game._player.walk(Common::Point(83, 87), FACING_SOUTHEAST);
|
_game._player.walk(Common::Point(83, 87), FACING_SOUTHEAST);
|
||||||
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
|
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
|
||||||
} else if (_scene->_priorSceneId == 104) {
|
} else if (_scene->_priorSceneId == 104) {
|
||||||
// Player fell from pit -> death
|
// Player fell from pit -> death
|
||||||
// TODO
|
Common::Point deathPos = Common::Point(0, 0);
|
||||||
|
int deathScale = 0;
|
||||||
|
int deathDepth = 0;
|
||||||
|
_game._player._stepEnabled = false;
|
||||||
|
_game._player._visible = false;
|
||||||
|
|
||||||
|
switch (_globals[36]) {
|
||||||
|
case 0:
|
||||||
|
deathPos = Common::Point(221, 57);
|
||||||
|
deathScale = 50;
|
||||||
|
deathDepth = 14;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
deathPos = Common::Point(219, 85);
|
||||||
|
deathScale = 60;
|
||||||
|
deathDepth = 6;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
deathPos = Common::Point(257, 138);
|
||||||
|
deathScale = 76;
|
||||||
|
deathDepth = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_scene->_userInterface.emptyConversationList();
|
||||||
|
_scene->_userInterface.setup(kInputConversation);
|
||||||
|
_globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
|
||||||
|
_scene->_sequences.setDepth(_globals._sequenceIndexes[3], deathDepth);
|
||||||
|
_scene->_sequences.setPosition(_globals._sequenceIndexes[3], deathPos);
|
||||||
|
_scene->_sequences.setScale(_globals._sequenceIndexes[3], deathScale);
|
||||||
|
_scene->_sequences.setTimingTrigger(120, 65);
|
||||||
|
_globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
|
||||||
|
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
|
||||||
} else if (_scene->_priorSceneId == 103 || _scene->_priorSceneId != -1) {
|
} else if (_scene->_priorSceneId == 103 || _scene->_priorSceneId != -1) {
|
||||||
_game._player._playerPos = Common::Point(282, 145);
|
_game._player._playerPos = Common::Point(282, 145);
|
||||||
_game._player._facing = FACING_WEST;
|
_game._player._facing = FACING_WEST;
|
||||||
_animRunningFl = true;
|
_anim0RunningFl = true;
|
||||||
// TODO: Door closing animation
|
_scene->loadAnimation(formAnimName('d', 1), 60, 0);
|
||||||
} else if (_scene->_priorSceneId == -1) {
|
} else if (_scene->_priorSceneId == -1) {
|
||||||
// TODO
|
_globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
|
||||||
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
|
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -657,12 +693,20 @@ void Scene102::enter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene102::step() {
|
void Scene102::step() {
|
||||||
if (_game._trigger == 60) { // Door closes
|
if (_game._trigger == 60) {
|
||||||
// TODO
|
// Door closes
|
||||||
_animRunningFl = false;
|
_globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
|
||||||
} else if (_game._trigger == 65) { // Death
|
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
|
||||||
// TODO
|
_anim0RunningFl = false;
|
||||||
_scene->_currentSceneId = 104;
|
} else if (_game._trigger == 65) {
|
||||||
|
// Death
|
||||||
|
if (_globals[kDeathLocation] == 0)
|
||||||
|
_vm->_dialogs->show(10232);
|
||||||
|
else
|
||||||
|
_vm->_dialogs->show(10229);
|
||||||
|
|
||||||
|
_vm->_sound->command(16);
|
||||||
|
_scene->_nextSceneId = 104;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,34 +719,31 @@ void Scene102::preActions() {
|
||||||
void Scene102::actions() {
|
void Scene102::actions() {
|
||||||
if (_action.isAction(VERB_WALK_DOWN, NOUN_AISLE)) {
|
if (_action.isAction(VERB_WALK_DOWN, NOUN_AISLE)) {
|
||||||
_scene->_nextSceneId = 101;
|
_scene->_nextSceneId = 101;
|
||||||
_game._player._stepEnabled = true;
|
} else if (_action.isAction(VERB_WALK_THROUGH, NOUN_ORCHESTRA_DOOR) ||
|
||||||
}
|
|
||||||
|
|
||||||
if (_action.isAction(VERB_WALK_THROUGH, NOUN_ORCHESTRA_DOOR) ||
|
|
||||||
_action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR) ||
|
_action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR) ||
|
||||||
_action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR)) {
|
_action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR)) {
|
||||||
if (_animRunningFl) {
|
if (_anim0RunningFl) {
|
||||||
// TODO
|
_scene->_sequences.setTimingTrigger(15, 70);
|
||||||
|
_game._player._stepEnabled = false;
|
||||||
} else {
|
} else {
|
||||||
_scene->_nextSceneId = 103; // FIXME: temporary HACK - remove!
|
|
||||||
|
|
||||||
switch (_game._trigger) {
|
switch (_game._trigger) {
|
||||||
case 70: // try again
|
case 70: // try again
|
||||||
case 0:
|
case 0:
|
||||||
// TODO
|
_scene->deleteSequence(_globals._sequenceIndexes[2]);
|
||||||
|
_scene->loadAnimation(formAnimName('d', 0), 1, 0);
|
||||||
|
_game._player._stepEnabled = false;
|
||||||
|
_game._player._visible = false;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
_scene->_nextSceneId = 103;
|
_scene->_nextSceneId = 103;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (_action._lookFlag)
|
||||||
_game._player._stepEnabled = true;
|
_vm->_dialogs->show(10210);
|
||||||
}
|
else if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
|
||||||
|
|
||||||
// TODO: Look around
|
|
||||||
|
|
||||||
if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
|
|
||||||
if (_action.isObject(NOUN_PIT))
|
if (_action.isObject(NOUN_PIT))
|
||||||
_vm->_dialogs->show(10211);
|
_vm->_dialogs->show(10211);
|
||||||
else if (_action.isObject(NOUN_SEATS))
|
else if (_action.isObject(NOUN_SEATS))
|
||||||
|
@ -740,18 +781,12 @@ void Scene102::actions() {
|
||||||
_vm->_dialogs->show(10227);
|
_vm->_dialogs->show(10227);
|
||||||
else if (_action.isObject(NOUN_CHANDELIER))
|
else if (_action.isObject(NOUN_CHANDELIER))
|
||||||
_vm->_dialogs->show(10231);
|
_vm->_dialogs->show(10231);
|
||||||
else
|
} else if (_action.isAction(VERB_CLOSE, NOUN_ORCHESTRA_DOOR)) {
|
||||||
return;
|
|
||||||
|
|
||||||
_game._player._stepEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_action.isAction(VERB_CLOSE, NOUN_ORCHESTRA_DOOR)) {
|
|
||||||
_vm->_dialogs->show(10228);
|
_vm->_dialogs->show(10228);
|
||||||
_game._player._stepEnabled = true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
_game._player._stepEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
|
|
||||||
class Scene102 : public Scene1xx {
|
class Scene102 : public Scene1xx {
|
||||||
private:
|
private:
|
||||||
bool _animRunningFl;
|
bool _anim0RunningFl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Scene102(MADSEngine *vm);
|
Scene102(MADSEngine *vm);
|
||||||
|
|
|
@ -754,4 +754,12 @@ void Scene::setDynamicAnim(int id, int anim_id, int segment) {
|
||||||
void Scene::setCamera(Common::Point pos) {
|
void Scene::setCamera(Common::Point pos) {
|
||||||
warning("TODO: Scene::setCamera");
|
warning("TODO: Scene::setCamera");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scene::drawToBackground(int series_id, int sprite_id, Common::Point pos, int depth, int scale) {
|
||||||
|
warning("TODO: Scene::drawToBackground");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene::deleteSequence(int idx) {
|
||||||
|
warning("TODO: Scene::deleteSequence");
|
||||||
|
}
|
||||||
} // End of namespace MADS
|
} // End of namespace MADS
|
||||||
|
|
|
@ -256,6 +256,8 @@ public:
|
||||||
|
|
||||||
void setDynamicAnim(int id, int anim_id, int segment);
|
void setDynamicAnim(int id, int anim_id, int segment);
|
||||||
void setCamera(Common::Point pos);
|
void setCamera(Common::Point pos);
|
||||||
|
void drawToBackground(int series_id, int sprite_id, Common::Point pos, int depth, int scale);
|
||||||
|
void deleteSequence(int idx);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace MADS
|
} // End of namespace MADS
|
||||||
|
|
|
@ -555,4 +555,8 @@ int SequenceList::addStampCycle(int srcSpriteIdx, bool flipped, int sprite) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SequenceList::setTimingTrigger(int delay, int code) {
|
||||||
|
warning("TODO: SequenceList::setTimingTrigger");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} // End of namespace
|
} // End of namespace
|
||||||
|
|
|
@ -127,6 +127,7 @@ public:
|
||||||
void setMotion(int seqIndex, int flags, int deltaX, int deltaY);
|
void setMotion(int seqIndex, int flags, int deltaX, int deltaY);
|
||||||
|
|
||||||
int addStampCycle(int srcSpriteIdx, bool flipped, int sprite);
|
int addStampCycle(int srcSpriteIdx, bool flipped, int sprite);
|
||||||
|
int setTimingTrigger(int delay, int code);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace MADS
|
} // End of namespace MADS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue