MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / ProcessPlayers

Function ProcessPlayers

Source/player.cpp:2997–3090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2995}
2996
2997void ProcessPlayers()
2998{
2999 assert(MyPlayer != nullptr);
3000 Player &myPlayer = *MyPlayer;
3001
3002 if (myPlayer.pLvlLoad > 0) {
3003 myPlayer.pLvlLoad--;
3004 }
3005
3006 if (sfxdelay > 0) {
3007 sfxdelay--;
3008 if (sfxdelay == 0) {
3009 switch (sfxdnum) {
3010 case USFX_DEFILER1:
3011 InitQTextMsg(TEXT_DEFILER1);
3012 break;
3013 case USFX_DEFILER2:
3014 InitQTextMsg(TEXT_DEFILER2);
3015 break;
3016 case USFX_DEFILER3:
3017 InitQTextMsg(TEXT_DEFILER3);
3018 break;
3019 case USFX_DEFILER4:
3020 InitQTextMsg(TEXT_DEFILER4);
3021 break;
3022 default:
3023 PlaySFX(sfxdnum);
3024 }
3025 }
3026 }
3027
3028 ValidatePlayer();
3029
3030 for (size_t pnum = 0; pnum < Players.size(); pnum++) {
3031 Player &player = Players[pnum];
3032 if (player.plractive && player.isOnActiveLevel() && (&player == MyPlayer || !player._pLvlChanging)) {
3033 CheckCheatStats(player);
3034
3035 if (!PlrDeathModeOK(player) && (player._pHitPoints >> 6) <= 0) {
3036 SyncPlrKill(player, DeathReason::Unknown);
3037 }
3038
3039 if (&player == MyPlayer) {
3040 if (HasAnyOf(player._pIFlags, ItemSpecialEffect::DrainLife) && leveltype != DTYPE_TOWN) {
3041 ApplyPlrDamage(DamageType::Physical, player, 0, 0, 4);
3042 }
3043 if (HasAnyOf(player._pIFlags, ItemSpecialEffect::NoMana) && player._pManaBase > 0) {
3044 player._pManaBase -= player._pMana;
3045 player._pMana = 0;
3046 RedrawComponent(PanelDrawComponent::Mana);
3047 }
3048 }
3049
3050 bool tplayer = false;
3051 do {
3052 switch (player._pmode) {
3053 case PM_STAND:
3054 case PM_NEWLVL:

Callers 1

GameLogicFunction · 0.85

Calls 15

InitQTextMsgFunction · 0.85
ValidatePlayerFunction · 0.85
CheckCheatStatsFunction · 0.85
PlrDeathModeOKFunction · 0.85
SyncPlrKillFunction · 0.85
HasAnyOfFunction · 0.85
ApplyPlrDamageFunction · 0.85
RedrawComponentFunction · 0.85
DoWalkFunction · 0.85
DoAttackFunction · 0.85
DoRangeAttackFunction · 0.85
DoBlockFunction · 0.85

Tested by

no test coverage detected