void GameController::update(float dt) { if(!state) { throw GameControllerException("Current game state is null, cannot update."); } if(enqueuedNextState) { if(outTransition) { HIKARI_LOG(debug4) << "Has out transition"; if(outTransition->isComplete()) { HIKARI_LOG(debug4) << "Transition complete!"; outTransition.reset(); gotoNextState(); } else { outTransition->update(dt); } } else { gotoNextState(); } } else { if(inTransition) { HIKARI_LOG(debug4) << "Has in transition"; if(inTransition->isComplete()) { HIKARI_LOG(debug4) << "In transition complete!"; inTransition.reset(); } else { inTransition->update(dt); } } else { state->update(dt); } } }
uint32 AsScene3010DeadBolt::hmAnimation(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_ANIMATION_STOP: gotoNextState(); break; } return messageResult; }
uint32 AsScene1308KeyboardDoor::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x3002: gotoNextState(); break; } return messageResult; }
uint32 AsScene1907WaterHint::hmShowing(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x3002: gotoNextState(); break; } return messageResult; }
uint32 AsScene1907Symbol::hmTryToPlugIn(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x3002: gotoNextState(); break; } return messageResult; }
uint32 AsScene2402TV::hmJoke(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x431EA0B0) playSound(0); break; case 0x3002: gotoNextState(); break; } return messageResult; }
uint32 AsScene2101Door::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x3002: gotoNextState(); break; case 0x4808: stOpenDoor(); break; case 0x4809: stCloseDoor(); break; } return messageResult; }
uint32 AsScene1308LightWallSymbols::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2002: stFadeIn(); break; case 0x2003: stFadeOut(); break; case 0x3002: gotoNextState(); break; } return messageResult; }
uint32 AsScene1302Bridge::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x3002: gotoNextState(); break; case 0x4808: stLowerBridge(); break; case 0x4809: stRaiseBridge(); break; } return messageResult; }
uint32 AsScene2101Door::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_ANIMATION_STOP: gotoNextState(); break; case NM_KLAYMEN_OPEN_DOOR: stOpenDoor(); break; case NM_KLAYMEN_CLOSE_DOOR: stCloseDoor(); break; } return messageResult; }
uint32 AsScene1306Elevator::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2001: if (_isUp) _countdown = 144; messageResult = _isUp ? 1 : 0; break; case 0x3002: gotoNextState(); break; case 0x4808: if (_isDown) stGoingUp(); break; } return messageResult; }
uint32 AsScene2402Door::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2000: if (_isOpen) _countdown = 144; messageResult = _isOpen ? 1 : 0; break; case 0x3002: gotoNextState(); break; case 0x4808: _countdown = 144; _isOpen = true; setVisible(true); startAnimation(0x80495831, 0, -1); _newStickFrameIndex = STICK_LAST_FRAME; playSound(0, calcHash("fxDoorOpen38")); break; } return messageResult; }
uint32 AsScene2401Door::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2004: if (_isOpen) _countdown = 168; messageResult = _isOpen ? 1 : 0; break; case 0x3002: gotoNextState(); break; case 0x4808: if (!_isOpen) { _countdown = 168; _isOpen = true; setVisible(true); startAnimation(0x44687810, 0, -1); playSound(0, calcHash("fxDoorOpen38")); NextState(&AsScene2401Door::stDoorOpenFinished); } break; } return messageResult; }