diff Party.cpp @ 1295:86a83e12d795

moving files
author Ritor1
date Mon, 17 Jun 2013 17:34:01 +0600
parents 8c02e6f74b29
children c423f946dc99
line wrap: on
line diff
--- a/Party.cpp	Mon Jun 17 09:09:30 2013 +0600
+++ b/Party.cpp	Mon Jun 17 17:34:01 2013 +0600
@@ -19,7 +19,8 @@
 
 #include "mm7_data.h"
 #include "MM7.h"
-
+#include "Outdoor.h"
+#include "Indoor.h"
 
 
 
@@ -1151,4 +1152,84 @@
     UpdatePlayersAndHirelingsEmotions();
   }
   pParty->days_played_without_rest = 0;
+}
+//----- (004938D1) --------------------------------------------------------
+void __fastcall Rest(unsigned int uHoursToSleep)
+{
+  unsigned int v1; // esi@1
+  double v2; // st7@3
+  Player **v3; // esi@3
+
+  v1 = uHoursToSleep;
+  if ( uHoursToSleep > 240 )
+    InitializeActors();
+  v2 = (double)(7680 * v1) * 0.033333335;
+  pParty->uTimePlayed += (signed __int64)v2;
+  v3 = &pPlayers[1];
+  do
+  {
+    (*v3)->Recover((signed __int64)v2);
+    ++v3;
+  }
+  while ( (signed int)v3 <= (signed int)&pPlayers[4] );
+  _494035_timed_effects__water_walking_damage__etc();
+}
+//----- (004B1BDB) --------------------------------------------------------
+void __stdcall RestAndHeal(__int64 uNumMinutes)
+{
+  signed __int64 v1; // ST2C_8@1
+  signed __int64 v2; // qax@1
+  signed __int64 v3; // ST1C_8@1
+  unsigned __int64 v4; // qax@1
+  unsigned int v5; // ebx@1
+  Player *v6; // ebx@1
+
+  pParty->pHirelings[0].bHasUsedTheAbility = 0;
+  pParty->pHirelings[1].bHasUsedTheAbility = 0;
+  pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335);
+  v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
+  v2 = v1 / 60 / 60;
+  v3 = v2;
+  v4 = (unsigned int)v2 / 0x18;
+  v5 = (unsigned int)(v4 / 7) >> 2;
+  pParty->uCurrentTimeSecond = v1 % 60;
+  pParty->uCurrentMinute = v1 / 60 % 60;
+  pParty->uCurrentHour = v3 % 24;
+  pParty->uCurrentMonthWeek = v4 / 7 & 3;
+  pParty->uDaysPlayed = (unsigned int)v4 % 0x1C;
+  pParty->uCurrentMonth = v5 % 0xC;
+  pParty->uCurrentYear = v5 / 0xC + game_starting_year;
+  pParty->RestAndHeal();
+  dword_507B94 = 1;
+  v6 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
+  do
+  {
+	v6->uTimeToRecovery = 0;
+	memset(&v6->uTimeToRecovery, 0, 4u);
+    ++v6;
+  }
+  while ( v6 <= &pParty->pPlayers[3] );
+  pParty->UpdatePlayersAndHirelingsEmotions();
+}
+//----- (0047752B) --------------------------------------------------------
+int __cdecl GetPartyReputation()
+{
+  DDM_DLV_Header *v0; // ebx@1
+  signed int v1; // esi@3
+
+  v0 = &pOutdoor->ddm;
+  if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
+    v0 = &pIndoor->dlv;
+  v1 = 0;
+  if ( CheckHiredNPCSpeciality(Pirate) )
+    v1 += 5;
+  if ( CheckHiredNPCSpeciality(Burglar) )
+    v1 += 5;
+  if ( CheckHiredNPCSpeciality(Gypsy) )
+    v1 += 5;
+  if ( CheckHiredNPCSpeciality(Duper) )
+    v1 += 5;
+  if ( CheckHiredNPCSpeciality(FallenWizard) )
+    v1 += 5;
+  return v1 + v0->uReputation;
 }
\ No newline at end of file