Exemplo n.º 1
0
bool CBilgeSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (_enabled) {
		switch (getRandomNumber(4)) {
		case 0:
		case 4: {
			_enabled = false;
			CTurnOff offMsg;
			offMsg.execute(this);
			break;
		}

		case 1:
			startTalking(this, 230055);
			break;

		case 2:
			startTalking(this, 230067);
			break;

		case 3:
			startTalking(this, 230045);
			break;

		default:
			break;
		}
	} else {
		CTurnOn onMsg;
		onMsg.execute(this);
		_enabled = true;
	}

	return true;
}
Exemplo n.º 2
0
bool CSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
    if (!_field1D8) {
        Rect tempRect = _rect1;
        tempRect.translate(_bounds.left, _bounds.top);

        if (!_enabled || (_field188 && tempRect.contains(msg->_mousePos))) {
            CTurnOn onMsg;
            onMsg.execute(this);
            _enabled = true;
        } else if (getRandomNumber(256) < 130) {
            _enabled = false;
            CTurnOff offMsg;
            offMsg.execute(this);
        } else {
            switch (getRandomNumber(2)) {
            case 0:
                startTalking(this, 230055, findView());
                break;
            case 1:
                startTalking(this, 230067, findView());
                break;
            case 2:
                startTalking(this, 230045, findView());
                break;
            default:
                break;
            }
        }
    }

    return true;
}
Exemplo n.º 3
0
bool CDeskbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
    if (_npcFlags & NPCFLAG_40000)
        return true;

    CTurnOff turnOff;
    CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(msg);

    switch (msg->_dialogueId) {
    case 41684:
    case 41787:
    case 41788:
    case 41789:
        _npcFlags |= NPCFLAG_80000;
        turnOff.execute(this);

    case 41686:
        _npcFlags |= NPCFLAG_100000;
        turnOff.execute(this);
        break;

    default:
        break;
    }

    return true;
}
Exemplo n.º 4
0
bool CShipSetting::MouseDragStartMsg(CMouseDragStartMsg *msg) {
	if (!checkStartDragging(msg))
		return false;
	if (_itemName == "NULL")
		return true;

	CTurnOff offMsg;
	offMsg.execute(_target);

	if (isEquals("ChickenSetting") || _itemName == "ChickenBridge") {
		CActMsg actMsg("IncreaseQuantity");
		actMsg.execute("ChickenDispenser");
	}

	if (_itemName != "NULL") {
		CPassOnDragStartMsg passMsg(msg->_mousePos, 1);
		passMsg.execute(_itemName);

		msg->_dragItem = getRoot()->findByName(_itemName);

		CVisibleMsg visibleMsg(true);
		visibleMsg.execute(_itemName);
	}

	CSetFrameMsg frameMsg(0);
	frameMsg.execute(_frameTarget);
	_itemName = "NULL";
	_cursorId = CURSOR_ARROW;
	return true;
}
Exemplo n.º 5
0
bool CArboretumGate::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (!_v3) {
		CTurnOff offMsg;
		offMsg.execute(this);
	}

	return true;
}
Exemplo n.º 6
0
bool CDeskbot::LeaveViewMsg(CLeaveViewMsg *msg) {
    if (_deskbotActive) {
        CTurnOff turnOff;
        turnOff.execute(this);
    }

    return true;
}
Exemplo n.º 7
0
bool CSeasonalAdjustment::MovieEndMsg(CMovieEndMsg *msg) {
	if (msg->_endFrame == 6) {
		stateChangeSeason();
		CStatusChangeMsg changeMsg;
		changeMsg.execute(this);
		CTurnOff offMsg;
		offMsg.execute(this);
		offMsg.execute("LeftPanExit");
		offMsg.execute("RightPanExit");
	}

	return true;
}
Exemplo n.º 8
0
bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) {
	CPetControl *pet = getPetControl();
	if (msg->_value == _field1DC)
		return true;
	if (mailExists(pet->getRoomFlags()))
		return false;

	_field1DC = msg->_value;
	if (_field1DC) {
		CGameObject *item = msg->_object;
		_string3 = item->getName();
		CHoseConnectedMsg hoseMsg(1, this);
		hoseMsg.execute(msg->_object);
		item->petMoveToHiddenRoom();

		CPumpingMsg pumpingMsg(1, this);
		pumpingMsg.execute(this);
		_field1DC = 1;

		if (_enabled) {
			_enabled = false;
		} else {
			playMovie(_startFrame9, _endFrame9, 0);
			playSound("z#26.wav");
		}

		playMovie(_field1C4, _field1C8, MOVIE_NOTIFY_OBJECT);
	} else {
		stopMovie();
		stopSound(_field1EC);
		playMovie(_field1F0, _field1F4, MOVIE_NOTIFY_OBJECT);

		CPumpingMsg pumpingMsg(0, this);
		pumpingMsg.execute(_string3);

		CGameObject *obj = getHiddenObject(_string3);
		if (obj) {
			obj->petAddToInventory();
			obj->setVisible(true);
		}

		_enabled = true;
		CTurnOff offMsg;
		offMsg.execute(this);
	}

	return true;
}
Exemplo n.º 9
0
bool CSGTStateRoom::ActMsg(CActMsg *msg) {
	CPetControl *pet = getPetControl();
	uint roomFlags = pet->getRoomFlags();
	uint assignedRoom = pet->getAssignedRoomFlags();

	if (roomFlags != assignedRoom) {
		petDisplayMessage(NOT_YOUR_ASSIGNED_ROOM);
	} else if (_isClosed) {
		CTurnOn onMsg;
		onMsg.execute(this);
	} else {
		CTurnOff offMsg;
		offMsg.execute(this);
	}

	return true;
}
Exemplo n.º 10
0
bool CLightSwitch::PETActivateMsg(CPETActivateMsg *msg) {
	if (msg->_name == "Light") {
		if (_flag) {
			CTurnOff offMsg;
			offMsg.execute("1stClassState", CLight::_type, MSGFLAG_CLASS_DEF | MSGFLAG_SCAN);

		} else {
			CTurnOn onMsg;
			onMsg.execute("1stClassState", CLight::_type, MSGFLAG_CLASS_DEF | MSGFLAG_SCAN);
			_flag = false;
			if (_turnOnTV)
				CTelevision::_turnOn = false;
		}
	}

	return true;
}
Exemplo n.º 11
0
bool CShipSetting::AddHeadPieceMsg(CAddHeadPieceMsg *msg) {
	_cursorId = CURSOR_HAND;

	if (msg->_value == "Enable") {
		CTurnOn onMsg;
		onMsg.execute(_target);

		if (isEquals("ChickenSetting")) {
			CActMsg actMsg("DecreaseQuantity");
			actMsg.execute("ChickenDispenser");
		}
	} else {
		CTurnOff offMsg;
		offMsg.execute(_target);
	}

	return true;
}
Exemplo n.º 12
0
bool CNodeAutoSoundPlayer::LeaveNodeMsg(CLeaveNodeMsg *msg) {
	CNodeItem *node = findNode();
	CRoomItem *room = findRoom();

	if (node == msg->_oldNode) {
		CTurnOff offMsg;
		offMsg.execute(this);

		if (_enabled) {
			CChangeMusicMsg changeMsg;
			changeMsg._action = MUSIC_START;
			changeMsg.execute(room, CAutoMusicPlayer::_type,
				MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
		}
	}

	return true;
}
Exemplo n.º 13
0
bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
    switch (msg->_action) {
    case 19:
        inc54();
        lockMouse();
        petSetArea(PET_CONVERSATION);
        playClip("ReprogramPETInHand", MOVIE_NOTIFY_OBJECT);
        _npcFlags |= NPCFLAG_10000;
        _classNum = (PassengerClass)msg->_param1;

        switch (_classNum) {
        case FIRST_CLASS:
            petDisplayMessage(UPGRADED_TO_FIRST_CLASS);
            setPassengerClass(_classNum);
            petReassignRoom(_classNum);
            break;
        case SECOND_CLASS:
            petDisplayMessage(UPGRADED_TO_SECOND_CLASS);
            setPassengerClass(_classNum);
            petReassignRoom(_classNum);
            break;
        case THIRD_CLASS:
            setPassengerClass(THIRD_CLASS);
            petReassignRoom(_classNum);
            break;
        default:
            break;
        }

    case 20:
        if (getPassengerClass() == 1) {
            CPetControl *petControl = getPetControl();
            if (petControl)
                petControl->changeLocationClass(UNCHECKED);
        }
        break;

    case 21:
        if (getPassengerClass() == FIRST_CLASS) {
            CPetControl *petControl = getPetControl();
            if (petControl)
                petControl->changeLocationClass(THIRD_CLASS);
        }
        break;

    case 22:
        if (getPassengerClass() == FIRST_CLASS) {
            CPetControl *petControl = getPetControl();
            if (petControl)
                petControl->changeLocationClass(SECOND_CLASS);
        }
        break;

    case 23:
        if (getPassengerClass() == FIRST_CLASS) {
            CPetControl *petControl = getPetControl();
            if (petControl)
                petControl->changeLocationClass(FIRST_CLASS);
        }
        break;

    case 26:
        _npcFlags |= NPCFLAG_80000;
        CTurnOff turnOff;
        turnOff.execute(this);
        lockMouse();
        break;
    }

    return true;
}
Exemplo n.º 14
0
bool CBarbot::LeaveViewMsg(CLeaveViewMsg *msg) {
	CTurnOff offMsg;
	offMsg.execute(this);
	return true;
}