New feature: mercs with a gun-related trait (New trait system only) can use the 'Focus' skill via the skill menu ([$] in tactical). This skill grants an interrupt modifier bonus in the targeted area, but also a penalty outside of it.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20659&goto=350400&#msg_350400

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8432 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-07-26 13:49:38 +00:00
parent 7b00af164b
commit 0992a423e7
27 changed files with 203 additions and 45 deletions
+25 -1
View File
@@ -1936,6 +1936,30 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
{
iPoints -= 1;
}
// Flugente: focus skill
if ( (pSoldier->usSoldierFlagMask2 & SOLDIER_TRAIT_FOCUS) )
{
if ( pSoldier->CanUseSkill( SKILLS_FOCUS, FALSE, pSoldier->sFocusGridNo ) )
{
// if target is in focus, increase interrupt chance, otherwise lower it
// radius depends on range
INT16 range = PythSpacesAway( pSoldier->sFocusGridNo, pSoldier->sGridNo );
INT16 radius = gSkillTraitValues.ubSNFocusRadius * range / 20;
INT16 range_opponent = PythSpacesAway( pSoldier->sFocusGridNo, MercPtrs[ubOpponentID]->sGridNo );
if ( range_opponent <= radius )
iPoints += gSkillTraitValues.sSNFocusInterruptBonus;
else
iPoints -= 2 * gSkillTraitValues.sSNFocusInterruptBonus;
}
else
{
pSoldier->usSoldierFlagMask2 &= ~SOLDIER_TRAIT_FOCUS;
pSoldier->sFocusGridNo = NOWHERE;
}
}
}
else
{
@@ -1949,7 +1973,7 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
}
}
}
// Flugente: interrupt modifier from special stats
iPoints += pSoldier->GetInterruptModifier( ubDistance );