• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GET_GAME_STATE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GET_GAME_STATE函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_GAME_STATE函数的具体用法?C++ GET_GAME_STATE怎么用?C++ GET_GAME_STATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GET_GAME_STATE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Intro

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);

		setSegue (Segue_peace);
	}
	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
	{
		setSegue (Segue_peace);

		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);
	}
}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:66,代码来源:ilwrathc.c


示例2: OrzNeutral

static void
OrzNeutral (RESPONSE_REF R)
{
	BYTE i, LastStack;
	RESPONSE_REF pStr[3];

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

		DISABLE_PHRASE (hostile_1);
		LastStack = 2;
	}
	else if (PLAYER_SAID (R, we_are_vindicator0))
	{
		NPCPhrase (NICE_TO_MEET_YOU);

		SET_GAME_STATE (ORZ_STACK0, 1);
		LastStack = 1;
	}
	else if (PLAYER_SAID (R, who_you))
	{
		NPCPhrase (WE_ARE_ORZ);

		SET_GAME_STATE (ORZ_ANDRO_STATE, 1);
	}
	else if (PLAYER_SAID (R, why_here))
	{
		NPCPhrase (HERE_BECAUSE);

		SET_GAME_STATE (ORZ_ANDRO_STATE, 2);
	}
	else if (PLAYER_SAID (R, no_alliance))
	{
		NPCPhrase (MAYBE_LATER);

		DISABLE_PHRASE (talk_about_alliance);
		SET_GAME_STATE (REFUSED_ORZ_ALLIANCE, 1);
	}
	else if (PLAYER_SAID (R, decide_later))
	{
		NPCPhrase (OK_LATER);

		DISABLE_PHRASE (talk_about_alliance);
		SET_GAME_STATE (REFUSED_ORZ_ALLIANCE, 1);
	}
	else if (PLAYER_SAID (R, dont_really_care))
		NPCPhrase (YOU_ARE_OUR_FRIENDS);
	else if (PLAYER_SAID (R, where_androsyn))
	{
		WhereAndrosyn (R);
		return;
	}
	else if (PLAYER_SAID (R, talk_about_alliance)
			|| PLAYER_SAID (R, seem_like_nice_guys))
	{
		OfferAlliance (R);
		return;
	}
	else if (PLAYER_SAID (R, hostile_2))
	{
		ExitConversation (R);
		return;
	}

	if (GET_GAME_STATE (ORZ_ANDRO_STATE) == 0)
		pStr[0] = who_you;
	else if (GET_GAME_STATE (ORZ_ANDRO_STATE) == 1)
		pStr[0] = why_here;
	else if (PHRASE_ENABLED (where_androsyn) && GET_GAME_STATE (ORZ_ANDRO_STATE) == 2)
		pStr[0] = where_androsyn;
	if (GET_GAME_STATE (REFUSED_ORZ_ALLIANCE))
	{
		if (PHRASE_ENABLED (talk_about_alliance))
			pStr[1] = talk_about_alliance;
	}
	else if (GET_GAME_STATE (ORZ_STACK0) == 0)
	{
		construct_response (shared_phrase_buf,
				we_are_vindicator0,
				GLOBAL_SIS (CommanderName),
				we_are_vindicator1,
				GLOBAL_SIS (ShipName),
				we_are_vindicator2,
				(UNICODE*)NULL);
		pStr[1] = we_are_vindicator0;
	}
	else
		pStr[1] = seem_like_nice_guys;
	if (PHRASE_ENABLED (hostile_1))
		pStr[2] = hostile_1;
	else
		pStr[2] = hostile_2;

	if (pStr[LastStack])
	{
		if (pStr[LastStack] != we_are_vindicator0)
			Response (pStr[LastStack], OrzNeutral);
//.........这里部分代码省略.........
开发者ID:SirDifferential,项目名称:Shiver-Balance-Mod,代码行数:101,代码来源:orzc.c


示例3: UseCaster

// Returns TRUE if the broadcaster has been successfully activated,
// and FALSE otherwise.
static BOOLEAN
UseCaster (void)
{
	if (inHQSpace ())
	{
		if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)
		{
			SET_GAME_STATE (USED_BROADCASTER, 1);
			return TRUE;
		}
		return FALSE;
	}

	if (LOBYTE (GLOBAL (CurrentActivity)) != IN_INTERPLANETARY
			|| !playerInSolarSystem ())
		return FALSE;

	if (playerInPlanetOrbit ()
			&& matchWorld (pSolarSysState, pSolarSysState->pOrbitalDesc,
				1, MATCH_PLANET)
			&& CurStarDescPtr->Index == CHMMR_DEFINED
			&& !GET_GAME_STATE (CHMMR_UNLEASHED))
	{
		// In orbit around the Chenjesu/Mmrnmhrm home planet.
		NextActivity |= CHECK_LOAD;  /* fake a load game */
		GLOBAL (CurrentActivity) |= START_ENCOUNTER;

		EncounterGroup = 0;
		PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
		ReinitQueue (&GLOBAL (ip_group_q));
		assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);

		SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
		SaveSolarSysLocation ();
		return TRUE;
	}

	{
		BOOLEAN FoundIlwrath;
		HIPGROUP hGroup;

		FoundIlwrath = (CurStarDescPtr->Index == ILWRATH_DEFINED)
				&& StartSphereTracking (ILWRATH_SHIP);
				// In the Ilwrath home system and they are alive?

		if (!FoundIlwrath &&
				(hGroup = GetHeadLink (&GLOBAL (ip_group_q))))
		{
			// Is an Ilwrath ship in the system?
			IP_GROUP *GroupPtr;

			GroupPtr = LockIpGroup (&GLOBAL (ip_group_q), hGroup);
			FoundIlwrath = (GroupPtr->race_id == ILWRATH_SHIP);
			UnlockIpGroup (&GLOBAL (ip_group_q), hGroup);
		}

		if (FoundIlwrath)
		{
			NextActivity |= CHECK_LOAD; /* fake a load game */
			GLOBAL (CurrentActivity) |= START_ENCOUNTER;

			EncounterGroup = 0;
			PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
			ReinitQueue (&GLOBAL (ip_group_q));
			assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);

			if (CurStarDescPtr->Index == ILWRATH_DEFINED)
			{
				// Ilwrath home system.
				SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 4);
			}
			else
			{
				// Ilwrath ship.
				SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 5);
			}
			
			if (playerInPlanetOrbit ())
				SaveSolarSysLocation ();
			return TRUE;
		}
	}

	return FALSE;
}
开发者ID:smaass,项目名称:UQM-MegaMod,代码行数:87,代码来源:devices.c


示例4: Intro

static void
Intro (void)
{
	DWORD GrpOffs;

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

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		return;
	}

	GrpOffs = GET_GAME_STATE_32 (URQUAN_PROBE_GRPOFFS0);
	if (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY
			&& GLOBAL (BattleGroupRef)
			&& GLOBAL (BattleGroupRef) == GrpOffs)
	{
		NPCPhrase (SEND_MESSAGE);
		SET_GAME_STATE (PROBE_MESSAGE_DELIVERED, 1);
	}
	else if (GET_GAME_STATE (PLAYER_HYPNOTIZED))
	{
		SetCommIntroMode (CIM_FADE_IN_SCREEN, ONE_SECOND * 5);
		UrquanHypno ((RESPONSE_REF)0);
	}
	else
	{
		BYTE NumVisits;

		if (!GET_GAME_STATE (URQUAN_SENSES_EVIL)
				&& GET_GAME_STATE (TALKING_PET_ON_SHIP))
		{
			NPCPhrase (SENSE_EVIL);
			SET_GAME_STATE (URQUAN_SENSES_EVIL, 1);
		}

		GrpOffs = GET_GAME_STATE_32 (COLONY_GRPOFFS0);
		if (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY
				&& GLOBAL (BattleGroupRef)
				&& GLOBAL (BattleGroupRef) == GrpOffs)
		{
			NPCPhrase (CAUGHT_YA);

			SET_GAME_STATE (BATTLE_SEGUE, 1);
			return;
		}

		GrpOffs = GET_GAME_STATE_32 (SAMATRA_GRPOFFS0);
		if (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY
				&& GLOBAL (BattleGroupRef)
				&& GLOBAL (BattleGroupRef) == GrpOffs)
		{
			NPCPhrase (HELLO_SAMATRA);

			SET_GAME_STATE (AWARE_OF_SAMATRA, 1);
			SET_GAME_STATE (BATTLE_SEGUE, 1);
		}
		else
		{
			NumVisits = GET_GAME_STATE (URQUAN_VISITS);
			if (!GET_GAME_STATE (KOHR_AH_FRENZY))
			{
				switch (NumVisits++)
				{
					case 0:
						NPCPhrase (INIT_HELLO);
						break;
					case 1:
						NPCPhrase (SUBSEQUENT_HELLO_1);
						break;
					case 2:
						NPCPhrase (SUBSEQUENT_HELLO_2);
						break;
					case 3:
						NPCPhrase (SUBSEQUENT_HELLO_3);
						break;
					case 4:
						NPCPhrase (SUBSEQUENT_HELLO_4);
						--NumVisits;
						break;
				}

				NormalUrquan ((RESPONSE_REF)0);
			}
			else
			{
				switch (NumVisits++)
				{
					case 0:
						NPCPhrase (INIT_FLEE_HUMAN);
						LoserUrquan ((RESPONSE_REF)0);
						break;
					case 1:
						NPCPhrase (SUBSEQUENT_FLEE_HUMAN);
						SET_GAME_STATE (BATTLE_SEGUE, 0);
						--NumVisits;
						break;
				}
			}
//.........这里部分代码省略.........
开发者ID:dczanik,项目名称:Hires-Shiver-Balance-Mod,代码行数:101,代码来源:urquanc.c


示例5: TaaloWorld

static void
TaaloWorld (RESPONSE_REF R)
{
	// We can only get here when ORZ_MANNER != HOSTILE (2)
	BYTE Manner;

	Manner = GET_GAME_STATE (ORZ_MANNER);
	if (PLAYER_SAID (R, demand_to_land))
	{
		NPCPhrase (ASK_NICELY);

		DISABLE_PHRASE (demand_to_land);
	}
	else if (PLAYER_SAID (R, why_you_here))
	{
		if (Manner != 1)
			NPCPhrase (FRIENDLY_EXPLANATION);
		else
			NPCPhrase (ANGRY_EXPLANATION);

		DISABLE_PHRASE (why_you_here);
	}
	else if (PLAYER_SAID (R, what_is_this_place))
	{
		if (Manner != 1)
			NPCPhrase (FRIENDLY_PLACE);
		else
			NPCPhrase (ANGRY_PLACE);

		DISABLE_PHRASE (what_is_this_place);
	}
	else if (PLAYER_SAID (R, may_we_land))
	{
		NPCPhrase (ALLIES_CAN_VISIT);

		DISABLE_PHRASE (may_we_land);
	}
	else if (PLAYER_SAID (R, make_alliance))
	{
		NPCPhrase (CANT_ALLY_HERE);

		DISABLE_PHRASE (make_alliance);
	}
	else if (PLAYER_SAID (R, why_busy))
	{
		NPCPhrase (BUSY_BECAUSE);

		DISABLE_PHRASE (why_busy);
	}

	if (PHRASE_ENABLED (may_we_land))
	{
		if (Manner == 3 &&
				ActivateStarShip (ORZ_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
			Response (may_we_land, ExitConversation);
		else
			Response (may_we_land, TaaloWorld);
	}
	else if (PHRASE_ENABLED (make_alliance))
		Response (make_alliance, TaaloWorld);
	else if (PHRASE_ENABLED (why_busy))
		Response (why_busy, TaaloWorld);
	if (PHRASE_ENABLED (demand_to_land))
	{
		if (Manner == 1)
			Response (demand_to_land, ExitConversation);
		else
			Response (demand_to_land, TaaloWorld);
	}
	if (PHRASE_ENABLED (why_you_here))
		Response (why_you_here, TaaloWorld);
	if (PHRASE_ENABLED (what_is_this_place))
		Response (what_is_this_place, TaaloWorld);
	Response (bye_taalo, ExitConversation);
}
开发者ID:SirDifferential,项目名称:Shiver-Balance-Mod,代码行数:75,代码来源:orzc.c


示例6: TellMoonBase

static void
TellMoonBase (RESPONSE_REF R)
{
	if (R == 0)
	{
		NPCPhrase (DEALT_WITH_BASE_YET);
	}
	else if (PLAYER_SAID (R, i_lost_my_lander))
	{
		NPCPhrase (HERE_IS_A_NEW_LANDER);
		++GLOBAL_SIS (NumLanders);
		LockMutex (GraphicsLock);
		DrawLanders ();
		DeltaSISGauges (4, 0, 0);
		UnlockMutex (GraphicsLock);

		SET_GAME_STATE (LANDERS_LOST, 1);
	}
	else if (PLAYER_SAID (R, i_lost_another_lander))
	{
		NPCPhrase (HERE_IS_ANOTHER_LANDER);
		++GLOBAL_SIS (NumLanders);
		LockMutex (GraphicsLock);
		DrawLanders ();
		DeltaSISGauges (4, 0, 0);
		UnlockMutex (GraphicsLock);
	}
	else if (PLAYER_SAID (R, need_fuel_mercury) ||
			PLAYER_SAID (R, need_fuel_luna))
	{
		NPCPhrase (GIVE_FUEL);
		LockMutex (GraphicsLock);
		DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
		UnlockMutex (GraphicsLock);

		SET_GAME_STATE (GIVEN_FUEL_BEFORE, 1);
	}
	else if (PLAYER_SAID (R, need_fuel_again))
	{
		NPCPhrase (GIVE_FUEL_AGAIN);
		LockMutex (GraphicsLock);
		DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
		UnlockMutex (GraphicsLock);
	}
	else if (PLAYER_SAID (R, we_are_here_to_help))
	{
		NPCPhrase (BASE_ON_MOON);
	}
	else if (GET_GAME_STATE (STARBASE_YACK_STACK1) == 0)
	{
		NPCPhrase (ABOUT_BASE);

		SET_GAME_STATE (STARBASE_YACK_STACK1, 1);
	}
	else
	{
		NPCPhrase (ABOUT_BASE_AGAIN);
	}

	if (GLOBAL_SIS (NumLanders) == 0
			&& GET_GAME_STATE (CHMMR_BOMB_STATE) < 2)
	{
		if (GET_GAME_STATE (LANDERS_LOST))
			Response (i_lost_another_lander, TellMoonBase);
		else
			Response (i_lost_my_lander, TellMoonBase);
	}
	if (GLOBAL_SIS (FuelOnBoard) < 2 * FUEL_TANK_SCALE)
	{
		if (GET_GAME_STATE (GIVEN_FUEL_BEFORE))
			Response (need_fuel_again, TellMoonBase);
		else
			Response (need_fuel_luna, TellMoonBase);
	}
	if (GET_GAME_STATE (WILL_DESTROY_BASE) == 0)
		Response (we_will_take_care_of_base, ByeBye);
	else
		Response (take_care_of_base_again, ByeBye);
	if (GET_GAME_STATE (STARBASE_YACK_STACK1) == 0)
		Response (tell_me_about_base, TellMoonBase);
	else
		Response (tell_me_again, TellMoonBase);
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:83,代码来源:comandr.c


示例7: CombatIsInevitable

static void
CombatIsInevitable (RESPONSE_REF R)
{
	SET_GAME_STATE (BATTLE_SEGUE, 1);

	if (PLAYER_SAID (R, you_must_surrender))
		NPCPhrase (NOPE);
	else if (PLAYER_SAID (R, whats_up_1)
			|| PLAYER_SAID (R, whats_up_2)
			|| PLAYER_SAID (R, whats_up_3)
			|| PLAYER_SAID (R, whats_up_4))
	{
		BYTE NumVisits;

		NumVisits = GET_GAME_STATE (URQUAN_INFO);
		switch (NumVisits++)
		{
			case 0:
				NPCPhrase (GENERAL_INFO_1);
				break;
			case 1:
				NPCPhrase (GENERAL_INFO_2);
				break;
			case 2:
				NPCPhrase (GENERAL_INFO_3);
				break;
			case 3:
				NPCPhrase (GENERAL_INFO_4);
				--NumVisits;
				break;
		}
		SET_GAME_STATE (URQUAN_INFO, NumVisits);
	}
	else if (PLAYER_SAID (R, i_wont_surrender))
		NPCPhrase (BAD_CHOICE);
	else if (PLAYER_SAID (R, i_will_surrender))
	{
		NPCPhrase (GOOD_CHOICE);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		GLOBAL_SIS (CrewEnlisted) = (COUNT)~0;
		GLOBAL (CurrentActivity) |= CHECK_RESTART;
	}
	else if (PLAYER_SAID (R, like_to_leave))
		NPCPhrase (INDEPENDENCE_IS_BAD);
	else if (PLAYER_SAID (R, bye_wars_over))
	{
		NPCPhrase (GOODBYE_WARS_OVER);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
	}
	else if (PLAYER_SAID (R, bye_sub_hypno))
		NPCPhrase (GOODBYE_AND_DIE_SUB_HYPNO);
	else if (PLAYER_SAID (R, bye_init_hypno))
	{
		NPCPhrase (GOODBYE_AND_DIE_INIT_HYPNO);

		SET_GAME_STATE (URQUAN_HYPNO_VISITS, 1);
	}
	else if (PLAYER_SAID (R, terran_amphibian)
			|| PLAYER_SAID (R, talking_pet_on_steroids))
	{
		NPCPhrase (BAD_NEWS);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		SET_GAME_STATE (URQUAN_HYPNO_VISITS, 1);
	}
	else if (PLAYER_SAID (R, falling_asleep)
			|| PLAYER_SAID (R, someone_else_controlled))
	{
		NPCPhrase (SOUNDS_FAMILIAR);

		SET_GAME_STATE (BATTLE_SEGUE, 0);
		SET_GAME_STATE (URQUAN_HYPNO_VISITS, 1);
	}
}
开发者ID:dczanik,项目名称:Hires-Shiver-Balance-Mod,代码行数:76,代码来源:urquanc.c


示例8: GenerateBurvixese_generateEnergy

static bool
GenerateBurvixese_generateEnergy (SOLARSYS_STATE *solarSys, PLANET_DESC *world,
		COUNT *whichNode)
{
	DWORD rand_val;
	DWORD old_rand;

	if (matchWorld (solarSys, world, 0, MATCH_PLANET))
	{
		COUNT nodeI;
		COUNT i;

		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;
			solarSys->SysInfo.PlanetInfo.CurType = 1;
			solarSys->SysInfo.PlanetInfo.CurDensity = 0;
			if (nodeI >= *whichNode
					&& !(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
					& (1L << i)))
				break;
			++nodeI;
		} while (++i < 16);
		*whichNode = nodeI;

		TFB_SeedRandom (old_rand);
		return true;
	}

	if (matchWorld (solarSys, world, 0, 0)
			&& !GET_GAME_STATE (BURVIXESE_BROADCASTERS))
	{
		old_rand = TFB_SeedRandom (
				solarSys->SysInfo.PlanetInfo.ScanSeed[ENERGY_SCAN]);

		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;
		solarSys->SysInfo.PlanetInfo.CurDensity = 0;
		solarSys->SysInfo.PlanetInfo.CurType = 0;
		if (!(solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
				& (1L << 0))
				&& *whichNode == (COUNT)~0)
			*whichNode = 1;
		else
		{
			*whichNode = 0;
			if (solarSys->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN]
					& (1L << 0))
			{
				SET_GAME_STATE (BURVIXESE_BROADCASTERS, 1);
				SET_GAME_STATE (BURV_BROADCASTERS_ON_SHIP, 1);
			}
		}

		TFB_SeedRandom (old_rand);
		return true;
	}

	*whichNode = 0;
	return true;
}
开发者ID:jurchik,项目名称:project6014,代码行数:73,代码来源:genburv.c


示例9: BombWorld

static void
BombWorld (RESPONSE_REF R)
{
	BYTE LastStack;
	RESPONSE_REF pStr[2];

	LastStack = 0;
	pStr[0] = pStr[1] = 0;
	if (PLAYER_SAID (R, why_you_here))
	{
		NPCPhrase (WE_GUARD_BOMB);

		SET_GAME_STATE (BOMB_STACK1, 1);
	}
	else if (PLAYER_SAID (R, what_about_bomb))
	{
		NPCPhrase (ABOUT_BOMB);

		SET_GAME_STATE (BOMB_STACK1, 2);
	}
	else if (PLAYER_SAID (R, give_us_bomb_or_die))
	{
		NPCPhrase (GUARDS_WARN);

		SET_GAME_STATE (BOMB_STACK1, 3);
	}
	else if (PLAYER_SAID (R, demand_bomb))
	{
		NPCPhrase (GUARDS_FIGHT);

		setSegue (Segue_hostile);
		SET_GAME_STATE (UTWIG_HOSTILE, 1);
		SET_GAME_STATE (UTWIG_INFO, 0);
		SET_GAME_STATE (UTWIG_HOME_VISITS, 0);
		SET_GAME_STATE (UTWIG_VISITS, 0);
		SET_GAME_STATE (BOMB_VISITS, 0);
		return;
	}
	else if (PLAYER_SAID (R, may_we_have_bomb))
	{
		NPCPhrase (NO_BOMB);

		LastStack = 1;
		SET_GAME_STATE (BOMB_STACK2, 1);
	}
	else if (PLAYER_SAID (R, please))
	{
		NPCPhrase (SORRY_NO_BOMB);

		SET_GAME_STATE (BOMB_STACK2, 2);
	}
	else if (PLAYER_SAID (R, whats_up_bomb))
	{
		if (GET_GAME_STATE (BOMB_INFO))
			NPCPhrase (GENERAL_INFO_BOMB_2);
		else
		{
			NPCPhrase (GENERAL_INFO_BOMB_1);

			SET_GAME_STATE (BOMB_INFO, 1);
		}

		DISABLE_PHRASE (whats_up_bomb);
	}

	switch (GET_GAME_STATE (BOMB_STACK2))
	{
		case 0:
			pStr[1] = may_we_have_bomb;
			break;
		case 1:
			pStr[1] = please;
			break;
	}
	switch (GET_GAME_STATE (BOMB_STACK1))
	{
		case 0:
			pStr[0] = why_you_here;
			pStr[1] = 0;
			break;
		case 1:
			pStr[0] = what_about_bomb;
			pStr[1] = 0;
			break;
		case 2:
			pStr[0] = give_us_bomb_or_die;
			break;
		case 3:
			pStr[0] = demand_bomb;
			break;
	}

	if (pStr[LastStack])
		Response (pStr[LastStack], BombWorld);
	LastStack ^= 1;
	if (pStr[LastStack])
		Response (pStr[LastStack], BombWorld);

	if (PHRASE_ENABLED (whats_up_bomb) && (GET_GAME_STATE (BOMB_STACK1) > 1))
		Response (whats_up_bomb, BombWorld);
//.........这里部分代码省略.........
开发者ID:njvack,项目名称:uqm-ios,代码行数:101,代码来源:utwigc.c


示例10: Intro

static void
Intro (void)
{
	BYTE NumVisits;

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

		setSegue (Segue_peace);
		return;
	}

	if (GET_GAME_STATE (UTWIG_HOSTILE))
	{
		if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
		{
			NumVisits = GET_GAME_STATE (BOMB_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (HOSTILE_BOMB_HELLO_1);
					break;
				case 1:
					NPCPhrase (HOSTILE_BOMB_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (BOMB_VISITS, NumVisits);
		}
		else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
		{
			NumVisits = GET_GAME_STATE (UTWIG_HOME_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (HOSTILE_HOMEWORLD_HELLO_1);
					break;
				case 1:
					NPCPhrase (HOSTILE_HOMEWORLD_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (UTWIG_HOME_VISITS, NumVisits);
		}
		else
		{
			NumVisits = GET_GAME_STATE (UTWIG_VISITS);
			switch (NumVisits++)
			{
				case 0:
					NPCPhrase (HOSTILE_SPACE_HELLO_1);
					break;
				case 1:
					NPCPhrase (HOSTILE_SPACE_HELLO_2);
					--NumVisits;
					break;
			}
			SET_GAME_STATE (UTWIG_VISITS, NumVisits);
		}

		if (!GET_GAME_STATE (ULTRON_CONDITION)
				|| (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6)))
		{
			setSegue (Segue_hostile);
		}
		else
		{
			Response (hey_wait_got_ultron, ExitConversation);
		}
	}
	else if (CheckAlliance (UTWIG_SHIP) == GOOD_GUY)
	{
		if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
		{
			NumVisits = GET_GAME_STATE (UTWIG_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 (UTWIG_HOME_VISITS, NumVisits);

			AlliedHome ((RESPONSE_REF)0);
		}
		else
		{
			NumVisits = GET_GAME_STATE (UTWIG_SUPOX_MISSION);
			if (NumVisits == 1)
//.........这里部分代码省略.........
开发者ID:njvack,项目名称:uqm-ios,代码行数:101,代码来源:utwigc.c


示例11: NeutralUtwig

static void
NeutralUtwig (RESPONSE_REF R)
{
	BYTE i, LastStack;
	RESPONSE_REF pStr[4];

	LastStack = 0;
	pStr[0] = pStr[1] = pStr[2] = pStr[3] = 0;
	if (PLAYER_SAID (R, we_are_vindicator0))
	{
		NPCPhrase (WOULD_BE_HAPPY_BUT);

		SET_GAME_STATE (UTWIG_STACK1, 1);
	}
	else if (PLAYER_SAID (R, why_sad))
	{
		NPCPhrase (ULTRON_BROKE);

		SET_GAME_STATE (UTWIG_STACK1, 2);
	}
	else if (PLAYER_SAID (R, what_ultron))
	{
		NPCPhrase (GLORIOUS_ULTRON);

		SET_GAME_STATE (UTWIG_STACK1, 3);
	}
	else if (PLAYER_SAID (R, dont_be_babies))
	{
		NPCPhrase (MOCK_OUR_PAIN);

		setSegue (Segue_hostile);
		SET_GAME_STATE (UTWIG_STACK1, 4);
		SET_GAME_STATE (UTWIG_HOSTILE, 1);
		SET_GAME_STATE (UTWIG_INFO, 0);
		SET_GAME_STATE (UTWIG_HOME_VISITS, 0);
		SET_GAME_STATE (UTWIG_VISITS, 0);
		SET_GAME_STATE (BOMB_VISITS, 0);
		return;
	}
	else if (PLAYER_SAID (R, real_sorry_about_ultron))
	{
		NPCPhrase (APPRECIATE_SYMPATHY);

		SET_GAME_STATE (UTWIG_STACK1, 4);
		return;
	}
	else if (PLAYER_SAID (R, what_about_you_1))
	{
		NPCPhrase (ABOUT_US_1);

		LastStack = 2;
		SET_GAME_STATE (UTWIG_WAR_NEWS, 1);
	}
	else if (PLAYER_SAID (R, what_about_you_2))
	{
		NPCPhrase (ABOUT_US_2);

		LastStack = 2;
		StartSphereTracking (SUPOX_SHIP);
		SET_GAME_STATE (UTWIG_WAR_NEWS, 2);
	}
	else if (PLAYER_SAID (R, what_about_you_3))
	{
		NPCPhrase (ABOUT_US_3);
		
		SET_GAME_STATE (UTWIG_WAR_NEWS, 3);
	}
	else if (PLAYER_SAID (R, what_about_urquan_1))
	{
		NPCPhrase (ABOUT_URQUAN_1);

		LastStack = 3;
		SET_GAME_STATE (UTWIG_STACK2, 1);
	}
	else if (PLAYER_SAID (R, what_about_urquan_2))
	{
		NPCPhrase (ABOUT_URQUAN_2);

		SET_GAME_STATE (UTWIG_STACK2, 2);
	}

	switch (GET_GAME_STATE (UTWIG_STACK1))
	{
		case 0:
			{
				UNICODE buf[ALLIANCE_NAME_BUFSIZE];

				GetAllianceName (buf, name_1);
				construct_response (
						shared_phrase_buf,
						we_are_vindicator0,
						GLOBAL_SIS (CommanderName),
						we_are_vindicator1,
						buf,
						we_are_vindicator2,
						(UNICODE*)NULL);
			}
			pStr[0] = we_are_vindicator0;
			break;
		case 1:
//.........这里部分代码省略.........
开发者ID:njvack,项目名称:uqm-ios,代码行数:101,代码来源:utwigc.c


示例12: AlliedHome

static void
AlliedHome (RESPONSE_REF R)
{
	BYTE NumVisits, News;

	News = GET_GAME_STATE (UTWIG_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 (UTWIG_WAR_NEWS, 1);
		}
		else switch (GET_GAME_STATE (UTWIG_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 (UTWIG_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 && EscortFeasibilityStudy (UTWIG_SHIP) != 0)
		Response (can_you_help, ExitConversation);
	Response (bye_allied_homeworld, ExitConversation);
}
开发者ID:njvack,项目名称:uqm-ios,代码行数:84,代码来源:utwigc.c


示例13: ExitConversation

static void
ExitConversation (RESPONSE_REF R)
{
	setSegue (Segue_peace);

	if (PLAYER_SAID (R, bye_neutral))
		NPCPhrase (GOODBYE_NEUTRAL);
	else if (PLAYER_SAID (R, bye_after_space))
		NPCPhrase (GOODBYE_AFTER_SPACE);
	else if (PLAYER_SAID (R, bye_before_space))
		NPCPhrase (GOODBYE_BEFORE_SPACE);
	else if (PLAYER_SAID (R, bye_allied_homeworld))
		NPCPhrase (GOODBYE_ALLIED_HOMEWORLD);
	else if (PLAYER_SAID (R, bye_bomb))
		NPCPhrase (GOODBYE_BOMB);
	else if (PLAYER_SAID (R, demand_bomb))
	{
		NPCPhrase (GUARDS_FIGHT);

		setSegue (Segue_hostile);
	}
	else if (PLAYER_SAID (R, got_ultron)
			|| PLAYER_SAID (R, hey_wait_got_ultron))
	{
		if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 6))
		{
			NPCPhrase (NO_ULTRON_AT_BOMB);

			SET_GAME_STATE (REFUSED_ULTRON_AT_BOMB, 1);
		}
		else
		{
			if (PLAYER_SAID (R, got_ultron))
				NPCPhrase (DONT_WANT_TO_LOOK);
			else
				NPCPhrase (TAUNT_US_BUT_WE_LOOK);
			if (GET_GAME_STATE (ULTRON_CONDITION) < 4)
			{
				switch (GET_GAME_STATE (UTWIG_INFO))
				{
					case 0:
						if (PLAYER_SAID (R, got_ultron))
							NPCPhrase (SICK_TRICK_1);
						else
						{
							NPCPhrase (TRICKED_US_1);

							setSegue (Segue_hostile);
						}
						break;
					case 1:
						if (PLAYER_SAID (R, got_ultron))
							NPCPhrase (SICK_TRICK_2);
						else
						{
							NPCPhrase (TRICKED_US_2);

							setSegue (Segue_hostile);
						}
						break;
				}
				SET_GAME_STATE (UTWIG_INFO, 1);
			}
			else
			{
				NPCPhrase (HAPPY_DAYS);
				if (GET_GAME_STATE (KOHR_AH_FRENZY))
					NPCPhrase (TOO_LATE);
				else
				{
					NPCPhrase (OK_ATTACK_KOHRAH);

					AddEvent (RELATIVE_EVENT, 0, 0, 0, ADVANCE_UTWIG_SUPOX_MISSION);
				}

				SET_GAME_STATE (UTWIG_HAVE_ULTRON, 1);
				SET_GAME_STATE (ULTRON_CONDITION, 5);

				SET_GAME_STATE (UTWIG_VISITS, 0);
				SET_GAME_STATE (SUPOX_VISITS, 0);
				SET_GAME_STATE (UTWIG_HOME_VISITS, 0);
				SET_GAME_STATE (SUPOX_HOME_VISITS, 0);
				SET_GAME_STATE (BOMB_VISITS, 0);

				SET_GAME_STATE (SUPOX_INFO, 0);
				SET_GAME_STATE (UTWIG_INFO, 0);
				SET_GAME_STATE (SUPOX_WAR_NEWS, 0);
				SET_GAME_STATE (UTWIG_WAR_NEWS, 0);
				SET_GAME_STATE (SUPOX_HOSTILE, 0);
				SET_GAME_STATE (UTWIG_HOSTILE, 0);

				SetRaceAllied (UTWIG_SHIP, TRUE);
				SetRaceAllied (SUPOX_SHIP, TRUE);
			}
		}
	}
	else if (PLAYER_SAID (R, can_you_help))
	{
		NPCPhrase (HOW_HELP);
		if (EscortFeasibilityStudy (UTWIG_SHIP) == 0)
//.........这里部分代码省略.........
开发者ID:njvack,项目名称:uqm-ios,代码行数:101,代码来源:utwigc.c


示例14: NoRadioactives

static void
NoRadioactives (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, yes_this_is_supply_ship))
	{
		NPCPhrase (ABOUT_TIME);

		if (GLOBAL_SIS (ElementAmounts[RADIOACTIVE]))
			GiveRadios (0);
		else
		{
			Response (i_lied, NoRadioactives);
			Response (plumb_out, NoRadioactives);
		}
	}
	else
	{
		if (PLAYER_SAID (R, where_can_i_get_radios))
		{
			NPCPhrase (RADIOS_ON_MERCURY);

			DISABLE_PHRASE (where_can_i_get_radios);
		}
		else if (PLAYER_SAID (R, no_but_well_help0))
			NPCPhrase (THE_WHAT_FROM_WHERE);
		else if (PLAYER_SAID (R, what_slave_planet)
				|| PLAYER_SAID (R, i_lied))
			NPCPhrase (DONT_KNOW_WHO_YOU_ARE);
		else if (PLAYER_SAID (R, plumb_out))
			NPCPhrase (WHAT_KIND_OF_IDIOT);
		else if (PLAYER_SAID (R, i_lost_my_lander))
		{
			NPCPhrase (HERE_IS_A_NEW_LANDER);
			++GLOBAL_SIS (NumLanders);
			LockMutex (GraphicsLock);
			DrawLanders ();
			DeltaSISGauges (4, 0, 0);
			UnlockMutex (GraphicsLock);

			SET_GAME_STATE (LANDERS_LOST, 1);
		}
		else if (PLAYER_SAID (R, i_lost_another_lander))
		{
			NPCPhrase (HERE_IS_ANOTHER_LANDER);
			++GLOBAL_SIS (NumLanders);
			LockMutex (GraphicsLock);
			DrawLanders ();
			DeltaSISGauges (4, 0, 0);
			UnlockMutex (GraphicsLock);
		}
		else if (PLAYER_SAID (R, need_fuel_mercury) ||
				PLAYER_SAID (R, need_fuel_luna))
		{
			NPCPhrase (GIVE_FUEL);
			LockMutex (GraphicsLock);
			DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
			UnlockMutex (GraphicsLock);

			SET_GAME_STATE (GIVEN_FUEL_BEFORE, 1);
		}
		else if (PLAYER_SAID (R, need_fuel_again))
		{
			NPCPhrase (GIVE_FUEL_AGAIN);
			LockMutex (GraphicsLock);
			DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
			UnlockMutex (GraphicsLock);
		}

		if (GLOBAL_SIS (ElementAmounts[RADIOACTIVE]))
			GiveRadios (0);
		else
		{
			if (GLOBAL_SIS (NumLanders) == 0
					&& GET_GAME_STATE (CHMMR_BOMB_STATE) < 2)
			{
				if (GET_GAME_STATE (LANDERS_LOST))
					Response (i_lost_another_lander, NoRadioactives);
				else
					Response (i_lost_my_lander, NoRadioactives);
			}
			if (GLOBAL_SIS (FuelOnBoard) < 2 * FUEL_TANK_SCALE)
			{
				if (GET_GAME_STATE (GIVEN_FUEL_BEFORE))
					Response (need_fuel_again, NoRadioactives);
				else
					Response (need_fuel_mercury, NoRadioactives);
			}
	
			Response (ok_i_will_get_radios, ByeBye);
			if (PHRASE_ENABLED (where_can_i_get_radios))
			{
				Response (where_can_i_get_radios, NoRadioactives);
			}
		}
	}
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:96,代码来源:comandr.c


示例15: equipShip

// NB: Ship maximum speed and turning rate aren't updated in
// HyperSpace/QuasiSpace or in melee.
void
equipShip (void)
{
	int i;

	// Don't do anything unless in the full game.
	if (LOBYTE (GLOBAL (CurrentActivity)) == SUPER_MELEE)
		return;

	// Thrusters:
	for (i = 0; i < NUM_DRIVE_SLOTS; i++)
		GLOBAL_SIS (DriveSlots[i]) = FUSION_THRUSTER;

	// Turning jets:
	for (i = 0; i < NUM_JET_SLOTS; i++)
		GLOBAL_SIS (JetSlots[i]) = TURNING_JETS;

	// Shields:
	SET_GAME_STATE (LANDER_SHIELDS,
			(1 << EARTHQUAKE_DISASTER) |
			(1 << BIOLOGICAL_DISASTER) |
			(1 << LIGHTNING_DISASTER) |
			(1 << LAVASPOT_DISASTER));
	// Lander upgrades:
	SET_GAME_STATE (IMPROVED_LANDER_SPEED, 1);
	SET_GAME_STATE (IMPROVED_LANDER_CARGO, 1);
	SET_GAME_STATE (IMPROVED_LANDER_SHOT, 1);

	// Modules:
	if (GET_GAME_STATE (CHMMR_BOMB_STATE) < 2)
	{
		// The Precursor bomb has not been installed.
		// This is the original TFB testing layout.
		i = 0;
		GLOBAL_SIS (ModuleSlots[i++]) = HIGHEFF_FUELSYS;
		GLOBAL_SIS (ModuleSlots[i++]) = HIGHEFF_FUELSYS;
		GLOBAL_SIS (ModuleSlots[i++]) = CREW_POD;
		GLOBAL_SIS (ModuleSlots[i++]) = CREW_POD;
		GLOBAL_SIS (ModuleSlots[i++]) = CREW_POD;
		GLOBAL_SIS (ModuleSlots[i++]) = CREW_POD;
		GLOBAL_SIS (ModuleSlots[i++]) = CREW_POD;
		GLOBAL_SIS (ModuleSlots[i++]) = STORAGE_BAY;
		GLOBAL_SIS (ModuleSlots[i++]) = SHIVA_FURNACE;
		GLOBAL_SIS (ModuleSlots[i++]) = SHIVA_FURNACE;
		GLOBAL_SIS (ModuleSlots[i++]) = DYNAMO_UNIT;
		GLOBAL_SIS (ModuleSlots[i++]) = TRACKING_SYSTEM;
		GLOBAL_SIS (ModuleSlots[i++]) = TRACKING_SYSTEM;
		GLOBAL_SIS (ModuleSlots[i++]) = SHIVA_FURNACE;
		GLOBAL_SIS (ModuleSlots[i++]) = CANNON_WEAPON;
		GLOBAL_SIS (ModuleSlots[i++]) = CANNON_WEAPON;
		
		// Landers:
		GLOBAL_SIS (NumLanders) = MAX_LANDERS;
	}
	else
	{
		// The Precursor bomb has been installed.
		i = NUM_BOMB_MODULES;
		GLOBAL_SIS (ModuleSlots[i++]) = HIGHEFF_FUELSYS;
		GLOBAL_SIS (ModuleSlots[i++]) = CREW_POD;
		GLOBAL_SIS (ModuleSlots[i++]) = SHIVA_FURNACE;
		GLOBAL_SIS (ModuleSlots[i++]) = SHIVA_FURNACE;
		GLOBAL_SIS (ModuleSlots[i++]) = CANNON_WEAPON;
		GLOBAL_SIS (ModuleSlots[i++]) = SHIVA_FURNACE;
	}

	assert (i <= NUM_MODULE_SLOTS);

	// Fill the fuel and crew compartments to the maximum.
	GLOBAL_SIS (FuelOnBoard) = FUEL_RESERVE;
	GLOBAL_SIS (CrewEnlisted) = 0;
	for (i = 0; i < NUM_MODULE_SLOTS; i++)
	{
		switch (GLOBAL_SIS (ModuleSlots[i])) {
			case CREW_POD:
				GLOBAL_SIS (CrewEnlisted) += CREW_POD_CAPACITY;
				break;
			case FUEL_TANK:
				GLOBAL_SIS (FuelOnBoard) += FUEL_TANK_CAPACITY;
				break;
			case HIGHEFF_FUELSYS:
				GLOBAL_SIS (FuelOnBoard) += HEFUEL_TANK_CAPACITY;
				break;
		}
	}

	// Update the maximum speed and turning rate when in interplanetary.
	if (pSolarSysState != NULL)
	{
		// Thrusters:
		pSolarSysState->max_ship_speed = 5 * IP_SHIP_THRUST_INCREMENT;
		for (i = 0; i < NUM_DRIVE_SLOTS; i++)
			if (GLOBAL_SIS (DriveSlots[i] == FUSION_THRUSTER))
				pSolarSysState->max_ship_speed += IP_SHIP_THRUST_INCREMENT;

		// Turning jets:
		pSolarSysState->turn_wait = IP_SHIP_TURN_WAIT;
		for (i = 0; i < NUM_JET_SLOTS; i++)
//.........这里部分代码省略.........
开发者ID:intgr,项目名称:sc2-uqm,代码行数:101,代码来源:uqmdebug.c


示例16: AskAfterRadios

static void
AskAfterRadios (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, i_lost_my_lander))
	{
		NPCPhrase (HERE_IS_A_NEW_LANDER);
		++GLOBAL_SIS (NumLanders);
		LockMutex (GraphicsLock);
		DrawLanders ();
		DeltaSISGauges (4, 0, 0);
		UnlockMutex (GraphicsLock);

		SET_GAME_STATE (LANDERS_LOST, 1);
	}
	else if (PLAYER_SAID (R, i_lost_another_lander))
	{
		NPCPhrase (HERE_IS_ANOTHER_LANDER);
		++GLOBAL_SIS (NumLanders);
		LockMutex (GraphicsLock);
		DrawLanders ();
		DeltaSISGauges (4, 0, 0);
		UnlockMutex (GraphicsLock);
	}
	else if (PLAYER_SAID (R, need_fuel_mercury) ||
			PLAYER_SAID (R, need_fuel_luna))
	{
		NPCPhrase (GIVE_FUEL);
		LockMutex (GraphicsLock);
		DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
		UnlockMutex (GraphicsLock);

		SET_GAME_STATE (GIVEN_FUEL_BEFORE, 1);
	}
	else if (PLAYER_SAID (R, need_fuel_again))
	{
		NPCPhrase (GIVE_FUEL_AGAIN);
		LockMutex (GraphicsLock);
		DeltaSISGauges (0, 5 * FUEL_TANK_SCALE, 0);
		UnlockMutex (GraphicsLock);
	}
	else if (PLAYER_SAID (R, where_get_radios))
	{
		NPCPhrase (RADIOS_ON_MERCURY);

		DISABLE_PHRASE (where_get_radios);
	}

	{
		if (GLOBAL_SIS (NumLanders) == 0
				&& GET_GAME_STATE (CHMMR_BOMB_STATE) < 2)
		{
			if (GET_GAME_STATE (LANDERS_LOST))
				Response (i_lost_another_lander, AskAfterRadios);
			else
				Response (i_lost_my_lander, AskAfterRadios);
		}
		if (GLOBAL_SIS (FuelOnBoard) < 2 * FUEL_TANK_SCALE)
		{
			if (GET_GAME_STATE (GIVEN_FUEL_BEFORE))
				Response (need_fuel_again, AskAfterRadios);
			else
				Response (need_fuel_mercury, AskAfterRadios);
		}
		Response (well_go_get_them_now, ByeBye);
		if (PHRASE_ENABLED (where_get_radios))
		{
			Response (where_get_radios, AskAfterRadios);
		}
	}
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:70,代码来源:comandr.c


示例17: Buy

static void
Buy (RESPONSE_REF R)
{
	if (PLAYER_SAID (R, want_to_buy)
			|| PLAYER_SAID (R, im_ready_to_buy))
	{
		NPCPhrase (READY_TO_SELL);
		if (!GET_GAME_STATE (ROSY_SPHERE))
			NPCPhrase (HAVE_SPHERE);
		if (!GET_GAME_STATE (ARTIFACT_2_ON_SHIP))
			NPCPhrase (HAVE_ART_1);
		if (!GET_GAME_STATE (ARTIFACT_3_ON_SHIP))
			NPCPhrase (HAVE_ART_2);
		NPCPhrase (SHIPS_AND_FUEL);

		SET_GAME_STATE (KNOW_DRUUGE_SLAVERS, 3);
	}
	else if (PLAYER_SAID (R, buy_druuge_ship))
	{
#define SHIP_CREW_COST 100
		if (GLOBAL_SIS (CrewEnlisted) < SHIP_CREW_COST)
			NPCPhrase (NOT_ENOUGH_CREW);
		else if (ActivateStarShip (DRUUGE_SHIP, FEASIBILITY_STUDY) == 0)
			NPCPhrase (NOT_ENOUGH_ROOM);
		else
		{
			LockMutex (GraphicsLock);
			DeltaSISGauges (-SHIP_CREW_COST, 0, 0);
			UnlockMutex (GraphicsLock);
			SlaveryCount += SHIP_CREW_COST;
			ActivateStarShip (DRUUGE_SHIP, 1);

			NPCPhrase (BOUGHT_SHIP);
		}
	}
#define ARTIFACT_CREW_COST 100
	else if (PLAYER_SAID (R, buy_rosy_sphere))
	{
		if (GLOBAL_SIS (CrewEnlisted) < ARTIFACT_CREW_COST)
			NPCPhrase (NOT_ENOUGH_CREW);
		else
		{
			LockMutex (GraphicsLock);
			DeltaSISGauges (-ARTIFACT_CREW_COST, 0, 0);
			UnlockMutex (GraphicsLock);
			SlaveryCount += ARTIFACT_CREW_COST;
			SET_GAME_STATE (ROSY_SPHERE_ON_SHIP, 1);
			SET_GAME_STATE (ROSY_SPHERE, 1);

			NPCPhrase (BOUGHT_SPHERE);
		}
	}
	else if (PLAYER_SAID (R, buy_art_1))
	{
		if (GLOBAL_SIS (CrewEnlisted) < ARTIFACT_CREW_COST)
			NPCPhrase (NOT_ENOUGH_CREW);
		else
		{
			LockMutex (GraphicsLock);
			DeltaSISGauges (-ARTIFACT_CREW_COST, 0, 0);
			UnlockMutex (GraphicsLock);
			SlaveryCount += ARTIFACT_CREW_COST;
			SET_GAME_STATE (ARTIFACT_2_ON_SHIP, 1);

			NPCPhrase (BOUGHT_ART_1);
		}
	}
	else if (PLAYER_SAID (R, buy_art_2))
	{
		if (GLOBAL_SIS (CrewEnlisted) < ARTIFACT_CREW_COST)
			NPCPhrase (NOT_ENOUGH_CREW);
		else
		{
			LockMutex (GraphicsLock);
			DeltaSISGauges (-ARTIFACT_CREW_COST, 0, 0);
			UnlockMutex (GraphicsLock);
			SlaveryCount += ARTIFACT_CREW_COST;
			SET_GAME_STATE (ARTIFACT_3_ON_SHIP, 1);

			NPCPhrase (BOUGHT_ART_2);
		}
	}
	else if (PLAYER_SAID (R, buy_fuel))
	{
#define FUEL_CREW_COST 10
		if (GLOBAL_SIS (CrewEnlisted) < FUEL_CREW_COST)
			NPCPhrase (NOT_ENOUGH_CREW);
		else
		{
			LockMutex (GraphicsLock);
			DeltaSISGauges (-FUEL_CREW_COST,
					FUEL_CREW_COST * FUEL_TANK_SCALE, 0);
			UnlockMutex (GraphicsLock);
			SlaveryCount += FUEL_CREW_COST;

			NPCPhrase (BOUGHT_FUEL);
		}
	}

	Response (buy_druuge_ship, Buy);
//.........这里部分代码省略.........
开发者ID:jurchik,项目名称:project6014,代码行数:101,代码来源:druugec.c


示例18: RevealSelf

static void
RevealSelf (RESPONSE_REF R)
{
	BYTE i, stack;

	stack = 0;
	if (PLAYER_SAID (R, we_are_vindicator0))
	{
		NPCPhrase (THATS_IMPOSSIBLE);

		DISABLE_PHRASE (we_are_vindicator0);
	}
	else if (PLAYER_SAID (R, our_mission_was_secret))
	{
		NPCPhrase (ACKNOWLEDGE_SECRET);

		DISABLE_PHRASE (our_mission_was_secret);
	}
	else if (PLAYER_SAID (R, first_give_info))
	{
		NPCPhrase (ASK_AWAY);

		stack = 1;
		DISABLE_PHRASE (first_give_info);
	}
	else if (PLAYER_SAID (R, whats_this_starbase))
	{
		NPCPhrase (STARBASE_IS);

		stack = 1;
		DISABLE_PHRASE (whats_this_starbase);
	}
	else if (PLAYER_SAID (R, what_about_earth))
	{
		NPCPhrase (HAPPENED_TO_EARTH);

		stack = 1;
		DISABLE_PHRASE (what_about_earth);
	}
	else if (PLAYER_SAID (R, where_are_urquan))
	{
		NPCPhrase (URQUAN_LEFT);

		stack = 1;
		DISABLE_PHRASE (where_are_urquan);
	}
	else if (PLAYER_SAID (R, it_went_away))
		NPCPhrase (DEEP_TROUBLE);
	else if (PLAYER_SAID (R, we_destroyed_it))
		NPCPhrase (GOOD_NEWS);
	else if (PLAYER_SAID (R, what_probe))
		NPCPhrase (SURE_HOPE);

	for (i = 0; i < 2; ++i, stack ^= 1)
	{
		if (stack == 1)
		{
			if (PHRASE_ENABLED (first_give_info))
				Response (first_give_info, RevealSelf);
			else if (PHRASE_ENABLED (whats_this_starbase))
				Response (whats_this_starbase, RevealSelf);
			else if (PHRASE_ENABLED (what_about_earth))
				Response (what_about_earth, RevealSelf);
			else if (PHRASE_ENABLED (where_are_urquan))
				Response (where_are_urquan, RevealSelf);
			else if (PHRASE_ENABLED (what_was_red_thing))
			{
				Response (what_was_red_thing, TellProbe);
			}
		}
		else
		{
			if (PHRASE_ENABLED (we_are_vindicator0))
			{
				construct_response (shared_phrase_buf,
						we_are_vindicator0,
						GLOBAL_SIS (CommanderName),
						we_are_vindicator1,
						GLOBAL_SIS (ShipName),
						we_are_vindicator2,
						(UNICODE*)NULL);
				DoResponsePhrase (we_are_vindicator0, RevealSelf, shared_phrase_buf);
			}
			else if (PHRASE_ENABLED (our_mission_was_secret))
				Response (our_mission_was_secret, RevealSelf);
			else
			{
				if (GET_GAME_STATE (MOONBASE_DESTROYED) == 0)
					Response (we_are_here_to_help, TellMoonBase);
				else
					Response (we_are_here_to_help, BaseDestroyed);
			}
		}
	}
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:95,代码来源:comandr.c


示例19: DoTransaction

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GET_GLOBAL函数代码示例发布时间:2022-05-30
下一篇:
C++ GET_FLOAT_WORD函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap