Exemplo n.º 1
0
void FightsManager::enemyKilled() {
	Resources &res = Resources::getReference();
	Hotspot *playerHotspot = res.getActiveHotspot(PLAYER_ID);
	FighterRecord &playerRec = getDetails(PLAYER_ID);

	playerHotspot->setTickProc(PLAYER_TICK_PROC_ID);
	playerRec.fwhits = GENERAL_MAGIC_ID;
	playerHotspot->resource()->colorOffset = 128;
	playerHotspot->setSize(32, 48);
	playerHotspot->resource()->width = 32;
	playerHotspot->resource()->height = 48;
	playerHotspot->setAnimationIndex(PLAYER_ANIM_INDEX);
	playerHotspot->setPosition(playerHotspot->x(), playerHotspot->y() + 5);
	playerHotspot->setDirection(LEFT);

	if (playerHotspot->roomNumber() == 6) {
		Dialog::show(0xc9f);
		HotspotData *axeHotspot = res.getHotspot(0x2738);
		axeHotspot->roomNumber = PLAYER_ID;
		axeHotspot->flags |= HOTSPOTFLAG_FOUND;

		// Prevent the weapon animation being drawn
		axeHotspot = res.getHotspot(0x440);
		axeHotspot->layer = 0;
	}
}
Exemplo n.º 2
0
void Script::normalGoewin(uint16 v1, uint16 v2, uint16 v3) {
	Resources &res = Resources::getReference();
	Hotspot *hotspot = res.getActiveHotspot(GOEWIN_ID);
	assert(hotspot);

	if (!hotspot->currentActions().isEmpty())
		hotspot->currentActions().top().setAction(DISPATCH_ACTION);
	hotspot->setCharacterMode(CHARMODE_NONE);
	hotspot->setDirection(UP);
	hotspot->setTickProc(STANDARD_CHARACTER_TICK_PROC);

	// Clear walk to position for Goewin so player must walk up to her when interacting
	hotspot->resource()->walkX = 0;
	hotspot->resource()->walkY = 0;
}
Exemplo n.º 3
0
Hotspot *Resources::addHotspot(uint16 hotspotId) {
	HotspotData *hData = getHotspot(hotspotId);
	assert(hData);
	Hotspot *hotspot = new Hotspot(hData);
	_activeHotspots.push_back(HotspotList::value_type(hotspot));

	if (hotspotId < FIRST_NONCHARACTER_ID) {
		// Default characters to facing upwards until they start moving
		hotspot->setDirection(UP);
		hotspot->setCharRectY(0);

		// When reactivating an NPC, ensure that their previous state wasn't PROCESSING_PATH, since
		// the pause has destroyed the previously decided destination position
		if (!hData->npcSchedule.isEmpty() && (hData->npcSchedule.top().action() == PROCESSING_PATH))
			hData->npcSchedule.top().setAction(DISPATCH_ACTION);
	}

	return hotspot;
}