static bool
GenerateVux_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT whichNode)
{
	if (CurStarDescPtr->Index == MAIDENS_DEFINED
			&& matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		assert (!GET_GAME_STATE (SHOFIXTI_MAIDENS) && whichNode == 0);

		GenerateDefault_landerReport (solarSys);
		SetLanderTakeoff ();

		SET_GAME_STATE (SHOFIXTI_MAIDENS, 1);
		SET_GAME_STATE (MAIDENS_ON_SHIP, 1);
		
		return true; // picked up
	}

	if (CurStarDescPtr->Index == VUX_DEFINED
			&& matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		// Standard ruins report
		GenerateDefault_landerReportCycle (solarSys);
		return false;
	}

	(void) whichNode;
	return false;
}
static bool
GenerateOrz_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT whichNode)
{
	if (CurStarDescPtr->Index == TAALO_PROTECTOR_DEFINED
			&& matchWorld (solarSys, world, 1, 2))
	{
		assert (!GET_GAME_STATE (TAALO_PROTECTOR) && whichNode == 0);

		GenerateDefault_landerReport (solarSys);
		SetLanderTakeoff ();

		SET_GAME_STATE (TAALO_PROTECTOR, 1);
		SET_GAME_STATE (TAALO_PROTECTOR_ON_SHIP, 1);

		return true; // picked up
	}

	if (CurStarDescPtr->Index == ORZ_DEFINED
			&& matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		// Standard ruins report
		GenerateDefault_landerReportCycle (solarSys);
		return false;
	}

	(void) whichNode;
	return false;
}
static bool
GenerateUtwig_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT whichNode)
{
	if (CurStarDescPtr->Index == UTWIG_DEFINED
			&& matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		// Standard ruins report
		GenerateDefault_landerReportCycle (solarSys);
		return false;
	}

	if (CurStarDescPtr->Index == BOMB_DEFINED
			&& matchWorld (solarSys, world, 5, 1))
	{
		assert (!GET_GAME_STATE (UTWIG_BOMB) && whichNode == 0);

		GenerateDefault_landerReport (solarSys);
		SetLanderTakeoff ();

		SET_GAME_STATE (UTWIG_BOMB, 1);
		SET_GAME_STATE (UTWIG_BOMB_ON_SHIP, 1);
		SET_GAME_STATE (DRUUGE_MANNER, 1);
		SET_GAME_STATE (DRUUGE_VISITS, 0);
		SET_GAME_STATE (DRUUGE_HOME_VISITS, 0);

		return true; // picked up
	}

	(void) whichNode;
	return false;
}
LOCDATA*
init_yehat_comm (void)
{
	LOCDATA *retval;

	yehat_desc.init_encounter_func = Intro;
	yehat_desc.post_encounter_func = post_yehat_enc;
	yehat_desc.uninit_encounter_func = uninit_yehat;

	yehat_desc.AlienTextBaseline.x = SIS_SCREEN_WIDTH * 2 / 3;
	yehat_desc.AlienTextBaseline.y = RES_SIS_SCALE(60);
	yehat_desc.AlienTextWidth = (SIS_TEXT_WIDTH - 16) * 2 / 3;

	if (LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	retval = &yehat_desc;

	return (retval);
}
LOCDATA*
init_pkunk_comm (void)
{
	LOCDATA *retval;

	pkunk_desc.init_encounter_func = Intro;
	pkunk_desc.post_encounter_func = post_pkunk_enc;
	pkunk_desc.uninit_encounter_func = uninit_pkunk;

	pkunk_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	pkunk_desc.AlienTextBaseline.y = 0;
	pkunk_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (GET_GAME_STATE (PKUNK_MANNER) == 3
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		// Enter communications immediately.
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		// Ask the player whether to attack or talk.
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &pkunk_desc;

	return (retval);
}
Example #6
0
static bool
GenerateRainbowWorld_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
{
	if (matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		BYTE which_rainbow;
		UWORD rainbow_mask;
		STAR_DESC *SDPtr;

		rainbow_mask = MAKE_WORD (
				GET_GAME_STATE (RAINBOW_WORLD0),
				GET_GAME_STATE (RAINBOW_WORLD1));

		which_rainbow = 0;
		SDPtr = &star_array[0];
		while (SDPtr != CurStarDescPtr)
		{
			if (SDPtr->Index == RAINBOW_DEFINED)
				++which_rainbow;
			++SDPtr;
		}
		rainbow_mask |= 1 << which_rainbow;
		SET_GAME_STATE (RAINBOW_WORLD0, LOBYTE (rainbow_mask));
		SET_GAME_STATE (RAINBOW_WORLD1, HIBYTE (rainbow_mask));
	}

	GenerateDefault_generateOrbital (solarSys, world);
	return true;
}
LOCDATA*
init_urquan_comm (void)
{
	LOCDATA *retval;

	DWORD GrpOffs;

	urquan_desc.init_encounter_func = Intro;
	urquan_desc.post_encounter_func = post_urquan_enc;
	urquan_desc.uninit_encounter_func = uninit_urquan;

	urquan_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	urquan_desc.AlienTextBaseline.y = 0;
	urquan_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	GrpOffs = GET_GAME_STATE_32 (URQUAN_PROBE_GRPOFFS0);
	if (GET_GAME_STATE (PLAYER_HYPNOTIZED)
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE
			|| (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY
			&& GLOBAL (BattleGroupRef)
			&& GLOBAL (BattleGroupRef) == GrpOffs))
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &urquan_desc;

	return (retval);
}
Example #8
0
LOCDATA*
init_druuge_comm (void)
{
	LOCDATA *retval;

	SlaveryCount = 0;
	AttemptedSalvage = FALSE;

	druuge_desc.init_encounter_func = Intro;
	druuge_desc.post_encounter_func = post_druuge_enc;
	druuge_desc.uninit_encounter_func = uninit_druuge;

	druuge_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	druuge_desc.AlienTextBaseline.y = RES_SIS_SCALE(70);
	druuge_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if ((GET_GAME_STATE (DRUUGE_MANNER) == 0
			&& (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7)))
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &druuge_desc;

	return (retval);
}
Example #9
0
LOCDATA*
init_umgah_comm (void)
{
	LOCDATA *retval;

	umgah_desc.init_encounter_func = Intro;
	umgah_desc.post_encounter_func = post_umgah_enc;
	umgah_desc.uninit_encounter_func = uninit_umgah;

	umgah_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	umgah_desc.AlienTextBaseline.y = 0;
	umgah_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if ((GET_GAME_STATE (TALKING_PET) && !GET_GAME_STATE (UMGAH_HOSTILE))
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &umgah_desc;

	return (retval);
}
Example #10
0
static bool
GenerateBurvixese_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT whichNode)
{
	if (matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		// Standard ruins report
		GenerateDefault_landerReportCycle (solarSys);
		return false;
	}

	if (matchWorld (solarSys, world, 0, 0))
	{
		assert (!GET_GAME_STATE (BURVIXESE_BROADCASTERS) && whichNode == 0);

		GenerateDefault_landerReport (solarSys);
		SetLanderTakeoff ();

		SET_GAME_STATE (BURVIXESE_BROADCASTERS, 1);
		SET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP, 1);

		return true; // picked up
	}

	(void) whichNode;
	return false;
}
Example #11
0
static bool
GenerateWreck_pickupEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT whichNode)
{
	if (matchWorld (solarSys, world, 6, MATCH_PLANET))
	{
		assert (whichNode == 0);

		GenerateDefault_landerReportCycle (solarSys);

		if (!GET_GAME_STATE (PORTAL_KEY))
		{
			SetLanderTakeoff ();

			SET_GAME_STATE (PORTAL_KEY, 1);
			SET_GAME_STATE (PORTAL_KEY_ON_SHIP, 1);
		}

		// The Wreck cannot be "picked up". It is always on the surface.
		return false;
	}

	(void) whichNode;
	return false;
}
Example #12
0
static void
BombAmbush (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, whats_up_at_bomb_planet))
	{
		NPCPhrase (GEN_INFO_AT_BOMB_PLANET);
		SET_GAME_STATE (BOMB_VISITS, 2);
	}
	else if (PLAYER_SAID (R, we_get_bomb))
	{
		NPCPhrase (NOT_GET_BOMB);
		SET_GAME_STATE (BOMB_VISITS, 3);
	}

	switch (GET_GAME_STATE (BOMB_VISITS))
	{
		case 1:
			Response (whats_up_at_bomb_planet, BombAmbush);
			break;
		case 2:
			Response (we_get_bomb, BombAmbush);
			break;
		default:
			Response (then_we_take_bomb, ExitConversation);
			break;
	}
	Response (bye, ExitConversation);
}
Example #13
0
static void
CombatIsInevitable (RESPONSE_REF R)
{
	SET_GAME_STATE (BATTLE_SEGUE, 1);

	if (PLAYER_SAID (R, bye_space))
		NPCPhrase (BYE_AND_DIE_SPACE);
	else if (PLAYER_SAID (R, bye_homeworld))
		NPCPhrase (BYE_AND_DIE_HOMEWORLD);
	else if (PLAYER_SAID (R, like_to_land))
		NPCPhrase (NEVER_LET_LAND);
	else if (PLAYER_SAID (R, bye_sun_device))
	{
		NPCPhrase (GOODBYE_SUN_DEVICE);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		DoRamble (R);
		if (!(GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7)))
			NPCPhrase (BYE_AND_DIE_SPACE);
		else
			NPCPhrase (BYE_AND_DIE_HOMEWORLD);
	}
}
Example #14
0
LOCDATA*
init_blackurq_comm (void)
{
	LOCDATA *retval;

	blackurq_desc.init_encounter_func = Intro;
	blackurq_desc.post_encounter_func = post_blackurq_enc;
	blackurq_desc.uninit_encounter_func = uninit_blackurq;

	blackurq_desc.AlienTextBaseline.x =	TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	blackurq_desc.AlienTextBaseline.y = 0;
	blackurq_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (!GET_GAME_STATE (KOHR_AH_KILLED_ALL)
			&& LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	retval = &blackurq_desc;

	return (retval);
}
Example #15
0
static void
ExitConversation (RESPONSE_REF R)
{
	SET_GAME_STATE (BATTLE_SEGUE, 0);

	if (PLAYER_SAID (R, bye_angry_space))
		NPCPhrase (GOODBYE_ANGRY_SPACE);
	else if (PLAYER_SAID (R, bye_friendly_space))
		NPCPhrase (GOODBYE_FRIENDLY_SPACE);
	else if (PLAYER_SAID (R, bye_friendly_homeworld))
		NPCPhrase (GOODBYE_FRDLY_HOMEWORLD);
	else if (PLAYER_SAID (R, lets_fight))
		NPCPhrase (NO_FIGHT);
	else if (PLAYER_SAID (R, bug_eyed_fruitcakes))
	{
		NPCPhrase (WE_NEVER_FRIENDS);

		SET_GAME_STATE (ARILOU_MANNER, 2);
	}
	else if (PLAYER_SAID (R, best_if_i_killed_you))
	{
		NPCPhrase (WICKED_HUMAN);

		SET_GAME_STATE (ARILOU_MANNER, 2);
	}
}
Example #16
0
LOCDATA*
init_spahome_comm ()
{
	LOCDATA *retval;

	spahome_desc.init_encounter_func = Intro;
	spahome_desc.post_encounter_func = post_spahome_enc;
	spahome_desc.uninit_encounter_func = uninit_spahome;

	spahome_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	spahome_desc.AlienTextBaseline.y = 0;
	spahome_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	// use alternate "Safe Ones" track if available
	spahome_desc.AlienAltSongRes = SPAHOME_MUSIC;
	spahome_desc.AlienSongFlags |= LDASF_USE_ALTERNATE;

	if (GET_GAME_STATE (SPATHI_MANNER) == 3)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}

	retval = &spahome_desc;

	return (retval);
}
Example #17
0
LOCDATA*
init_arilou_comm (void)
{
	LOCDATA *retval;

	arilou_desc.init_encounter_func = Intro;
	arilou_desc.post_encounter_func = post_arilou_enc;
	arilou_desc.uninit_encounter_func = uninit_arilou;

	arilou_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	arilou_desc.AlienTextBaseline.y = 0;
	arilou_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (GET_GAME_STATE (ARILOU_SPACE_SIDE) > 1
			|| GET_GAME_STATE (ARILOU_MANNER) == 3
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &arilou_desc;

	return (retval);
}
Example #18
0
LOCDATA*
init_supox_comm (void)
{
	LOCDATA *retval;

	supox_desc.init_encounter_func = Intro;
	supox_desc.post_encounter_func = post_supox_enc;
	supox_desc.uninit_encounter_func = uninit_supox;

	supox_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	supox_desc.AlienTextBaseline.y = 0;
	supox_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (!GET_GAME_STATE (SUPOX_HOSTILE)
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &supox_desc;

	return (retval);
}
Example #19
0
static COUNT
DeltaCredit (SIZE delta_credit)
{
	COUNT Credit;

	Credit = MAKE_WORD (
			GET_GAME_STATE (MELNORME_CREDIT0),
			GET_GAME_STATE (MELNORME_CREDIT1)
			);
	if ((int)delta_credit >= 0 || ((int)(-delta_credit) <= (int)(Credit)))
	{
		Credit += delta_credit;
		SET_GAME_STATE (MELNORME_CREDIT0, LOBYTE (Credit));
		SET_GAME_STATE (MELNORME_CREDIT1, HIBYTE (Credit));
		LockMutex (GraphicsLock);
		DrawStatusMessage ((UNICODE *)~0);
		UnlockMutex (GraphicsLock);
	}
	else
	{
		NPCPhrase (NEED_MORE_CREDIT0);
		NPCPhrase (delta_credit + (int)Credit);
		NPCPhrase (NEED_MORE_CREDIT1);
	}
	
	return (Credit);
}
Example #20
0
LOCDATAPTR
init_mycon_comm (void)
{
	LOCDATAPTR retval;

	mycon_desc.init_encounter_func = Intro;
	mycon_desc.uninit_encounter_func = uninit_mycon;

	mycon_desc.AlienTextTemplate.baseline.x =
			TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	mycon_desc.AlienTextTemplate.baseline.y = 0;
	mycon_desc.AlienTextTemplate.align = ALIGN_CENTER;
	mycon_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	retval = &mycon_desc;

	return (retval);
}
Example #21
0
LOCDATA*
init_orz_comm (void)
{
	LOCDATA *retval;

	orz_desc.init_encounter_func = Intro;
	orz_desc.post_encounter_func = post_orz_enc;
	orz_desc.uninit_encounter_func = uninit_orz;

	orz_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	orz_desc.AlienTextBaseline.y = 0;
	orz_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (GET_GAME_STATE (ORZ_MANNER) == 3
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &orz_desc;

	return (retval);
}
Example #22
0
static void
AlienRaces (void)
{
	BYTE stack = GET_GAME_STATE (MELNORME_ALIEN_INFO_STACK);
	const int phraseId = GetLineSafe (ok_buy_alien_race_lines, stack);
	// Two pieces of alien knowledge trigger state changes.
	switch (phraseId)
	{
		case OK_BUY_ALIEN_RACE_14:
			if (!GET_GAME_STATE (FOUND_PLUTO_SPATHI))
			{
				SET_GAME_STATE (KNOW_SPATHI_PASSWORD, 1);
				SET_GAME_STATE (SPATHI_HOME_VISITS, 7);
			}
			break;
		case OK_BUY_ALIEN_RACE_15:
			if (GET_GAME_STATE (KNOW_ABOUT_SHATTERED) < 2)
			{
				SET_GAME_STATE (KNOW_ABOUT_SHATTERED, 2);
			}
			SET_GAME_STATE (KNOW_SYREEN_WORLD_SHATTERED, 1);
			break;
	}
	NPCPhrase (phraseId);
	SET_GAME_STATE (MELNORME_ALIEN_INFO_STACK, stack + 1);
}
Example #23
0
static void
ExplainSlaveTrade (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, want_to_buy))
		NPCPhrase (WE_SELL_FOR_CREW);
	else if (PLAYER_SAID (R, isnt_this_slave_trading))
	{
		NPCPhrase (NO_SLAVE_TRADE);

		SET_GAME_STATE (KNOW_DRUUGE_SLAVERS, 1);
	}
	else if (PLAYER_SAID (R, what_do_with_crew))
	{
		NPCPhrase (HAVE_FUN);

		SET_GAME_STATE (KNOW_DRUUGE_SLAVERS, 2);
	}

	switch (GET_GAME_STATE (KNOW_DRUUGE_SLAVERS))
	{
		case 0:
			Response (isnt_this_slave_trading, ExplainSlaveTrade);
			break;
		case 1:
			Response (what_do_with_crew, ExplainSlaveTrade);
			break;
	}
	Response (i_will_never_trade_crew,  TradeWorld);
	Response (im_ready_to_buy, Buy);
}
LOCDATA*
init_ilwrath_comm (void)
{
	LOCDATA *retval;

	ilwrath_desc.init_encounter_func = Intro;
	ilwrath_desc.post_encounter_func = post_ilwrath_enc;
	ilwrath_desc.uninit_encounter_func = uninit_ilwrath;

	ilwrath_desc.AlienTextBaseline.x = TEXT_X_OFFS + (SIS_TEXT_WIDTH >> 1);
	ilwrath_desc.AlienTextBaseline.y = 70;
	ilwrath_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16;

	if (GET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER)
			|| (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA)
			& ((1 << 4) | (1 << 5)))
			|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	retval = &ilwrath_desc;

	return (retval);
}
Example #25
0
static void
RealizeMistake (RESPONSE_REF R)
{
    (void) R;  // ignored
    NPCPhrase (DGRUNTI);
    SET_GAME_STATE (SHOFIXTI_STACK1, 0);
    SET_GAME_STATE (SHOFIXTI_STACK3, 0);
    SET_GAME_STATE (SHOFIXTI_STACK2, 3);

    {
        UNICODE buf[ALLIANCE_NAME_BUFSIZE];

        GetAllianceName (buf, name_1);
        construct_response (
            shared_phrase_buf,
            i_am_captain0,
            GLOBAL_SIS (CommanderName),
            i_am_captain1,
            buf,
            i_am_captain2,
            GLOBAL_SIS (ShipName),
            i_am_captain3,
            (UNICODE*)NULL);
    }
    DoResponsePhrase (i_am_captain0, ExplainDefeat, shared_phrase_buf);
    Response (i_am_nice, ExplainDefeat);
    Response (i_am_guy, ExplainDefeat);
}
Example #26
0
static bool
GenerateZoqFotPik_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
{
	if (matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		if (ActivateStarShip (ZOQFOTPIK_SHIP, SPHERE_TRACKING))
		{
			PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
			ReinitQueue (&GLOBAL (ip_group_q));
			assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);

			if (GET_GAME_STATE (ZOQFOT_DISTRESS))
			{
				CloneShipFragment (BLACK_URQUAN_SHIP,
						&GLOBAL (npc_built_ship_q), 0);

				GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
				SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
				InitCommunication (BLACKURQ_CONVERSATION);

				if (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))
					return true;

				if (GetHeadLink (&GLOBAL (npc_built_ship_q)))
				{
					GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
					ReinitQueue (&GLOBAL (npc_built_ship_q));
					GetGroupInfo (GROUPS_RANDOM, GROUP_LOAD_IP);
					return true;
				}
			}

			CloneShipFragment (ZOQFOTPIK_SHIP, &GLOBAL (npc_built_ship_q),
					INFINITE_FLEET);

			GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
			SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
			InitCommunication (ZOQFOTPIK_CONVERSATION);

			if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
			{
				GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
				ReinitQueue (&GLOBAL (npc_built_ship_q));
				GetGroupInfo (GROUPS_RANDOM, GROUP_LOAD_IP);
			}

			return true;
		}

		LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo);
		solarSys->PlanetSideFrame[1] =
				CaptureDrawable (LoadGraphic (RUINS_MASK_PMAP_ANIM));
		solarSys->SysInfo.PlanetInfo.DiscoveryString =
				CaptureStringTable (LoadStringTable (RUINS_STRTAB));
	}

	GenerateDefault_generateOrbital (solarSys, world);
	return true;
}
Example #27
0
static void
Intro (void)
{
	SET_GAME_STATE (STARBASE_AVAILABLE, 1);
	NPCPhrase (STARBASE_WILL_BE_READY);
	return;

	if (GET_GAME_STATE (PROBE_ILWRATH_ENCOUNTER))
	{
		NPCPhrase (VERY_IMPRESSIVE);

		Response (cook_their_butts, ByeBye);
		Response (overthrow_evil_aliens, ByeBye);
		Response (annihilate_those_monsters, ByeBye);
	}
	else if (GET_GAME_STATE (STARBASE_VISITED))
	{
		if (GET_GAME_STATE (RADIOACTIVES_PROVIDED))
		{
			if (GET_GAME_STATE (MOONBASE_DESTROYED) == 0)
			{
				TellMoonBase (0);
			}
			else
			{
				BaseDestroyed (0);
			}
		}
		else
		{
			CommData.AlienColorMap =
					SetAbsColorMapIndex (CommData.AlienColorMap, 1);
			NPCPhrase (DO_YOU_HAVE_RADIO_THIS_TIME);

			if (GLOBAL_SIS (ElementAmounts[RADIOACTIVE]))
				GiveRadios (0);
			else
				AskAfterRadios (0);
		}
	}
	else /* first visit */
	{
		CommData.AlienColorMap =
				SetAbsColorMapIndex (CommData.AlienColorMap, 1);

		SET_GAME_STATE (STARBASE_VISITED, 1);

		NPCPhrase (ARE_YOU_SUPPLY_SHIP);
		construct_response (
				shared_phrase_buf,
				no_but_well_help0,
				GLOBAL_SIS (ShipName),
				no_but_well_help1,
				(UNICODE*)NULL);
		DoResponsePhrase (no_but_well_help0, NoRadioactives, shared_phrase_buf);
		Response (yes_this_is_supply_ship, NoRadioactives);
		Response (what_slave_planet, NoRadioactives);
	}
}
Example #28
0
static bool
GenerateDruuge_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT *whichNode)
{
	if (matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		COUNT i;
		COUNT nodeI;
		DWORD rand_val;
		DWORD old_rand;

		old_rand = TFB_SeedRandom (
				solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);

		nodeI = 0;
		i = 0;
		do
		{
			rand_val = TFB_Random ();
			solarSys->SysInfo.PlanetInfo.CurPt.x =
					(LOBYTE (LOWORD (rand_val)) % (MAP_WIDTH - (8 << 1))) + 8;
			solarSys->SysInfo.PlanetInfo.CurPt.y =
					(HIBYTE (LOWORD (rand_val)) % (MAP_HEIGHT - (8 << 1))) + 8;
			if (!GET_GAME_STATE (ROSY_SPHERE))
				solarSys->SysInfo.PlanetInfo.CurType = 0;
			else
				solarSys->SysInfo.PlanetInfo.CurType = 1;
			solarSys->SysInfo.PlanetInfo.CurDensity = 0;
			if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
					& (1L << i))
			{
				solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
						&= ~(1L << i);

				if (!GET_GAME_STATE (ROSY_SPHERE))
				{
					SetLanderTakeoff ();

					SET_GAME_STATE (ROSY_SPHERE, 1);
					SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
				}
			}
			if (nodeI >= *whichNode
					&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
					& (1L << i)))
				break;
			++nodeI;
		} while (++i < 16);
		*whichNode = nodeI;

		TFB_SeedRandom (old_rand);

		return true;
	}

	*whichNode = 0;

	return true;
}
static void
ExitConversation (RESPONSE_REF Response)
{
	SET_GAME_STATE (BATTLE_SEGUE, 0);

	if (PLAYER_SAID (Response, bye_ally_space))
		NPCPhrase (GOODBYE_ALLY_SPACE);
	else if (PLAYER_SAID (Response, bye_friendly_space))
		NPCPhrase (GOODBYE_FRIENDLY_SPACE);
	else if (PLAYER_SAID (Response, part_in_peace))
		NPCPhrase (KEEP_IT_SECRET);
	else if (PLAYER_SAID (Response, we_sorry_space))
		NPCPhrase (APOLOGIZE_AT_HOMEWORLD);
	else if (PLAYER_SAID (Response, give_info_space))
		NPCPhrase (HERES_SOME_INFO);
	else if (PLAYER_SAID (Response, bye_angry_space))
		NPCPhrase (GOODBYE_ANGRY_SPACE);
	else if (PLAYER_SAID (Response, attack_you_now))
	{
		NPCPhrase (YIPES);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (Response, we_fight_again_space))
	{
		NPCPhrase (OK_FIGHT_AGAIN_SPACE);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (Response, die_slugboy)
			|| PLAYER_SAID (Response, we_fight_1)
			|| PLAYER_SAID (Response, we_fight_2)
			|| PLAYER_SAID (Response, pay_for_crimes)
			|| PLAYER_SAID (Response, tell_me_coordinates)
			|| PLAYER_SAID (Response, changed_mind))
	{
		if (PLAYER_SAID (Response, tell_me_coordinates))
			NPCPhrase (FAKE_COORDINATES);
		NPCPhrase (OK_WE_FIGHT_AT_PLUTO);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (Response, join_us))
	{
		if (ActivateStarShip (SPATHI_SHIP, FEASIBILITY_STUDY) == 0)
			NPCPhrase (TOO_SCARY);
		else
		{
			NPCPhrase (WILL_JOIN);

			AlienTalkSegue ((COUNT)~0);
			ActivateStarShip (SPATHI_SHIP, 1);
			/* Make the Eluder escort captained by Fwiffo alone */
			SetEscortCrewComplement (SPATHI_SHIP, 1,
					NAME_OFFSET + NUM_CAPTAINS_NAMES);
		}
	}
}
static void
SpathiNeutral (RESPONSE_REF R)
{
	if (R == 0)
	{
		BYTE NumVisits;

		NumVisits = GET_GAME_STATE (SPATHI_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (INIT_NEUTRAL_HELLO_SPACE);
				break;
			case 1:
				NPCPhrase (SUBSEQUENT_NEUTRAL_HELLO_SPACE);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (SPATHI_VISITS, NumVisits);
	}
	else if (PLAYER_SAID (R, look_weird))
	{
		NPCPhrase (YOU_LOOK_WEIRD);

		SET_GAME_STATE (SPATHI_STACK0, 1);
	}
	else if (PLAYER_SAID (R, no_look_really_weird))
	{
		NPCPhrase (NO_YOU_LOOK_REALLY_WEIRD);

		SET_GAME_STATE (SPATHI_STACK0, 2);
	}

	switch (GET_GAME_STATE (SPATHI_STACK0))
	{
		case 0:
			Response (look_weird, SpathiNeutral);
			break;
		case 1:
			Response (no_look_really_weird, SpathiNeutral);
			break;
	}
	if (GET_GAME_STATE (SPATHI_STACK1) == 0)
	{
		Response (come_in_peace, SpathiBefriend);
	}
	if (GET_GAME_STATE (SPATHI_STACK2) == 0)
	{
		Response (prepare_to_die, SpathiAntagonize);
	}
	else
	{
		Response (attack_you_now, ExitConversation);
	}
	Response (part_in_peace, ExitConversation);
}