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 FightsManager::setupPigFight() {
	Resources &res = Resources::getReference();
	Hotspot *player = res.getActiveHotspot(PLAYER_ID);
	player->setSkipFlag(false);
	player->resource()->colorOffset = 16;
	player->setTickProc(PLAYER_FIGHT_TICK_PROC_ID);
	player->setSize(48, 53);
	player->setAnimationIndex(PLAYER_FIGHT_ANIM_INDEX);
	player->resource()->width = 48;
	player->resource()->height = 53;

	player->setOccupied(false);
	player->setPosition(262, 94);
	FighterRecord &rec = getDetails(PLAYER_ID);
	rec.fwhits = 0;
	rec.fwtrue_x = 262;
	rec.fwtrue_y = 53;
	rec.fwseq_ad = FIGHT_PLAYER_INIT;
	rec.fwenemy_ad = PIG_ID;
}