本文整理汇总了C++中HUDInitMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ HUDInitMessage函数的具体用法?C++ HUDInitMessage怎么用?C++ HUDInitMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HUDInitMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HUDInitMessage
bool CTrigger::DoSecretExit (int nPlayer)
{
if (nPlayer != gameData.multiplayer.nLocalPlayer)
return false;
if ((LOCALPLAYER.shields < 0) || gameStates.app.bPlayerIsDead)
return false;
if (gameData.app.nGameMode & GM_MULTI) {
HUDInitMessage (TXT_TELEPORT_MULTI);
audio.PlaySound (SOUND_BAD_SELECTION);
return false;
}
bool bDisabled = PSecretLevelDestroyed () == 1;
if (gameData.demo.nState == ND_STATE_RECORDING) // record whether we're really going to the secret level
NDRecordSecretExitBlown (bDisabled);
if (bDisabled && (gameData.demo.nState != ND_STATE_PLAYBACK)) {
HUDInitMessage (TXT_SECRET_DESTROYED);
audio.PlaySound (SOUND_BAD_SELECTION);
return false;
}
if (gameData.demo.nState == ND_STATE_RECORDING) // stop demo recording
gameData.demo.nState = ND_STATE_PAUSED;
audio.StopAll (); //kill the sounds
audio.PlaySound (SOUND_SECRET_EXIT);
paletteManager.DisableEffect ();
EnterSecretLevel ();
gameData.reactor.bDestroyed = 0;
return true;
}
示例2: MultiSendMacro
void MultiSendMacro (int key)
{
if (!(gameOpts->multi.bUseMacros && (gameData.app.nGameMode & GM_MULTI)))
return;
switch (key) {
case KEY_F9:
key = 0;
break;
case KEY_F10:
key = 1;
break;
case KEY_F11:
key = 2;
break;
case KEY_F12:
key = 3;
break;
default:
Int3 ();
}
if (!gameData.multigame.msg.szMacro [key][0]) {
HUDInitMessage (TXT_NO_MACRO);
return;
}
strcpy (gameData.multigame.msg.szMsg, gameData.multigame.msg.szMacro [key]);
gameData.multigame.msg.nReceiver = 100;
HUDInitMessage ("%s '%s'", TXT_SENDING, gameData.multigame.msg.szMsg);
MultiMessageFeedback ();
}
示例3: TransferEnergyToShield
void TransferEnergyToShield(fix time)
{
fix e; //how much energy gets transfered
static fix last_playTime=0;
if (time <= 0)
return;
e = min (time * CONVERTER_RATE, LOCALPLAYER.energy - INITIAL_ENERGY);
e = min (e, (MAX_SHIELDS - LOCALPLAYER.shields) * CONVERTER_SCALE);
if (e <= 0) {
if (LOCALPLAYER.energy <= INITIAL_ENERGY)
HUDInitMessage (TXT_TRANSFER_ENERGY, X2I(INITIAL_ENERGY));
else
HUDInitMessage (TXT_TRANSFER_SHIELDS);
return;
}
LOCALPLAYER.energy -= e;
LOCALPLAYER.shields += e / CONVERTER_SCALE;
MultiSendShields ();
gameStates.app.bUsingConverter = 1;
if (last_playTime > gameData.time.xGame)
last_playTime = 0;
if (gameData.time.xGame > last_playTime+CONVERTER_SOUND_DELAY) {
audio.PlaySound(SOUND_CONVERT_ENERGY);
last_playTime = gameData.time.xGame;
}
}
示例4: MultiSendMsgEnd
void MultiSendMsgEnd ()
{
gameData.multigame.msg.nReceiver = 100;
if (!strnicmp (gameData.multigame.msg.szMsg, TXT_NAMES_OFF, 6)) {
bNameReturning = 1-bNameReturning;
HUDInitMessage (TXT_NAMERET, bNameReturning? TXT_NR_ACTIVE : TXT_NR_DISABLED);
}
else if (!strnicmp (gameData.multigame.msg.szMsg, TXT_HANDICAP, 9)) {
if (HandicapPlayer ())
return;
}
else if (!strnicmp (gameData.multigame.msg.szMsg, TXT_BOMBS_OFF, 7))
netGame.DoSmartMine = 0;
else if (!(gameStates.render.cockpit.bShowPingStats || strnicmp (gameData.multigame.msg.szMsg, TXT_PING, 5))) {
if (PingPlayer (-1))
return;
}
else if (!strnicmp (gameData.multigame.msg.szMsg, TXT_MOVE, 5)) {
if (MovePlayer ())
return;
}
else if (!strnicmp (gameData.multigame.msg.szMsg, TXT_KICK, 5) && (gameData.app.nGameMode & GM_NETWORK)) {
if (KickPlayer (0))
return;
}
else if (!strnicmp (gameData.multigame.msg.szMsg, TXT_BAN, 4) && (gameData.app.nGameMode & GM_NETWORK)) {
if (KickPlayer (1))
return;
}
else
HUDInitMessage ("%s '%s'", TXT_SENDING, gameData.multigame.msg.szMsg);
MultiSendMessage ();
MultiMessageFeedback ();
MultiSendMsgQuit ();
}
示例5: MovePlayer
int MovePlayer (void)
{
int i;
if ((gameData.app.nGameMode & GM_NETWORK) && (gameData.app.nGameMode & GM_TEAM)) {
int name_index = 5;
if (strlen (gameData.multigame.msg.szMsg) > 5)
while (gameData.multigame.msg.szMsg [name_index] == ' ')
name_index++;
if (!NetworkIAmMaster ()) {
HUDInitMessage (TXT_MOVE_RIGHTS, gameData.multiplayer.players [NetworkWhoIsMaster ()].callsign);
return 1;
}
if (strlen (gameData.multigame.msg.szMsg) <= (size_t) name_index) {
HUDInitMessage (TXT_MOVE_NAME);
return 1;
}
for (i = 0; i < gameData.multiplayer.nPlayers; i++)
if ((!strnicmp (gameData.multiplayer.players [i].callsign, &gameData.multigame.msg.szMsg [name_index], strlen (gameData.multigame.msg.szMsg)-name_index)) && (gameData.multiplayer.players [i].connected)) {
if ((gameData.app.nGameMode & GM_CAPTURE) && (gameData.multiplayer.players [i].flags & PLAYER_FLAGS_FLAG)) {
HUDInitMessage (TXT_MOVE_FLAG);
return 1;
}
SetTeam (i, -1);
break;
}
}
return 0;
}
示例6: KickPlayer
int KickPlayer (int bBan)
{
int i, name_index = 5 - bBan;
const char *pszKick = GT (589 + bBan);
if (strlen (gameData.multigame.msg.szMsg) > 5)
while (gameData.multigame.msg.szMsg [name_index] == ' ')
name_index++;
if (!NetworkIAmMaster ()) {
HUDInitMessage (TXT_KICK_RIGHTS, gameData.multiplayer.players [NetworkWhoIsMaster ()].callsign, pszKick);
MultiSendMsgQuit ();
return 1;
}
if (strlen (gameData.multigame.msg.szMsg) <= (size_t) name_index) {
HUDInitMessage (TXT_KICK_NAME, pszKick);
MultiSendMsgQuit ();
return 1;
}
if (gameData.multigame.msg.szMsg [name_index] == '#' && ::isdigit (gameData.multigame.msg.szMsg [name_index+1])) {
int players [MAX_PLAYERS];
int listpos = gameData.multigame.msg.szMsg [name_index+1] - '0';
if (gameData.multigame.kills.bShowList == 1 || gameData.multigame.kills.bShowList == 2) {
if (listpos == 0 || listpos >= gameData.multiplayer.nPlayers) {
HUDInitMessage (TXT_KICK_PLR, pszKick);
MultiSendMsgQuit ();
return 1;
}
MultiGetKillList (players);
i = players [listpos];
if ((i != gameData.multiplayer.nLocalPlayer) && (gameData.multiplayer.players [i].connected))
goto kick_player;
}
else
HUDInitMessage (TXT_KICK_NUMBER, pszKick);
MultiSendMsgQuit ();
return 1;
}
for (i = 0; i < gameData.multiplayer.nPlayers; i++)
if ((!strnicmp (gameData.multiplayer.players [i].callsign, &gameData.multigame.msg.szMsg [name_index], strlen (gameData.multigame.msg.szMsg)-name_index)) && (i != gameData.multiplayer.nLocalPlayer) && (gameData.multiplayer.players [i].connected)) {
kick_player:;
if (gameStates.multi.nGameType >= IPX_GAME)
NetworkDumpPlayer (
netPlayers.m_info.players [i].network.ipx.server,
netPlayers.m_info.players [i].network.ipx.node,
7);
HUDInitMessage (TXT_DUMPING, gameData.multiplayer.players [i].callsign);
if (bBan)
banList.Add (gameData.multiplayer.players [i].callsign);
MultiSendMsgQuit ();
return 1;
}
return 0;
}
示例7: TurboCheat
void TurboCheat (void)
{
gameStates.app.cheats.bTurboMode = !gameStates.app.cheats.bTurboMode;
if (!gameStates.app.cheats.bTurboMode)
HUDInitMessage (TXT_DILATED);
else {
HUDInitMessage (TXT_SWOOSH);
DoCheatPenalty ();
}
}
示例8: AhimsaCheat
void AhimsaCheat (void)
{
gameStates.app.cheats.bRobotsFiring = !gameStates.app.cheats.bRobotsFiring;
if (gameStates.app.cheats.bRobotsFiring)
HUDInitMessage (TXT_BOTFIRE_ON);
else {
DoCheatPenalty();
HUDInitMessage (TXT_BOTFIRE_OFF);
}
}
示例9: RobotsKillRobotsCheat
void RobotsKillRobotsCheat (void)
{
gameStates.app.cheats.bRobotsKillRobots = !gameStates.app.cheats.bRobotsKillRobots;
if (!gameStates.app.cheats.bRobotsKillRobots)
HUDInitMessage (TXT_KILL_PLAYER);
else {
DoCheatPenalty ();
HUDInitMessage (TXT_RABID_BOTS);
}
}
示例10: UnlockAllCheat
void UnlockAllCheat (void)
{
#if 1//def _DEBUG
UnlockAllWalls (!gameStates.app.cheats.nUnlockLevel);
HUDInitMessage (!gameStates.app.cheats.nUnlockLevel ? TXT_ROBBING_BANK : TXT_LET_ME_OVER);
#else
UnlockAllWalls (gameStates.app.bD1Mission || !gameStates.app.cheats.nUnlockLevel);
HUDInitMessage ((gameStates.app.bD1Mission || !gameStates.app.cheats.nUnlockLevel) ? TXT_ROBBING_BANK : TXT_LET_ME_OVER);
#endif
gameStates.app.cheats.nUnlockLevel = 1;
}
示例11: BuddyDudeCheat
void BuddyDudeCheat (void)
{
gameStates.app.cheats.bMadBuddy = !gameStates.app.cheats.bMadBuddy;
if (gameStates.app.cheats.bMadBuddy) {
strcpy (gameData.escort.szName, "Wingnut");
HUDInitMessage (TXT_GB_ANGRY, gameData.escort.szName);
}
else {
strcpy(gameData.escort.szName, gameData.escort.szRealName);
HUDInitMessage (TXT_GB_CALM, gameData.escort.bMayTalk);
}
}
示例12: MovePlayer
int MovePlayer (void)
{
int i;
if ((gameData.app.nGameMode & GM_NETWORK) && (gameData.app.nGameMode & GM_TEAM)) {
int name_index = 5;
if (strlen (gameData.multigame.msg.szMsg) > 5)
while (gameData.multigame.msg.szMsg [name_index] == ' ')
name_index++;
if (!NetworkIAmMaster ()) {
HUDInitMessage (TXT_MOVE_RIGHTS, gameData.multiplayer.players [NetworkWhoIsMaster ()].callsign);
return 1;
}
if (strlen (gameData.multigame.msg.szMsg) <= (size_t) name_index) {
HUDInitMessage (TXT_MOVE_NAME);
return 1;
}
for (i = 0; i < gameData.multiplayer.nPlayers; i++)
if ((!strnicmp (gameData.multiplayer.players [i].callsign, &gameData.multigame.msg.szMsg [name_index], strlen (gameData.multigame.msg.szMsg)-name_index)) && (gameData.multiplayer.players [i].connected)) {
if ((gameData.app.nGameMode & GM_CAPTURE) && (gameData.multiplayer.players [i].flags & PLAYER_FLAGS_FLAG)) {
HUDInitMessage (TXT_MOVE_FLAG);
return 1;
}
#if 1
SetTeam (i, -1);
#else
#if 0
if (netGame.teamVector & (1<<i))
netGame.teamVector&= (~ (1<<i));
else
netGame.teamVector|= (1<<i);
#else
netGame.teamVector ^= (1<<i);
#endif
for (t = 0;t<gameData.multiplayer.nPlayers;t++)
if (gameData.multiplayer.players [t].connected)
MultiResetObjectTexture (gameData.objs.objects + gameData.multiplayer.players [t].nObject);
NetworkSendNetgameUpdate ();
sprintf (gameData.multigame.msg.szMsg, TXT_TEAMCHANGE3, gameData.multiplayer.players [i].callsign);
if (i == gameData.multiplayer.nLocalPlayer) {
HUDInitMessage (TXT_TEAMCHANGE1);
ResetCockpit ();
}
else
HUDInitMessage (TXT_TEAMCHANGE2, gameData.multiplayer.players [i].callsign);
#endif
break;
}
}
return 0;
}
示例13: NetworkNewPlayer
void NetworkNewPlayer (tSequencePacket *their)
{
int nObject;
int nPlayer;
nPlayer = their->player.connected;
Assert (nPlayer >= 0);
Assert (nPlayer < gameData.multiplayer.nMaxPlayers);
nObject = gameData.multiplayer.players [nPlayer].nObject;
if (gameData.demo.nState == ND_STATE_RECORDING)
NDRecordMultiConnect (nPlayer, nPlayer == gameData.multiplayer.nPlayers, their->player.callsign);
memcpy (gameData.multiplayer.players [nPlayer].callsign, their->player.callsign, CALLSIGN_LEN+1);
memcpy (netPlayers.players [nPlayer].callsign, their->player.callsign, CALLSIGN_LEN+1);
ClipRank ((char *) &their->player.rank);
netPlayers.players [nPlayer].rank = their->player.rank;
netPlayers.players [nPlayer].versionMajor = their->player.versionMajor;
netPlayers.players [nPlayer].versionMinor = their->player.versionMinor;
NetworkCheckForOldVersion ((char) nPlayer);
if (gameStates.multi.nGameType >= IPX_GAME) {
if ((* (uint *)their->player.network.ipx.server) != 0)
IpxGetLocalTarget (
their->player.network.ipx.server,
their->player.network.ipx.node,
gameData.multiplayer.players [nPlayer].netAddress);
else
memcpy (gameData.multiplayer.players [nPlayer].netAddress, their->player.network.ipx.node, 6);
}
memcpy (&netPlayers.players [nPlayer].network, &their->player.network, sizeof (tNetworkInfo));
gameData.multiplayer.players [nPlayer].nPacketsGot = 0;
gameData.multiplayer.players [nPlayer].connected = 1;
gameData.multiplayer.players [nPlayer].netKillsTotal = 0;
gameData.multiplayer.players [nPlayer].netKilledTotal = 0;
memset (gameData.multigame.kills.matrix [nPlayer], 0, MAX_PLAYERS * sizeof (short));
gameData.multiplayer.players [nPlayer].score = 0;
gameData.multiplayer.players [nPlayer].flags = 0;
gameData.multiplayer.players [nPlayer].nKillGoalCount = 0;
if (nPlayer == gameData.multiplayer.nPlayers) {
gameData.multiplayer.nPlayers++;
netGame.nNumPlayers = gameData.multiplayer.nPlayers;
}
DigiPlaySample (SOUND_HUD_MESSAGE, F1_0);
ClipRank ((char *) &their->player.rank);
if (gameOpts->multi.bNoRankings)
HUDInitMessage ("'%s' %s\n", their->player.callsign, TXT_JOINING);
else
HUDInitMessage ("%s'%s' %s\n", pszRankStrings [their->player.rank], their->player.callsign, TXT_JOINING);
MultiMakeGhostPlayer (nPlayer);
GetPlayerSpawn (GetRandomPlayerPosition (), OBJECTS + gameData.multiplayer.players [nPlayer].nObject);
MultiSendScore ();
MultiSortKillList ();
// CreatePlayerAppearanceEffect (&OBJECTS [nObject]);
}
示例14: RapidFireCheat
void RapidFireCheat (void)
{
if (gameStates.app.cheats.bLaserRapidFire) {
gameStates.app.cheats.bLaserRapidFire = 0;
HUDInitMessage("%s", TXT_RAPIDFIRE_OFF);
}
else {
gameStates.app.cheats.bLaserRapidFire = 0xbada55;
DoCheatPenalty ();
HUDInitMessage("%s", TXT_RAPIDFIRE_ON);
}
}
示例15: TurboCheat
void TurboCheat (int bVerbose)
{
gameStates.app.cheats.bTurboMode = !gameStates.app.cheats.bTurboMode;
if (!gameStates.app.cheats.bTurboMode) {
if (bVerbose)
HUDInitMessage (TXT_DILATED);
}
else {
if (bVerbose)
HUDInitMessage (TXT_SWOOSH);
DoCheatPenalty ();
}
}