mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix/change: the hospital now checks for mercs with damaged stats in addition to damaged health. in addition, the hospital now charges money to heal damaged stats (by rftr).
Minor fixes for quest debug log. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9180 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "Assignments.h"
|
||||
#include "strategic.h"
|
||||
#include "Strategic Event Handler.h"
|
||||
#include "Soldier Control.h"
|
||||
#endif
|
||||
|
||||
#include "BobbyRMailOrder.h"
|
||||
@@ -290,7 +291,7 @@ UINT32 NumWoundedMercsNearby( UINT8 ubProfileID )
|
||||
{
|
||||
pSoldier = MercSlots[ uiLoop ];
|
||||
|
||||
if ( pSoldier && pSoldier->bTeam == gbPlayerNum && pSoldier->stats.bLife > 0 && pSoldier->stats.bLife < pSoldier->stats.bLifeMax && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL
|
||||
if ( pSoldier && pSoldier->bTeam == gbPlayerNum && pSoldier->stats.bLife > 0 && (pSoldier->stats.bLife < pSoldier->stats.bLifeMax || NumberOfDamagedStats(pSoldier) > 0) && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL
|
||||
&& pSoldier->sSectorX == pNPC->sSectorX && pSoldier->sSectorY == pNPC->sSectorY && pSoldier->bSectorZ == pNPC->bSectorZ )
|
||||
{
|
||||
if (PythSpacesAway( sGridNo, pSoldier->sGridNo ) <= HOSPITAL_PATIENT_DISTANCE)
|
||||
|
||||
@@ -3170,7 +3170,7 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||
//Save to tempfile
|
||||
SaveWorldItemsToTempItemFile( sSectorX, sSectorY, (INT8)bSectorZ, guiNumWorldItems, gWorldItems );
|
||||
|
||||
DebugQuestInfo(String("--- Enter Sector %s%s Level %d ---", pVertStrings[sSectorY], pHortStrings[sSectorX], bSectorZ));
|
||||
DebugQuestInfo(String("Enter Sector %s%s Level %d", pVertStrings[sSectorY], pHortStrings[sSectorX], bSectorZ));
|
||||
|
||||
return TRUE; //because the map was loaded.
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#include "PreBattle Interface.h"
|
||||
@@ -75,6 +74,7 @@
|
||||
#include "Map Screen Helicopter.h"
|
||||
#include "Cheats.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier Control.h"
|
||||
#endif
|
||||
|
||||
#include "LuaInitNPCs.h"
|
||||
@@ -3729,7 +3729,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
{
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 && pSoldier->stats.bLife < pSoldier->stats.bLifeMax && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL && PythSpacesAway( pSoldier->sGridNo, pSoldier2->sGridNo ) < HOSPITAL_PATIENT_DISTANCE )
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 && (pSoldier->stats.bLife < pSoldier->stats.bLifeMax || NumberOfDamagedStats(pSoldier) > 0) && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL && PythSpacesAway( pSoldier->sGridNo, pSoldier2->sGridNo ) < HOSPITAL_PATIENT_DISTANCE )
|
||||
{
|
||||
SetSoldierAssignment( pSoldier, ASSIGNMENT_HOSPITAL, 0, 0, 0 );
|
||||
TriggerNPCRecord( pSoldier->ubProfile, 2 );
|
||||
@@ -4520,6 +4520,12 @@ UINT32 CalcPatientMedicalCost( SOLDIERTYPE * pSoldier )
|
||||
|
||||
uiCost = 10 * ( pSoldier->stats.bLifeMax - pSoldier->stats.bLife );
|
||||
|
||||
for (UINT8 index = 0; index < NUM_DAMAGABLE_STATS; ++index)
|
||||
{
|
||||
// charge additional $150 for every damaged stat point
|
||||
uiCost += (150 * pSoldier->ubCriticalStatDamage[index]);
|
||||
}
|
||||
|
||||
if ( pSoldier->stats.bLife < OKLIFE )
|
||||
{
|
||||
// charge additional $25 for every point below OKLIFE he is
|
||||
@@ -4577,7 +4583,7 @@ UINT32 CalcMedicalCost( UINT8 ubId )
|
||||
pSoldier = MercPtrs[ cnt ];
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL )
|
||||
{
|
||||
if ( pSoldier->stats.bLife < pSoldier->stats.bLifeMax )
|
||||
if ( pSoldier->stats.bLife < pSoldier->stats.bLifeMax || NumberOfDamagedStats(pSoldier) > 0)
|
||||
{
|
||||
if (PythSpacesAway( sGridNo, pSoldier->sGridNo ) <= HOSPITAL_PATIENT_DISTANCE)
|
||||
{
|
||||
|
||||
+1
-1
@@ -1934,7 +1934,7 @@ void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData
|
||||
SOLDIERTYPE * pNPC;
|
||||
BOOLEAN fAttemptingToGiveItem;
|
||||
|
||||
DebugQuestInfo(String("Converse: merc <%d> to NPC <%d> %d data %d", ubMerc, ubNPC, bApproach, uiApproachData));
|
||||
DebugQuestInfo(String("Converse: merc <%d> to NPC <%d> approach %d data %d", ubMerc, ubNPC, bApproach, uiApproachData));
|
||||
|
||||
// we have to record whether an item is being given in order to determine whether,
|
||||
// in the case where the approach is overridden, we need to return the item to the
|
||||
|
||||
Reference in New Issue
Block a user