diff Party.cpp @ 1439:468f434a8d8a

Слияние
author Ritor1
date Mon, 22 Jul 2013 18:00:58 +0600
parents c0b273d33338
children 16a24dc103e7
line wrap: on
line diff
--- a/Party.cpp	Mon Jul 22 18:00:34 2013 +0600
+++ b/Party.cpp	Mon Jul 22 18:00:58 2013 +0600
@@ -26,6 +26,7 @@
 #include "Sprites.h"
 #include "SpriteObject.h"
 #include "ObjectList.h"
+#include "Conditions.h"
 
 Party *pParty; // idb
 
@@ -251,7 +252,7 @@
   while ( v2 <= &pParty->pPlayers[3] )
   {
     v3 = 0;
-	v4 = v2->pInventoryItems;
+	v4 = v2->pInventoryItemList;
     do
     {
       if ( v4->uItemID == uItemID )
@@ -561,7 +562,7 @@
         //v10 = uSkillIdx - 35 < 0;
       }
       //while (uSkillIdx < 36);
-      pItems = pCharacter->pInventoryItems;
+      pItems = pCharacter->pInventoryItemList;
       //v13 = 138;
       for (int i = 0; i < 138; i++)
       {
@@ -949,7 +950,7 @@
 
 
     auto condition = player->GetMajorConditionIdx();
-    if (condition == Player::Condition_Good || condition == Player::Condition_Zombie)
+    if (condition == Condition_Good || condition == Condition_Zombie)
     {
       if (player->uExpressionTimePassed < player->uExpressionTimeLength)
         continue;
@@ -999,23 +1000,23 @@
 
       switch (condition)
       {
-        case Player::Condition_Dead:        player->expression = CHARACTER_EXPRESSION_DEAD;      break;
-        case Player::Condition_Pertified:   player->expression = CHARACTER_EXPRESSION_PERTIFIED; break;
-        case Player::Condition_Eradicated:  player->expression = CHARACTER_EXPRESSION_ERADICATED; break;
-        case Player::Condition_Cursed:      player->expression = CHARACTER_EXPRESSION_CURSED; break;
-        case Player::Condition_Weak:        player->expression = CHARACTER_EXPRESSION_WEAK; break;
-        case Player::Condition_Sleep:       player->expression = CHARACTER_EXPRESSION_SLEEP; break;
-        case Player::Condition_Fear:        player->expression = CHARACTER_EXPRESSION_FEAR; break;
-        case Player::Condition_Drunk:       player->expression = CHARACTER_EXPRESSION_DRUNK; break;
-        case Player::Condition_Insane:      player->expression = CHARACTER_EXPRESSION_INSANE; break;
-        case Player::Condition_Poison1:
-        case Player::Condition_Poison2:
-        case Player::Condition_Poison3:     player->expression = CHARACTER_EXPRESSION_POISONED; break;
-        case Player::Condition_Disease1:
-        case Player::Condition_Disease2:
-        case Player::Condition_Disease3:    player->expression = CHARACTER_EXPRESSION_DISEASED; break;
-        case Player::Condition_Paralyzed:   player->expression = CHARACTER_EXPRESSION_PARALYZED; break;
-        case Player::Condition_Unconcious:  player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break;
+        case Condition_Dead:        player->expression = CHARACTER_EXPRESSION_DEAD;      break;
+        case Condition_Pertified:   player->expression = CHARACTER_EXPRESSION_PERTIFIED; break;
+        case Condition_Eradicated:  player->expression = CHARACTER_EXPRESSION_ERADICATED; break;
+        case Condition_Cursed:      player->expression = CHARACTER_EXPRESSION_CURSED; break;
+        case Condition_Weak:        player->expression = CHARACTER_EXPRESSION_WEAK; break;
+        case Condition_Sleep:       player->expression = CHARACTER_EXPRESSION_SLEEP; break;
+        case Condition_Fear:        player->expression = CHARACTER_EXPRESSION_FEAR; break;
+        case Condition_Drunk:       player->expression = CHARACTER_EXPRESSION_DRUNK; break;
+        case Condition_Insane:      player->expression = CHARACTER_EXPRESSION_INSANE; break;
+        case Condition_Poison1:
+        case Condition_Poison2:
+        case Condition_Poison3:     player->expression = CHARACTER_EXPRESSION_POISONED; break;
+        case Condition_Disease1:
+        case Condition_Disease2:
+        case Condition_Disease3:    player->expression = CHARACTER_EXPRESSION_DISEASED; break;
+        case Condition_Paralyzed:   player->expression = CHARACTER_EXPRESSION_PARALYZED; break;
+        case Condition_Unconcious:  player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break;
         default:
           assert(false);
       }
@@ -1097,7 +1098,7 @@
     if ( pPlayer->classType == PLAYER_CLASS_LICH )
     {
       have_vessels_soul = false;
-      v7 = pPlayer->pInventoryItems;//[0].field_1A;
+      v7 = pPlayer->pInventoryItemList;//[0].field_1A;
       for ( uint i = 138; i; --i )
       {
         if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer == pPlayerID + 1 )
@@ -1153,6 +1154,7 @@
   }
   pParty->days_played_without_rest = 0;
 }
+
 //----- (004938D1) --------------------------------------------------------
 void __fastcall Rest(unsigned int uHoursToSleep)
 {
@@ -1214,16 +1216,16 @@
 //----- (0041F5BE) --------------------------------------------------------
 void __cdecl Sleep6Hours()
 {
-  if ( _506F18_num_hours_to_sleep < 6 )
+  if ( _506F18_num_minutes_to_sleep < 6 )
   {
     pParty->pPlayers[3].SetAsleep(false);
     pParty->pPlayers[2].SetAsleep(false);
     pParty->pPlayers[1].SetAsleep(false);
     pParty->pPlayers[0].SetAsleep(false);
-    if ( _506F18_num_hours_to_sleep )
+    if ( _506F18_num_minutes_to_sleep )
     {
-      Rest(_506F18_num_hours_to_sleep);
-      _506F18_num_hours_to_sleep = 0;
+      Rest(_506F18_num_minutes_to_sleep);
+      _506F18_num_minutes_to_sleep = 0;
       LoadActualSkyFrame();
     }
     if ( dword_506F14 == 2 )
@@ -1236,7 +1238,7 @@
         pTexture_RestUI_CurrentHourglassFrame->Release();
       pTexture_RestUI_CurrentHourglassFrame = 0;
       pTexture_RestUI_CurrentSkyFrame = 0;
-      pIcons_LOD->_4114F2();
+      pIcons_LOD->RemoveTexturesPackFromTextureList();
       pIcons_LOD->SyncLoadedFilesCount();
       pCurrentScreen = SCREEN_GAME;
       viewparams->bRedrawGameUI = 1;
@@ -1251,7 +1253,7 @@
   else
   {
     Rest(6u);
-    _506F18_num_hours_to_sleep -= 6;
+    _506F18_num_minutes_to_sleep -= 6;
     LoadActualSkyFrame();
   }
   viewparams->bRedrawGameUI = 1;
@@ -1446,7 +1448,7 @@
   if ( uActiveCharacter
     && (v2 = pPlayers[uActiveCharacter]->AddItem(-1, pParty->pPickedItem.uItemID)) != 0 )
   {
-    memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u);
+    memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2-1], &pParty->pPickedItem, 0x24u);
 	pMouse->RemoveHoldingItem();
   }
   else
@@ -1458,7 +1460,7 @@
       v4 = v3->AddItem(-1, pParty->pPickedItem.uItemID);
       if ( v4 )
 	  {
-		memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u);
+		memcpy(&pParty->pPlayers[v12].pInventoryItemList[v4 - 1], &pParty->pPickedItem, 0x24u);
 		pMouse->RemoveHoldingItem();
 		break;
 	  }
@@ -1513,4 +1515,15 @@
     pIcons_LOD->SyncLoadedFilesCount();
   }
   return 1;
+}
+
+
+bool Party::IsPartyEvil()
+{
+  return _449B57_test_bit(_quest_bits, 100);
+}
+
+bool Party::IsPartyGood()
+{
+  return _449B57_test_bit(_quest_bits, 99);
 }
\ No newline at end of file