comparison 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
comparison
equal deleted inserted replaced
131:3ee983b8082b 135:9b0d651821f1
750 signed int result; // eax@84 750 signed int result; // eax@84
751 unsigned int v7; // [sp-8h] [bp-10h]@3 751 unsigned int v7; // [sp-8h] [bp-10h]@3
752 int v8; // [sp-4h] [bp-Ch]@3 752 int v8; // [sp-4h] [bp-Ch]@3
753 753
754 v3 = this; 754 v3 = this;
755 if ( this->uClass == uClass ) 755 if ( this->classType == uClass )
756 { 756 {
757 LABEL_84: 757 LABEL_84:
758 result = 1; 758 result = 1;
759 } 759 }
760 else 760 else
1298 pPlayers[v21]->PlaySound(107, 0); 1298 pPlayers[v21]->PlaySound(107, 0);
1299 } 1299 }
1300 result = 1; 1300 result = 1;
1301 break; 1301 break;
1302 case 0x11u: 1302 case 0x11u:
1303 if ( v3->uClass == 35 || v3->pConditions[16] || v3->pConditions[17] || !v3->pConditions[14] ) 1303 if ( v3->classType == PLAYER_CLASS_LICH || v3->Eradicated() ||
1304 v3->Zombie() || !v3->Dead())
1304 goto LABEL_76; 1305 goto LABEL_76;
1305 memset(v3, 0, 0xA0u); 1306 memset(v3, 0, 0xA0u);
1306 v3->sHealth = v3->GetMaxHealth(); 1307 v3->sHealth = v3->GetMaxHealth();
1307 v18 = 0; 1308 v18 = 0;
1308 v3->field_1928 = v3->uFace; 1309 v3->field_1928 = v3->uFace;
3274 goto LABEL_17; 3275 goto LABEL_17;
3275 } 3276 }
3276 v4 = 0; 3277 v4 = 0;
3277 LABEL_17: 3278 LABEL_17:
3278 v18 = type; 3279 v18 = type;
3279 if ( v3->uClass == 35 && v4 >= 200 ) 3280 if ( v3->classType == PLAYER_CLASS_LICH && v4 >= 200 )
3280 return 0; 3281 return 0;
3281 if ( v4 ) 3282 if ( v4 )
3282 { 3283 {
3283 v6 = GetActualLuck(); 3284 v6 = GetActualLuck();
3284 v7 = _48EA1B_get_static_effect(v6) + v4 + 30; 3285 v7 = _48EA1B_get_static_effect(v6) + v4 + 30;
4274 int v3; // esi@1 4275 int v3; // esi@1
4275 int v4; // esi@1 4276 int v4; // esi@1
4276 int v6; // esi@1 4277 int v6; // esi@1
4277 4278
4278 v3 = _48EA1B_get_static_effect(GetActualEndurance()); 4279 v3 = _48EA1B_get_static_effect(GetActualEndurance());
4279 v4 = pBaseHealthPerLevelByClass[uClass] * (GetActualLevel() + v3); 4280 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3);
4280 v6 = uFullHealthBonus 4281 v6 = uFullHealthBonus
4281 + pBaseHealthByClass[uClass / 4] 4282 + pBaseHealthByClass[classType / 4]
4282 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) 4283 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH)
4283 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4; 4284 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4;
4284 if (v6 <= 0) 4285 if (v6 <= 0)
4285 return 1; 4286 return 1;
4286 return v6; 4287 return v6;
4297 int v7; // esi@6 4298 int v7; // esi@6
4298 int v8; // esi@6 4299 int v8; // esi@6
4299 int v9; // esi@6 4300 int v9; // esi@6
4300 int result; // eax@7 4301 int result; // eax@7
4301 4302
4302 switch (uClass) 4303 switch (classType)
4303 { 4304 {
4304 case 5u: 4305 case 5u:
4305 case 6u: 4306 case 6u:
4306 case 7u: 4307 case 7u:
4307 case 0x10u: 4308 case 0x10u:
4339 v4 = GetActualWillpower(); 4340 v4 = GetActualWillpower();
4340 v5 = _48EA1B_get_static_effect(v4); 4341 v5 = _48EA1B_get_static_effect(v4);
4341 v6 = GetActualIntelligence(); 4342 v6 = GetActualIntelligence();
4342 v3 = _48EA1B_get_static_effect(v6) + v5; 4343 v3 = _48EA1B_get_static_effect(v6) + v5;
4343 LABEL_6: 4344 LABEL_6:
4344 v7 = pBaseManaPerLevelByClass[uClass] * (GetActualLevel() + v3); 4345 v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3);
4345 v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA, 0) + v7; 4346 v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA, 0) + v7;
4346 v9 = uFullManaBonus 4347 v9 = uFullManaBonus
4347 + pBaseManaByClass[uClass / 4] 4348 + pBaseManaByClass[classType / 4]
4348 + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA) 4349 + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA)
4349 + v8; 4350 + v8;
4350 if ( v9 < 1 ) 4351 if ( v9 < 1 )
4351 goto LABEL_7; 4352 goto LABEL_7;
4352 result = v9; 4353 result = v9;
4478 goto LABEL_19; 4479 goto LABEL_19;
4479 } 4480 }
4480 v5 = 0; 4481 v5 = 0;
4481 LABEL_20: 4482 LABEL_20:
4482 v7 = GetItemsBonus(a2, 0) + v3; 4483 v7 = GetItemsBonus(a2, 0) + v3;
4483 if ( v2->uClass != 35 || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) ) 4484 if ( v2->classType != PLAYER_CLASS_LICH || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) )
4484 result = v7 + *(&v2->sResFireBase + v5); 4485 result = v7 + *(&v2->sResFireBase + v5);
4485 return result; 4486 return result;
4486 } 4487 }
4487 4488
4488 //----- (0048E7D0) -------------------------------------------------------- 4489 //----- (0048E7D0) --------------------------------------------------------
4552 v9 = 10; 4553 v9 = 10;
4553 } 4554 }
4554 LABEL_28: 4555 LABEL_28:
4555 v7 = GetItemsBonus(a2, 0); 4556 v7 = GetItemsBonus(a2, 0);
4556 result = v10 + GetMagicalBonus(a2) + v7 + v9 + *(&v3->sResFireBonus + v2) + *(&v3->sResFireBase + v2); 4557 result = v10 + GetMagicalBonus(a2) + v7 + v9 + *(&v3->sResFireBonus + v2) + *(&v3->sResFireBase + v2);
4557 if ( v3->uClass == 35 ) 4558 if ( v3->classType == PLAYER_CLASS_LICH )
4558 { 4559 {
4559 if ( result > 200 ) 4560 if ( result > 200 )
4560 result = 200; 4561 result = 200;
4561 } 4562 }
4562 return result; 4563 return result;
5739 v2 += 3; 5740 v2 += 3;
5740 v5 = 55; 5741 v5 = 55;
5741 } 5742 }
5742 if ( CheckHiredNPCSpeciality(v5) ) 5743 if ( CheckHiredNPCSpeciality(v5) )
5743 v2 += 4; 5744 v2 += 4;
5744 if ( v9->uClass == 31 && sub_476387() ) 5745 if ( v9->classType == PLAYER_CLASS_31 && sub_476387() )
5745 v2 += 3; 5746 v2 += 3;
5746 LABEL_86: 5747 LABEL_86:
5747 if ( uSkillType <= PLAYER_SKILL_DARK ) 5748 if ( uSkillType <= PLAYER_SKILL_DARK )
5748 { 5749 {
5749 if ( uSkillType == PLAYER_SKILL_DARK ) 5750 if ( uSkillType == PLAYER_SKILL_DARK )
6014 goto LABEL_11; 6015 goto LABEL_11;
6015 } 6016 }
6016 LABEL_12: 6017 LABEL_12:
6017 if ( a2 == CHARACTER_ATTRIBUTE_HEALTH ) 6018 if ( a2 == CHARACTER_ATTRIBUTE_HEALTH )
6018 { 6019 {
6019 v60 = pBaseHealthPerLevelByClass[v2->uClass]; 6020 v60 = pBaseHealthPerLevelByClass[v2->classType];
6020 v61 = v2->GetBodybuilding(); 6021 v61 = v2->GetBodybuilding();
6021 return v60 * v61; 6022 return v60 * v61;
6022 } 6023 }
6023 if ( a2 == CHARACTER_ATTRIBUTE_MANA ) 6024 if ( a2 == CHARACTER_ATTRIBUTE_MANA )
6024 { 6025 {
6025 v60 = pBaseManaPerLevelByClass[v2->uClass]; 6026 v60 = pBaseManaPerLevelByClass[v2->classType];
6026 v61 = v2->GetMediatation(); 6027 v61 = v2->GetMediatation();
6027 return v60 * v61; 6028 return v60 * v61;
6028 } 6029 }
6029 if ( a2 != 9 ) 6030 if ( a2 != 9 )
6030 { 6031 {
6489 this->uSex = (PLAYER_SEX)BYTE4(v1); 6490 this->uSex = (PLAYER_SEX)BYTE4(v1);
6490 return v1; 6491 return v1;
6491 } 6492 }
6492 6493
6493 //----- (0049024A) -------------------------------------------------------- 6494 //----- (0049024A) --------------------------------------------------------
6494 void Player::Reset(unsigned __int8 classID) 6495 void Player::Reset(PLAYER_CLASS_TYPE cls)
6495 { 6496 {
6496 sLevelModifier = 0; 6497 sLevelModifier = 0;
6497 sAgeModifier = 0; 6498 sAgeModifier = 0;
6498 6499
6499 uClass = classID; 6500 classType = cls;
6500 uLuckBonus = 0; 6501 uLuckBonus = 0;
6501 uSpeedBonus = 0; 6502 uSpeedBonus = 0;
6502 uAccuracyBonus = 0; 6503 uAccuracyBonus = 0;
6503 uEnduranceBonus = 0; 6504 uEnduranceBonus = 0;
6504 uWillpowerBonus = 0; 6505 uWillpowerBonus = 0;
6511 memset(field_152, 0, 64); 6512 memset(field_152, 0, 64);
6512 memset(&spellbook, 0, sizeof(PlayerSpells)); 6513 memset(&spellbook, 0, sizeof(PlayerSpells));
6513 6514
6514 for (uint i = 0; i < 37; ++i) 6515 for (uint i = 0; i < 37; ++i)
6515 { 6516 {
6516 if (pSkillAvailabilityPerClass[uClass / 4][i] != 2) 6517 if (pSkillAvailabilityPerClass[classType / 4][i] != 2)
6517 continue; 6518 continue;
6518 6519
6519 pActiveSkills[i] = 1; 6520 pActiveSkills[i] = 1;
6520 6521
6521 switch (i) 6522 switch (i)
6554 result = (PLAYER_SKILL_TYPE)0; 6555 result = (PLAYER_SKILL_TYPE)0;
6555 v7 = 0; 6556 v7 = 0;
6556 pActiveSkill = this->pActiveSkills; 6557 pActiveSkill = this->pActiveSkills;
6557 do 6558 do
6558 { 6559 {
6559 if ( *pActiveSkill && pSkillAvailabilityPerClass[uClass / 4][result] == 2 ) 6560 if ( *pActiveSkill && pSkillAvailabilityPerClass[classType / 4][result] == 2 )
6560 { 6561 {
6561 if ( v7 == order ) 6562 if ( v7 == order )
6562 return result; 6563 return result;
6563 ++v7; 6564 ++v7;
6564 } 6565 }
6574 result = (PLAYER_SKILL_TYPE)0; 6575 result = (PLAYER_SKILL_TYPE)0;
6575 v5 = 0; 6576 v5 = 0;
6576 pActiveSkill = this->pActiveSkills; 6577 pActiveSkill = this->pActiveSkills;
6577 do 6578 do
6578 { 6579 {
6579 if ( *pActiveSkill && pSkillAvailabilityPerClass[uClass / 4][result] == 1 ) 6580 if ( *pActiveSkill && pSkillAvailabilityPerClass[classType / 4][result] == 1 )
6580 { 6581 {
6581 if ( v5 == order - 2 ) 6582 if ( v5 == order - 2 )
6582 return result; 6583 return result;
6583 ++v5; 6584 ++v5;
6584 } 6585 }
6591 { 6592 {
6592 if ( order <= 12 ) 6593 if ( order <= 12 )
6593 { 6594 {
6594 result = (PLAYER_SKILL_TYPE)0; 6595 result = (PLAYER_SKILL_TYPE)0;
6595 v3 = 0; 6596 v3 = 0;
6596 v4 = (char *)pSkillAvailabilityPerClass[uClass / 4]; 6597 v4 = (char *)pSkillAvailabilityPerClass[classType / 4];
6597 do 6598 do
6598 { 6599 {
6599 if ( *v4 == 1 ) 6600 if ( *v4 == 1 )
6600 { 6601 {
6601 if ( v3 == order - 4 ) 6602 if ( v3 == order - 4 )
7971 return v6; 7972 return v6;
7972 case VAR_Sex: 7973 case VAR_Sex:
7973 v7 = (CHARACTER_RACE)this->uSex; 7974 v7 = (CHARACTER_RACE)this->uSex;
7974 goto _cmp_against_arg2; 7975 goto _cmp_against_arg2;
7975 case VAR_Class: 7976 case VAR_Class:
7976 v7 = (CHARACTER_RACE)this->uClass; 7977 v7 = (CHARACTER_RACE)this->classType;
7977 goto _cmp_against_arg2; 7978 goto _cmp_against_arg2;
7978 case VAR_Race: 7979 case VAR_Race:
7979 v7 = GetRace(); 7980 v7 = GetRace();
7980 _cmp_against_arg2: 7981 _cmp_against_arg2:
7981 if ( a1 == v7 ) 7982 if ( a1 == v7 )
8451 goto LABEL_124; 8452 goto LABEL_124;
8452 case VAR_Sex: 8453 case VAR_Sex:
8453 this->uSex = (PLAYER_SEX)a3; 8454 this->uSex = (PLAYER_SEX)a3;
8454 goto LABEL_124; 8455 goto LABEL_124;
8455 case VAR_Class: 8456 case VAR_Class:
8456 this->uClass = a3; 8457 this->classType = (PLAYER_CLASS_TYPE)a3;
8457 if ( (char)a3 != 35 ) 8458 if ( (char)a3 != 35 )
8458 goto LABEL_124; 8459 goto LABEL_124;
8459 v8 = 0; 8460 v8 = 0;
8460 v9 = this->pInventoryItems; 8461 v9 = this->pInventoryItems;
8461 break; 8462 break;
8861 goto _play_sound; 8862 goto _play_sound;
8862 case VAR_Sex: 8863 case VAR_Sex:
8863 Dst->uSex = (PLAYER_SEX)val; 8864 Dst->uSex = (PLAYER_SEX)val;
8864 goto _play_anim_and_exit; 8865 goto _play_anim_and_exit;
8865 case VAR_Class: 8866 case VAR_Class:
8866 Dst->uClass = val; 8867 Dst->classType = (PLAYER_CLASS_TYPE)val;
8867 goto _play_anim_and_exit; 8868 goto _play_anim_and_exit;
8868 case VAR_CurrentHP: 8869 case VAR_CurrentHP:
8869 v8 = &Dst->sHealth; 8870 v8 = &Dst->sHealth;
8870 *v8 += val; 8871 *v8 += val;
8871 if ( Dst->sHealth <= Dst->GetMaxHealth() ) 8872 if ( Dst->sHealth <= Dst->GetMaxHealth() )