Mercurial > mm7
diff Player.cpp @ 135:9b0d651821f1
Party creation screen: sorcerer class icon fixed
author | Nomad |
---|---|
date | Mon, 11 Feb 2013 20:23:55 +0200 |
parents | 1c471f3629fb |
children | 9abdd40a107b |
line wrap: on
line diff
--- a/Player.cpp Mon Feb 11 19:42:28 2013 +0200 +++ b/Player.cpp Mon Feb 11 20:23:55 2013 +0200 @@ -752,7 +752,7 @@ int v8; // [sp-4h] [bp-Ch]@3 v3 = this; - if ( this->uClass == uClass ) + if ( this->classType == uClass ) { LABEL_84: result = 1; @@ -1300,7 +1300,8 @@ result = 1; break; case 0x11u: - if ( v3->uClass == 35 || v3->pConditions[16] || v3->pConditions[17] || !v3->pConditions[14] ) + if ( v3->classType == PLAYER_CLASS_LICH || v3->Eradicated() || + v3->Zombie() || !v3->Dead()) goto LABEL_76; memset(v3, 0, 0xA0u); v3->sHealth = v3->GetMaxHealth(); @@ -3276,7 +3277,7 @@ v4 = 0; LABEL_17: v18 = type; - if ( v3->uClass == 35 && v4 >= 200 ) + if ( v3->classType == PLAYER_CLASS_LICH && v4 >= 200 ) return 0; if ( v4 ) { @@ -4276,9 +4277,9 @@ int v6; // esi@1 v3 = _48EA1B_get_static_effect(GetActualEndurance()); - v4 = pBaseHealthPerLevelByClass[uClass] * (GetActualLevel() + v3); + v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3); v6 = uFullHealthBonus - + pBaseHealthByClass[uClass / 4] + + pBaseHealthByClass[classType / 4] + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4; if (v6 <= 0) @@ -4299,7 +4300,7 @@ int v9; // esi@6 int result; // eax@7 - switch (uClass) + switch (classType) { case 5u: case 6u: @@ -4341,10 +4342,10 @@ v6 = GetActualIntelligence(); v3 = _48EA1B_get_static_effect(v6) + v5; LABEL_6: - v7 = pBaseManaPerLevelByClass[uClass] * (GetActualLevel() + v3); + v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3); v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA, 0) + v7; v9 = uFullManaBonus - + pBaseManaByClass[uClass / 4] + + pBaseManaByClass[classType / 4] + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA) + v8; if ( v9 < 1 ) @@ -4480,7 +4481,7 @@ v5 = 0; LABEL_20: v7 = GetItemsBonus(a2, 0) + v3; - if ( v2->uClass != 35 || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) ) + if ( v2->classType != PLAYER_CLASS_LICH || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) ) result = v7 + *(&v2->sResFireBase + v5); return result; } @@ -4554,7 +4555,7 @@ LABEL_28: v7 = GetItemsBonus(a2, 0); result = v10 + GetMagicalBonus(a2) + v7 + v9 + *(&v3->sResFireBonus + v2) + *(&v3->sResFireBase + v2); - if ( v3->uClass == 35 ) + if ( v3->classType == PLAYER_CLASS_LICH ) { if ( result > 200 ) result = 200; @@ -5741,7 +5742,7 @@ } if ( CheckHiredNPCSpeciality(v5) ) v2 += 4; - if ( v9->uClass == 31 && sub_476387() ) + if ( v9->classType == PLAYER_CLASS_31 && sub_476387() ) v2 += 3; LABEL_86: if ( uSkillType <= PLAYER_SKILL_DARK ) @@ -6016,13 +6017,13 @@ LABEL_12: if ( a2 == CHARACTER_ATTRIBUTE_HEALTH ) { - v60 = pBaseHealthPerLevelByClass[v2->uClass]; + v60 = pBaseHealthPerLevelByClass[v2->classType]; v61 = v2->GetBodybuilding(); return v60 * v61; } if ( a2 == CHARACTER_ATTRIBUTE_MANA ) { - v60 = pBaseManaPerLevelByClass[v2->uClass]; + v60 = pBaseManaPerLevelByClass[v2->classType]; v61 = v2->GetMediatation(); return v60 * v61; } @@ -6491,12 +6492,12 @@ } //----- (0049024A) -------------------------------------------------------- -void Player::Reset(unsigned __int8 classID) +void Player::Reset(PLAYER_CLASS_TYPE cls) { sLevelModifier = 0; sAgeModifier = 0; - uClass = classID; + classType = cls; uLuckBonus = 0; uSpeedBonus = 0; uAccuracyBonus = 0; @@ -6513,7 +6514,7 @@ for (uint i = 0; i < 37; ++i) { - if (pSkillAvailabilityPerClass[uClass / 4][i] != 2) + if (pSkillAvailabilityPerClass[classType / 4][i] != 2) continue; pActiveSkills[i] = 1; @@ -6556,7 +6557,7 @@ pActiveSkill = this->pActiveSkills; do { - if ( *pActiveSkill && pSkillAvailabilityPerClass[uClass / 4][result] == 2 ) + if ( *pActiveSkill && pSkillAvailabilityPerClass[classType / 4][result] == 2 ) { if ( v7 == order ) return result; @@ -6576,7 +6577,7 @@ pActiveSkill = this->pActiveSkills; do { - if ( *pActiveSkill && pSkillAvailabilityPerClass[uClass / 4][result] == 1 ) + if ( *pActiveSkill && pSkillAvailabilityPerClass[classType / 4][result] == 1 ) { if ( v5 == order - 2 ) return result; @@ -6593,7 +6594,7 @@ { result = (PLAYER_SKILL_TYPE)0; v3 = 0; - v4 = (char *)pSkillAvailabilityPerClass[uClass / 4]; + v4 = (char *)pSkillAvailabilityPerClass[classType / 4]; do { if ( *v4 == 1 ) @@ -7973,7 +7974,7 @@ v7 = (CHARACTER_RACE)this->uSex; goto _cmp_against_arg2; case VAR_Class: - v7 = (CHARACTER_RACE)this->uClass; + v7 = (CHARACTER_RACE)this->classType; goto _cmp_against_arg2; case VAR_Race: v7 = GetRace(); @@ -8453,7 +8454,7 @@ this->uSex = (PLAYER_SEX)a3; goto LABEL_124; case VAR_Class: - this->uClass = a3; + this->classType = (PLAYER_CLASS_TYPE)a3; if ( (char)a3 != 35 ) goto LABEL_124; v8 = 0; @@ -8863,7 +8864,7 @@ Dst->uSex = (PLAYER_SEX)val; goto _play_anim_and_exit; case VAR_Class: - Dst->uClass = val; + Dst->classType = (PLAYER_CLASS_TYPE)val; goto _play_anim_and_exit; case VAR_CurrentHP: v8 = &Dst->sHealth;