Mercurial > mm7
comparison Player.cpp @ 1258:eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
author | Grumpy7 |
---|---|
date | Wed, 12 Jun 2013 03:59:08 +0200 |
parents | 7ef8ae7ce42a |
children | d6e5b6b76612 |
comparison
equal
deleted
inserted
replaced
1255:7e5e328454c7 | 1258:eb1a22f7dfef |
---|---|
7869 | 7869 |
7870 //----- (0044A5CB) -------------------------------------------------------- | 7870 //----- (0044A5CB) -------------------------------------------------------- |
7871 void Player::SetVariable(enum VariableType var_type, signed int var_value) | 7871 void Player::SetVariable(enum VariableType var_type, signed int var_value) |
7872 { | 7872 { |
7873 signed int currPlayerId; // ebx@1 | 7873 signed int currPlayerId; // ebx@1 |
7874 Player *unused4; // esi@1 | 7874 Player *v4_unused; // esi@1 |
7875 unsigned int v5; // edi@1 | 7875 unsigned int v5_unused; // edi@1 |
7876 unsigned int v6; // esi@13 | 7876 unsigned int v6; // esi@13 |
7877 unsigned int v7; // esi@14 | 7877 unsigned int v7; // esi@14 |
7878 signed int v8; // eax@17 | 7878 signed int v8_unused; // eax@17 |
7879 ItemGen *v9; // ecx@17 | 7879 ItemGen *v9; // ecx@17 |
7880 int v10; // eax@21 | 7880 int v10; // eax@21 |
7881 signed int v11; // eax@30 | 7881 signed int v11; // eax@30 |
7882 Player *unused12; // ecx@44 | 7882 Player *unused12; // ecx@44 |
7883 char *v13; // ecx@45 | 7883 char *v13; // ecx@45 |
7895 signed int v25; // eax@172 | 7895 signed int v25; // eax@172 |
7896 int v26; // [sp-8h] [bp-3Ch]@84 | 7896 int v26; // [sp-8h] [bp-3Ch]@84 |
7897 signed int unused27; // [sp-4h] [bp-38h]@4 | 7897 signed int unused27; // [sp-4h] [bp-38h]@4 |
7898 int v28; // [sp-4h] [bp-38h]@84 | 7898 int v28; // [sp-4h] [bp-38h]@84 |
7899 ItemGen item; // [sp+Ch] [bp-28h]@52 | 7899 ItemGen item; // [sp+Ch] [bp-28h]@52 |
7900 char v30; // [sp+32h] [bp-2h]@1 | 7900 char v30_drawanim; // [sp+32h] [bp-2h]@1 |
7901 char v31; // [sp+33h] [bp-1h]@1 | 7901 char v31_playsound; // [sp+33h] [bp-1h]@1 |
7902 | 7902 |
7903 v30 = 0; | 7903 v30_drawanim = 0; |
7904 v31 = 0; | 7904 v31_playsound = 0; |
7905 v5 = 0; | |
7906 | 7905 |
7907 currPlayerId = -1; | 7906 currPlayerId = -1; |
7908 for (int i = 1; i <= 4; i++) //TODO: add a member variable for playerid in the future | 7907 for (int i = 1; i <= 4; i++) //TODO: add a member variable for playerid in the future |
7909 { | 7908 { |
7910 if ( this == pPlayers[i] ) | 7909 if ( this == pPlayers[i] ) |
7977 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), | 7976 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
7978 v23) ) | 7977 v23) ) |
7979 return; | 7978 return; |
7980 bFlashHistoryBook = 1; | 7979 bFlashHistoryBook = 1; |
7981 } | 7980 } |
7982 LABEL_172: | |
7983 v25 = 8 * currPlayerId + 400; | 7981 v25 = 8 * currPlayerId + 400; |
7984 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); | 7982 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); |
7985 pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5); | 7983 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); |
7986 return; | 7984 return; |
7987 } | 7985 } |
7988 if ( var_type != VAR_NumDeaths ) | 7986 if ( var_type != VAR_NumDeaths ) |
7989 { | 7987 { |
7990 switch ( var_type ) | 7988 switch ( var_type ) |
8008 pParty->uNumArenaLordWins = var_value; | 8006 pParty->uNumArenaLordWins = var_value; |
8009 break; | 8007 break; |
8010 } | 8008 } |
8011 return; | 8009 return; |
8012 } | 8010 } |
8013 pParty->uNumDeaths = var_value; | 8011 else |
8014 LABEL_168: | 8012 { |
8015 if (v30 == 1) | 8013 pParty->uNumDeaths = var_value; |
8016 { | 8014 DrawPlayerBuffAnimBasedOnCondition(v30_drawanim == 1, currPlayerId); |
8017 LABEL_169: | 8015 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); |
8018 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); | |
8019 } | |
8020 LABEL_170: | |
8021 if ( v31 != 1 ) | |
8022 return; | 8016 return; |
8023 v5 = 0; | 8017 } |
8024 goto LABEL_172; | |
8025 } | 8018 } |
8026 if ( var_type == VAR_AutoNotes ) | 8019 if ( var_type == VAR_AutoNotes ) |
8027 { | 8020 { |
8028 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_autonote_bits[((signed __int16)var_value - 1) >> 3]) | 8021 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_autonote_bits[((signed __int16)var_value - 1) >> 3]) |
8029 //&& (&dword_723718_autonote_related)[8 * a3] ) | 8022 //&& (&dword_723718_autonote_related)[8 * a3] ) |
8030 && pAutonoteTxt[var_value-1].pText ) | 8023 && pAutonoteTxt[var_value-1].pText ) |
8031 { | 8024 { |
8032 v20 = pPlayers[currPlayerId + 1]; | 8025 v20 = pPlayers[currPlayerId + 1]; |
8033 v30 = 1; | 8026 v30_drawanim = 1; |
8034 v20->PlaySound(SPEECH_96, 0); | 8027 v20->PlaySound(SPEECH_96, 0); |
8035 v21 = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3]; | 8028 v21 = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3]; |
8036 bFlashAutonotesBook = 1; | 8029 bFlashAutonotesBook = 1; |
8037 _506568_autonote_type = v21; | 8030 _506568_autonote_type = v21; |
8038 } | 8031 } |
8039 _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u); | 8032 _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u); |
8040 v31 = 1; | 8033 v31_playsound = 1; |
8041 goto LABEL_168; | 8034 DrawPlayerBuffAnimBasedOnCondition(v30_drawanim == 1, currPlayerId); |
8035 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); | |
8036 return; | |
8042 } | 8037 } |
8043 if ( var_type <= VAR_BaseLuck ) | 8038 if ( var_type <= VAR_BaseLuck ) |
8044 { | 8039 { |
8045 switch ( var_type ) | 8040 switch ( var_type ) |
8046 { | 8041 { |
8049 goto LABEL_124; | 8044 goto LABEL_124; |
8050 case VAR_Class: | 8045 case VAR_Class: |
8051 this->classType = (PLAYER_CLASS_TYPE)var_value; | 8046 this->classType = (PLAYER_CLASS_TYPE)var_value; |
8052 if ( (char)var_value == PLAYER_CLASS_LICH ) | 8047 if ( (char)var_value == PLAYER_CLASS_LICH ) |
8053 { | 8048 { |
8054 v8 = 0; | 8049 v9 = NULL; |
8055 v9 = this->pInventoryItems; | 8050 for (int i = 0; i < 138; i++) |
8056 while ( v9->uItemID != 615 ) | |
8057 { | 8051 { |
8058 ++v8; | 8052 v9 = &this->pInventoryItems[i]; |
8059 ++v9; | 8053 if (v9->uItemID == 615) |
8060 if ( v8 >= 138 ) | 8054 break; |
8061 goto LABEL_22; | |
8062 } | 8055 } |
8063 v10 = (int)((char *)this + 36 * v8); | 8056 if (v9 != NULL || v9->uItemID != 615) |
8064 *(int *)(v10 + 532) = 601; | 8057 { |
8065 *(char *)(v10 + 558) = currPlayerId + 1; | 8058 v10 = (int)((char *)this + 36 * 138); //originally 36 * v8. the code got to this condition only if v8 was equal to 138 |
8066 LABEL_22: | 8059 *(int *)(v10 + 532) = 601; |
8060 *(char *)(v10 + 558) = currPlayerId + 1; | |
8061 } | |
8067 if ( this->sResFireBase < 20 ) | 8062 if ( this->sResFireBase < 20 ) |
8068 this->sResFireBase = 20; | 8063 this->sResFireBase = 20; |
8069 if ( this->sResAirBase < 20 ) | 8064 if ( this->sResAirBase < 20 ) |
8070 this->sResAirBase = 20; | 8065 this->sResAirBase = 20; |
8071 if ( this->sResWaterBase < 20 ) | 8066 if ( this->sResWaterBase < 20 ) |
8118 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & | 8113 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & |
8119 pPlayers[currPlayerId + 1]->_guilds_member_bits[((signed __int16)var_value - 1)/ 8]) | 8114 pPlayers[currPlayerId + 1]->_guilds_member_bits[((signed __int16)var_value - 1)/ 8]) |
8120 //&& dword_723E80_award_related[2 * a3] ) | 8115 //&& dword_723E80_award_related[2 * a3] ) |
8121 && pAwards[var_value].pText ) | 8116 && pAwards[var_value].pText ) |
8122 { | 8117 { |
8123 v30 = 1; | 8118 v30_drawanim = 1; |
8124 v31 = 1; | 8119 v31_playsound = 1; |
8125 pPlayers[currPlayerId + 1]->PlaySound(SPEECH_96, 0); | 8120 pPlayers[currPlayerId + 1]->PlaySound(SPEECH_96, 0); |
8126 } | 8121 } |
8127 _449B7E_toggle_bit((unsigned char *)this->_guilds_member_bits, var_value, 1u); | 8122 _449B7E_toggle_bit((unsigned char *)this->_guilds_member_bits, var_value, 1u); |
8128 goto LABEL_168; | 8123 DrawPlayerBuffAnimBasedOnCondition(v30_drawanim == 1, currPlayerId); |
8124 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); | |
8125 return; | |
8129 case VAR_Experience: | 8126 case VAR_Experience: |
8130 this->uExperience = var_value; | 8127 this->uExperience = var_value; |
8131 goto LABEL_124; | 8128 goto LABEL_124; |
8132 case VAR_QBits_QuestsDone: | 8129 case VAR_QBits_QuestsDone: |
8133 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) | 8130 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) |
8134 // && (&dword_722F10)[4 * a3] ) | 8131 // && (&dword_722F10)[4 * a3] ) |
8135 && pQuestTable[var_value-1] ) | 8132 && pQuestTable[var_value-1] ) |
8136 { | 8133 { |
8137 v14 = pPlayers[currPlayerId + 1]; | 8134 v14 = pPlayers[currPlayerId + 1]; |
8138 bFlashQuestBook = 1; | 8135 bFlashQuestBook = 1; |
8139 v30 = 1; | 8136 v30_drawanim = 1; |
8140 v31 = 1; | 8137 v31_playsound = 1; |
8141 v14->PlaySound(SPEECH_93, 0); | 8138 v14->PlaySound(SPEECH_93, 0); |
8142 } | 8139 } |
8143 v13 = (char *)pParty->_quest_bits; | 8140 v13 = (char *)pParty->_quest_bits; |
8144 LABEL_51: | 8141 LABEL_51: |
8145 _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u); | 8142 _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u); |
8146 if (( v30 != 1 )&&( v31 != 1 )) | 8143 DrawPlayerBuffAnimBasedOnCondition(v30_drawanim == 1, currPlayerId); |
8147 return; | 8144 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); |
8148 else | |
8149 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); | |
8150 if ( v31 != 1 ) | |
8151 return; | |
8152 v25 = 8 * currPlayerId + 400; | |
8153 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); | |
8154 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); | |
8155 return; | 8145 return; |
8156 case VAR_PlayerItemInHands: | 8146 case VAR_PlayerItemInHands: |
8157 item.Reset(); | 8147 item.Reset(); |
8158 item.Reset(); | 8148 item.Reset(); |
8159 item.uItemID = var_value; | 8149 item.uItemID = var_value; |
8196 goto LABEL_72; | 8186 goto LABEL_72; |
8197 case VAR_LuckBonus: | 8187 case VAR_LuckBonus: |
8198 goto LABEL_73; | 8188 goto LABEL_73; |
8199 case VAR_BaseMight: | 8189 case VAR_BaseMight: |
8200 this->uMight = (unsigned __int8)var_value; | 8190 this->uMight = (unsigned __int8)var_value; |
8201 goto LABEL_84; | 8191 v28 = 0; |
8192 v26 = 92; | |
8193 goto LABEL_112; | |
8202 case VAR_BaseIntellect: | 8194 case VAR_BaseIntellect: |
8203 this->uIntelligence = (unsigned __int8)var_value; | 8195 this->uIntelligence = (unsigned __int8)var_value; |
8204 goto LABEL_84; | 8196 v28 = 0; |
8197 v26 = 92; | |
8198 goto LABEL_112; | |
8205 case VAR_BasePersonality: | 8199 case VAR_BasePersonality: |
8206 this->uWillpower = (unsigned __int8)var_value; | 8200 this->uWillpower = (unsigned __int8)var_value; |
8207 goto LABEL_84; | 8201 v28 = 0; |
8202 v26 = 92; | |
8203 goto LABEL_112; | |
8208 case VAR_BaseEndurance: | 8204 case VAR_BaseEndurance: |
8209 this->uEndurance = (unsigned __int8)var_value; | 8205 this->uEndurance = (unsigned __int8)var_value; |
8210 goto LABEL_84; | 8206 v28 = 0; |
8207 v26 = 92; | |
8208 goto LABEL_112; | |
8211 case VAR_BaseSpeed: | 8209 case VAR_BaseSpeed: |
8212 this->uSpeed = (unsigned __int8)var_value; | 8210 this->uSpeed = (unsigned __int8)var_value; |
8213 goto LABEL_84; | 8211 v28 = 0; |
8212 v26 = 92; | |
8213 goto LABEL_112; | |
8214 case VAR_BaseAccuracy: | 8214 case VAR_BaseAccuracy: |
8215 this->uAccuracy = (unsigned __int8)var_value; | 8215 this->uAccuracy = (unsigned __int8)var_value; |
8216 goto LABEL_84; | 8216 v28 = 0; |
8217 v26 = 92; | |
8218 goto LABEL_112; | |
8217 case VAR_BaseLuck: | 8219 case VAR_BaseLuck: |
8218 this->uLuck = (unsigned __int8)var_value; | 8220 this->uLuck = (unsigned __int8)var_value; |
8219 goto LABEL_84; | 8221 v28 = 0; |
8222 v26 = 92; | |
8223 goto LABEL_112; | |
8220 default: | 8224 default: |
8221 return; | 8225 return; |
8222 } | 8226 } |
8223 LABEL_111: | 8227 LABEL_111: |
8224 v28 = 0; | 8228 v28 = 0; |
8225 v26 = SPEECH_91; | 8229 v26 = SPEECH_91; |
8226 LABEL_112: | 8230 LABEL_112: |
8227 v19 = pPlayers[currPlayerId + 1]; | 8231 v19 = pPlayers[currPlayerId + 1]; |
8228 v31 = 1; | 8232 v31_playsound = 1; |
8229 v19->PlaySound((PlayerSpeech)v26, v28); | 8233 v19->PlaySound((PlayerSpeech)v26, v28); |
8230 goto LABEL_169; | 8234 DrawPlayerBuffAnimBasedOnCondition(true, currPlayerId); |
8235 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); | |
8236 return; | |
8231 } | 8237 } |
8232 if ( var_type <= VAR_MagicResistance ) | 8238 if ( var_type <= VAR_MagicResistance ) |
8233 { | 8239 { |
8234 switch ( var_type ) | 8240 switch ( var_type ) |
8235 { | 8241 { |
8261 LABEL_73: | 8267 LABEL_73: |
8262 this->uLuckBonus = (unsigned __int8)var_value; | 8268 this->uLuckBonus = (unsigned __int8)var_value; |
8263 goto LABEL_111; | 8269 goto LABEL_111; |
8264 case VAR_FireResistance: | 8270 case VAR_FireResistance: |
8265 this->sResFireBase = (unsigned __int8)var_value; | 8271 this->sResFireBase = (unsigned __int8)var_value; |
8266 goto LABEL_84; | 8272 v28 = 0; |
8273 v26 = 92; | |
8274 goto LABEL_112; | |
8267 case VAR_AirResistance: | 8275 case VAR_AirResistance: |
8268 this->sResAirBase = (unsigned __int8)var_value; | 8276 this->sResAirBase = (unsigned __int8)var_value; |
8269 goto LABEL_84; | 8277 v28 = 0; |
8278 v26 = 92; | |
8279 goto LABEL_112; | |
8270 case VAR_WaterResistance: | 8280 case VAR_WaterResistance: |
8271 this->sResWaterBase = (unsigned __int8)var_value; | 8281 this->sResWaterBase = (unsigned __int8)var_value; |
8272 goto LABEL_84; | 8282 v28 = 0; |
8283 v26 = 92; | |
8284 goto LABEL_112; | |
8273 case VAR_EarthResistance: | 8285 case VAR_EarthResistance: |
8274 this->sResEarthBase = (unsigned __int8)var_value; | 8286 this->sResEarthBase = (unsigned __int8)var_value; |
8275 goto LABEL_84; | 8287 v28 = 0; |
8288 v26 = 92; | |
8289 goto LABEL_112; | |
8276 case VAR_SpiritResistance: | 8290 case VAR_SpiritResistance: |
8277 this->sResSpiritBase = (unsigned __int8)var_value; | 8291 this->sResSpiritBase = (unsigned __int8)var_value; |
8278 goto LABEL_84; | 8292 v28 = 0; |
8293 v26 = 92; | |
8294 goto LABEL_112; | |
8279 case VAR_MindResistance: | 8295 case VAR_MindResistance: |
8280 this->sResMindBase = (unsigned __int8)var_value; | 8296 this->sResMindBase = (unsigned __int8)var_value; |
8281 goto LABEL_84; | 8297 v28 = 0; |
8298 v26 = 92; | |
8299 goto LABEL_112; | |
8282 case VAR_BodyResistance: | 8300 case VAR_BodyResistance: |
8283 this->sResBodyBase = (unsigned __int8)var_value; | 8301 this->sResBodyBase = (unsigned __int8)var_value; |
8284 goto LABEL_84; | 8302 v28 = 0; |
8303 v26 = 92; | |
8304 goto LABEL_112; | |
8285 case VAR_LightResistance: | 8305 case VAR_LightResistance: |
8286 this->sResLightBase = (unsigned __int8)var_value; | 8306 this->sResLightBase = (unsigned __int8)var_value; |
8287 goto LABEL_84; | 8307 v28 = 0; |
8308 v26 = 92; | |
8309 goto LABEL_112; | |
8288 case VAR_DarkResistance: | 8310 case VAR_DarkResistance: |
8289 this->sResDarkBase = (unsigned __int8)var_value; | 8311 this->sResDarkBase = (unsigned __int8)var_value; |
8290 goto LABEL_84; | 8312 v28 = 0; |
8313 v26 = 92; | |
8314 goto LABEL_112; | |
8291 case VAR_MagicResistance: | 8315 case VAR_MagicResistance: |
8292 this->sResMagicBase = (unsigned __int8)var_value; | 8316 this->sResMagicBase = (unsigned __int8)var_value; |
8293 LABEL_84: | |
8294 v28 = 0; | 8317 v28 = 0; |
8295 v26 = 92; | 8318 v26 = 92; |
8296 goto LABEL_112; | 8319 goto LABEL_112; |
8297 default: | 8320 default: |
8298 return; | 8321 return; |
8319 return; | 8342 return; |
8320 } | 8343 } |
8321 memset(this, 0, 0xA0u); | 8344 memset(this, 0, 0xA0u); |
8322 } | 8345 } |
8323 LABEL_124: | 8346 LABEL_124: |
8324 v31 = 1; | 8347 v31_playsound = 1; |
8325 goto LABEL_169; | 8348 DrawPlayerBuffAnimBasedOnCondition(true, currPlayerId); |
8349 PlaySoundBasedOnCondition(v31_playsound = 1, currPlayerId); | |
8350 return; | |
8326 } | 8351 } |
8327 LABEL_106: | 8352 LABEL_106: |
8328 v16 = (int)((char *)&this->pConditions[16] + 2 * var_type); | 8353 v16 = (int)((char *)&this->pConditions[16] + 2 * var_type); |
8329 v17 = *(char *)v16; | 8354 v17 = *(char *)v16; |
8330 if ( var_value <= VAR_BodyResistanceBonus ) | 8355 if ( var_value <= VAR_BodyResistanceBonus ) |
8338 } | 8363 } |
8339 *(short *)v16 = v18; | 8364 *(short *)v16 = v18; |
8340 goto LABEL_124; | 8365 goto LABEL_124; |
8341 } | 8366 } |
8342 if ( var_type == VAR_DisarmTrapSkill ) | 8367 if ( var_type == VAR_DisarmTrapSkill ) |
8343 if ( v30 != 1 ) | 8368 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); |
8344 { | 8369 DrawPlayerBuffAnimBasedOnCondition(v30_drawanim == 1, currPlayerId); |
8345 if ( v31 != 1 ) | 8370 return; |
8346 return; | |
8347 v5 = 0; | |
8348 goto LABEL_172; | |
8349 } | |
8350 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); | |
8351 goto LABEL_170; | |
8352 if ( var_type <= VAR_MagicResistanceBonus ) | 8371 if ( var_type <= VAR_MagicResistanceBonus ) |
8353 { | 8372 { |
8354 switch ( var_type ) | 8373 switch ( var_type ) |
8355 { | 8374 { |
8356 case VAR_FireResistanceBonus: | 8375 case VAR_FireResistanceBonus: |
8393 break; | 8412 break; |
8394 } | 8413 } |
8395 goto LABEL_111; | 8414 goto LABEL_111; |
8396 } | 8415 } |
8397 if ( var_type > VAR_MagicResistanceBonus && var_type <= VAR_DiplomacySkill ) | 8416 if ( var_type > VAR_MagicResistanceBonus && var_type <= VAR_DiplomacySkill ) |
8398 if ( v30 != 1 ) | 8417 { |
8399 { | 8418 PlaySoundBasedOnCondition(v31_playsound == 1, currPlayerId); |
8400 if ( v31 != 1 ) | 8419 DrawPlayerBuffAnimBasedOnCondition(v30_drawanim == 1, currPlayerId); |
8401 return; | 8420 return; |
8402 v5 = 0; | 8421 } |
8403 v25 = 8 * currPlayerId + 400; | 8422 } |
8404 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); | 8423 |
8405 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); | 8424 |
8406 return; | 8425 //----- (new function) -------------------------------------------------------- |
8407 } | 8426 void Player::PlaySoundBasedOnCondition(bool condition, int currPlayerId) |
8408 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); | 8427 { |
8409 goto LABEL_170; | 8428 if (condition) |
8410 } | 8429 { |
8411 | 8430 signed int v25 = 8 * currPlayerId + 400; |
8431 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); | |
8432 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); | |
8433 } | |
8434 } | |
8435 | |
8436 //----- (new function) -------------------------------------------------------- | |
8437 void Player::DrawPlayerBuffAnimBasedOnCondition(bool condition, int currPlayerId) | |
8438 { | |
8439 if (condition) | |
8440 { | |
8441 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); | |
8442 } | |
8443 } | |
8412 | 8444 |
8413 //----- (0044AFFB) -------------------------------------------------------- | 8445 //----- (0044AFFB) -------------------------------------------------------- |
8414 void Player::AddVariable(enum VariableType var_type, signed int val) | 8446 void Player::AddVariable(enum VariableType var_type, signed int val) |
8415 { | 8447 { |
8416 char v3; // bl@1 | 8448 char v3; // bl@1 |