- added new disability "Fear of heights"

- Fix: wrong backgrounds were filtered out when checking for personality/disability/traits

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8351 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-12-31 12:00:45 +00:00
parent 58eb840439
commit 3ab70dde90
28 changed files with 144 additions and 50 deletions
+2
View File
@@ -103,6 +103,7 @@ MoraleEvent gbMoraleEvent[NUM_MORALE_EVENTS] =
{ TACTICAL_MORALE_EVENT, 5}, //MORALE_GOOD_FOOD,
{ TACTICAL_MORALE_EVENT, -1}, //MORALE_BAD_FOOD,
{ TACTICAL_MORALE_EVENT, -5}, //MORALE_LOATHSOME_FOOD,
{TACTICAL_MORALE_EVENT, -8}, //MORALE_FEAR_OF_HEIGHTS,
// added by anv
{ STRATEGIC_MORALE_EVENT, -5}, //MORALE_BUDDY_FIRED,
{ STRATEGIC_MORALE_EVENT, -8}, //MORALE_BUDDY_FIRED_ON_BAD_TERMS,
@@ -1004,6 +1005,7 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
case MORALE_GOOD_FOOD:
case MORALE_BAD_FOOD:
case MORALE_LOATHSOME_FOOD:
case MORALE_FEAR_OF_HEIGHTS:
Assert( pSoldier );
HandleMoraleEventForSoldier( pSoldier, bMoraleEvent );
break;
+1
View File
@@ -54,6 +54,7 @@ typedef enum
MORALE_GOOD_FOOD, // 40
MORALE_BAD_FOOD,
MORALE_LOATHSOME_FOOD,
MORALE_FEAR_OF_HEIGHTS,
// added by anv
MORALE_BUDDY_FIRED,
+5
View File
@@ -209,6 +209,11 @@ INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier )
// SANDRO - fear of insects, and we are in tropical sector
iEffExpLevel -= 1;
}
else if ( DoesMercHaveDisability( pSoldier, AFRAID_OF_HEIGHTS ) && pSoldier->pathing.bLevel > 0 )
{
// Flugente: fear of heights
iEffExpLevel -= 2;
}
}
// Flugente: diseases can affect stat effectivity
+29 -4
View File
@@ -2047,6 +2047,10 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
{
ubPoints = (ubPoints * 9) / 10;
}
else if ( DoesMercHaveDisability( this, AFRAID_OF_HEIGHTS ) && this->pathing.bLevel > 0 )
{
ubPoints = (ubPoints * 9) / 10;
}
}
// Adjust APs due to drugs...
@@ -9335,13 +9339,16 @@ void SOLDIERTYPE::BeginSoldierClimbUpRoof( void )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] );
return;
}
INT8 bNewDirection;
UINT8 ubWhoIsThere;
if ( is_client )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, MPClientMessage[43] );
return;//hayden disable climbing roof
}
INT8 bNewDirection;
UINT8 ubWhoIsThere;
if ( FindHeigherLevel( this, this->sGridNo, this->ubDirection, &bNewDirection ) && (this->pathing.bLevel == 0) )
{
if ( EnoughPoints( this, GetAPsToClimbRoof( this, FALSE ), 0, TRUE ) )
@@ -9376,11 +9383,29 @@ void SOLDIERTYPE::BeginSoldierClimbUpRoof( void )
else
this->EVENT_InitNewSoldierAnim( CLIMBUPROOF, 0, FALSE );
// Flugente: if we are afraid of heights, we complain
if ( DoesMercHaveDisability( this, AFRAID_OF_HEIGHTS ) )
{
if ( !(this->usQuoteSaidFlags & SOLDIER_QUOTE_SAID_PERSONALITY) )
{
HandleMoraleEvent( this, MORALE_FEAR_OF_HEIGHTS, this->sSectorX, this->sSectorY, this->bSectorZ );
TacticalCharacterDialogue( this, QUOTE_PERSONALITY_TRAIT );
this->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY;
// Flugente: dynamic opinions
HandleDynamicOpinionChange( this, OPINIONEVENT_ANNOYINGDISABILITY, TRUE, TRUE );
}
// otherwise remove flag, so we'll complain every second time we climb roof
else
{
this->usQuoteSaidFlags &= ~SOLDIER_QUOTE_SAID_PERSONALITY;
}
}
this->InternalReceivingSoldierCancelServices( FALSE );
this->InternalGivingSoldierCancelServices( FALSE );
}
}
}
else
+2
View File
@@ -330,6 +330,8 @@ typedef enum
DEAF,
SHORTSIGHTED,
HEMOPHILIAC,
AFRAID_OF_HEIGHTS,
NUM_DISABILITIES
} PersonalityTrait;