Beispiel #1
0
void Scene2101::update() {
	if (_countdown1 != 0) {
		if (_doorStatus == 2) {
			if (--_countdown1 == 0) {
				sendMessage(_asDoor, 0x4809, 0);
				_doorStatus = 1;
			}
		} else {
			if (_klaymen->getX() > 575)
				_canAcceptInput  = false;
			if (--_countdown1 == 0) {
				if (_klaymen->getX() < 480) {
					sendMessage(_asDoor, 0x4809, 0);
					_doorStatus = 1;
				} else if (_klaymen->getX() >= 480 && _klaymen->getX() <= 575) {
					_klaymen->setDoDeltaX(0);
					setMessageList2(0x004B8F48);
					sendMessage(_asDoor, 0x4809, 0);
					sendMessage(_asHitByDoorEffect, 0x2001, 0);
					_doorStatus = 1;
				}
			}
		}
	} else if (_doorStatus == 1 && _messageValue >= 0 && _klaymen->getX() > 470 && !isMessageList2(0x004B8F48))
		setMessageList2(0x004B8F50);
	Scene::update();
}
Beispiel #2
0
uint32 Scene1201::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
	uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
	switch (messageNum) {
	case NM_ANIMATION_START:
		if (param.asInteger() == 0x07053000) {
			_creatureExploded = true;
			sendMessage(_asCreature, 0x2004, 0);
		} else if (param.asInteger() == 0x140E5744)
			sendMessage(_asCreature, NM_KLAYMEN_CLIMB_LADDER, 0);
		else if (param.asInteger() == 0x40253C40) {
			_canAcceptInput = false;
			sendMessage(_asCreature, NM_KLAYMEN_STOP_CLIMBING, 0);
		} else if (param.asInteger() == 0x090EB048) {
			if (_klaymen->getX() < 572)
				setMessageList2(0x004AEC90);
			else
				setMessageList2(0x004AEC20);
		}
		break;
	case 0x2001:
		if (getGlobalVar(V_MATCH_STATUS) == 0)
			setMessageList2(0x004AECB0);
		else {
			sendEntityMessage(_klaymen, 0x1014, _asMatch);
			setMessageList2(0x004AECC0);
		}
		break;
	case NM_POSITION_CHANGE:
		if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) {
			// Move the TNT dummy if the fuse is burning
			sendEntityMessage(_klaymen, 0x1014, _asTntMan);
			setMessageList2(0x004AECF0, false);
		} else if (getGlobalVar(V_MATCH_STATUS) == 3) {
			// Light the TNT dummy if we have the match
			sendEntityMessage(_klaymen, 0x1014, _asTntMan);
			if (_klaymen->getX() > _asTntMan->getX())
				setMessageList(0x004AECD0);
			else
				setMessageList(0x004AECE0);
		}
		break;
	case 0x4814:
		cancelMessageList();
		break;
	case 0x4826:
		if (sender == _asTape) {
			sendEntityMessage(_klaymen, 0x1014, _asTape);
			setMessageList(0x004AED38);
		}
		break;
	case 0x4829:
		sendMessage(_asRightDoor, 0x4829, 0);
		break;
	case 0x8000:
		sendMessage(_asKlaymenHead, NM_KLAYMEN_STOP_CLIMBING, 0);
		break;
	}
	return messageResult;
}
Beispiel #3
0
bool Scene::queryPositionRectList(int16 mouseX, int16 mouseY) {
    int16 klaymenX = _klaymen->getX();
    int16 klaymenY = _klaymen->getY();
    if (_rectType == 1) {
        RectList &rectList = *_rectList;
        for (uint i = 0; i < rectList.size(); i++) {
            debug(2, "(%d, %d) ? (%d, %d, %d, %d)", klaymenX, klaymenY, rectList[i].rect.x1, rectList[i].rect.y1, rectList[i].rect.x2, rectList[i].rect.y2);
            if (rectList[i].rect.contains(klaymenX, klaymenY)) {
                for (uint j = 0; j < rectList[i].subRects.size(); j++) {
                    debug(2, "  (%d, %d) ? (%d, %d, %d, %d)", mouseX, mouseY, rectList[i].subRects[j].rect.x1, rectList[i].subRects[j].rect.y1, rectList[i].subRects[j].rect.x2, rectList[i].subRects[j].rect.y2);
                    if (rectList[i].subRects[j].rect.contains(mouseX, mouseY)) {
                        return setMessageList2(rectList[i].subRects[j].messageListId);
                    }
                }
            }
        }
    } else if (_rectType == 2) {
        MessageList *messageList = _dataResource.getMessageListAtPos(klaymenX, klaymenY, mouseX, mouseY);
        if (messageList && messageList->size())
            setMessageList2(messageList, true, true);
    }
    return true;
}
Beispiel #4
0
uint32 Scene2101::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
	Scene::handleMessage(messageNum, param, sender);
	switch (messageNum) {
	case 0x100D:
		if (param.asInteger() == 0x02144CB1)
			sendEntityMessage(_klaymen, 0x1014, _ssFloorButton);
		else if (param.asInteger() == 0x21E64A00) {
			if (_doorStatus == 0)
				setMessageList(0x004B8E80);
			else
				setMessageList(0x004B8EC8);
		} else if (param.asInteger() == 0x41442820)
			cancelMessageList();
		break;
	case 0x2000:
		if (param.asInteger() != 0) {
			setRectList(0x004B9008);
			_klaymen->setKlaymenIdleTable3();
		} else {
			setRectList(0x004B8FF8);
			_klaymen->setKlaymenIdleTable1();
		}
		break;
	case 0x480B:
		if (sender == _ssFloorButton && _doorStatus == 1) {
			sendMessage(_asDoor, 0x4808, 0);
			_doorStatus = 0;
			_countdown1 = 90;
		}
		break;
	case 0x4826:
		if (sender == _asTape1 || sender == _asTape2) {
			if (_klaymen->getX() >= 228 && _klaymen->getX() <= 500) {
				sendEntityMessage(_klaymen, 0x1014, sender);
				setMessageList(0x004B8F78);
			} else if (_klaymen->getX() < 228)
				setMessageList2(0x004B8F00);
		}
		break;
	}
	return 0;
}
Beispiel #5
0
bool Scene::setMessageList2(uint32 id, bool canAcceptInput, bool doConvertMessages) {
    return setMessageList2(_vm->_staticData->getMessageList(id), canAcceptInput, doConvertMessages);
}