Small visual changes (by Sevenfm)

see: http://www.bears-pit.com/board/ubbthreads.php/topics/172712/16/Code_Snippets.html

1) ENEMY_HIT_COUNT in ja2_options.ini accepts 2 new parameters:
  3 - show damage as white asterisks
  4 - show damage as red asterisks
  Number of asterisks is scaled (maximum 5): >0, >10, >30, >60, >100

2) Suppression tactical tooltip now shows suppression points from last attacks.
Previously it was always = 0 because ubSuppressionPoints value is cleared after each attack.

3) It is now possible to show suppression values above soldier, just as hit count.
There are new options in ja2_options.ini

Possible values:
 0 - do not show
 1 - show on moving hit counter
 2 - show above soldier
The values are color coded:
 Suppression is light gray
 Shock is yellow
 AP loss is blue
 Morale hit is green

SHOW_SUPPRESSION_COUNT = 0
SHOW_SHOCK_COUNT = 0
SHOW_AP_COUNT = 0
SHOW_MORALE_COUNT = 0

This option defines if values are shown as numbers or asterisks (1..5, using scale)
SHOW_SUPPRESSION_USE_ASTERISK = FALSE

This option defines if only 1 asterisk is shown or several (1..5) to represent value
SHOW_SUPPRESSION_SCALE_ASTERISK = TRUE

Show suppression above soldier during enemy attack. All other values are shown after attack, when HandleSuppressionFire function is calculated.
SHOW_SUPPRESSION_COUNT_ALT = TRUE

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6689 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-12-10 11:04:59 +00:00
parent 467649c7a4
commit 534af956c8
9 changed files with 389 additions and 8 deletions
+55 -1
View File
@@ -1027,6 +1027,15 @@ SOLDIERTYPE& SOLDIERTYPE::operator=(const OLDSOLDIERTYPE_101& src)
this->usAISkillUse = 0;
for (UINT8 i = 0; i < SOLDIER_COUNTER_MAX; ++i) this->usSkillCounter[i] = 0;
for (UINT8 i = 0; i < SOLDIER_COOLDOWN_MAX; ++i) this->usSkillCooldown[i] = 0;
this->ubLastShock = 0;
this->ubLastSuppression = 0;
this->ubLastAP = 0;
this->ubLastMorale = 0;
this->ubLastShockFromHit = 0;
this->ubLastMoraleFromHit = 0;
this->ubLastAPFromHit = 0;
}
return *this;
}
@@ -5676,10 +5685,12 @@ void SOLDIERTYPE::EVENT_SoldierGotHit( UINT16 usWeaponIndex, INT16 sDamage, INT1
if ( this->ubAttackerID != NOBODY && MercPtrs[ this->ubAttackerID ]->bTeam == gbPlayerNum )
{
HandleMoraleEvent( MercPtrs[ this->ubAttackerID ], MORALE_DID_LOTS_OF_DAMAGE, MercPtrs[ this->ubAttackerID ]->sSectorX, MercPtrs[ this->ubAttackerID ]->sSectorY, MercPtrs[ this->ubAttackerID ]->bSectorZ );
this->ubLastMoraleFromHit++;
}
if (this->bTeam == gbPlayerNum)
{
HandleMoraleEvent( this, MORALE_TOOK_LOTS_OF_DAMAGE, this->sSectorX, this->sSectorY, this->bSectorZ );
this->ubLastMoraleFromHit++;
}
}
@@ -7732,6 +7743,13 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
// HEADROCK HAM 3.5: After considerable testing, suppression is now cleared after every attack. Total APs lost
// is cleared every turn (here) and only acts as reference now (no effect on AP loss).
this->ubAPsLostToSuppression = 0;
this->ubLastShock = 0;
this->ubLastSuppression = 0;
this->ubLastAP = 0;
this->ubLastMorale = 0;
this->ubLastAPFromHit = 0;
this->ubLastShockFromHit = 0;
this->ubLastMoraleFromHit = 0;
this->flags.fCloseCall = FALSE;
@@ -9888,6 +9906,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
if ( !AM_A_ROBOT( this ) )
{
DeductPoints( this, sAPCost, sBreathLoss, DISABLED_INTERRUPT );
this->ubLastAPFromHit += sAPCost;
}
ubCombinedLoss = (UINT8) sLifeDeduct / 10 + sBreathLoss / 2000;
@@ -9896,6 +9915,7 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
if ( !AM_A_ROBOT( this ) )
{
this->aiData.bShock += ubCombinedLoss;
this->ubLastShockFromHit += ubCombinedLoss;
}
// start the stopwatch - the blood is gushing!
@@ -9906,13 +9926,13 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
// If we are already dead, don't show damage!
if ( bOldLife != 0 && fShowDamage && sLifeDeduct != 0 && sLifeDeduct < 1000 )
{
/*
// Display damage
INT16 sOffsetX, sOffsetY;
// Set Damage display counter
this->flags.fDisplayDamage = TRUE;
this->bDisplayDamageCount = 0;
if ( this->ubBodyType == QUEENMONSTER )
{
this->sDamageX = 0;
@@ -9924,6 +9944,14 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo
this->sDamageX = sOffsetX;
this->sDamageY = sOffsetY;
}
*/
// sevenfm: moved code to function
SetDamageDisplayCounter(this);
// zero suppression valued stored from last attack
this->ubLastShock = 0;
this->ubLastSuppression = 0;
this->ubLastMorale = 0;
this->ubLastAP = 0;
}
}
@@ -21242,3 +21270,29 @@ BOOLEAN PlayerTeamIsScanning()
return FALSE;
}
void SetDamageDisplayCounter(SOLDIERTYPE* pSoldier)
{
INT16 sOffsetX, sOffsetY;
if( pSoldier->flags.fDisplayDamage )
{
return;
}
pSoldier->flags.fDisplayDamage = TRUE;
pSoldier->bDisplayDamageCount = 0;
if ( pSoldier->ubBodyType == QUEENMONSTER )
{
pSoldier->sDamageX = 0;
pSoldier->sDamageY = 0;
}
else
{
GetSoldierAnimOffsets( pSoldier, &sOffsetX, &sOffsetY );
pSoldier->sDamageX = sOffsetX;
pSoldier->sDamageY = sOffsetY;
}
}