diff mm7_2.cpp @ 947:99aa9c8464cf

Improved conditions handling.
author Nomad
date Wed, 01 May 2013 14:30:02 +0200
parents eb3bb0f2e1b9
children 5a2dbb00c399
line wrap: on
line diff
--- a/mm7_2.cpp	Wed May 01 14:10:16 2013 +0200
+++ b/mm7_2.cpp	Wed May 01 14:30:02 2013 +0200
@@ -6823,7 +6823,9 @@
     {
       switch (wParam)
       {
-        case 101:
+        case 103:  pRenderer->SavePCXScreenshot();  return 0;
+
+        case 101:  // Quit game
         case 40001:
         {
           v38 = 0;
@@ -6834,9 +6836,6 @@
         }
         return 0;
 
-        case 103:
-          pRenderer->SavePCXScreenshot();
-        return 0;
 
         case 104:
           pRenderer->ChangeBetweenWinFullscreenModes();
@@ -6844,95 +6843,33 @@
             pArcomageGame->field_F6 = 1;
         return 0;
 
-        case 40007:
-          pParty->SetGold(pParty->uNumGold + 10000);
-        return 0;
-
-        case 40008:
-          GivePartyExp(20000);
-        return 0;
-
-        case 40013:
-          pParty->SetGold(0);
-        return 0;
+        case 40007:  pParty->SetGold(pParty->uNumGold + 10000); return 0;
+        case 40008:  GivePartyExp(20000);  return 0;
+        case 40013:  pParty->SetGold(0);   return 0;
 
         case 40059:
           for (uint i = 0; i < 4; ++i)
             pParty->pPlayers[i].uSkillPoints = 50;
         return 0;
-
-        case 40044://condition Afraid/fear
-          pPlayers[uActiveCharacter]->pConditions[3] = 1;
-        return 0;
-
-        case 40043://condition Asleep
-          pPlayers[uActiveCharacter]->pConditions[2] = 1;
-        return 0;
-
-        case 40037://condition Curse
-          pPlayers[uActiveCharacter]->pConditions[0] = 1;
-        return 0;
-
-        case 40036://condition Disease1
-          pPlayers[uActiveCharacter]->pConditions[7] = 1;
-        return 0;
-
-        case 40035://condition Disease2
-          pPlayers[uActiveCharacter]->pConditions[9] = 1;
-        return 0;
-
-        case 40034://condition Disease3
-          pPlayers[uActiveCharacter]->pConditions[11] = 1;
-        return 0;
-
-        case 40041://condition Dead
-          pPlayers[uActiveCharacter]->pConditions[14] = 1;
-        return 0;
-
-        case 40039://condition Drunk
-          pPlayers[uActiveCharacter]->pConditions[4] = 1;
-        return 0;
-
-        case 40042://condition Eradicated
-          pPlayers[uActiveCharacter]->pConditions[16] = 1;
-        return 0;
-
-        case 40038://condition Isane
-          pPlayers[uActiveCharacter]->pConditions[5] = 1;
-        return 0;
-
-        case 40045://condition Paralized
-          pPlayers[uActiveCharacter]->pConditions[12] = 1;
-        return 0;
-
-        case 40033://condition Poison1
-          pPlayers[uActiveCharacter]->pConditions[6] = 1;
-        return 0;
-
-        case 40032://condition Poison2
-          pPlayers[uActiveCharacter]->pConditions[8] = 1;
-        return 0;
-
-        case 40031://condition Poison3
-          pPlayers[uActiveCharacter]->pConditions[10] = 1;
-        return 0;
-
-        case 40029://condition Stone
-          pPlayers[uActiveCharacter]->pConditions[15] = 1;
-        return 0;
-
-        case 40040://condition Unconscious
-          pPlayers[uActiveCharacter]->pConditions[13] = 1;
-        return 0;
-
-        case 40030://condition Weak
-          pPlayers[uActiveCharacter]->pConditions[1] = 1;
-        return 0;
-
-        case 40073://condition Zombie
-          pPlayers[uActiveCharacter]->pConditions[17] = 1;
-        return 0;
-
+        
+        case 40029:  pPlayers[uActiveCharacter]->SetPertified(true);  return 0;
+        case 40030:  pPlayers[uActiveCharacter]->SetWeak(true);       return 0;
+        case 40031:  pPlayers[uActiveCharacter]->SetPoison3(true);    return 0;
+        case 40032:  pPlayers[uActiveCharacter]->SetPoison2(true);    return 0;
+        case 40033:  pPlayers[uActiveCharacter]->SetPoison1(true);    return 0;
+        case 40034:  pPlayers[uActiveCharacter]->SetDisease3(true);   return 0;
+        case 40035:  pPlayers[uActiveCharacter]->SetDisease2(true);   return 0;
+        case 40036:  pPlayers[uActiveCharacter]->SetDisease1(true);   return 0;
+        case 40037:  pPlayers[uActiveCharacter]->SetCursed(true);     return 0;
+        case 40038:  pPlayers[uActiveCharacter]->SetInsane(true);     return 0;
+        case 40039:  pPlayers[uActiveCharacter]->SetDrunk(true);      return 0;
+        case 40040:  pPlayers[uActiveCharacter]->SetUnconcious(true); return 0;
+        case 40041:  pPlayers[uActiveCharacter]->SetDead(true);       return 0;
+        case 40042:  pPlayers[uActiveCharacter]->SetEradicated(true); return 0;
+        case 40043:  pPlayers[uActiveCharacter]->SetAsleep(true);     return 0;
+        case 40044:  pPlayers[uActiveCharacter]->SetAfraid(true);     return 0;
+        case 40045:  pPlayers[uActiveCharacter]->SetParalyzed(true);  return 0;
+        case 40073:  pPlayers[uActiveCharacter]->SetZombie(true);     return 0;
       }
     }
     return DefWindowProcA(hWnd, Msg, wParam, lParam);