Mercurial > mm7
changeset 271:1f0af5cac2dd
_42ECB5_PlayerAttacksActor
author | Nomad |
---|---|
date | Mon, 18 Feb 2013 13:07:25 +0200 |
parents | 0b58962bf229 |
children | 6e585f21a01e |
files | Actor.h GUIButton.h GUIWindow.cpp GUIWindow.h Game.cpp Items.h Keyboard.cpp Party.h Weather.cpp Weather.h mm7_2.cpp mm7_5.cpp mm7_6.cpp mm7_data.h |
diffstat | 14 files changed, 165 insertions(+), 158 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.h Mon Feb 18 11:29:55 2013 +0200 +++ b/Actor.h Mon Feb 18 13:07:25 2013 +0200 @@ -23,7 +23,7 @@ int _427546(int a2); int CalcMagicalDamageToActor(struct Actor *pActor, int a2, signed int a3); bool GetMagicalResistance(struct Actor *pActor, unsigned int uType); - int FindClosesActor(int a2, int a3, int a4); + int FindClosestActor(int a2, int a3, int a4); char field_0; };
--- a/GUIButton.h Mon Feb 18 11:29:55 2013 +0200 +++ b/GUIButton.h Mon Feb 18 13:07:25 2013 +0200 @@ -21,7 +21,7 @@ unsigned int uControlID; unsigned int uControlParam; int field_28; - int field_2C; + int field_2C_is_pushed; GUIButton *pPrev; GUIButton *pNext; struct GUIWindow *pParent;
--- a/GUIWindow.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/GUIWindow.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -1727,7 +1727,7 @@ v15 = v14 + uWidth - 1; pButton->uZ = v15; v17 = pButton->uY; - pButton->field_2C = 0; + pButton->field_2C_is_pushed = 0; pButton->uW = v17 + uHeight - 1; pButton->field_1C = a7; pButton->uControlID = uControlID;
--- a/GUIWindow.h Mon Feb 18 11:29:55 2013 +0200 +++ b/GUIWindow.h Mon Feb 18 13:07:25 2013 +0200 @@ -166,7 +166,7 @@ UIMSG_E = 0xE, UIMSG_F = 0xF, UIMSG_11 = 0x11, - UIMSG_17 = 0x17, + UIMSG_Attack = 23, UIMSG_19 = 0x19, UIMSG_1B = 0x1B, UIMSG_1C = 0x1C,
--- a/Game.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/Game.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -1051,7 +1051,7 @@ //----- (0044EB12) -------------------------------------------------------- bool Game::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) { - if ( !pCurrentScreen && pVisInstance && pRenderer->pRenderD3D ) + if (pCurrentScreen == SCREEN_GAME && pVisInstance && pRenderer->pRenderD3D) { bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter);
--- a/Items.h Mon Feb 18 11:29:55 2013 +0200 +++ b/Items.h Mon Feb 18 13:07:25 2013 +0200 @@ -26,6 +26,8 @@ ITEM_CROSSBOW_1 = 0x2F, ITEM_MACE_1 = 0x32, ITEM_STAFF_1 = 0x3D, + ITEM_BLASTER = 65, + ITEM_LASER_RIFLE = 66, ITEM_LEATHER_1 = 0x42, ITEM_CHAINMAIL_1 = 0x47, ITEM_PLATE_1 = 0x4C, @@ -94,6 +96,8 @@ Reset(); } + inline bool Broken() {return uAttributes & ITEM_BROKEN;} + bool GenerateArtifact(); unsigned int GetValue(); const char *GetDisplayName();
--- a/Keyboard.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/Keyboard.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -36,6 +36,7 @@ KeyboardActionMapping::KeyboardActionMapping() { uLastKeyPressed = 0; + field_204 = 0; SetDefaultMapping(); ReadMappings();
--- a/Party.h Mon Feb 18 11:29:55 2013 +0200 +++ b/Party.h Mon Feb 18 13:07:25 2013 +0200 @@ -37,7 +37,7 @@ PARTY_BUFF_HASTE = 0x8, PARTY_BUFF_HEROISM = 0x9, PARTY_BUFF_IMMOLATION = 0xA, - PARTY_BUFF_INVISIBILITY = 0xB, + PARTY_BUFF_INVISIBILITY = 11, PARTY_BUFF_RESIST_MIND = 0xC, PARTY_BUFF_PROTECTION_FROM_MAGIC = 0xD, PARTY_BUFF_SHIELD = 0xE,
--- a/Weather.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/Weather.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -197,7 +197,7 @@ } //----- (004C2F0B) -------------------------------------------------------- -bool Weather::_4C2F0B(__int16 a2) +bool Weather::OnPlayerTurn(__int16 a2) { int v3; // edx@3 signed int v4; // ebx@3
--- a/Weather.h Mon Feb 18 11:29:55 2013 +0200 +++ b/Weather.h Mon Feb 18 13:07:25 2013 +0200 @@ -12,7 +12,7 @@ int DrawSnow(); int Initialize(); int Draw(); - bool _4C2F0B(__int16 a2); + bool OnPlayerTurn(__int16 dangle);
--- a/mm7_2.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/mm7_2.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -9124,24 +9124,26 @@ } //----- (00452A9E) -------------------------------------------------------- -signed int __fastcall sub_452A9E(signed int a1) +int sub_452A9E(int square_distance) { signed int result; // eax@2 int v2; // edx@3 - signed int v3; // edi@3 - signed int v4; // ebx@3 + unsigned int v3; // edi@3 + //signed int v4; // ebx@3 int v5; // esi@4 - if ( a1 > 1 ) - { + if (square_distance < 1) + return square_distance; + + v2 = 0; - v3 = a1; + v3 = square_distance; result = 0; - v4 = 16; - do - { + //v4 = 16; + for (uint i = 0; i < 16; ++i) + { result *= 2; - v2 = ((unsigned int)v3 >> 30) | 4 * v2; + v2 = (v3 >> 30) | 4 * v2; v5 = 2 * result + 1; v3 *= 4; if ( v2 >= (unsigned int)v5 ) @@ -9149,17 +9151,11 @@ ++result; v2 -= v5; } - --v4; - } - while ( v4 ); - if ( a1 - result * result >= (unsigned int)(result - 1) ) + //--v4; + } + //while ( v4 ); + if ( square_distance - result * result >= (unsigned int)(result - 1) ) ++result; - } - else - { - result = a1; - } - return result; } //----- (00452AE2) --------------------------------------------------------
--- a/mm7_5.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/mm7_5.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -2729,7 +2729,8 @@ Actor::StealFrom(uMessageParam); } continue; - case 0x17: + + case UIMSG_Attack: if ( !uActiveCharacter ) //goto LABEL_90; { @@ -16516,8 +16517,7 @@ y = pY; x = pX; } - if ( pCurrentScreen - || !dword_507B98_ctrl_pressed ) + if ( pCurrentScreen != SCREEN_GAME || !dword_507B98_ctrl_pressed ) goto LABEL_30; v4 = GetCurrentMenuID(); x = pX; @@ -16564,7 +16564,7 @@ if ( x >= (signed int)i->uX && x <= (signed int)i->uZ && y >= (signed int)i->uY && y <= (signed int)i->uW ) { LABEL_50: - i->field_2C = 1; + i->field_2C_is_pushed = 1; v10 = pMessageQueue_50CBD0->uNumMessages; if ( pMessageQueue_50CBD0->uNumMessages ) {
--- a/mm7_6.cpp Mon Feb 18 11:29:55 2013 +0200 +++ b/mm7_6.cpp Mon Feb 18 13:07:25 2013 +0200 @@ -3323,7 +3323,7 @@ v666 = 1; else v666 = v1; - a2 = stru_50C198.FindClosesActor(5120, 1, v666); + a2 = stru_50C198.FindClosestActor(5120, 1, v666); v6 = pMouse->uPointingObjectID; if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) { @@ -7832,16 +7832,16 @@ } //----- (0042ECB5) -------------------------------------------------------- -bool __cdecl _42ECB5_PlayerAttacksActor() +void _42ECB5_PlayerAttacksActor() { - unsigned int v0; // ebx@1 - Player *v1; // esi@1 - bool result; // eax@1 + //unsigned int v0; // ebx@1 + //Player *v1; // esi@1 + //bool result; // eax@1 int v3; // edi@2 - unsigned int v4; // eax@7 + //unsigned int v4; // eax@7 char *v5; // eax@8 - int v6; // ecx@9 - signed int v7; // eax@16 + //int v6; // ecx@9 + //signed int v7; // eax@16 Actor *v8; // edi@20 unsigned int v9; // ecx@21 char *v10; // eax@26 @@ -7860,74 +7860,88 @@ int v23; // [sp-4h] [bp-40h]@44 SoundID v24; // [sp-4h] [bp-40h]@58 Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 - unsigned int a2; // [sp+18h] [bp-24h]@20 - unsigned int v27; // [sp+1Ch] [bp-20h]@1 + //unsigned int a2; // [sp+18h] [bp-24h]@20 + //unsigned int v27; // [sp+1Ch] [bp-20h]@1 int v28; // [sp+20h] [bp-1Ch]@9 - unsigned int *v28b; + //unsigned int *v28b; int v29; // [sp+24h] [bp-18h]@16 int v30; // [sp+28h] [bp-14h]@16 - int v31; // [sp+2Ch] [bp-10h]@4 + //int v31; // [sp+2Ch] [bp-10h]@4 int v32; // [sp+30h] [bp-Ch]@7 - int v33; // [sp+34h] [bp-8h]@7 + //int v33; // [sp+34h] [bp-8h]@7 int v34; // [sp+38h] [bp-4h]@17 - v0 = uActiveCharacter; - v27 = 6972 * uActiveCharacter; - v1 = &pParty->pPlayers[uActiveCharacter-1]; - result = pParty->pPlayers[uActiveCharacter-1].CanAct(); - if ( result ) + //v0 = uActiveCharacter; + //v27 = 6972 * uActiveCharacter; + //v1 = &pParty->pPlayers[uActiveCharacter-1]; + //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); + auto player = &pParty->pPlayers[uActiveCharacter - 1]; + if (!player->CanAct()) + return; + + pStru277->_427D48(uActiveCharacter); + v3 = 0; + if (pParty->Invisible()) + pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); + + //v31 = player->pEquipment.uBow; + int bow_idx = player->pEquipment.uBow; + if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) + bow_idx = 0; + + v32 = 0; + //v33 = 0; + //v4 = v1->pEquipment.uMainHand; + int laser_weapon_item_id = 0; + + int main_hand_idx = player->pEquipment.uMainHand; + if (main_hand_idx) { - pStru277->_427D48(v0); - v3 = 0; - if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 ) - pParty->pPartyBuffs[11].Reset(); - v31 = v1->pEquipment.uBow; - if ( v31 && v1->field_1F5[36 * v31 + 15] & 2 ) - v31 = 0; - v4 = v1->pEquipment.uMainHand; - v32 = 0; - v33 = 0; - if ( v4 ) - { + auto item = &player->pInventoryItems[main_hand_idx - 1]; //v5 = (char *)v1 + 36 * v4; - if ( !(v1->pInventoryItems[v4].field_1A & 2) )//v5[516] & 2) ) + if (!item->Broken()) + { + //v28b = &v1->pInventoryItems[v4].uItemID; + //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); + if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_C) { - v28b = &v1->pInventoryItems[v4].uItemID; - v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); - if ( pItemsTable->pItems[v6].uEquipType == 12 ) - { - if ( v1->pInventoryItems[v4]._bonus_type <= 0 ) - { - *v28b = 0; - v1->pEquipment.uMainHand = 0; - } - else - { - v32 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); - } - } + if (item->_bonus_type <= 0) + player->pEquipment.uMainHand = 0; else - { - if ( v6 == 64 || v6 == 65 ) - v33 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); - } + v32 = item->uItemID;//*((int *)v5 + 124); } + else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) + laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); } + } + v30 = 0; v29 = 0; v28 = 0; - v7 = pMouse->uPointingObjectID; - if ( (pMouse->uPointingObjectID & 7) != OBJECT_Actor || (v34 = pMouse->uPointingObjectID, !pActors[v7 >> 3].CanAct()) ) - v34 = stru_50C198.FindClosesActor(5120, 0, 0); + //v7 = pMouse->uPointingObjectID; + + int target_pid = pMouse->uPointingObjectID; + int target_type = target_pid & 7, + target_id = target_pid >> 3; + if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) + { + target_pid = stru_50C198.FindClosestActor(5120, 0, 0); + target_type = target_pid & 7; + target_id = target_pid >> 3; + } + + a3.z = 0; a3.y = 0; a3.x = 0; - if ( (v34 & 7) == OBJECT_Actor) - { - a2 = v34 >> 3; - v8 = &pActors[v34 >> 3]; - v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.y) * (v8->vPosition.y - pParty->vPosition.y) + (v8->vPosition.z - pParty->vPosition.z) * (v8->vPosition.z - pParty->vPosition.z)) - - v8->uActorRadius; + if (target_type == OBJECT_Actor) + { + //a2 = target_id; + v8 = &pActors[target_id]; + int distance_x = v8->vPosition.x - pParty->vPosition.x, + distance_y = v8->vPosition.y - pParty->vPosition.y, + distance_z = v8->vPosition.z - pParty->vPosition.z; + v34 = sub_452A9E(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - v8->uActorRadius; if ( v34 >= 0 ) { v9 = 0; @@ -7937,15 +7951,15 @@ v9 = 0; v34 = 0; } - if ( v33 != v9 ) + if ( laser_weapon_item_id != v9 ) { v28 = 1; - v22 = v0 + 8; + v22 = uActiveCharacter + 8; v20 = v9; v18 = v9; v16 = 102; LABEL_34: - _42777D_CastSpell_UseWand_ShootArrow(v16, v0 - 1, v18, v20, v22); + _42777D_CastSpell_UseWand_ShootArrow(v16, uActiveCharacter - 1, v18, v20, v22); LABEL_28: v3 = 0; goto LABEL_29; @@ -7955,18 +7969,18 @@ v29 = 1; _42777D_CastSpell_UseWand_ShootArrow( *((int *)&pSpellDatas[66].field_8 - + *(int *)(&stru_AA1058[3].pSounds[36 * *(int *)&pParty->pArtifactsFound[v27 + 22] + 41048] + v27)), - v0 - 1, + + *(int *)(&stru_AA1058[3].pSounds[36 * *(int *)&pParty->pArtifactsFound[6972 * uActiveCharacter + 22] + 41048] + 6972 * uActiveCharacter)), + uActiveCharacter - 1, 8u, v9, - v0 + 8); - v10 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; + uActiveCharacter + 8); + v10 = &player->field_1F5[36 * player->pEquipment.uMainHand + 11]; --*(int *)v10; - v11 = (char *)v1 + 36 * v1->pEquipment.uMainHand; + v11 = (char *)player + 36 * player->pEquipment.uMainHand; if ( *((int *)v11 + 128) <= 0 ) { *((int *)v11 + 124) = 0; - v1->pEquipment.uMainHand = 0; + player->pEquipment.uMainHand = 0; } goto LABEL_28; } @@ -7976,19 +7990,19 @@ a3.y = v8->vPosition.y - pParty->vPosition.y; a3.z = v8->vPosition.z - pParty->vPosition.z; Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); - DamageMonsterFromParty((8 * v0 - 8) | 4, a2, &a3); - if ( v1->WearsItem(506, 1) || v1->WearsItem(506, 0) ) + DamageMonsterFromParty((8 * uActiveCharacter - 8) | OBJECT_Player, target_id, &a3); + if ( player->WearsItem(506, 1) || player->WearsItem(506, 0) ) _42FA66_do_explosive_impact( v8->vPosition.x, v8->vPosition.y, v8->vPosition.z + v8->uActorHeight / 2, 0, 512, - v0); + uActiveCharacter); } else { - if ( v31 != v9 ) + if ( bow_idx != v9 ) { v30 = 1; v22 = 0; @@ -8001,10 +8015,11 @@ v3 = 0; goto LABEL_39; } - if ( v33 ) + + if ( laser_weapon_item_id ) { v28 = 1; - v23 = v0 + 8; + v23 = uActiveCharacter + 8; v21 = 0; v19 = 0; v17 = 102; @@ -8013,33 +8028,33 @@ { if ( v32 ) { - v12 = v1->pEquipment.uMainHand; + v12 = player->pEquipment.uMainHand; v29 = 1; _42777D_CastSpell_UseWand_ShootArrow( - *((int *)&pSpellDatas[66].field_8 + *(int *)&v1->pInventoryItems[v12-1]), - v0 - 1, + *((int *)&pSpellDatas[66].field_8 + *(int *)&player->pInventoryItems[v12-1]), + uActiveCharacter - 1, 8u, 0, - v0 + 8); - v13 = &v1->field_1F5[36 * v1->pEquipment.uMainHand + 11]; + uActiveCharacter + 8); + v13 = &player->field_1F5[36 * player->pEquipment.uMainHand + 11]; --*(int *)v13; - v14 = (char *)v1 + 36 * v1->pEquipment.uMainHand; + v14 = (char *)player + 36 * player->pEquipment.uMainHand; if ( *((int *)v14 + 128) <= 0 ) { *((int *)v14 + 124) = 0; - v1->pEquipment.uMainHand = 0; + player->pEquipment.uMainHand = 0; } LABEL_29: v34 = v3; if ( v30 == v3 ) { if ( v29 != v3 ) - return 1; + return; if ( v28 == v3 ) { - v15 = v1->pEquipment.uMainHand; - if ( v1->HasItemEquipped(EQUIP_TWO_HANDED) ) - v34 = pItemsTable->pItems[*(int *)&v1->pInventoryItems[v15-1]].uSkillType; + v15 = player->pEquipment.uMainHand; + if ( player->HasItemEquipped(EQUIP_TWO_HANDED) ) + v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[v15-1]].uSkillType; pTurnEngine->_40471C(); } else @@ -8050,7 +8065,7 @@ else { v34 = 5; - v1->PlaySound(SPEECH_50, v3); + player->PlaySound(SPEECH_50, v3); } switch ( v34 ) { @@ -8081,18 +8096,18 @@ pAudioPlayer->PlaySound(v24, v3, v3, -1, v3, v3, v3, v3); break; default: - return 1; - } - return 1; + return; + } + return; } - if ( !v31 ) + if ( !bow_idx ) { LABEL_39: - v31 = v1->GetAttackRecoveryTime(v3); + int v31 = player->GetAttackRecoveryTime(v3); if ( v31 < 30 ) v31 = 30; if ( pParty->bTurnBasedModeOn == v3 ) - v1->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v31 * 2.133333333333333)); + player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v31 * 2.133333333333333)); goto LABEL_29; } v23 = 0; @@ -8101,14 +8116,12 @@ v30 = 1; v17 = 100; } - _42777D_CastSpell_UseWand_ShootArrow(v17, v0 - 1, v19, v21, v23); + _42777D_CastSpell_UseWand_ShootArrow(v17, uActiveCharacter - 1, v19, v21, v23); goto LABEL_29; - } - return result; } //----- (0042F184) -------------------------------------------------------- -int stru319::FindClosesActor(int a2, int a3, int a4) +int stru319::FindClosestActor(int a2, int a3, int a4) { int v4; // edi@1 stru319 *v5; // esi@1 @@ -8899,7 +8912,7 @@ int v17; // [sp-14h] [bp-1Ch]@8 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54 - __int16 v20; // [sp-14h] [bp-1Ch]@60 + //__int16 v20; // [sp-14h] [bp-1Ch]@60 int v21; // [sp-14h] [bp-1Ch]@68 int v22; // [sp-Ch] [bp-14h]@158 InputAction inputAction; // [sp+0h] [bp-8h]@7 @@ -8941,7 +8954,7 @@ switch ( inputAction ) { case INPUT_MoveForward: - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if (!pParty->bTurnBasedModeOn) //goto _do_move_forward; @@ -8971,7 +8984,7 @@ break; case INPUT_MoveBackwards: //__debugbreak(); - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if (!pParty->bTurnBasedModeOn) //goto _do_move_backwards; @@ -9001,7 +9014,7 @@ break; case INPUT_StrafeLeft: //__debugbreak(); - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if (!pParty->bTurnBasedModeOn) //goto _do_strafe_left; @@ -9023,7 +9036,7 @@ break; case INPUT_StrafeRight: //__debugbreak(); - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if (!pParty->bTurnBasedModeOn) //goto _do_strafe_right; @@ -9044,7 +9057,7 @@ v5->Add(partyAction); break; case INPUT_TurnLeft: - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if ( GetAsyncKeyState(VK_CONTROL) ) // strafing { @@ -9066,14 +9079,11 @@ pActionQueue->Add(partyAction_); if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) { - v20 = 10; - //goto LABEL_75; - pWeather->_4C2F0B(v20); - break; + pWeather->OnPlayerTurn(10); } break; case INPUT_TurnRight: - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if ( GetAsyncKeyState(17) ) // strafing { @@ -9083,27 +9093,24 @@ break; pTurnEngine->uActionPointsLeft -= 26; } - v21 = 4; + v21 = PARTY_StrafeRight; } else { if ( pParty->uFlags2 & 2 ) - v21 = 19; + v21 = PARTY_FastTurnRight; else - v21 = 2; + v21 = PARTY_TurnRight; } pActionQueue->Add((PartyAction)v21); if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) { - v20 = -10; -//LABEL_75: - pWeather->_4C2F0B(v20); + pWeather->OnPlayerTurn(-10); } break; case INPUT_Jump: //__debugbreak(); - if ( pCurrentScreen - || pParty->bTurnBasedModeOn) + if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) break; partyAction = (PartyAction)12; //goto _add_action_and_continue_; @@ -9143,7 +9150,7 @@ break; case INPUT_Combat: //__debugbreak(); - if ( !pCurrentScreen ) + if (pCurrentScreen == SCREEN_GAME) { if (pParty->bTurnBasedModeOn) { @@ -9162,7 +9169,7 @@ break; case INPUT_CastReady: //__debugbreak(); - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) //goto LABEL_118; @@ -9181,9 +9188,10 @@ { pActionQueue = pPartyActionQueue; LABEL_120: + if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; //goto _send_message; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; @@ -9205,7 +9213,7 @@ break; case INPUT_Attack: //__debugbreak(); - if ( pCurrentScreen ) + if (pCurrentScreen != SCREEN_GAME) break; if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) goto LABEL_120; @@ -9213,11 +9221,11 @@ pTurnEngine->field_18 |= 8u; break; case INPUT_EventTrigger: - if ( !pCurrentScreen ) + if (pCurrentScreen == SCREEN_GAME) { if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) break; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)404; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action; //goto _send_message; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; @@ -9234,7 +9242,7 @@ v11 = 1; pMessageQueue_50CBD0->uNumMessages = 1; //LABEL_132: - pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; + pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; //_send_message: pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; @@ -9247,7 +9255,7 @@ if ( (signed int)v11 < 40 ) //goto LABEL_132; { - pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)113; + pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; ++pMessageQueue_50CBD0->uNumMessages;
--- a/mm7_data.h Mon Feb 18 11:29:55 2013 +0200 +++ b/mm7_data.h Mon Feb 18 13:07:25 2013 +0200 @@ -1933,7 +1933,7 @@ bool __fastcall sub_427769_spell(unsigned int uSpellID); bool __fastcall _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6); int __fastcall sub_42EBBE(int, int); // weak -bool __cdecl _42ECB5_PlayerAttacksActor(); +void _42ECB5_PlayerAttacksActor(); void __thiscall InitializeTurnBasedAnimations(void *); signed int __cdecl sub_42F4DA(); bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9); @@ -2052,8 +2052,6 @@ signed int __cdecl const_2(); bool __cdecl sub_44C28F_open_nwc_dungeon(); // int __cdecl crt_deconstruct_44C42C(); - - void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5); int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3); void __cdecl sub_450218_prolly_generate_chests_loot(); @@ -2063,7 +2061,7 @@ bool __fastcall SpawnActor(unsigned int uMonsterID); int __cdecl GetAlertStatus(); unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4); -signed int __fastcall sub_452A9E(signed int a1); +int sub_452A9E(int a1); int __fastcall MakeColorMaskFromBitDepth(int a1); void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels); int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb