Mercurial > mm7
changeset 2300:4c3f91554be8
stru319::GetMagicalResistance renamed to stru319::DoesDmgTypeDoDamage
author | Grumpy7 |
---|---|
date | Sun, 16 Mar 2014 19:58:02 +0100 |
parents | 815d9ecf9881 |
children | df24d11208df |
files | Actor.cpp Actor.h CastSpellInfo.cpp SpriteObject.cpp mm7_2.cpp mm7_6.cpp |
diffstat | 6 files changed, 14 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Sun Mar 16 19:43:28 2014 +0100 +++ b/Actor.cpp Sun Mar 16 19:58:02 2014 +0100 @@ -3643,7 +3643,7 @@ && uDamageAmount != 0 ) player->ReceiveDamage(uDamageAmount, attackElement); int knockbackValue = 20 * v61 / (signed int)pMonster->pMonsterInfo.uHP; - if ( (player->GetSpecialItemBonus(24) || hit_will_stun) && stru_50C198.GetMagicalResistance(pMonster, DMGT_EARTH) ) + if ( (player->GetSpecialItemBonus(24) || hit_will_stun) && stru_50C198.DoesDmgTypeDoDamage(pMonster, DMGT_EARTH) ) { extraRecoveryTime = 20; knockbackValue = 10; @@ -3657,7 +3657,7 @@ ShowStatusBarString(pTmpBuf.data(), 2u); } } - if ( hit_will_paralyze && pMonster->CanAct() && stru_50C198.GetMagicalResistance(pMonster, DMGT_EARTH)) + if ( hit_will_paralyze && pMonster->CanAct() && stru_50C198.DoesDmgTypeDoDamage(pMonster, DMGT_EARTH)) { v43 = player->GetActualSkillLevel(PLAYER_SKILL_MACE); v45 = SkillToMastery(v43);
--- a/Actor.h Sun Mar 16 19:43:28 2014 +0100 +++ b/Actor.h Sun Mar 16 19:58:02 2014 +0100 @@ -14,7 +14,7 @@ { int which_player_to_attack(struct Actor *pActor); int _427546(int a2); - bool GetMagicalResistance(struct Actor *pActor, unsigned int uType); + bool DoesDmgTypeDoDamage(struct Actor *pActor, unsigned int uType); int FindClosestActor(int a2, int a3, int a4); char field_0;
--- a/CastSpellInfo.cpp Sun Mar 16 19:43:28 2014 +0100 +++ b/CastSpellInfo.cpp Sun Mar 16 19:58:02 2014 +0100 @@ -439,7 +439,7 @@ mon_id = PID_ID(a2); if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - if ( stru_50C198.GetMagicalResistance(&pActors[mon_id], 3) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[mon_id], 3) ) { pActors[mon_id].pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); v704.x = 0; @@ -622,7 +622,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; mon_id = PID_ID(a2); - if (PID_TYPE(a2) == OBJECT_Actor && stru_50C198.GetMagicalResistance(&pActors[mon_id], 9) ) + if (PID_TYPE(a2) == OBJECT_Actor && stru_50C198.DoesDmgTypeDoDamage(&pActors[mon_id], 9) ) { Actor::AI_Stand(PID_ID(a2), 4, 0x80, 0); pActors[mon_id].pActorBuffs[ACTOR_BUFF_PARALYZED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)23040 * spell_level * 0.033333335), skill_level, 0, 0, 0); @@ -649,7 +649,7 @@ break; //v721 = 836 * PID_ID(a2); mon_id = PID_ID(a2); - if (PID_TYPE(a2) == OBJECT_Actor && stru_50C198.GetMagicalResistance(&pActors[mon_id], 3) ) + if (PID_TYPE(a2) == OBJECT_Actor && stru_50C198.DoesDmgTypeDoDamage(&pActors[mon_id], 3) ) { pActors[mon_id].pActorBuffs[ACTOR_BUFF_SLOWED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)23040 * spell_level * 0.033333335), skill_level, amount, 0, 0); pActors[mon_id].uAttributes |= 0x80000; @@ -663,7 +663,7 @@ v61 = PID_ID(a2); if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - if ( stru_50C198.GetMagicalResistance(&pActors[v61], 7) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[v61], 7) ) { uint power = 300 * spell_level; if ( skill_level == 2 ) @@ -2219,7 +2219,7 @@ if (PID_TYPE(a2) == OBJECT_Actor) { //v730 = 836 * mon_id; - if ( stru_50C198.GetMagicalResistance(&pActors[mon_id], 7) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[mon_id], 7) ) { pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset(); pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset(); @@ -2259,7 +2259,7 @@ //v730 = 836 * mon_id; if ( MonsterStats::BelongsToSupertype(pActors[mon_id].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) break; - if ( stru_50C198.GetMagicalResistance(&pActors[mon_id], 7) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[mon_id], 7) ) { pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Reset(); pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset(); @@ -2320,7 +2320,7 @@ pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8); pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); pSpellSprite.Create(0, 0, 0, 0); - if ( stru_50C198.GetMagicalResistance(&pActors[_50BF30_actors_in_viewport_ids[a2]], 7) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[_50BF30_actors_in_viewport_ids[a2]], 7) ) { pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), skill_level, 0, 0, 0); @@ -3006,7 +3006,7 @@ mon_id = PID_ID(a2); if ( !MonsterStats::BelongsToSupertype(pActors[mon_id].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) break; - if ( !stru_50C198.GetMagicalResistance(&pActors[mon_id], 10) ) + if ( !stru_50C198.DoesDmgTypeDoDamage(&pActors[mon_id], 10) ) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
--- a/SpriteObject.cpp Sun Mar 16 19:43:28 2014 +0100 +++ b/SpriteObject.cpp Sun Mar 16 19:58:02 2014 +0100 @@ -1032,7 +1032,7 @@ if ( v11 >= v7 * v7 + v9 * v9 + v10 * v10 ) { - if ( stru_50C198.GetMagicalResistance(&pActors[i], 0xAu) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[i], 0xAu) ) { pActors[i].pActorBuffs[this->spell_id].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(this->spell_level << 7) * 0.033333335), this->spell_skill, 4, 0, 0);
--- a/mm7_2.cpp Sun Mar 16 19:43:28 2014 +0100 +++ b/mm7_2.cpp Sun Mar 16 19:58:02 2014 +0100 @@ -4343,7 +4343,7 @@ if ( pSpriteObjects[uLayingItemID].uType != 9030 || v152 != 4 ) { v108 = v139; - if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) ) + if ( stru_50C198.DoesDmgTypeDoDamage(&pActors[v139], v107) ) { v138 = 0; if ( pSpriteObjects[uLayingItemID].uType == 8030 )
--- a/mm7_6.cpp Sun Mar 16 19:43:28 2014 +0100 +++ b/mm7_6.cpp Sun Mar 16 19:58:02 2014 +0100 @@ -60,7 +60,7 @@ } //----- (00427662) -------------------------------------------------------- -bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) +bool stru319::DoesDmgTypeDoDamage(Actor *pActor, unsigned int uType) { signed int resist; // esi@2 bool result; // eax@13