Mercurial > mm7
changeset 42:2bcc7b24c831
stats screen fixes, and boundary fixes
author | zipi |
---|---|
date | Sun, 20 Jan 2013 21:58:23 +0000 |
parents | fc3016f5a07a |
children | 196847ece26a |
files | Actor.cpp Player.cpp mm7_1.cpp mm7_5.cpp mm7_6.cpp mm7_data.cpp mm7_data.h |
diffstat | 7 files changed, 56 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Sun Jan 20 20:52:13 2013 +0000 +++ b/Actor.cpp Sun Jan 20 21:58:23 2013 +0000 @@ -2489,7 +2489,7 @@ v1 = uActiveCharacter; v7 = uActorID; - pPlayer = (Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; + pPlayer = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; result = pPlayer->CanAct(); if ( result ) {
--- a/Player.cpp Sun Jan 20 20:52:13 2013 +0000 +++ b/Player.cpp Sun Jan 20 21:58:23 2013 +0000 @@ -6959,7 +6959,7 @@ unsigned int thisa; // [sp+28h] [bp-4h]@22 thisb = this; - v3 = (Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552]; + v3 = &pParty->pPlayers[a2-1];//(Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552]; v73 = 1; if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) ) return; @@ -6987,7 +6987,7 @@ } v69 = 2; LABEL_111: - ((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->Heal(v69); + pParty->pPlayers[a2-1].Heal(v69);//((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->Heal(v69); } LABEL_112: v3->PlaySound(36, 0); @@ -7160,7 +7160,7 @@ v33 = HIDWORD(v3->pConditions[15]); v34 = LODWORD(v3->pConditions[16]); v35 = HIDWORD(v3->pConditions[16]); - memset(&stru_AA1058[3].pSounds[6972 * a2 + 40552], 0, 0xA0u); + memset(&pParty->pPlayers[a2-1],0,0xA0u);//memset(&stru_AA1058[3].pSounds[6972 * a2 + 40552], 0, 0xA0u); HIDWORD(v3->pConditions[14]) = v31; LODWORD(v3->pConditions[15]) = v32; HIDWORD(v3->pConditions[15]) = v33; @@ -7531,7 +7531,7 @@ pMouse->RemoveHoldingItem(); return; } - if ( ((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() ) + if ( pParty->pPlayers[a2-1].CanAct() )//if ( ((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() ) { sub_467F48(pParty->pPickedItem.uItemID); v65 = 0; @@ -7575,7 +7575,7 @@ pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); return; } - if ( !((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() ) + if ( !pParty->pPlayers[a2-1].CanAct() )//if ( !((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() ) { v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; v57 = pGlobalTXT_LocalizationStrings[382]; @@ -7687,7 +7687,7 @@ } if ( pCurrentScreen == 23 ) return; - if ( !((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() ) + if ( !pParty->pPlayers[a2-1].CanAct() )//if ( !((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() ) goto LABEL_89; if ( bUnderwater == 1 ) {
--- a/mm7_1.cpp Sun Jan 20 20:52:13 2013 +0000 +++ b/mm7_1.cpp Sun Jan 20 21:58:23 2013 +0000 @@ -623,8 +623,8 @@ sprintf( Source, pGlobalTXT_LocalizationStrings[429], - &stru_AA1058[3].pSounds[6972 * v1 + 40720], - pClassNames[stru_AA1058[3].pSounds[6972 * v1 + 40737]]); + &pParty->pPlayers[v1-1].pName,//&stru_AA1058[3].pSounds[6972 * v1 + 40720], + &pClassNames[pParty->pPlayers[v1-1].uClass]);//&pClassNames[stru_AA1058[3].pSounds[6972 * v1 + 40737]]); strcat(pTmpBuf, Source); strcat(pTmpBuf, "\xC" "00000"); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
--- a/mm7_5.cpp Sun Jan 20 20:52:13 2013 +0000 +++ b/mm7_5.cpp Sun Jan 20 21:58:23 2013 +0000 @@ -5651,9 +5651,9 @@ int v40; // eax@77 int v41; // eax@77 int v42; // eax@78 - char *v43; // eax@81 + Player *v43; // eax@81 Actor *v44; // esi@82 - char *v45; // edi@84 + Player *v45; // edi@84 unsigned __int16 v46; // ax@84 int v47; // ebx@105 int v48; // eax@107 @@ -5900,18 +5900,18 @@ v44 = &pActors[v39]; if ( a4 == -1 ) a4 = stru_50C198.which_player_would_attack(v44); - v45 = (char *)&pParty->pPlayers[a4]; + v45 = &pParty->pPlayers[a4]; v77 = Actor::_43B3E0_CalcDamage(v44, v74); v46 = v37->uItemType; if ( v37->uItemType == 545 ) { - LOBYTE(v51) = ((Player *)v45)->GetActualSkillLevel(PLAYER_SKILL_UNARMED); + LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED); v52 = v51; if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) ) { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[637], v45 + 168); + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[637], v45->pName); ShowStatusBarString(pTmpBuf, 2u); - ((Player *)v45)->PlaySound(6, 0); + v45->PlaySound(6, 0); return; } } @@ -5929,29 +5929,29 @@ && v46 != 540 ) goto LABEL_115; } - if ( !stru_50C198.ActorHitOrMiss(v44, (Player *)v45) ) + if ( !stru_50C198.ActorHitOrMiss(v44, v45) ) return; - if ( *((_QWORD *)v45 + 782) > 0i64 ) + if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 ) v77 >>= 1; - if ( ((Player *)v45)->HasEnchantedItemEquipped(36) ) + if ( v45->HasEnchantedItemEquipped(36) ) v77 >>= 1; - if ( ((Player *)v45)->HasEnchantedItemEquipped(69) ) + if ( v45->HasEnchantedItemEquipped(69) ) v77 >>= 1; - if ( ((Player *)v45)->HasItemEquipped(EQUIP_ARMOUR) - && *(int *)&v45[36 * *((int *)v45 + 1621) + 496] == 504 ) + if ( v45->HasItemEquipped(EQUIP_ARMOUR) + && *(_DWORD *)&v45->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v45->pEquipment.uBody + 5] == 504 ) v77 >>= 1; v75 = 0; - v47 = (int)(v45 + 6472); + v47 = (int)&v45->pEquipment; do { - if ( ((Player *)v45)->HasItemEquipped((ITEM_EQUIP_TYPE)v75) ) + if ( v45->HasItemEquipped((ITEM_EQUIP_TYPE)v75) ) { v48 = *(int *)&v45[36 * *(int *)v47 + 496]; if ( v48 == 520 ) v77 >>= 1; if ( v48 == 531 ) v77 >>= 1; - if ( ((Player *)v45)->GetEquippedItemEquipType(v75) == 4 && SkillToMastery(*((short *)v45 + 140)) == 4 ) + if ( v45->GetEquippedItemEquipType(v75) == 4 && SkillToMastery(v45->pActiveSkills[8]) == 4 ) v77 >>= 1; } ++v75; @@ -5990,10 +5990,10 @@ LABEL_133: if ( !(dword_6BE368_debug_settings_2 & 0x10) ) { - v54 = ((Player *)v45)->ReceiveDamage(v77, v50); - if ( *((int *)v45 + 1553) >= 0 ) - { - if ( *((int *)v45 + 1553) > 0 || *((int *)v45 + 1552) ) + v54 = v45->ReceiveDamage(v77, v50); + if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 ) + { + if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) ) { v55 = v44->uAIState; if ( v55 != 5 ) @@ -6040,7 +6040,7 @@ v64 = 51; if ( rand() % 100 < 20 ) v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1; - ((Player *)v45)->PlaySound(v64, 0); + v45->PlaySound(v64, 0); } } } @@ -6052,14 +6052,14 @@ && !(dword_6BE368_debug_settings_2 & 0x10) && v44->pMonsterInfo.uSpecialAttack && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType ) - ((Player *)v45)->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44); + v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44); if ( !pParty->bTurnBasedModeOn ) { - v65 = ((Player *)v45)->GetActualEndurance(); - v66 = (double)(20 - ((Player *)v45)->_48EA1B_get_static_effect(v65)) + v65 = v45->GetActualEndurance(); + v66 = (double)(20 - v45->_48EA1B_get_static_effect(v65)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; - ((Player *)v45)->SetRecoveryTime((signed __int64)v66); + v45->SetRecoveryTime((signed __int64)v66); } return; } @@ -6073,12 +6073,12 @@ LABEL_80: if ( a4 != -1 ) { - v43 = (char *)&pParty->pPlayers[a4]; + v43 = &pParty->pPlayers[a4]; LABEL_168: - a4b = (Player *)v43; + a4b = v43; if ( v38 != 4 || v37->field_48 != 100 ) { - v70 = ((Player *)v43)->GetMaxHealth(); + v70 = v43->GetMaxHealth(); v68 = _43AFE3_calc_spell_damage(v37->field_48, v37->field_4C, v37->field_50, v70); v69 = LOBYTE(pSpellStats->pInfos[v37->field_48].uSchool); } @@ -6110,7 +6110,7 @@ while ( a4a <= 4 ); if ( v74 ) { - v43 = &stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; + v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; goto LABEL_168; } } @@ -17378,7 +17378,7 @@ int v137; // [sp+1Ch] [bp-4h]@27 int v138; // [sp+1Ch] [bp-4h]@33 - pPlayer = (Player *)&stru_AA1058[3].pSounds[6972 * uPlayerID + 40552]; + pPlayer = &pParty->pPlayers[uPlayerID-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uPlayerID + 40552]; v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE); pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0)); v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); @@ -17397,7 +17397,7 @@ v7 = pPlayer->GetBaseStrength(); v8 = pPlayer->GetActualMight(); v9 = UI_GetHealthManaStringColor(v8, v7); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[144], v9, v6, v5); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v6, v5); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 53, 0, pTmpBuf, 0, 0, 0); v10 = LOBYTE(pFontArrus->uFontHeight) + 51; v11 = pPlayer->GetBaseIntelligence(); @@ -17405,7 +17405,7 @@ v13 = pPlayer->GetBaseIntelligence(); v14 = pPlayer->GetActualIntelligence(); v15 = UI_GetHealthManaStringColor(v14, v13); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[116], v15, v12, v11); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v12, v11); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0); v16 = LOBYTE(pFontArrus->uFontHeight) + v10 - 2; v17 = pPlayer->GetBaseWillpower(); @@ -17413,7 +17413,7 @@ v19 = pPlayer->GetBaseWillpower(); v20 = pPlayer->GetActualWillpower(); v21 = UI_GetHealthManaStringColor(v20, v19); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[163], v21, v18, v17); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v18, v17); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v16, 0, pTmpBuf, 0, 0, 0); v22 = LOBYTE(pFontArrus->uFontHeight) + v16 - 2; v23 = pPlayer->GetBaseEndurance(); @@ -17421,7 +17421,7 @@ v25 = pPlayer->GetBaseEndurance(); v26 = pPlayer->GetActualEndurance(); v27 = UI_GetHealthManaStringColor(v26, v25); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[75], v27, v24, v23); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v24, v23); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v22, 0, pTmpBuf, 0, 0, 0); v28 = LOBYTE(pFontArrus->uFontHeight) + v22 - 2; v29 = pPlayer->GetBaseAccuracy(); @@ -17429,7 +17429,7 @@ v31 = pPlayer->GetBaseAccuracy(); v32 = pPlayer->GetActualAccuracy(); v33 = UI_GetHealthManaStringColor(v32, v31); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[1], v33, v30, v29); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v30, v29); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v28, 0, pTmpBuf, 0, 0, 0); v34 = LOBYTE(pFontArrus->uFontHeight) + v28 - 2; v35 = pPlayer->GetBaseSpeed(); @@ -17437,7 +17437,7 @@ v37 = pPlayer->GetBaseSpeed(); v38 = pPlayer->GetActualSpeed(); v39 = UI_GetHealthManaStringColor(v38, v37); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[211], v39, v36, v35); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v36, v35); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v34, 0, pTmpBuf, 0, 0, 0); v40 = LOBYTE(pFontArrus->uFontHeight) + v34 - 2; v41 = pPlayer->GetBaseLuck(); @@ -17445,22 +17445,22 @@ v43 = pPlayer->GetBaseLuck(); v44 = pPlayer->GetActualLuck(); v45 = UI_GetHealthManaStringColor(v44, v43); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[136], v45, v42, v41); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v42, v41); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v40, 0, pTmpBuf, 0, 0, 0); - a2 = "%s"; + a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; v46 = v40 + 2 * LOBYTE(pFontArrus->uFontHeight) + 5; if ( pPlayer->GetMaxHealth() >= 1000 ) - a2 = (const char *)&unk_4E2EB8; + a2 = "%s\f%05u\r388%d\f00000 / %d\n"; v47 = pPlayer->GetMaxHealth(); v48 = pPlayer->sHealth; v49 = pPlayer->GetMaxHealth(); v50 = UI_GetHealthManaStringColor(pPlayer->sHealth, v49); sprintf(pTmpBuf, a2, pGlobalTXT_LocalizationStrings[108], v50, v48, v47); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v46, 0, pTmpBuf, 0, 0, 0); - a2a = "%s"; + a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n"; uY = LOBYTE(pFontArrus->uFontHeight) + v46 - 2; if ( pPlayer->GetMaxMana() >= 1000 ) - a2a = (const char *)&unk_4E2EB8; + a2a = "%s\f%05u\r388%d\f00000 / %d\n"; v51 = pPlayer->GetMaxMana(); v52 = pPlayer->sMana; v53 = pPlayer->GetMaxMana(); @@ -17473,13 +17473,13 @@ v58 = pPlayer->GetBaseAC(); v59 = pPlayer->GetActualAC(); v60 = UI_GetHealthManaStringColor(v59, v58); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[12], v60, v57, v56); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v57, v56); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v55, 0, pTmpBuf, 0, 0, 0); v61 = v55 + 2 * LOBYTE(pFontArrus->uFontHeight) - 2; v62 = pPlayer->GetMajorConditionIdx(); v63 = aCharacterConditionNames[v62]; v64 = GetConditionDrawColor(v62); - sprintf(pTmpBuf, "%s: ", pGlobalTXT_LocalizationStrings[47], v64, v63); + sprintf(pTmpBuf, "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, v63); pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v61, 0, pTmpBuf, 226, 0); v65 = LOBYTE(pFontArrus->uFontHeight) + v61 - 1; v66 = pPlayer->uQuickSpell; @@ -17494,9 +17494,9 @@ v70 = pPlayer->GetBaseAge(); v71 = pPlayer->GetActualAge(); v72 = UI_GetHealthManaStringColor(v71, v70); - sprintf(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[5], v72, v69, v68); + sprintf(pTmpBuf, "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v69, v68); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, 50, 0, pTmpBuf, 0, 0, 0); - a2b = "%s"; + a2b = "%s\f%05u\t100%d\f00000 / %d\n"; uYa = LOBYTE(pFontArrus->uFontHeight) + 48; if ( pPlayer->GetBaseLevel() > 99 ) a2b = format_4E2E68; @@ -17515,7 +17515,7 @@ v79 = LODWORD(pPlayer->uExperience); v80 = v78; v81 = pPlayer->GetExperienceDisplayColor(); - sprintf(pTmpBuf, "%s\r180", v80, v81, v79); + sprintf(pTmpBuf, "%s\r180\f%05d%lu\f00000\n\n", v80, v81, v79); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYb, 0, pTmpBuf, 0, 0, 0); v82 = uYb + 2 * LOBYTE(pFontArrus->uFontHeight); v83 = pPlayer->GetActualAttack(0);
--- a/mm7_6.cpp Sun Jan 20 20:52:13 2013 +0000 +++ b/mm7_6.cpp Sun Jan 20 21:58:23 2013 +0000 @@ -7856,8 +7856,8 @@ v0 = uActiveCharacter; v27 = 6972 * uActiveCharacter; - v1 = (Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; - result = ((Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552])->CanAct(); + v1 = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552]; + result = pParty->pPlayers[uActiveCharacter-1].CanAct();//((Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552])->CanAct(); if ( result ) { pStru277->_427D48(v0);
--- a/mm7_data.cpp Sun Jan 20 20:52:13 2013 +0000 +++ b/mm7_data.cpp Sun Jan 20 21:58:23 2013 +0000 @@ -543,7 +543,6 @@ char aS_6[2]; // idb char aSS_0[777]; // idb char aS_5[4]; // idb -_UNKNOWN unk_4E2EB8; // weak char string_4E3294[8]; char Format[777]; // idb char aMem03i_txt[777]; // idb
--- a/mm7_data.h Sun Jan 20 20:52:13 2013 +0000 +++ b/mm7_data.h Sun Jan 20 21:58:23 2013 +0000 @@ -529,7 +529,6 @@ extern char aS_6[2]; // idb extern char aSS_0[]; // idb extern char aS_5[4]; // idb -extern _UNKNOWN unk_4E2EB8; // weak extern char string_4E3294[8]; extern char Format[]; // idb extern char aMem03i_txt[]; // idb