Esempio n. 1
0
static void
DoBluster (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, trade_is_for_the_weak))
	{
		XFormColorMap (GetColorMapAddress (
				SetAbsColorMapIndex (CommData.AlienColorMap, 2)
				), ONE_SECOND / 2);

		SET_GAME_STATE (MELNORME_YACK_STACK2, 4);
		NPCPhrase (WERE_NOT_AFRAID);
	}
	else if (PLAYER_SAID (R, why_blue_light))
	{
		SET_GAME_STATE (WHY_MELNORME_BLUE, 1);

		NPCPhrase (BLUE_IS_MAD);
	}
	else if (PLAYER_SAID (R, we_strong_1))
	{
		local_stack0 = 1;
		NPCPhrase (YOU_NOT_STRONG_1);
	}
	else if (PLAYER_SAID (R, we_strong_2))
	{
		local_stack0 = 2;
		NPCPhrase (YOU_NOT_STRONG_2);
	}
	else if (PLAYER_SAID (R, we_strong_3))
	{
		local_stack0 = 3;
		NPCPhrase (YOU_NOT_STRONG_3);
	}
	else if (PLAYER_SAID (R, just_testing))
	{
		local_stack1 = 1;
		NPCPhrase (REALLY_TESTING);
	}

	if (!GET_GAME_STATE (WHY_MELNORME_BLUE))
		Response (why_blue_light, DoBluster);
	switch (local_stack0)
	{
		case 0:
			Response (we_strong_1, DoBluster);
			break;
		case 1:
			Response (we_strong_2, DoBluster);
			break;
		case 2:
			Response (we_strong_3, DoBluster);
			break;
	}
	switch (local_stack1)
	{
		case 0:
			Response (just_testing, DoBluster);
			break;
		case 1:
		{
			Response (yes_really_testing, DoFirstMeeting);
			break;
		}
	}
	Response (youre_on, ExitConversation);
}
Esempio n. 2
0
static void
SpathiInfo (RESPONSE_REF R)
{
	BYTE InfoLeft;
	
	InfoLeft = FALSE;
	if (PLAYER_SAID (R, like_some_info))
		NPCPhrase (WHAT_ABOUT);
	else if (PLAYER_SAID (R, what_about_hierarchy))
	{
		NPCPhrase (ABOUT_HIERARCHY);

		DISABLE_PHRASE (what_about_hierarchy);
	}
	else if (PLAYER_SAID (R, what_about_history))
	{
		NPCPhrase (ABOUT_HISTORY);

		DISABLE_PHRASE (what_about_history);
	}
	else if (PLAYER_SAID (R, what_about_alliance))
	{
		NPCPhrase (ABOUT_ALLIANCE);

		DISABLE_PHRASE (what_about_alliance);
	}
	else if (PLAYER_SAID (R, what_about_other))
	{
		NPCPhrase (ABOUT_OTHER);

		DISABLE_PHRASE (what_about_other);
	}
	else if (PLAYER_SAID (R, what_about_precursors))
	{
		NPCPhrase (ABOUT_PRECURSORS);

		DISABLE_PHRASE (what_about_precursors);
	}

	if (PHRASE_ENABLED (what_about_hierarchy))
	{
		InfoLeft = TRUE;
		Response (what_about_hierarchy, SpathiInfo);
	}
	if (PHRASE_ENABLED (what_about_history))
	{
		InfoLeft = TRUE;
		Response (what_about_history, SpathiInfo);
	}
	if (PHRASE_ENABLED (what_about_alliance))
	{
		InfoLeft = TRUE;
		Response (what_about_alliance, SpathiInfo);
	}
	if (PHRASE_ENABLED (what_about_other))
	{
		InfoLeft = TRUE;
		Response (what_about_other, SpathiInfo);
	}
	if (PHRASE_ENABLED (what_about_precursors))
	{
		InfoLeft = TRUE;
		Response (what_about_precursors, SpathiInfo);
	}
	Response (enough_info, SpathiAllies);

	if (!InfoLeft)
	{
		DISABLE_PHRASE (like_some_info);
	}
}
Esempio n. 3
0
static void
YehatSpace (RESPONSE_REF R)
{
	BYTE i, LastStack;
	RESPONSE_REF pStr[3];

	LastStack = 0;
	pStr[0] = pStr[1] = pStr[2] = 0;
	if (PLAYER_SAID (R, whats_up_space_1)
			|| PLAYER_SAID (R, whats_up_space_2)
			|| PLAYER_SAID (R, whats_up_space_3)
			|| PLAYER_SAID (R, whats_up_space_4))
	{
		BYTE NumVisits;

		NumVisits = GET_GAME_STATE (YEHAT_REBEL_INFO);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (GENERAL_INFO_SPACE_1);
				break;
			case 1:
				NPCPhrase (GENERAL_INFO_SPACE_2);
				break;
			case 2:
				NPCPhrase (GENERAL_INFO_SPACE_3);
				break;
			case 3:
				NPCPhrase (GENERAL_INFO_SPACE_4);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (YEHAT_REBEL_INFO, NumVisits);

		DISABLE_PHRASE (whats_up_space_1);
	}
	else if (PLAYER_SAID (R, i_demand_you_ally_space0))
	{
		NPCPhrase (WE_CANNOT_1);

		LastStack = 2;
		SET_GAME_STATE (NO_YEHAT_ALLY_SPACE, 1);
	}
	else if (PLAYER_SAID (R, obligation))
	{
		NPCPhrase (WE_CANNOT_2);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		SET_GAME_STATE (NO_YEHAT_ALLY_SPACE, 2);

		return;
	}
	else if (PLAYER_SAID (R, at_least_help_us_space))
	{
		NPCPhrase (SORRY_CANNOT);

		LastStack = 1;
		SET_GAME_STATE (NO_YEHAT_HELP_SPACE, 1);
	}
	else if (PLAYER_SAID (R, dishonor))
	{
		NPCPhrase (HERES_A_HINT);

		SET_GAME_STATE (NO_YEHAT_HELP_SPACE, 2);
	}
	else if (PLAYER_SAID (R, what_about_pkunk_royalist))
	{
		if (GET_GAME_STATE (YEHAT_ABSORBED_PKUNK))
			NPCPhrase (PKUNK_ABSORBED_ROYALIST);
		else
			NPCPhrase (HATE_PKUNK_ROYALIST);

		SET_GAME_STATE (YEHAT_ROYALIST_TOLD_PKUNK, 1);
	}

// SET_FUNCPTR (&PtrDesc, YehatSpace);
	if (PHRASE_ENABLED (whats_up_space_1))
	{
		switch (GET_GAME_STATE (YEHAT_REBEL_INFO))
		{
			case 0:
				pStr[0] = whats_up_space_1;
				break;
			case 1:
				pStr[0] = whats_up_space_2;
				break;
			case 2:
				pStr[0] = whats_up_space_3;
				break;
			case 3:
				pStr[0] = whats_up_space_4;
				break;
		}
	}
	switch (GET_GAME_STATE (NO_YEHAT_HELP_SPACE))
	{
		case 0:
			pStr[1] = at_least_help_us_space;
			break;
		case 1:
			pStr[1] = dishonor;
			break;
	}
	switch (GET_GAME_STATE (NO_YEHAT_ALLY_SPACE))
	{
		case 0:
		{
			UNICODE buf[ALLIANCE_NAME_BUFSIZE];

			GetAllianceName (buf, name_1);
			construct_response (
					shared_phrase_buf,
					i_demand_you_ally_space0,
					GLOBAL_SIS (CommanderName),
					i_demand_you_ally_space1,
					GLOBAL_SIS (ShipName),
					i_demand_you_ally_space2,
					buf,
					i_demand_you_ally_space3,
					(UNICODE*)NULL);
			pStr[2] = i_demand_you_ally_space0;
			break;
		}
		case 1:
			pStr[2] = obligation;
			break;
	}

	if (pStr[LastStack])
	{
		if (pStr[LastStack] != i_demand_you_ally_space0)
			Response (pStr[LastStack], YehatSpace);
		else
			DoResponsePhrase (pStr[LastStack], YehatSpace, shared_phrase_buf);
	}
	for (i = 0; i < 3; ++i)
	{
		if (i != LastStack && pStr[i])
		{
			if (pStr[i] != i_demand_you_ally_space0)
				Response (pStr[i], YehatSpace);
			else
				DoResponsePhrase (pStr[i], YehatSpace, shared_phrase_buf);
		}
	}
	if (!GET_GAME_STATE (YEHAT_ROYALIST_TOLD_PKUNK)
			&& GET_GAME_STATE (PKUNK_VISITS)
			&& GET_GAME_STATE (PKUNK_HOME_VISITS))
		Response (what_about_pkunk_royalist, YehatSpace);
	if (GET_GAME_STATE (SHOFIXTI_VISITS))
	{
		switch (GET_GAME_STATE (YEHAT_REBEL_TOLD_PKUNK))
		{
			case 0:
				Response (shofixti_alive_1, StartRevolt);
				break;
			case 1:
				Response (shofixti_alive_2, StartRevolt);
				break;
		}
	}
	Response (bye_space, ExitConversation);
}
Esempio n. 4
0
static void
SpathiParty (RESPONSE_REF R)
{
	if (R == 0)
	{
		BYTE NumVisits;

		NumVisits = GET_GAME_STATE (SPATHI_HOME_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (MUST_PARTY_1);
				break;
			case 1:
				NPCPhrase (MUST_PARTY_2);
				break;
			case 2:
				NPCPhrase (MUST_PARTY_3);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (SPATHI_HOME_VISITS, NumVisits);
	}
	else if (PLAYER_SAID (R, deals_a_deal))
	{
		NPCPhrase (WAIT_A_WHILE);

		DISABLE_PHRASE (deals_a_deal);
	}
	else if (PLAYER_SAID (R, how_long))
	{
		NPCPhrase (TEN_YEARS);

		DISABLE_PHRASE (how_long);
	}
	else if (PLAYER_SAID (R, reneging))
	{
		NPCPhrase (ADULT_VIEW);

		DISABLE_PHRASE (reneging);
	}
	else if (PLAYER_SAID (R, return_beasts))
	{
		NPCPhrase (WHAT_RELATIONSHIP);

		DISABLE_PHRASE (return_beasts);
	}
	else if (PLAYER_SAID (R, minds_and_might))
	{
		NPCPhrase (HUH);

		DISABLE_PHRASE (minds_and_might);
	}
	else if (PLAYER_SAID (R, fellowship))
	{
		NPCPhrase (WHAT);

		DISABLE_PHRASE (fellowship);
	}

	if (PHRASE_ENABLED (deals_a_deal))
		Response (deals_a_deal, SpathiParty);
	else if (PHRASE_ENABLED (how_long))
		Response (how_long, SpathiParty);
	else if (PHRASE_ENABLED (reneging))
		Response (reneging, SpathiParty);
	else if (PHRASE_ENABLED (return_beasts))
		Response (return_beasts, SpathiParty);
	else
	{
		if (PHRASE_ENABLED (minds_and_might))
			Response (minds_and_might, SpathiParty);
		if (PHRASE_ENABLED (fellowship))
			Response (fellowship, SpathiParty);
		Response (do_as_we_say, ExitConversation);

		return;
	}
	switch (GET_GAME_STATE (SPATHI_HOME_VISITS) - 1)
	{
		case 0:
			Response (bye_from_party_1, ExitConversation);
			break;
		case 1:
			Response (bye_from_party_2, ExitConversation);
			break;
		default:
			Response (bye_from_party_3, ExitConversation);
			break;
	}
}
Esempio n. 5
0
static void
Intro (void)
{
	BYTE Manner;

	Manner = GET_GAME_STATE (SPATHI_MANNER);
	if (Manner == 2)
	{
		NPCPhrase (HATE_YOU_FOREVER);
		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (Manner == 1
			&& GET_GAME_STATE (KNOW_SPATHI_PASSWORD)
			&& (GET_GAME_STATE (FOUND_PLUTO_SPATHI)
			|| GET_GAME_STATE (SPATHI_HOME_VISITS) != 7))
	{
		SpathiAngry ((RESPONSE_REF)0);
	}
	else if (ActivateStarShip (SPATHI_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
	{
		CommData.AlienColorMap =
				SetAbsColorMapIndex (CommData.AlienColorMap, 1);
		SpathiAllies ((RESPONSE_REF)0);
	}
	else if (GET_GAME_STATE (SPATHI_PARTY))
	{
		CommData.AlienColorMap =
				SetAbsColorMapIndex (CommData.AlienColorMap, 1);
		SpathiParty ((RESPONSE_REF)0);
	}
	else if (GET_GAME_STATE (SPATHI_QUEST))
	{
		if (GET_GAME_STATE (LIED_ABOUT_CREATURES) < 2)
		{
			CommData.AlienColorMap =
					SetAbsColorMapIndex (CommData.AlienColorMap, 1);
			SpathiQuest ((RESPONSE_REF)0);
		}
		else
		{
			NPCPhrase (YOU_LIED_2);

			SET_GAME_STATE (SPATHI_MANNER, 2);
			SET_GAME_STATE (BATTLE_SEGUE, 1);
		}
	}
	else if (GET_GAME_STATE (KNOW_SPATHI_QUEST))
	{
		CommData.AlienColorMap =
				SetAbsColorMapIndex (CommData.AlienColorMap, 1);
		LearnQuest ((RESPONSE_REF)0);
	}
	else if (GET_GAME_STATE (KNOW_SPATHI_PASSWORD)
			&& (GET_GAME_STATE (FOUND_PLUTO_SPATHI)
			|| GET_GAME_STATE (SPATHI_HOME_VISITS) != 7))
	{
		CommData.AlienColorMap =
				SetAbsColorMapIndex (CommData.AlienColorMap, 1);
		SpathiCouncil ((RESPONSE_REF)0);
	}
	else
	{
		SpathiPassword ((RESPONSE_REF)0);
	}
}
Esempio n. 6
0
static void
HomeWorld (RESPONSE_REF R)
{
	BYTE i, LastStack;
	RESPONSE_REF pStr[3];

	LastStack = 0;
	pStr[0] = pStr[1] = pStr[2] = 0;
	if (PLAYER_SAID (R, we_are_us0))
	{
		NPCPhrase (TERRIBLY_EXCITING);

		SET_GAME_STATE (SLYLANDRO_STACK1, 1);
		DISABLE_PHRASE (we_are_us0);
	}
	else if (PLAYER_SAID (R, what_other_visitors))
	{
		NPCPhrase (VISITORS);

		SET_GAME_STATE (PLAYER_KNOWS_PROBE, 1);
		SET_GAME_STATE (SLYLANDRO_STACK1, 2);
	}
	else if (PLAYER_SAID (R, any_other_visitors))
	{
		NPCPhrase (LONG_AGO);

		SET_GAME_STATE (SLYLANDRO_STACK1, 3);
	}
	else if (PLAYER_SAID (R, what_about_sentient_milieu))
	{
		NPCPhrase (MET_TAALO_THEY_ARE_FROM);

		SET_GAME_STATE (SLYLANDRO_STACK1, 4);
	}
	else if (PLAYER_SAID (R, who_else))
	{
		NPCPhrase (PRECURSORS);

		SET_GAME_STATE (SLYLANDRO_STACK1, 5);
	}
	else if (PLAYER_SAID (R, precursors_yow))
	{
		NPCPhrase (ABOUT_PRECURSORS);

		SET_GAME_STATE (SLYLANDRO_STACK1, 6);
	}
	else if (PLAYER_SAID (R, must_know_more))
	{
		NPCPhrase (ALL_WE_KNOW);

		SET_GAME_STATE (SLYLANDRO_STACK1, 7);
	}
	else if (PLAYER_SAID (R, who_are_you))
	{
		NPCPhrase (WE_ARE_SLY);

		LastStack = 1;
		SET_GAME_STATE (SLYLANDRO_STACK2, 1);
	}
	else if (PLAYER_SAID (R, where_are_you))
	{
		NPCPhrase (DOWN_HERE);

		LastStack = 2;
		SET_GAME_STATE (SLYLANDRO_STACK3, 1);
	}
	else if (PLAYER_SAID (R, thats_impossible_1))
	{
		NPCPhrase (NO_ITS_NOT_1);

		LastStack = 2;
		SET_GAME_STATE (SLYLANDRO_STACK3, 2);
	}
	else if (PLAYER_SAID (R, thats_impossible_2))
	{
		NPCPhrase (NO_ITS_NOT_2);

		LastStack = 2;
		SET_GAME_STATE (SLYLANDRO_STACK3, 3);
	}
	else if (PLAYER_SAID (R, like_more_about_you))
	{
		SlylandroInfo (R);
		return;
	}
	else if (PLAYER_SAID (R, enough_about_me))
		NPCPhrase (OK_ENOUGH_YOU);
	else if (PLAYER_SAID (R, enough_info))
		NPCPhrase (OK_ENOUGH_INFO);
	else if (PLAYER_SAID (R, enough_probe))
		NPCPhrase (OK_ENOUGH_PROBE);
	else if (PLAYER_SAID (R, mega_self_destruct))
	{
		NPCPhrase (WHY_YES_THERE_IS);

		SET_GAME_STATE (SLYLANDRO_KNOW_BROKEN, 1);
		SET_GAME_STATE (DESTRUCT_CODE_ON_SHIP, 1);
		i = GET_GAME_STATE (SLYLANDRO_MULTIPLIER) + 1;
		SET_GAME_STATE (SLYLANDRO_MULTIPLIER, i);
		AddEvent (RELATIVE_EVENT, 0, 0, 0, SLYLANDRO_RAMP_DOWN);
	}

	switch (GET_GAME_STATE (SLYLANDRO_STACK1))
	{
		case 0:
			construct_response (shared_phrase_buf,
					we_are_us0,
					GLOBAL_SIS (CommanderName),
					we_are_us1,
					GLOBAL_SIS (ShipName),
					we_are_us2,
					(UNICODE*)NULL);
			pStr[0] = we_are_us0;
			break;
		case 1:
			pStr[0] = what_other_visitors;
			break;
		case 2:
			pStr[0] = any_other_visitors;
			break;
		case 3:
			pStr[0] = what_about_sentient_milieu;
			break;
		case 4:
			pStr[0] = who_else;
			break;
		case 5:
			pStr[0] = precursors_yow;
			break;
		case 6:
			pStr[0] = must_know_more;
			break;
	}
	switch (GET_GAME_STATE (SLYLANDRO_STACK2))
	{
		case 0:
			pStr[1] = who_are_you;
			break;
		case 1:
			if (PHRASE_ENABLED (like_more_about_you))
				pStr[1] = like_more_about_you;
			break;
	}
	switch (GET_GAME_STATE (SLYLANDRO_STACK3))
	{
		case 0:
			pStr[2] = where_are_you;
			break;
		case 1:
			pStr[2] = thats_impossible_1;
			break;
		case 2:
			pStr[2] = thats_impossible_2;
			break;
	}

	if (pStr[LastStack])
	{
		if (pStr[LastStack] != we_are_us0)
			Response (pStr[LastStack], HomeWorld);
		else
			DoResponsePhrase (pStr[LastStack], HomeWorld, shared_phrase_buf);
	}
	for (i = 0; i < 3; ++i)
	{
		if (i != LastStack && pStr[i])
		{
			if (pStr[i] != we_are_us0)
				Response (pStr[i], HomeWorld);
			else
				DoResponsePhrase (pStr[i], HomeWorld, shared_phrase_buf);
		}
	}
	if (GET_GAME_STATE (SLYLANDRO_STACK1))
	{
		switch (GET_GAME_STATE (SLYLANDRO_STACK4))
		{
			case 0:
				Response (happy_to_tell_more, HumanInfo);
				break;
			case 1:
				Response (would_you_like_to_know_more, HumanInfo);
				break;
		}
	}
	if (GET_GAME_STATE (PLAYER_KNOWS_PROBE)
			&& !GET_GAME_STATE (SLYLANDRO_KNOW_BROKEN))
	{
		switch (GET_GAME_STATE (SLYLANDRO_STACK5))
		{
			case 0:
				Response (what_are_probes, ProbeInfo);
				break;
			case 1:
				if (PHRASE_ENABLED (know_more_probe))
					Response (know_more_probe, ProbeInfo);
				break;
		}
	}
	Response (bye, ExitConversation);
}
Esempio n. 7
0
static void
LearnQuest (RESPONSE_REF R)
{
	if (R == 0)
	{
		NPCPhrase (QUEST_AGAIN);

		DISABLE_PHRASE (what_test);
		if (GET_GAME_STATE (KNOW_SPATHI_EVIL))
		{
			DISABLE_PHRASE (tell_evil);
		}
	}
	else if (PLAYER_SAID (R, how_prove))
		NPCPhrase (BETTER_IDEA);
	else if (PLAYER_SAID (R, what_test))
	{
		NPCPhrase (WIPE_EVIL);

		SET_GAME_STATE (KNOW_SPATHI_QUEST, 1);
		DISABLE_PHRASE (what_test);
	}
	else if (PLAYER_SAID (R, tell_evil))
	{
		NPCPhrase (BEFORE_ACCEPT);

		SET_GAME_STATE (KNOW_SPATHI_EVIL, 1);
		DISABLE_PHRASE (tell_evil);
		DISABLE_PHRASE (prove_strength);
	}
	else if (PLAYER_SAID (R, prove_strength))
	{
		NPCPhrase (YOUR_BEHAVIOR);

		DISABLE_PHRASE (prove_strength);
	}
	else if (PLAYER_SAID (R, why_dont_you_do_it))
	{
		NPCPhrase (WE_WONT_BECAUSE);

		DISABLE_PHRASE (why_dont_you_do_it);
	}

	if (PHRASE_ENABLED (what_test))
		Response (what_test, LearnQuest);
	else if (GET_GAME_STATE (SPATHI_CREATURES_ELIMINATED))
	{
		Response (already_got_them, ExitConversation);
	}
	else if (PHRASE_ENABLED (tell_evil))
	{
		Response (too_dangerous, ExitConversation);
		Response (tell_evil, LearnQuest);
	}
	else
	{
		Response (too_dangerous, ExitConversation);
		Response (think_more, ExitConversation);
		Response (i_accept, ExitConversation);
	}
	if (PHRASE_ENABLED (prove_strength) && !GET_GAME_STATE (KNOW_SPATHI_QUEST))
		Response (prove_strength, LearnQuest);
	if (PHRASE_ENABLED (why_dont_you_do_it))
		Response (why_dont_you_do_it, LearnQuest);
}
Esempio n. 8
0
static void
AlliedHome (RESPONSE_REF R)
{
	BYTE NumVisits, News;

	News = GET_GAME_STATE (SUPOX_WAR_NEWS);
	NumVisits = GET_GAME_STATE (UTWIG_SUPOX_MISSION);
	if (PLAYER_SAID (R, how_went_war))
	{
		NPCPhrase (ABOUT_BATTLE);

		News |= (1 << 0);
	}
	else if (PLAYER_SAID (R, how_goes_war))
	{
		if (NumVisits == 1)
		{
			NPCPhrase (FLEET_ON_WAY);

			SET_GAME_STATE (SUPOX_WAR_NEWS, 1);
		}
		else switch (GET_GAME_STATE (SUPOX_WAR_NEWS))
		{
			case 0:
				NPCPhrase (BATTLE_HAPPENS_1);
				News = 1;
				break;
			case 1:
				NPCPhrase (BATTLE_HAPPENS_2);
				News = 2;
				break;
		}

		DISABLE_PHRASE (how_goes_war);
	}
	else if (PLAYER_SAID (R, learn_new_info))
	{
		if (NumVisits < 5)
			NPCPhrase (NO_NEW_INFO);
		else
		{
			NPCPhrase (SAMATRA);

			News |= (1 << 1);
		}

		DISABLE_PHRASE (learn_new_info);
	}
	else if (PLAYER_SAID (R, what_now_homeworld))
	{
		if (NumVisits < 5)
			NPCPhrase (UP_TO_YOU);
		else
			NPCPhrase (HOPE_KILL_EACH_OTHER);

		DISABLE_PHRASE (what_now_homeworld);
	}
	else if (PLAYER_SAID (R, how_is_ultron))
	{
		NPCPhrase (ULTRON_IS_GREAT);

		DISABLE_PHRASE (how_is_ultron);
	}
	SET_GAME_STATE (SUPOX_WAR_NEWS, News);

	if (NumVisits >= 5)
	{
		if (!(News & (1 << 0)))
			Response (how_went_war, AlliedHome);
	}
	else if (PHRASE_ENABLED (how_goes_war)
			&& ((NumVisits == 1 && News == 0)
			|| (NumVisits && News < 2)))
		Response (how_goes_war, AlliedHome);
	if (PHRASE_ENABLED (learn_new_info))
		Response (learn_new_info, AlliedHome);
	if (PHRASE_ENABLED (what_now_homeworld))
		Response (what_now_homeworld, AlliedHome);
	if (PHRASE_ENABLED (how_is_ultron))
		Response (how_is_ultron, AlliedHome);
	if (NumVisits == 0)
		Response (can_you_help, ExitConversation);
	Response (bye_allied_homeworld, ExitConversation);
}
Esempio n. 9
0
static void
NeutralSupox (RESPONSE_REF R)
{
	BYTE i, LastStack, NumVisits;
	RESPONSE_REF pStr[3];

	LastStack = 0;
	pStr[0] = pStr[1] = pStr[2] = 0;
	if (PLAYER_SAID (R, i_am0))
	{
		NPCPhrase (WE_ARE_SUPOX);

		SET_GAME_STATE (SUPOX_STACK1, 1);
		DISABLE_PHRASE (i_am0);
	}
	else if (PLAYER_SAID (R, my_ship0))
	{
		NPCPhrase (OUR_SHIP);

		SET_GAME_STATE (SUPOX_STACK1, 2);
		DISABLE_PHRASE (my_ship0);
	}
	else if (PLAYER_SAID (R, from_alliance0))
	{
		NPCPhrase (FROM_SUPOX);

		SET_GAME_STATE (SUPOX_STACK1, 3);
		DISABLE_PHRASE (from_alliance0);
	}
	else if (PLAYER_SAID (R, are_you_copying))
	{
		NPCPhrase (YEAH_SORRY);

		SET_GAME_STATE (SUPOX_STACK1, 4);
	}
	else if (PLAYER_SAID (R, why_copy))
	{
		NPCPhrase (SYMBIOTS);

		SET_GAME_STATE (SUPOX_STACK1, 5);
	}
	else if (PLAYER_SAID (R, tell_us_of_your_species))
	{
		NPCPhrase (OUR_SPECIES);

		LastStack = 1;
		SET_GAME_STATE (SUPOX_STACK2, 1);
	}
	else if (PLAYER_SAID (R, plants_arent_intelligent))
	{
		NPCPhrase (PROVES_WERE_SPECIAL);

		SET_GAME_STATE (SUPOX_STACK2, 2);
	}
	else if (PLAYER_SAID (R, anyone_around_here))
	{
		NPCPhrase (UTWIG_NEARBY);

		LastStack = 2;
		SET_GAME_STATE (SUPOX_WAR_NEWS, 1);
		ActivateStarShip (UTWIG_SHIP, SPHERE_TRACKING);
	}
	else if (PLAYER_SAID (R, what_relation_to_utwig))
	{
		NPCPhrase (UTWIG_ALLIES);

		LastStack = 2;
		SET_GAME_STATE (SUPOX_WAR_NEWS, 1);
	}
	else if (PLAYER_SAID (R, whats_wrong_with_utwig))
	{
		NPCPhrase (BROKE_ULTRON);

		LastStack = 2;
		SET_GAME_STATE (SUPOX_WAR_NEWS, 2);
	}
	else if (PLAYER_SAID (R, whats_ultron))
	{
		NPCPhrase (TAKE_ULTRON);

		SET_GAME_STATE (SUPOX_WAR_NEWS, 0);
		SET_GAME_STATE (ULTRON_CONDITION, 1);

		Response (what_do_i_do_now, ExitConversation);
		Response (thanks_now_we_eat_you, ExitConversation);

		return;
	}
	else if (PLAYER_SAID (R, got_fixed_ultron))
	{
		NPCPhrase (GOOD_GIVE_TO_UTWIG);

		SET_GAME_STATE (SUPOX_ULTRON_HELP, 1);
	}
	else if (PLAYER_SAID (R, look_i_repaired_lots))
	{
		NPCPhrase (ALMOST_THERE);

		SET_GAME_STATE (SUPOX_ULTRON_HELP, 1);
	}
	else if (PLAYER_SAID (R, look_i_slightly_repaired))
	{
		NPCPhrase (GREAT_DO_MORE);

		SET_GAME_STATE (SUPOX_ULTRON_HELP, 1);
	}
	else if (PLAYER_SAID (R, where_get_repairs))
	{
		NPCPhrase (ANCIENT_RHYME);

		SET_GAME_STATE (SUPOX_ULTRON_HELP, 1);
	}

	switch (GET_GAME_STATE (SUPOX_STACK2))
	{
		case 0:
			pStr[1] = tell_us_of_your_species;
			break;
		case 1:
			pStr[1] = plants_arent_intelligent;
			break;
	}
	switch (GET_GAME_STATE (SUPOX_STACK1))
	{
		case 0:
			construct_response (shared_phrase_buf,
					i_am0,
					GLOBAL_SIS (CommanderName),
					i_am1,
					(UNICODE*)NULL);
			pStr[0] = i_am0;
			pStr[1] = 0;
			break;
		case 1:
			construct_response (shared_phrase_buf,
					my_ship0,
					GLOBAL_SIS (ShipName),
					my_ship1,
					(UNICODE*)NULL);
			pStr[0] = my_ship0;
			pStr[1] = 0;
			break;
		case 2:
			{
				UNICODE buf[ALLIANCE_NAME_BUFSIZE];

				GetAllianceName (buf, name_1);
				construct_response (
						shared_phrase_buf,
						from_alliance0,
						buf,
						from_alliance1,
						(UNICODE*)NULL);
			}
			pStr[0] = from_alliance0;
			pStr[1] = 0;
			break;
		case 3:
			pStr[0] = are_you_copying;
			pStr[1] = 0;
			break;
		case 4:
			pStr[0] = why_copy;
			pStr[1] = 0;
			break;
	}
	NumVisits = GET_GAME_STATE (ULTRON_CONDITION);
	if (NumVisits == 0)
	{
		switch (GET_GAME_STATE (SUPOX_WAR_NEWS))
		{
			case 0:
				if (GET_GAME_STATE (UTWIG_VISITS)
						|| GET_GAME_STATE (UTWIG_HOME_VISITS)
						|| GET_GAME_STATE (BOMB_VISITS))
					pStr[2] = what_relation_to_utwig;
				else
					pStr[2] = anyone_around_here;
				break;
			case 1:
				pStr[2] = whats_wrong_with_utwig;
				break;
			case 2:
				pStr[2] = whats_ultron;
				break;
		}
	}
	if (pStr[LastStack])
	{
		if (LastStack != 0 || GET_GAME_STATE (SUPOX_STACK1) > 2)
			Response (pStr[LastStack], NeutralSupox);
		else
			DoResponsePhrase (pStr[LastStack], NeutralSupox, shared_phrase_buf);
	}
	for (i = 0; i < 3; ++i)
	{
		if (i != LastStack && pStr[i])
		{
			if (i != 0 || GET_GAME_STATE (SUPOX_STACK1) > 2)
				Response (pStr[i], NeutralSupox);
			else
				DoResponsePhrase (pStr[i], NeutralSupox, shared_phrase_buf);
		}
	}
	if (!GET_GAME_STATE (SUPOX_ULTRON_HELP))
	{
		switch (NumVisits)
		{
			case 1:
				Response (where_get_repairs, NeutralSupox);
				break;
			case 2:
				Response (look_i_slightly_repaired, NeutralSupox);
				break;
			case 3:
				Response (look_i_repaired_lots, NeutralSupox);
				break;
			case 4:
				Response (got_fixed_ultron, NeutralSupox);
				break;
		}
	}
	Response (bye_neutral, ExitConversation);
}
Esempio n. 10
0
static void
ExitConversation (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, no_trade_now))
		NPCPhrase (OK_NO_TRADE_NOW_BYE);
	else if (PLAYER_SAID (R, youre_on))
	{
		NPCPhrase (YOU_GIVE_US_NO_CHOICE);

		SET_GAME_STATE (MELNORME_ANGER, 1);
		setSegue (Segue_hostile);
	}
	else if (PLAYER_SAID (R, so_we_can_attack))
	{
		NPCPhrase (DECEITFUL_HUMAN);

		SET_GAME_STATE (MELNORME_ANGER, 2);
		setSegue (Segue_hostile);
	}
	else if (PLAYER_SAID (R, bye_melnorme_slightly_angry))
		NPCPhrase (MELNORME_SLIGHTLY_ANGRY_GOODBYE);
	else if (PLAYER_SAID (R, ok_strip_me))
	{
		if (ShipWorth () < 4000 / MODULE_COST_SCALE)
				/* is ship worth stripping */
			NPCPhrase (NOT_WORTH_STRIPPING);
		else
		{
			SET_GAME_STATE (MELNORME_ANGER, 0);

			StripShip ((COUNT)~0);
			NPCPhrase (FAIR_JUSTICE);
		}
	}
	else if (PLAYER_SAID (R, fight_some_more))
	{
		NPCPhrase (OK_FIGHT_SOME_MORE);

		SET_GAME_STATE (MELNORME_ANGER, 3);
		setSegue (Segue_hostile);
	}
	else if (PLAYER_SAID (R, bye_melnorme_pissed_off))
		NPCPhrase (MELNORME_PISSED_OFF_GOODBYE);
	else if (PLAYER_SAID (R, well_if_thats_the_way_you_feel))
	{
		NPCPhrase (WE_FIGHT_AGAIN);

		setSegue (Segue_hostile);
	}
	else if (PLAYER_SAID (R, you_hate_us_so_we_go_away))
		NPCPhrase (HATE_YOU_GOODBYE);
	else if (PLAYER_SAID (R, take_it))
	{
		StripShip (0);
		NPCPhrase (HAPPY_TO_HAVE_RESCUED);
	}
	else if (PLAYER_SAID (R, leave_it))
	{
		SET_GAME_STATE (MELNORME_RESCUE_REFUSED, 1);
		NPCPhrase (MAYBE_SEE_YOU_LATER);
	}
	else if (PLAYER_SAID (R, no_help))
	{
		SET_GAME_STATE (MELNORME_RESCUE_REFUSED, 1);
		NPCPhrase (GOODBYE_AND_GOODLUCK);
	}
	else if (PLAYER_SAID (R, no_changed_mind))
	{
		NPCPhrase (GOODBYE_AND_GOODLUCK_AGAIN);
	}
	else if (PLAYER_SAID (R, be_leaving_now)
			|| PLAYER_SAID (R, goodbye))
	{
		NPCPhrase (FRIENDLY_GOODBYE);
	}
}
Esempio n. 11
0
static void
DoBuy (RESPONSE_REF R)
{
	COUNT credit;
	SIZE needed_credit;
	BYTE slot;
	DWORD capacity;

	credit = GetAvailableCredits ();

	capacity = FUEL_RESERVE;
	slot = NUM_MODULE_SLOTS - 1;
	do
	{
		if (GLOBAL_SIS (ModuleSlots[slot]) == FUEL_TANK
				|| GLOBAL_SIS (ModuleSlots[slot]) == HIGHEFF_FUELSYS)
		{
			COUNT volume;

			volume = GLOBAL_SIS (ModuleSlots[slot]) == FUEL_TANK
					? FUEL_TANK_CAPACITY : HEFUEL_TANK_CAPACITY;
			capacity += volume;
		}
	} while (slot--);

	// If they're out of credits, educate them on how commerce works.
	if (credit == 0)
	{
		AskedToBuy = TRUE;
		NPCPhrase (NEED_CREDIT);

		NatureOfConversation (R);
	}
	else if (PLAYER_SAID (R, buy_fuel)
			|| PLAYER_SAID (R, buy_1_fuel)
			|| PLAYER_SAID (R, buy_5_fuel)
			|| PLAYER_SAID (R, buy_10_fuel)
			|| PLAYER_SAID (R, buy_25_fuel)
			|| PLAYER_SAID (R, fill_me_up))
	{
		needed_credit = 0;
		if (PLAYER_SAID (R, buy_1_fuel))
			needed_credit = 1;
		else if (PLAYER_SAID (R, buy_5_fuel))
			needed_credit = 5;
		else if (PLAYER_SAID (R, buy_10_fuel))
			needed_credit = 10;
		else if (PLAYER_SAID (R, buy_25_fuel))
			needed_credit = 25;
		else if (PLAYER_SAID (R, fill_me_up))
			needed_credit = (capacity - GLOBAL_SIS (FuelOnBoard)
					+ FUEL_TANK_SCALE - 1)
				/ FUEL_TANK_SCALE;

		if (needed_credit == 0)
		{
			if (!GET_GAME_STATE (MELNORME_FUEL_PROCEDURE))
			{
				NPCPhrase (BUY_FUEL_INTRO);
				SET_GAME_STATE (MELNORME_FUEL_PROCEDURE, 1);
			}
		}
		else
		{
			if (GLOBAL_SIS (FuelOnBoard) / FUEL_TANK_SCALE
					+ needed_credit > capacity / FUEL_TANK_SCALE)
			{
				NPCPhrase (NO_ROOM_FOR_FUEL);
				goto TryFuelAgain;
			}

			if ((int)(needed_credit * (BIO_CREDIT_VALUE / 2)) <= (int)credit)
			{
				DWORD f;

				NPCPhrase (GOT_FUEL);

				f = (DWORD)needed_credit * FUEL_TANK_SCALE;
				while (f > 0x3FFFL)
				{
					DeltaSISGauges (0, 0x3FFF, 0);
					f -= 0x3FFF;
				}
				DeltaSISGauges (0, (SIZE)f, 0);
			}
			needed_credit *= (BIO_CREDIT_VALUE / 2);
		}
		if (needed_credit)
		{
			DeltaCredit (-needed_credit);
			if (GLOBAL_SIS (FuelOnBoard) >= capacity)
				goto BuyBuyBuy;
		}
TryFuelAgain:
		NPCPhrase (HOW_MUCH_FUEL);

		Response (buy_1_fuel, DoBuy);
		Response (buy_5_fuel, DoBuy);
		Response (buy_10_fuel, DoBuy);
		Response (buy_25_fuel, DoBuy);
		Response (fill_me_up, DoBuy);
		Response (done_buying_fuel, DoBuy);
	}
	else if (PLAYER_SAID (R, buy_technology)
			|| PLAYER_SAID (R, buy_new_tech))
	{
		// Note that this code no longer uses the MELNORME_TECH_STACK state
		// buts, as they're not needed; we can tell what technologies the
		// player has by using the technology API above.  This opens the
		// possibility of the player acquiring tech from someplace other than
		// the Melnorme.
		const TechSaleData* nextTech;

		// If it's our first time, give an introduction.
		if (!GET_GAME_STATE (MELNORME_TECH_PROCEDURE))
		{
			NPCPhrase (BUY_NEW_TECH_INTRO);
			SET_GAME_STATE (MELNORME_TECH_PROCEDURE, 1);
		}

		// Did the player just attempt to buy a tech?
		if (PLAYER_SAID (R, buy_new_tech))
		{
			nextTech = GetNextTechForSale ();
			if (!nextTech)
				goto BuyBuyBuy; // No tech left to buy

			if (!DeltaCredit (-nextTech->price))
				goto BuyBuyBuy;  // Can't afford it

			// Make the sale
			GrantTech (nextTech->techId);
			NPCPhrase (nextTech->sold_line);
		}

		nextTech = GetNextTechForSale ();
		if (!nextTech)
		{
			NPCPhrase (NEW_TECH_ALL_GONE);
			goto BuyBuyBuy; // No tech left to buy
		}

		NPCPhrase (nextTech->sale_line);

		Response (buy_new_tech, DoBuy);
		Response (no_buy_new_tech, DoBuy);
	}
	else if (PLAYER_SAID (R, buy_info)
			|| PLAYER_SAID (R, buy_current_events)
			|| PLAYER_SAID (R, buy_alien_races)
			|| PLAYER_SAID (R, buy_history))
	{
		if (!GET_GAME_STATE (MELNORME_INFO_PROCEDURE))
		{
			NPCPhrase (BUY_INFO_INTRO);
			SET_GAME_STATE (MELNORME_INFO_PROCEDURE, 1);
		}
		else if (PLAYER_SAID (R, buy_info))
		{
			NPCPhrase (OK_BUY_INFO);
		}
		else
		{
#define INFO_COST 75
			if (!DeltaCredit (-INFO_COST))
				goto BuyBuyBuy;

			if (PLAYER_SAID (R, buy_current_events))
				CurrentEvents ();
			else if (PLAYER_SAID (R, buy_alien_races))
				AlienRaces ();
			else if (PLAYER_SAID (R, buy_history))
				History ();
		}

		if (!AnyInfoLeftToSell ())
		{
			NPCPhrase (INFO_ALL_GONE);
			goto BuyBuyBuy;
		}

		if (GET_GAME_STATE (MELNORME_EVENTS_INFO_STACK) < NUM_EVENT_ITEMS)
			Response (buy_current_events, DoBuy);
		if (GET_GAME_STATE (MELNORME_ALIEN_INFO_STACK) < NUM_ALIEN_RACE_ITEMS)
			Response (buy_alien_races, DoBuy);
		if (GET_GAME_STATE (MELNORME_HISTORY_INFO_STACK) < NUM_HISTORY_ITEMS)
			Response (buy_history, DoBuy);
		Response (done_buying_info, DoBuy);
	}
	else
	{
		if (PLAYER_SAID (R, done_buying_fuel))
			NPCPhrase (OK_DONE_BUYING_FUEL);
		else if (PLAYER_SAID (R, no_buy_new_tech))
			NPCPhrase (OK_NO_BUY_NEW_TECH);
		else if (PLAYER_SAID (R, done_buying_info))
			NPCPhrase (OK_DONE_BUYING_INFO);
		else
			NPCPhrase (WHAT_TO_BUY);

BuyBuyBuy:
		if (GLOBAL_SIS (FuelOnBoard) < capacity)
			Response (buy_fuel, DoBuy);
		if (GetNextTechForSale ())
			Response (buy_technology, DoBuy);
		if (AnyInfoLeftToSell ())
			Response (buy_info, DoBuy);

		Response (done_buying, NatureOfConversation);
		Response (be_leaving_now, ExitConversation);
	}
}
Esempio n. 12
0
static BOOLEAN
StripShip (COUNT fuel_required)
{
	BYTE i, which_module;
	SBYTE crew_pods;

	SET_GAME_STATE (MELNORME_RESCUE_REFUSED, 0);

	crew_pods = -(SBYTE)(
			(GLOBAL_SIS (CrewEnlisted) + CREW_POD_CAPACITY - 1)
			/ CREW_POD_CAPACITY
			);
	if (fuel_required == 0)
	{
		GlobData.SIS_state = SIS_copy;
		DeltaSISGauges (UNDEFINED_DELTA, rescue_fuel, UNDEFINED_DELTA);
	}
	else if (fuel_required == (COUNT)~0)
	{
		GLOBAL_SIS (NumLanders) = 0;
		for (i = 0; i < NUM_DRIVE_SLOTS; ++i)
			GLOBAL_SIS (DriveSlots[i]) = EMPTY_SLOT + 0;
		for (i = 0; i < NUM_JET_SLOTS; ++i)
			GLOBAL_SIS (JetSlots[i]) = EMPTY_SLOT + 1;
		if (GLOBAL_SIS (FuelOnBoard) > FUEL_RESERVE)
			GLOBAL_SIS (FuelOnBoard) = FUEL_RESERVE;
		GLOBAL_SIS (TotalBioMass) = 0;
		GLOBAL_SIS (TotalElementMass) = 0;
		for (i = 0; i < NUM_ELEMENT_CATEGORIES; ++i)
			GLOBAL_SIS (ElementAmounts[i]) = 0;
		for (i = 0; i < NUM_MODULE_SLOTS; ++i)
		{
			which_module = GLOBAL_SIS (ModuleSlots[i]);
			if (which_module < BOMB_MODULE_0
					&& (which_module != CREW_POD
					|| ++crew_pods > 0))
				GLOBAL_SIS (ModuleSlots[i]) = EMPTY_SLOT + 2;
		}

		DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, UNDEFINED_DELTA);
	}
	else if (fuel_required)
	{
		SBYTE bays;
		BYTE num_searches, beg_mod, end_mod;
		COUNT worth, total;
		BYTE module_count[BOMB_MODULE_0];
		BYTE slot;
		DWORD capacity;
		RandomContext *rc;
		
		// Bug #567
		// In order to offer the same deal each time if it is refused, we seed
		// the random number generator with our location, thus making the deal
		// a repeatable pseudo-random function of where we got stuck and what,
		// exactly, is on our ship.
		rc = RandomContext_New();
		RandomContext_SeedRandom (rc, getStripRandomSeed ());

		SIS_copy = GlobData.SIS_state;
		for (i = PLANET_LANDER; i < BOMB_MODULE_0; ++i)
			module_count[i] = 0;

		capacity = FUEL_RESERVE;
		slot = NUM_MODULE_SLOTS - 1;
		do
		{
			if (SIS_copy.ModuleSlots[slot] == FUEL_TANK
					|| SIS_copy.ModuleSlots[slot] == HIGHEFF_FUELSYS)
			{
				COUNT volume;

				volume = SIS_copy.ModuleSlots[slot] == FUEL_TANK
						? FUEL_TANK_CAPACITY : HEFUEL_TANK_CAPACITY;
				capacity += volume;
			}
		} while (slot--);
		if (fuel_required > capacity)
			fuel_required = capacity;

		bays = -(SBYTE)(
				(SIS_copy.TotalElementMass + STORAGE_BAY_CAPACITY - 1)
				/ STORAGE_BAY_CAPACITY
				);
		for (i = 0; i < NUM_MODULE_SLOTS; ++i)
		{
			which_module = SIS_copy.ModuleSlots[i];
			if (which_module == CREW_POD)
				++crew_pods;
			else if (which_module == STORAGE_BAY)
				++bays;
		}

		worth = fuel_required / FUEL_TANK_SCALE;
		total = 0;
		num_searches = 0;
		beg_mod = end_mod = (BYTE)~0;
		while (total < worth && ShipWorth () && ++num_searches)
		{
			DWORD rand_val;

			rand_val = RandomContext_Random (rc);
			switch (which_module = LOBYTE (LOWORD (rand_val)) % (CREW_POD + 1))
			{
				case PLANET_LANDER:
					if (SIS_copy.NumLanders == 0)
						continue;
					--SIS_copy.NumLanders;
					break;
				case FUSION_THRUSTER:
					for (i = 0; i < NUM_DRIVE_SLOTS; ++i)
					{
						if (SIS_copy.DriveSlots[i] < EMPTY_SLOT)
							break;
					}
					if (i == NUM_DRIVE_SLOTS)
						continue;
					SIS_copy.DriveSlots[i] = EMPTY_SLOT + 0;
					break;
				case TURNING_JETS:
					for (i = 0; i < NUM_JET_SLOTS; ++i)
					{
						if (SIS_copy.JetSlots[i] < EMPTY_SLOT)
							break;
					}
					if (i == NUM_JET_SLOTS)
						continue;
					SIS_copy.JetSlots[i] = EMPTY_SLOT + 1;
					break;
				case CREW_POD:
					i = HIBYTE (LOWORD (rand_val)) % NUM_MODULE_SLOTS;
					which_module = SIS_copy.ModuleSlots[i];
					if (which_module >= BOMB_MODULE_0
							|| which_module == FUEL_TANK
							|| which_module == HIGHEFF_FUELSYS
							|| (which_module == STORAGE_BAY
							&& module_count[STORAGE_BAY] >= bays)
							|| (which_module == CREW_POD
							&& module_count[CREW_POD] >= crew_pods))
						continue;
					SIS_copy.ModuleSlots[i] = EMPTY_SLOT + 2;
					break;
			}

			if (beg_mod == (BYTE)~0)
				beg_mod = end_mod = which_module;
			else if (which_module > end_mod)
				end_mod = which_module;
			++module_count[which_module];
			total += GLOBAL (ModuleCost[which_module]);
		}
		RandomContext_Delete (rc);

		if (total == 0)
		{
			NPCPhrase (CHARITY);
			DeltaSISGauges (0, fuel_required, 0);
			return (FALSE);
		}
		else
		{
			NPCPhrase (RESCUE_OFFER);
			rescue_fuel = fuel_required;
			if (rescue_fuel == capacity)
				NPCPhrase (RESCUE_TANKS);
			else
				NPCPhrase (RESCUE_HOME);
			for (i = PLANET_LANDER; i < BOMB_MODULE_0; ++i)
			{
				if (module_count[i])
				{
					if (i == end_mod && i != beg_mod)
						NPCPhrase (END_LIST_WITH_AND);
					NPCPhrase (ENUMERATE_ONE + (module_count[i] - 1));
					NPCPhrase (GetStripModuleRef (i));
				}
			}
		}
	}

	return (TRUE);
}
Esempio n. 13
0
static void
DoMelnormeMiffed (RESPONSE_REF R)
{
	if (R == 0)
	{
		BYTE miffed_count;

		miffed_count = GET_GAME_STATE (MELNORME_MIFFED_COUNT);
		switch (miffed_count++)
		{
			case 0:
				NPCPhrase (HELLO_SLIGHTLY_ANGRY_1);
				break;
			case 1:
				NPCPhrase (HELLO_SLIGHTLY_ANGRY_2);
				break;
			default:
				--miffed_count;
				NPCPhrase (HELLO_SLIGHTLY_ANGRY_3);
				break;
		}
		SET_GAME_STATE (MELNORME_MIFFED_COUNT, miffed_count);

		XFormColorMap (GetColorMapAddress (
				SetAbsColorMapIndex (CommData.AlienColorMap, 2)
				), ONE_SECOND / 2);
	}
	else if (PLAYER_SAID (R, explore_relationship))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK3, 1);

		NPCPhrase (EXAMPLE_OF_RELATIONSHIP);
	}
	else if (PLAYER_SAID (R, excuse_1))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK3, 2);

		NPCPhrase (NO_EXCUSE_1);
	}
	else if (PLAYER_SAID (R, excuse_2))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK3, 3);

		NPCPhrase (NO_EXCUSE_2);
	}
	else if (PLAYER_SAID (R, excuse_3))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK3, 4);

		NPCPhrase (NO_EXCUSE_3);
	}

	switch (GET_GAME_STATE (MELNORME_YACK_STACK3))
	{
		case 0:
			Response (explore_relationship, DoMelnormeMiffed);
			break;
		case 1:
			Response (excuse_1, DoMelnormeMiffed);
			break;
		case 2:
			Response (excuse_2, DoMelnormeMiffed);
			break;
		case 3:
			Response (excuse_3, DoMelnormeMiffed);
			break;
	}
	Response (we_apologize, DoFirstMeeting);
	Response (so_we_can_attack, ExitConversation);
	Response (bye_melnorme_slightly_angry, ExitConversation);
}
Esempio n. 14
0
static void
DoFirstMeeting (RESPONSE_REF R)
{
	BYTE last_stack = 0;
	PVOIDFUNC temp_func, stack_func[] =
	{
		yack0_respond,
		yack1_respond,
		yack2_respond,
	};

	if (R == 0)
	{
		BYTE business_count;

		business_count = GET_GAME_STATE (MELNORME_BUSINESS_COUNT);
		switch (business_count++)
		{
			case 0:
				NPCPhrase (HELLO_NOW_DOWN_TO_BUSINESS_1);
				break;
			case 1:
				NPCPhrase (HELLO_NOW_DOWN_TO_BUSINESS_2);
				break;
			case 2:
				NPCPhrase (HELLO_NOW_DOWN_TO_BUSINESS_3);
				--business_count;
				break;
		}
		SET_GAME_STATE (MELNORME_BUSINESS_COUNT, business_count);
	}
	else if (PLAYER_SAID (R, we_are_from_alliance))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK0, 1);
		NPCPhrase (KNOW_OF_YOU);
	}
	else if (PLAYER_SAID (R, how_know))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK0, 2);
		NPCPhrase (KNOW_BECAUSE);
	}
	else if (PLAYER_SAID (R, what_about_yourselves))
	{
		last_stack = 1;
		SET_GAME_STATE (MELNORME_YACK_STACK1, 1);
		NPCPhrase (NO_TALK_ABOUT_OURSELVES);
	}
	else if (PLAYER_SAID (R, what_factors))
	{
		last_stack = 1;
		SET_GAME_STATE (MELNORME_YACK_STACK1, 2);
		NPCPhrase (FACTORS_ARE);
	}
	else if (PLAYER_SAID (R, what_about_universe))
	{
		last_stack = 2;
		SET_GAME_STATE (MELNORME_YACK_STACK2, 1);
		NPCPhrase (NO_FREE_LUNCH);
	}
	else if (PLAYER_SAID (R, giving_is_good_1))
	{
		last_stack = 2;
		SET_GAME_STATE (MELNORME_YACK_STACK2, 2);
		NPCPhrase (GIVING_IS_BAD_1);
	}
	else if (PLAYER_SAID (R, giving_is_good_2))
	{
		last_stack = 2;
		SET_GAME_STATE (MELNORME_YACK_STACK2, 3);
		NPCPhrase (GIVING_IS_BAD_2);
	}
	else if (PLAYER_SAID (R, yes_really_testing))
	{
		XFormColorMap (GetColorMapAddress (
				SetAbsColorMapIndex (CommData.AlienColorMap, 0)
				), ONE_SECOND / 2);

		NPCPhrase (TEST_RESULTS);
	}
	else if (PLAYER_SAID (R, we_apologize))
	{
		SET_GAME_STATE (MELNORME_ANGER, 0);
		XFormColorMap (GetColorMapAddress (
				SetAbsColorMapIndex (CommData.AlienColorMap, 0)
				), ONE_SECOND / 2);

		NPCPhrase (APOLOGY_ACCEPTED);
	}

	temp_func = stack_func[0];
	stack_func[0] = stack_func[last_stack];
	stack_func[last_stack] = temp_func;
	(*stack_func[0]) ();
	(*stack_func[1]) ();
	(*stack_func[2]) ();
	Response (no_trade_now, ExitConversation);
}
Esempio n. 15
0
static void
ProbeFunction (RESPONSE_REF R)
{
	BYTE LastStack;
	RESPONSE_REF pStr[2];

	LastStack = 0;
	pStr[0] = pStr[1] = 0;
	if (PLAYER_SAID (R, talk_more_probe_attack))
	{
		NPCPhrase (NO_PROBLEM_BUT_SURE);
	}
	else if (PLAYER_SAID (R, tell_me_about_basics))
	{
		NPCPhrase (BASIC_COMMANDS);

		SET_GAME_STATE (PLAYER_KNOWS_PROGRAM, 1);
		DISABLE_PHRASE (tell_basics_again);
	}
	else if (PLAYER_SAID (R, tell_basics_again))
	{
		NPCPhrase (OK_BASICS_AGAIN);

		DISABLE_PHRASE (tell_basics_again);
	}
	else if (PLAYER_SAID (R, what_effect))
	{
		NPCPhrase (AFFECTS_BEHAVIOR);

		SET_GAME_STATE (PLAYER_KNOWS_EFFECTS, 1);
		DISABLE_PHRASE (what_effect);
	}
	else if (PLAYER_SAID (R, tell_me_about_rep_1))
	{
		NPCPhrase (ABOUT_REP);

		LastStack = 2;
		SET_GAME_STATE (SLYLANDRO_STACK8, 3);
	}
	else if (PLAYER_SAID (R, what_set_priority))
	{
		NPCPhrase (MAXIMUM);

		SET_GAME_STATE (PLAYER_KNOWS_PRIORITY, 1);
		DISABLE_PHRASE (what_set_priority);
	}
	else if (PLAYER_SAID (R, how_does_probe_defend))
	{
		NPCPhrase (ONLY_SELF_DEFENSE);

		LastStack = 1;
		SET_GAME_STATE (SLYLANDRO_STACK9, 1);
	}
	else if (PLAYER_SAID (R, combat_behavior))
	{
		NPCPhrase (MISSILE_BATTERIES);

		LastStack = 1;
		SET_GAME_STATE (SLYLANDRO_STACK9, 2);
	}
	else if (PLAYER_SAID (R, what_missile_batteries))
	{
		NPCPhrase (LIGHTNING_ONLY_FOR_HARVESTING);

		SET_GAME_STATE (SLYLANDRO_STACK9, 3);
	}

	switch (GET_GAME_STATE (SLYLANDRO_STACK9))
	{
		case 0:
			pStr[0] = how_does_probe_defend;
			break;
		case 1:
			pStr[0] = combat_behavior;
			break;
		case 2:
			pStr[0] = what_missile_batteries;
			break;
	}
	switch (GET_GAME_STATE (SLYLANDRO_STACK8))
	{
		case 2:
			pStr[1] = tell_me_about_rep_1;
			break;
		case 3:
			if (PHRASE_ENABLED (what_set_priority))
				pStr[1] = what_set_priority;
			break;
	}

	if (LastStack && pStr[LastStack - 1])
		Response (pStr[LastStack - 1], ProbeFunction);
	if (!GET_GAME_STATE (PLAYER_KNOWS_PROGRAM))
		Response (tell_me_about_basics, ProbeFunction);
	else
	{
		if (GET_GAME_STATE (PLAYER_KNOWS_PRIORITY))
		{
			if (GET_GAME_STATE (PLAYER_KNOWS_EFFECTS))
			{
				Response (probe_has_bug, ProbeBug);
			}
			if (PHRASE_ENABLED (what_effect))
				Response (what_effect, ProbeFunction);
		}
		if (PHRASE_ENABLED (tell_basics_again))
			Response (tell_basics_again, ProbeFunction);
	}
	if (LastStack == 0)
	{
		do
		{
			if (pStr[LastStack])
				Response (pStr[LastStack], ProbeFunction);
		} while (++LastStack < 2);
	}
	else
	{
		LastStack = (LastStack - 1) ^ 1;
		if (pStr[LastStack])
			Response (pStr[LastStack], ProbeFunction);
	}

	Response (enough_problem, ProbeInfo);
}
Esempio n. 16
0
static void
Intro (void)
{
	BYTE NumVisits;

	if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		NPCPhrase (OUT_TAKES);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		return;
	}

	if (GET_GAME_STATE (SUPOX_HOSTILE))
	{
		NumVisits = GET_GAME_STATE (SUPOX_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (HOSTILE_SPACE_HELLO_1);
				break;
			case 1:
				NPCPhrase (HOSTILE_SPACE_HELLO_2);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (SUPOX_VISITS, NumVisits);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else if (ActivateStarShip (SUPOX_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
	{
		if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
		{
			NumVisits = GET_GAME_STATE (SUPOX_HOME_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (ALLIED_HOMEWORLD_HELLO_1);
					break;
				case 1:
					NPCPhrase (ALLIED_HOMEWORLD_HELLO_2);
					break;
				case 2:
					NPCPhrase (ALLIED_HOMEWORLD_HELLO_3);
					break;
				case 3:
					NPCPhrase (ALLIED_HOMEWORLD_HELLO_4);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (SUPOX_HOME_VISITS, NumVisits);

			AlliedHome ((RESPONSE_REF)0);
		}
		else
		{
			NumVisits = GET_GAME_STATE (UTWIG_SUPOX_MISSION);
			if (NumVisits == 1)
			{
				NumVisits = GET_GAME_STATE (SUPOX_VISITS);
				switch (NumVisits++)
				{
					case 0:
						NPCPhrase (HELLO_BEFORE_KOHRAH_SPACE_1);
						break;
					case 1:
						NPCPhrase (HELLO_BEFORE_KOHRAH_SPACE_2);
						--NumVisits;
						break;
				}
				SET_GAME_STATE (SUPOX_VISITS, NumVisits);

				BeforeKohrAh ((RESPONSE_REF)0);
			}
			else if (NumVisits < 5)
			{
				NumVisits = GET_GAME_STATE (SUPOX_VISITS);
				switch (NumVisits++)
				{
					case 0:
						NPCPhrase (HELLO_DURING_KOHRAH_SPACE_1);
						break;
					case 1:
						NPCPhrase (HELLO_DURING_KOHRAH_SPACE_2);
						--NumVisits;
						break;
				}
				SET_GAME_STATE (SUPOX_VISITS, NumVisits);
			}
			else
			{
				NumVisits = GET_GAME_STATE (SUPOX_VISITS);
				switch (NumVisits++)
				{
					case 0:
						NPCPhrase (HELLO_AFTER_KOHRAH_SPACE_1);
						break;
					case 1:
						NPCPhrase (HELLO_AFTER_KOHRAH_SPACE_2);
						--NumVisits;
						break;
				}
				SET_GAME_STATE (SUPOX_VISITS, NumVisits);

				AfterKohrAh ((RESPONSE_REF)0);
			}
		}
	}
	else
	{
		if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
		{
			NumVisits = GET_GAME_STATE (SUPOX_HOME_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (NEUTRAL_HOMEWORLD_HELLO_1);
					break;
				case 1:
					NPCPhrase (NEUTRAL_HOMEWORLD_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (SUPOX_HOME_VISITS, NumVisits);
		}
		else
		{
			NumVisits = GET_GAME_STATE (SUPOX_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (NEUTRAL_SPACE_HELLO_1);
					break;
				case 1:
					NPCPhrase (NEUTRAL_SPACE_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (SUPOX_VISITS, NumVisits);
		}

		NeutralSupox ((RESPONSE_REF)0);
	}
}
Esempio n. 17
0
static void
ProbeInfo (RESPONSE_REF R)
{
	BYTE i, LastStack, InfoLeft;
	RESPONSE_REF pStr[3];

	LastStack = 0;
	pStr[0] = pStr[1] = pStr[2] = 0;
	if (PLAYER_SAID (R, what_are_probes))
	{
		NPCPhrase (PROBES_ARE);

		SET_GAME_STATE (SLYLANDRO_STACK5, 1);
	}
	else if (PLAYER_SAID (R, know_more_probe))
		NPCPhrase (OK_WHAT_MORE_PROBE);
	else if (PLAYER_SAID (R, why_probe_always_attack))
	{
		NPCPhrase (ONLY_DEFEND);

		SET_GAME_STATE (SLYLANDRO_STACK6, 1);
	}
	else if (PLAYER_SAID (R, talk_more_probe_attack))
	{
		ProbeFunction (R);
		return;
	}
	else if (PLAYER_SAID (R, where_probes_from))
	{
		NPCPhrase (PROBES_FROM_MELNORME);

		LastStack = 1;
		SET_GAME_STATE (SLYLANDRO_STACK7, 1);
	}
	else if (PLAYER_SAID (R, why_sell))
	{
		NPCPhrase (SELL_FOR_INFO);

		LastStack = 1;
		SET_GAME_STATE (SLYLANDRO_STACK7, 2);
	}
	else if (PLAYER_SAID (R, how_long_ago))
	{
		NPCPhrase (FIFTY_THOUSAND_ROTATIONS);

		SET_GAME_STATE (SLYLANDRO_STACK7, 3);
	}
	else if (PLAYER_SAID (R, whats_probes_mission))
	{
		NPCPhrase (SEEK_OUT_NEW_LIFE);

		LastStack = 2;
		SET_GAME_STATE (SLYLANDRO_STACK8, 1);
	}
	else if (PLAYER_SAID (R, if_only_one))
	{
		NPCPhrase (THEY_REPLICATE);

		SET_GAME_STATE (SLYLANDRO_STACK8, 2);
	}
	else if (PLAYER_SAID (R, enough_problem))
		NPCPhrase (OK_ENOUGH_PROBLEM);

	if (!GET_GAME_STATE (SLYLANDRO_KNOW_BROKEN)
			&& GET_GAME_STATE (PROBE_EXHIBITED_BUG))
	{
		switch (GET_GAME_STATE (SLYLANDRO_STACK6))
		{
			case 0:
				pStr[0] = why_probe_always_attack;
				break;
			case 1:
				pStr[0] = talk_more_probe_attack;
				break;
		}
	}
	switch (GET_GAME_STATE (SLYLANDRO_STACK7))
	{
		case 0:
			pStr[1] = where_probes_from;
			break;
		case 1:
			pStr[1] = why_sell;
			break;
		case 2:
			pStr[1] = how_long_ago;
			break;
	}
	switch (GET_GAME_STATE (SLYLANDRO_STACK8))
	{
		case 0:
			pStr[2] = whats_probes_mission;
			break;
		case 1:
			pStr[2] = if_only_one;
			break;
	}

	InfoLeft = FALSE;
	if (pStr[LastStack])
	{
		InfoLeft = TRUE;
		Response (pStr[LastStack], ProbeInfo);
	}
	for (i = 0; i < 3; ++i)
	{
		if (i != LastStack && pStr[i])
		{
			InfoLeft = TRUE;
			Response (pStr[i], ProbeInfo);
		}
	}

	Response (enough_probe, HomeWorld);
	if (!InfoLeft)
	{
		DISABLE_PHRASE (know_more_probe);
	}
}
static void
CombatIsInevitable (RESPONSE_REF R)
{
	SET_GAME_STATE (BATTLE_SEGUE, 1);

	if (PLAYER_SAID (R, you_are_weak))
		NPCPhrase (STRENGTH_NOT_ALL);
	else if (PLAYER_SAID (R, slay_by_thousands))
		NPCPhrase (NO_SLAY_BY_THOUSANDS);
	else if (PLAYER_SAID (R, ease_up))
		NPCPhrase (NO_EASE_UP);
	else if (PLAYER_SAID (R, bye_space))
		NPCPhrase (GOODBYE_AND_DIE_SPACE);
	else if (PLAYER_SAID (R, bye_homeworld))
		NPCPhrase (GOODBYE_AND_DIE_HOMEWORLD);
	else if (PLAYER_SAID (R, want_peace))
		NPCPhrase (NO_PEACE);
	else if (PLAYER_SAID (R, want_alliance))
		NPCPhrase (NO_ALLIANCE);
	else if (PLAYER_SAID (R, but_evil_is_defined))
		NPCPhrase (DONT_CONFUSE_US);
	else if (PLAYER_SAID (R, bye_gods))
	{
		NPCPhrase (GOODBYE_GODS);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	if (PLAYER_SAID (R, whats_up))
	{
		NPCPhrase (GENERAL_INFO);
		Response (bye, CombatIsInevitable);
	}
	else if (PLAYER_SAID (R, whats_up_space_1)
			|| PLAYER_SAID (R, whats_up_space_2)
			|| PLAYER_SAID (R, whats_up_space_3)
			|| PLAYER_SAID (R, whats_up_space_4)
			|| PLAYER_SAID (R, whats_up_space_5))
	{
		BYTE NumVisits;

		NumVisits = GET_GAME_STATE (ILWRATH_INFO);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (GENERAL_INFO_SPACE_1);
				break;
			case 1:
				NPCPhrase (GENERAL_INFO_SPACE_2);
				break;
			case 2:
				NPCPhrase (GENERAL_INFO_SPACE_3);
				break;
			case 3:
				NPCPhrase (GENERAL_INFO_SPACE_4);
				break;
			case 4:
				NPCPhrase (GENERAL_INFO_SPACE_5);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (ILWRATH_INFO, NumVisits);
	}
	else
	{
		if (PLAYER_SAID (R, bye))
			NPCPhrase (GOODBYE_AND_DIE);
		else if (PLAYER_SAID (R, where_you_come_from))
			NPCPhrase (CAME_FROM);
		if (PLAYER_SAID (R, it_will_be_a_pleasure))
			NPCPhrase (WHO_BLASTS_WHO);
		if (PLAYER_SAID (R, surrender))
			NPCPhrase (NO_SURRENDER);
		if (PLAYER_SAID (R, be_reasonable))
			NPCPhrase (NOT_REASONABLE);
	}
}
Esempio n. 19
0
static void
SpathiAllies (RESPONSE_REF R)
{
	BYTE NumVisits;

	if (R == 0)
	{
		NumVisits = GET_GAME_STATE (SPATHI_HOME_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (HELLO_ALLIES_1);
				break;
			case 1:
				NPCPhrase (HELLO_ALLIES_2);
				break;
			case 2:
				NPCPhrase (HELLO_ALLIES_3);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (SPATHI_HOME_VISITS, NumVisits);
	}
	else if (PLAYER_SAID (R, whats_up))
	{
		NumVisits = GET_GAME_STATE (SPATHI_INFO);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (GENERAL_INFO_1);
				break;
			case 1:
				NPCPhrase (GENERAL_INFO_2);
				break;
			case 2:
				NPCPhrase (GENERAL_INFO_3);
				SET_GAME_STATE (KNOW_URQUAN_STORY, 1);
				SET_GAME_STATE (KNOW_KOHR_AH_STORY, 1);
				break;
			case 3:
				NPCPhrase (GENERAL_INFO_4);
				break;
			case 4:
				NPCPhrase (GENERAL_INFO_5);
				--NumVisits;
				break;
			case 5:
				NPCPhrase (GENERAL_INFO_5);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (SPATHI_INFO, NumVisits);

		DISABLE_PHRASE (whats_up);
	}
	else if (PLAYER_SAID (R, resources_please))
	{
		NPCPhrase (SORRY_NO_RESOURCES);

		DISABLE_PHRASE (resources_please);
	}
	else if (PLAYER_SAID (R, something_fishy))
	{
		NPCPhrase (NOTHING_FISHY);

		SET_GAME_STATE (SPATHI_INFO, 5);
	}
	else if (PLAYER_SAID (R, enough_info))
		NPCPhrase (OK_ENOUGH_INFO);

	if (GET_GAME_STATE (SPATHI_INFO) == 4)
		Response (something_fishy, SpathiAllies);
	if (PHRASE_ENABLED (whats_up))
		Response (whats_up, SpathiAllies);
	if (PHRASE_ENABLED (resources_please))
		Response (resources_please, SpathiAllies);
	if (PHRASE_ENABLED (like_some_info))
		Response (like_some_info, SpathiInfo);
	Response (bye_ally, ExitConversation);
}
static void
IlwrathInfo (RESPONSE_REF R)
{
	BYTE InfoLeft;

	InfoLeft = FALSE;
	if (PLAYER_SAID (R, want_info_on_ilwrath))
		NPCPhrase (WHAT_ABOUT_ILWRATH);
	else if (PLAYER_SAID (R, what_about_physio))
	{
		NPCPhrase (ABOUT_PHYSIO);

		DISABLE_PHRASE (what_about_physio);
	}
	else if (PLAYER_SAID (R, what_about_history))
	{
		NPCPhrase (ABOUT_HISTORY);

		DISABLE_PHRASE (what_about_history);
	}
	else if (PLAYER_SAID (R, what_about_culture))
	{
		NPCPhrase (ABOUT_CULTURE);

		DISABLE_PHRASE (what_about_culture);
	}
	else if (PLAYER_SAID (R, what_about_urquan))
	{
		NPCPhrase (URQUAN_TOO_NICE);

		DISABLE_PHRASE (what_about_urquan);
	}
	else if (PLAYER_SAID (R, are_you_evil))
	{
		NPCPhrase (OF_COURSE_WERE_EVIL);

		DISABLE_PHRASE (are_you_evil);
	}

	if (PHRASE_ENABLED (what_about_physio))
	{
		Response (what_about_physio, IlwrathInfo);
		InfoLeft = TRUE;
	}
	if (PHRASE_ENABLED (what_about_history))
	{
		Response (what_about_history, IlwrathInfo);
		InfoLeft = TRUE;
	}
	if (PHRASE_ENABLED (what_about_culture))
	{
		Response (what_about_culture, IlwrathInfo);
		InfoLeft = TRUE;
	}
	if (PHRASE_ENABLED (what_about_urquan))
	{
		Response (what_about_urquan, IlwrathInfo);
		InfoLeft = TRUE;
	}
	if (PHRASE_ENABLED (are_you_evil))
	{
		Response (are_you_evil, IlwrathInfo);
		InfoLeft = TRUE;
	}
	else
	{
		Response (but_evil_is_defined, CombatIsInevitable);
		InfoLeft = TRUE;
	}
	Response (enough_ilwrath, IlwrathHome);

	if (!InfoLeft)
		DISABLE_PHRASE (want_info_on_ilwrath);
}
Esempio n. 21
0
static void
AllianceOffer (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, misunderstanding))
	{
		NPCPhrase (JUST_MISUNDERSTANDING);
		XFormColorMap (GetColorMapAddress (
				SetAbsColorMapIndex (CommData.AlienColorMap, 1)
				), ONE_SECOND / 4);

		SET_GAME_STATE (SPATHI_MANNER, 3);
		SET_GAME_STATE (SPATHI_VISITS, 0);
	}
	else if (PLAYER_SAID (R, we_come_in_peace))
		NPCPhrase (OF_COURSE);
	else if (PLAYER_SAID (R, hand_in_friendship))
	{
		NPCPhrase (TOO_AFRAID);

		DISABLE_PHRASE (hand_in_friendship);
	}
	else if (PLAYER_SAID (R, stronger))
	{
		NPCPhrase (YOURE_NOT);

		DISABLE_PHRASE (stronger);
	}
	else if (PLAYER_SAID (R, yes_we_are))
	{
		NPCPhrase (NO_YOURE_NOT);

		DISABLE_PHRASE (yes_we_are);
	}
	else if (PLAYER_SAID (R, share_info))
	{
		NPCPhrase (NO_INFO);

		DISABLE_PHRASE (share_info);
	}
	else if (PLAYER_SAID (R, give_us_resources))
	{
		NPCPhrase (NO_RESOURCES);

		DISABLE_PHRASE (give_us_resources);
	}

	if (PHRASE_ENABLED (hand_in_friendship))
		Response (hand_in_friendship, AllianceOffer);
	else if (PHRASE_ENABLED (stronger))
		Response (stronger, AllianceOffer);
	else if (PHRASE_ENABLED (yes_we_are))
		Response (yes_we_are, AllianceOffer);
	else
	{
		Response (how_prove, LearnQuest);
	}
	if (PHRASE_ENABLED (share_info))
		Response (share_info, AllianceOffer);
	if (PHRASE_ENABLED (give_us_resources))
		Response (give_us_resources, AllianceOffer);
}
static void
GodsSpeak (RESPONSE_REF R)
{
	BYTE NumVisits;

	if (R == 0)
	{
		if (GET_GAME_STATE (ILWRATH_FIGHT_THRADDASH))
			NPCPhrase (GLORIOUS_WORSHIP);
		else if (GET_GAME_STATE (ILWRATH_DECEIVED))
			NPCPhrase (ON_WAY);
		else
		{
			NumVisits = GET_GAME_STATE (ILWRATH_GODS_SPOKEN);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (ILWRATH_BELIEVE);
					break;
				case 1:
					NPCPhrase (GODS_RETURN_1);
					break;
				case 2:
					NPCPhrase (GODS_RETURN_2);
					break;
				case 3:
					NPCPhrase (GODS_RETURN_3);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (ILWRATH_GODS_SPOKEN, NumVisits);
		}
	}
	else if (PLAYER_SAID (R, go_kill_thraddash))
	{
		NPCPhrase (OK_KILL_THRADDASH);

		SET_GAME_STATE (ILWRATH_DECEIVED, 1);
		AddEvent (RELATIVE_EVENT, 0, 0, 0, ADVANCE_ILWRATH_MISSION);
	}
	else if (PLAYER_SAID (R, worship_us))
	{
		NumVisits = GET_GAME_STATE (ILWRATH_WORSHIP);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (WE_WORSHIP_1);
				break;
			case 1:
				NPCPhrase (WE_WORSHIP_2);
				break;
			case 2:
				NPCPhrase (WE_WORSHIP_3);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (ILWRATH_WORSHIP, NumVisits);

		DISABLE_PHRASE (worship_us);
	}
	else if (PLAYER_SAID (R, enough_orders))
		NPCPhrase (NEVER_ENOUGH);

	if (!GET_GAME_STATE (ILWRATH_DECEIVED))
		Response (go_kill_thraddash, GodsSpeak);
	if (PHRASE_ENABLED (worship_us))
		Response (worship_us, GodsSpeak);
	if (PHRASE_ENABLED (other_divine_orders))
	{
		Response (other_divine_orders, GodsOrder);
	}
	Response (bye_gods, CombatIsInevitable);
}
Esempio n. 23
0
static void
SpathiCouncil (RESPONSE_REF R)
{
	if (R == 0)
		NPCPhrase (HELLO_AGAIN);
	else if (PLAYER_SAID (R, good_password))
	{
		NPCPhrase (YES_GOOD_PASSWORD);
		XFormColorMap (GetColorMapAddress (
				SetAbsColorMapIndex (CommData.AlienColorMap, 1)
				), ONE_SECOND / 4);

		SET_GAME_STATE (KNOW_SPATHI_PASSWORD, 1);
		SET_GAME_STATE (SPATHI_HOME_VISITS, 0);
	}
	else if (PLAYER_SAID (R, we_come_in_peace))
	{
		NPCPhrase (KILLED_SPATHI);

		DISABLE_PHRASE (we_come_in_peace);
	}
	else if (PLAYER_SAID (R, spathi_on_pluto))
	{
		NPCPhrase (WHERE_SPATHI);

		DISABLE_PHRASE (spathi_on_pluto);
	}
	else if (PLAYER_SAID (R, hostage))
	{
		NPCPhrase (GUN_TO_HEAD);

		SET_GAME_STATE (FOUND_PLUTO_SPATHI, 3);
		DISABLE_PHRASE (hostage);
	}
	else if (PLAYER_SAID (R, killed_fwiffo))
	{
		NPCPhrase (POOR_FWIFFO);

		SET_GAME_STATE (FOUND_PLUTO_SPATHI, 3);
		DISABLE_PHRASE (killed_fwiffo);
	}
	else if (PLAYER_SAID (R, fwiffo_fine))
	{
		NPCPhrase (NOT_LIKELY);

		R = killed_fwiffo;
		DISABLE_PHRASE (fwiffo_fine);
	}
	else if (PLAYER_SAID (R, surrender))
	{
		NPCPhrase (NO_SURRENDER);

		DISABLE_PHRASE (surrender);
	}

	if (GET_GAME_STATE (SPATHI_MANNER) == 0)
	{
		Response (we_come_in_peace, AllianceOffer);
	}
	else if (PHRASE_ENABLED (we_come_in_peace))
	{
		Response (we_come_in_peace, SpathiCouncil);
	}
	else
	{
		Response (misunderstanding, AllianceOffer);
	}
	if (GET_GAME_STATE (FOUND_PLUTO_SPATHI)
			&& GET_GAME_STATE (FOUND_PLUTO_SPATHI) < 3)
	{
		if (PHRASE_ENABLED (spathi_on_pluto))
			Response (spathi_on_pluto, SpathiCouncil);
		else if (ActivateStarShip (SPATHI_SHIP, ESCORTING_FLAGSHIP))
		{
			if (PHRASE_ENABLED (hostage))
				Response (hostage, SpathiCouncil);
		}
		else if (PHRASE_ENABLED (killed_fwiffo))
		{
			Response (killed_fwiffo, SpathiCouncil);
			if (PHRASE_ENABLED (fwiffo_fine))
				Response (fwiffo_fine, SpathiCouncil);
		}
	}
	if (PHRASE_ENABLED (surrender))
		Response (surrender, SpathiCouncil);
	else
	{
		Response (surrender_or_die, ExitConversation);
	}
	Response (bye_no_ally_offer, ExitConversation);
}
static void
Intro (void)
{
	BYTE NumVisits;

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

		Response (where_you_come_from, CombatIsInevitable);
		Response (it_will_be_a_pleasure, CombatIsInevitable);
		Response (surrender, CombatIsInevitable);
		Response (be_reasonable, CombatIsInevitable);
	}
	else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
	{
		IlwrathHome ((RESPONSE_REF)0);
	}
	else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
	{
		NumVisits = GET_GAME_STATE (ILWRATH_CHMMR_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (INIT_CHMMR_HELLO);
				break;
			case 1:
				NPCPhrase (SUBSEQUENT_CHMMR_HELLO);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (ILWRATH_CHMMR_VISITS, NumVisits);

		Response (whats_up, CombatIsInevitable);
		Response (bye, CombatIsInevitable);
	}
	else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 5))
	{
		// Communicating with an Ilwrath ship using a HyperWave Broadcaster.
		if (GET_GAME_STATE (ILWRATH_FIGHT_THRADDASH))
			NPCPhrase (BIG_FUN);
		else if (GET_GAME_STATE (ILWRATH_DECEIVED))
			NPCPhrase (FAST_AS_CAN);
		else
			NPCPhrase (JUST_GRUNTS);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 4))
	{
		// Communicating with the Ilwrath homeworld using a
		// Hyperwave Broadcaster.
		GodsSpeak ((RESPONSE_REF)0);
	}
	else
	{
		SET_GAME_STATE (BATTLE_SEGUE, 0);

		if (GET_GAME_STATE (ILWRATH_FIGHT_THRADDASH))
			NPCPhrase (HAPPY_FIGHTING_THRADDASH);
		else if (GET_GAME_STATE (ILWRATH_DECEIVED))
			NPCPhrase (ON_WAY_TO_THRADDASH);
		else
			IlwrathSpace ((RESPONSE_REF)0);
	}
}
Esempio n. 25
0
static void
ExitConversation (RESPONSE_REF R)
{
	SET_GAME_STATE (BATTLE_SEGUE, 0);
	if (PLAYER_SAID (R, we_attack_again))
	{
		NPCPhrase (WE_FIGHT_AGAIN);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (R, surrender_or_die))
	{
		NPCPhrase (DEFEND_OURSELVES);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (R, we_are_vindicator0))
	{
		NPCPhrase (NO_PASSWORD);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (R, gort_merenga)
			|| PLAYER_SAID (R, guph_florp)
			|| PLAYER_SAID (R, wagngl_fthagn)
			|| PLAYER_SAID (R, pleeese))
	{
		NPCPhrase (WRONG_PASSWORD);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (R, screw_password))
	{
		NPCPhrase (NO_PASSWORD);

		SET_GAME_STATE (BATTLE_SEGUE, 1);
	}
	else if (PLAYER_SAID (R, bye_no_ally_offer))
		NPCPhrase (GOODBYE_NO_ALLY_OFFER);
	else if (PLAYER_SAID (R, bye_angry_spathi))
		NPCPhrase (GOODBYE_ANGRY_SPATHI);
	else if (PLAYER_SAID (R, bye_ally))
		NPCPhrase (GOODBYE_ALLY);
	else if (PLAYER_SAID (R, already_got_them))
	{
		NPCPhrase (EARLY_BIRD_CHECK);

		SET_GAME_STATE (SPATHI_HOME_VISITS, 0);
		SET_GAME_STATE (SPATHI_VISITS, 0);
		SET_GAME_STATE (SPATHI_PARTY, 1);
		SET_GAME_STATE (SPATHI_MANNER, 3);
	}
	else if (PLAYER_SAID (R, too_dangerous))
		NPCPhrase (WE_AGREE);
	else if (PLAYER_SAID (R, think_more))
		NPCPhrase (COWARD);
	else if (PLAYER_SAID (R, i_accept))
	{
		NPCPhrase (AWAIT_RETURN);

		SET_GAME_STATE (SPATHI_QUEST, 1);
		SET_GAME_STATE (SPATHI_MANNER, 3);
		SET_GAME_STATE (SPATHI_VISITS, 0);
	}
	else if (PLAYER_SAID (R, do_as_we_say))
	{
		NPCPhrase (DEPART_FOR_EARTH);

		ActivateStarShip (SPATHI_SHIP, 0);
		AddEvent (RELATIVE_EVENT, 6, 0, 0, SPATHI_SHIELD_EVENT);
		SET_GAME_STATE (SPATHI_HOME_VISITS, 0);
		SET_GAME_STATE (SPATHI_VISITS, 0);
	}
	else if (PLAYER_SAID (R, killed_them_all_1))
	{
		NPCPhrase (WILL_CHECK_1);

		if (!GET_GAME_STATE (SPATHI_CREATURES_ELIMINATED))
		{
			SET_GAME_STATE (LIED_ABOUT_CREATURES, 1);
		}
		else
		{
			SET_GAME_STATE (SPATHI_HOME_VISITS, 0);
			SET_GAME_STATE (SPATHI_VISITS, 0);
			SET_GAME_STATE (SPATHI_PARTY, 1);
			SET_GAME_STATE (SPATHI_MANNER, 3);
		}
	}
	else if (PLAYER_SAID (R, killed_them_all_2))
	{
		NPCPhrase (WILL_CHECK_2);

		if (!GET_GAME_STATE (SPATHI_CREATURES_ELIMINATED))
		{
			SET_GAME_STATE (LIED_ABOUT_CREATURES, 2);
		}
		else
		{
			SET_GAME_STATE (SPATHI_HOME_VISITS, 0);
			SET_GAME_STATE (SPATHI_VISITS, 0);
			SET_GAME_STATE (SPATHI_PARTY, 1);
			SET_GAME_STATE (SPATHI_MANNER, 3);
		}
	}
	else if (PLAYER_SAID (R, bye_before_party))
	{
		NPCPhrase (GOODBYE_BEFORE_PARTY);
	}
	else if (PLAYER_SAID (R, bye_from_party_1)
		   || PLAYER_SAID (R, bye_from_party_2)
		   || PLAYER_SAID (R, bye_from_party_3))
	{
		NPCPhrase (GOODBYE_FROM_PARTY);
	}
}
Esempio n. 26
0
static void
HumanInfo (RESPONSE_REF R)
{
	BYTE InfoLeft;

	if (PLAYER_SAID (R, happy_to_tell_more))
	{
		NPCPhrase (TELL_MORE);

		SET_GAME_STATE (SLYLANDRO_STACK4, 1);
	}
	else if (PLAYER_SAID (R, would_you_like_to_know_more))
	{
		NPCPhrase (YES_TELL_MORE);
	}
	else if (PLAYER_SAID (R, we_come_from_earth))
	{
		NPCPhrase (OK_EARTH);

		SET_GAME_STATE (SLYLANDRO_KNOW_EARTH, 1);
	}
	else if (PLAYER_SAID (R, we_explore))
	{
		NPCPhrase (OK_EXPLORE);

		SET_GAME_STATE (SLYLANDRO_KNOW_EXPLORE, 1);
	}
	else if (PLAYER_SAID (R, we_fight_urquan))
	{
		NPCPhrase (URQUAN_NICE_GUYS);

		SET_GAME_STATE (SLYLANDRO_KNOW_URQUAN, 1);
	}
	else if (PLAYER_SAID (R, not_same_urquan))
	{
		NPCPhrase (PERSONALITY_CHANGE);

		SET_GAME_STATE (SLYLANDRO_KNOW_URQUAN, 2);
	}
	else if (PLAYER_SAID (R, we_gather))
	{
		NPCPhrase (MAYBE_INTERESTED);

		SET_GAME_STATE (SLYLANDRO_KNOW_GATHER, 1);
	}

	InfoLeft = FALSE;
	if (GET_GAME_STATE (SLYLANDRO_KNOW_URQUAN) == 1)
	{
		InfoLeft = TRUE;
		Response (not_same_urquan, HumanInfo);
	}
	if (!GET_GAME_STATE (SLYLANDRO_KNOW_EARTH))
	{
		InfoLeft = TRUE;
		Response (we_come_from_earth, HumanInfo);
	}
	if (!GET_GAME_STATE (SLYLANDRO_KNOW_EXPLORE))
	{
		InfoLeft = TRUE;
		Response (we_explore, HumanInfo);
	}
	if (!GET_GAME_STATE (SLYLANDRO_KNOW_URQUAN))
	{
		InfoLeft = TRUE;
		Response (we_fight_urquan, HumanInfo);
	}
	if (!GET_GAME_STATE (SLYLANDRO_KNOW_GATHER))
	{
		InfoLeft = TRUE;
		Response (we_gather, HumanInfo);
	}

	Response (enough_about_me, HomeWorld);
	if (!InfoLeft)
	{
		SET_GAME_STATE (SLYLANDRO_STACK4, 2);
	}
}
Esempio n. 27
0
static void
YehatHome (RESPONSE_REF R)
{

	if (PLAYER_SAID (R, whats_up_homeworld))
	{
		BYTE NumVisits;

		NumVisits = GET_GAME_STATE (YEHAT_ROYALIST_INFO);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (GENERAL_INFO_HOMEWORLD_1);
				break;
			case 1:
				NPCPhrase (GENERAL_INFO_HOMEWORLD_2);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (YEHAT_ROYALIST_INFO, NumVisits);

		DISABLE_PHRASE (whats_up_homeworld);
	}
	else if (PLAYER_SAID (R, at_least_help_us_homeworld))
	{
		NPCPhrase (NO_HELP_ENEMY);

		SET_GAME_STATE (NO_YEHAT_HELP_HOME, 1);
	}
	else if (PLAYER_SAID (R, give_info))
	{
		NPCPhrase (NO_INFO_FOR_ENEMY);

		SET_GAME_STATE (NO_YEHAT_INFO, 1);
	}
	else if (PLAYER_SAID (R, what_about_pkunk_royalist))
	{
		if (GET_GAME_STATE (YEHAT_ABSORBED_PKUNK))
			NPCPhrase (PKUNK_ABSORBED_ROYALIST);
		else
			NPCPhrase (HATE_PKUNK_ROYALIST);

		SET_GAME_STATE (YEHAT_ROYALIST_TOLD_PKUNK, 1);
	}

	if (PHRASE_ENABLED (whats_up_homeworld))
		Response (whats_up_homeworld, YehatHome);
	if (!GET_GAME_STATE (YEHAT_ROYALIST_TOLD_PKUNK)
			&& GET_GAME_STATE (PKUNK_VISITS)
			&& GET_GAME_STATE (PKUNK_HOME_VISITS))
		Response (what_about_pkunk_royalist, YehatHome);
	if (!GET_GAME_STATE (NO_YEHAT_HELP_HOME))
		Response (at_least_help_us_homeworld, YehatHome);
	if (!GET_GAME_STATE (NO_YEHAT_INFO))
		Response (give_info, YehatHome);
	if (!GET_GAME_STATE (NO_YEHAT_ALLY_HOME))
	{
		UNICODE buf[ALLIANCE_NAME_BUFSIZE];

		GetAllianceName (buf, name_1);
		construct_response (
				shared_phrase_buf,
				i_demand_you_ally_homeworld0,
				GLOBAL_SIS (CommanderName),
				i_demand_you_ally_homeworld1,
				buf,
				i_demand_you_ally_homeworld2,
				GLOBAL_SIS (ShipName),
				i_demand_you_ally_homeworld3,
				(UNICODE*)NULL);
		DoResponsePhrase (i_demand_you_ally_homeworld0,
				ExitConversation, shared_phrase_buf);
	}
	Response (bye_homeworld, ExitConversation);
}
Esempio n. 28
0
static void
SlylandroInfo (RESPONSE_REF R)
{
	BYTE InfoLeft;

	if (PLAYER_SAID (R, like_more_about_you))
	{
		NPCPhrase (SURE_KNOW_WHAT);
	}
	else if (PLAYER_SAID (R, what_about_home))
	{
		NPCPhrase (ABOUT_HOME);

		DISABLE_PHRASE (what_about_home);
	}
	else if (PLAYER_SAID (R, what_about_culture))
	{
		NPCPhrase (ABOUT_CULTURE);

		DISABLE_PHRASE (what_about_culture);
	}
	else if (PLAYER_SAID (R, what_about_history))
	{
		NPCPhrase (ABOUT_HISTORY);

		DISABLE_PHRASE (what_about_history);
	}
	else if (PLAYER_SAID (R, what_about_biology))
	{
		NPCPhrase (ABOUT_BIOLOGY);

		DISABLE_PHRASE (what_about_biology);
	}

	InfoLeft = FALSE;
	if (PHRASE_ENABLED (what_about_home))
	{
		InfoLeft = TRUE;
		Response (what_about_home, SlylandroInfo);
	}
	if (PHRASE_ENABLED (what_about_culture))
	{
		InfoLeft = TRUE;
		Response (what_about_culture, SlylandroInfo);
	}
	if (PHRASE_ENABLED (what_about_history))
	{
		InfoLeft = TRUE;
		Response (what_about_history, SlylandroInfo);
	}
	if (PHRASE_ENABLED (what_about_biology))
	{
		InfoLeft = TRUE;
		Response (what_about_biology, SlylandroInfo);
	}

	Response (enough_info, HomeWorld);
	if (!InfoLeft)
	{
		DISABLE_PHRASE (like_more_about_you);
	}
}
Esempio n. 29
0
static void
Intro (void)
{
	BYTE NumVisits;

	if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
	{
		NPCPhrase (OUT_TAKES);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		return;
	}

	if (GET_GAME_STATE (YEHAT_CIVIL_WAR))
	{
		if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
		{
			NumVisits = GET_GAME_STATE (YEHAT_HOME_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (ROYALIST_HOMEWORLD_HELLO_1);
					break;
				case 1:
					NPCPhrase (ROYALIST_HOMEWORLD_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (YEHAT_HOME_VISITS, NumVisits);
		}
		else
		{
			NumVisits = GET_GAME_STATE (YEHAT_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (ROYALIST_SPACE_HELLO_1);
					break;
				case 1:
					NPCPhrase (ROYALIST_SPACE_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (YEHAT_VISITS, NumVisits);
		}

		Royalists ((RESPONSE_REF)0);
	}
	else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
	{
		NumVisits = GET_GAME_STATE (YEHAT_HOME_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (HOMEWORLD_HELLO_1);
				break;
			case 1:
				NPCPhrase (HOMEWORLD_HELLO_2);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (YEHAT_HOME_VISITS, NumVisits);

		YehatHome ((RESPONSE_REF)0);
	}
	else
	{
		NumVisits = GET_GAME_STATE (YEHAT_VISITS);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (SPACE_HELLO_1);
				break;
			case 1:
				NPCPhrase (SPACE_HELLO_2);
				break;
			case 2:
				NPCPhrase (SPACE_HELLO_3);
				break;
			case 3:
				NPCPhrase (SPACE_HELLO_4);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (YEHAT_VISITS, NumVisits);

		YehatSpace ((RESPONSE_REF)0);
	}
}
Esempio n. 30
0
static void
NatureOfConversation (RESPONSE_REF R)
{
	BYTE num_new_rainbows;
	UWORD rainbow_mask;
	COUNT Credit;

	if (PLAYER_SAID (R, get_on_with_business))
	{
		SET_GAME_STATE (MELNORME_YACK_STACK2, 5);
		R = 0;
	}

	// Draw credits display
	DeltaCredit (0);
	Credit = GetAvailableCredits ();
	if (R == 0)
	{
		BYTE stack = GET_GAME_STATE (MELNORME_YACK_STACK2) - 5;
		NPCPhrase (GetLineSafe (hello_and_down_to_business_lines, stack));
		if (stack < (NUM_HELLO_LINES - 1))
			++stack;
		SET_GAME_STATE (MELNORME_YACK_STACK2, stack + 5);
	}

	rainbow_mask = MAKE_WORD (
			GET_GAME_STATE (RAINBOW_WORLD0),
			GET_GAME_STATE (RAINBOW_WORLD1)
			);
	num_new_rainbows = (BYTE)(-GET_GAME_STATE (MELNORME_RAINBOW_COUNT));
	while (rainbow_mask)
	{
		if (rainbow_mask & 1)
			++num_new_rainbows;

		rainbow_mask >>= 1;
	}

	if (GLOBAL_SIS (FuelOnBoard) > 0
			|| GLOBAL_SIS (TotalBioMass)
			|| Credit
			|| num_new_rainbows)
	{
		if (!GET_GAME_STATE (TRADED_WITH_MELNORME))
		{
			SET_GAME_STATE (TRADED_WITH_MELNORME, 1);

			NPCPhrase (TRADING_INFO);
		}

		if (R == 0)
		{
				/* Melnorme reports any news and turns purple */
			NPCPhrase (BUY_OR_SELL);
			AlienTalkSegue (1);
			XFormColorMap (GetColorMapAddress (
					SetAbsColorMapIndex (CommData.AlienColorMap, 1)
					), ONE_SECOND / 2);
			AlienTalkSegue ((COUNT)~0);
		}
		else if (PLAYER_SAID (R, why_turned_purple))
		{
			SET_GAME_STATE (WHY_MELNORME_PURPLE, 1);

			NPCPhrase (TURNED_PURPLE_BECAUSE);
		}
		else if (PLAYER_SAID (R, done_selling))
		{
			NPCPhrase (OK_DONE_SELLING);
		}
		else if (PLAYER_SAID (R, done_buying))
		{
			NPCPhrase (OK_DONE_BUYING);
		}

		if (!GET_GAME_STATE (WHY_MELNORME_PURPLE))
		{
			Response (why_turned_purple, NatureOfConversation);
		}
		if (!AskedToBuy)
			Response (buy, DoBuy);
		if (PHRASE_ENABLED (sell))
			Response (sell, DoSell);
		Response (goodbye, ExitConversation);
	}
	else /* needs to be rescued */
	{
		if (GET_GAME_STATE (MELNORME_RESCUE_REFUSED))
		{
			NPCPhrase (CHANGED_MIND);

			Response (yes_changed_mind, DoRescue);
			Response (no_changed_mind, ExitConversation);
		}
		else
		{
			BYTE num_rescues = GET_GAME_STATE (MELNORME_RESCUE_COUNT);
			NPCPhrase (GetLineSafe (rescue_lines, num_rescues));

			if (num_rescues < NUM_RESCUE_LINES - 1)
			{
				++num_rescues;
				SET_GAME_STATE (MELNORME_RESCUE_COUNT, num_rescues);
			}

			NPCPhrase (SHOULD_WE_HELP_YOU);

			Response (yes_help, DoRescue);
			Response (no_help, ExitConversation);
		}
	}
}