本文整理汇总了C++中HUDInitMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ HUDInitMessage函数的具体用法?C++ HUDInitMessage怎么用?C++ HUDInitMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HUDInitMessage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:32,代码来源:trigger.cpp
示例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 ();
}
开发者ID:paud,项目名称:d2x-xl,代码行数:29,代码来源:multimsg.c
示例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;
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:29,代码来源:gamecntl.cpp
示例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 ();
}
开发者ID:paud,项目名称:d2x-xl,代码行数:35,代码来源:multimsg.c
示例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;
}
开发者ID:stephengeorgewest,项目名称:diiscent,代码行数:30,代码来源:multimsg.cpp
示例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;
}
开发者ID:stephengeorgewest,项目名称:diiscent,代码行数:58,代码来源:multimsg.cpp
示例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 ();
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:10,代码来源:cheats.c
示例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);
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:10,代码来源:cheats.c
示例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);
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:10,代码来源:cheats.c
示例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;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:11,代码来源:cheats.c
示例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);
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:12,代码来源:cheats.c
示例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;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:53,代码来源:multimsg.c
示例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]);
}
开发者ID:paud,项目名称:d2x-xl,代码行数:53,代码来源:network_join.cpp
示例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);
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:12,代码来源:cheats.c
示例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 ();
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:13,代码来源:cheats.c
示例16: RobotsKillRobotsCheat
void RobotsKillRobotsCheat (int bVerbose)
{
gameStates.app.cheats.bRobotsKillRobots = !gameStates.app.cheats.bRobotsKillRobots;
if (!gameStates.app.cheats.bRobotsKillRobots) {
if (bVerbose)
HUDInitMessage (TXT_KILL_PLAYER);
}
else {
DoCheatPenalty ();
if (bVerbose)
HUDInitMessage (TXT_RABID_BOTS);
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:13,代码来源:cheats.c
示例17: AhimsaCheat
void AhimsaCheat (int bVerbose)
{
gameStates.app.cheats.bRobotsFiring = !gameStates.app.cheats.bRobotsFiring;
if (gameStates.app.cheats.bRobotsFiring) {
if (bVerbose)
HUDInitMessage (TXT_BOTFIRE_ON);
}
else {
DoCheatPenalty ();
if (bVerbose)
HUDInitMessage (TXT_BOTFIRE_OFF);
}
}
开发者ID:paud,项目名称:d2x-xl,代码行数:13,代码来源:cheats.c
示例18: PickupSuperLaser
int PickupSuperLaser (tObject *objP, int nId, int nPlayer)
{
tPlayer *playerP = gameData.multiplayer.players + nPlayer;
if (playerP->laserLevel < MAX_SUPER_LASER_LEVEL) {
ubyte nOldLevel = playerP->laserLevel;
if (playerP->laserLevel <= MAX_LASER_LEVEL)
playerP->laserLevel = MAX_LASER_LEVEL;
playerP->laserLevel++;
bLastPrimaryWasSuper [LASER_INDEX] = 1;
if (ISLOCALPLAYER (nPlayer)) {
if (gameData.demo.nState == ND_STATE_RECORDING)
NDRecordLaserLevel (nOldLevel, playerP->laserLevel);
PowerupBasic (10, 0, 10, LASER_SCORE, TXT_SUPERBOOST, playerP->laserLevel + 1, nPlayer);
UpdateLaserWeaponInfo ();
if (gameData.weapons.nPrimary != LASER_INDEX)
CheckToUsePrimary (SUPER_LASER_INDEX);
}
return 1;
}
playerP->laserLevel = MAX_SUPER_LASER_LEVEL;
if (nPlayer == gameData.multiplayer.nLocalPlayer)
HUDInitMessage (TXT_LASER_MAXEDOUT);
if (IsMultiGame)
return 0;
return PickupEnergyBoost (objP, nPlayer);
}
开发者ID:paud,项目名称:d2x-xl,代码行数:28,代码来源:pickupweapon.cpp
示例19: KillRobotsCheat
void KillRobotsCheat (int bVerbose)
{
if (bVerbose)
HUDInitMessage (TXT_ARMAGEDDON);
KillAllRobots (bVerbose);
ShakerRockStuff ();
}
开发者ID:paud,项目名称:d2x-xl,代码行数:7,代码来源:cheats.c
示例20: ApplyCloak
int ApplyCloak (int bForce, int nPlayer)
{
player *playerP = gameData.multi.players + ((nPlayer < 0) ? gameData.multi.nLocalPlayer : nPlayer);
if (!(bForce || ((gameOpts->gameplay.bInventory && !IsMultiGame) && playerP->nCloaks)))
return 0;
if (playerP->flags & PLAYER_FLAGS_CLOAKED) {
if (LOCALPLAYER (nPlayer))
HUDInitMessage ("%s %s!", TXT_ALREADY_ARE, TXT_CLOAKED);
return 0;
}
if (gameOpts->gameplay.bInventory && !IsMultiGame)
playerP->nCloaks--;
if (LOCALPLAYER (nPlayer)) {
playerP->cloak_time = gameData.app.xGameTime; // Not!changed by awareness events (like player fires laser).
playerP->flags |= PLAYER_FLAGS_CLOAKED;
AIDoCloakStuff ();
#ifdef NETWORK
if (gameData.app.nGameMode & GM_MULTI)
MultiSendCloak ();
#endif
PowerupBasic (-10,-10,-10, CLOAK_SCORE, "%s!", TXT_CLOAKING_DEVICE);
UsePowerup (-POW_CLOAK);
}
return 1;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:26,代码来源:powerup.c
注:本文中的HUDInitMessage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论