mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Fixed bug that resets melee attack aim location if the attack was stopped in interrupt.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9059 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2072,6 +2072,7 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
|||||||
numBytesRead = ReadFieldByField(hFile, &this->uiAnimSubFlags, sizeof(uiAnimSubFlags), sizeof(UINT32), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->uiAnimSubFlags, sizeof(uiAnimSubFlags), sizeof(UINT32), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->bAimShotLocation, sizeof(bAimShotLocation), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->bAimShotLocation, sizeof(bAimShotLocation), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubHitLocation, sizeof(ubHitLocation), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubHitLocation, sizeof(ubHitLocation), sizeof(UINT8), numBytesRead);
|
||||||
|
numBytesRead = ReadFieldByField(hFile, &this->bAimMeleeLocation, sizeof(bAimMeleeLocation), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->pEffectShades, sizeof(pEffectShades), 4, numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->pEffectShades, sizeof(pEffectShades), 4, numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->ubPlannedUIAPCost, sizeof(ubPlannedUIAPCost), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->ubPlannedUIAPCost, sizeof(ubPlannedUIAPCost), sizeof(UINT8), numBytesRead);
|
||||||
numBytesRead = ReadFieldByField(hFile, &this->sPlannedTargetX, sizeof(sPlannedTargetX), sizeof(INT16), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &this->sPlannedTargetX, sizeof(sPlannedTargetX), sizeof(INT16), numBytesRead);
|
||||||
|
|||||||
@@ -1334,6 +1334,7 @@ public:
|
|||||||
|
|
||||||
UINT8 bAimShotLocation;
|
UINT8 bAimShotLocation;
|
||||||
UINT8 ubHitLocation;
|
UINT8 ubHitLocation;
|
||||||
|
UINT8 bAimMeleeLocation;
|
||||||
|
|
||||||
UINT16 *pEffectShades[ NUM_SOLDIER_EFFECTSHADES ]; // Shading tables for effects
|
UINT16 *pEffectShades[ NUM_SOLDIER_EFFECTSHADES ]; // Shading tables for effects
|
||||||
|
|
||||||
|
|||||||
@@ -1662,6 +1662,8 @@ UINT8 HandleKnifeCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivate
|
|||||||
if ( fActivated )
|
if ( fActivated )
|
||||||
{
|
{
|
||||||
DetermineCursorBodyLocation( pSoldier->ubID, TRUE, TRUE );
|
DetermineCursorBodyLocation( pSoldier->ubID, TRUE, TRUE );
|
||||||
|
//shadooow: this fixes bug where the original aim location is lost if the attack is stopped due to interrupt
|
||||||
|
pSoldier->bAimMeleeLocation = pSoldier->bAimShotLocation;
|
||||||
|
|
||||||
if ( gfUIHandleShowMoveGrid )
|
if ( gfUIHandleShowMoveGrid )
|
||||||
{
|
{
|
||||||
@@ -1793,6 +1795,8 @@ UINT8 HandlePunchCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivate
|
|||||||
if ( fActivated )
|
if ( fActivated )
|
||||||
{
|
{
|
||||||
DetermineCursorBodyLocation( pSoldier->ubID, TRUE, TRUE );
|
DetermineCursorBodyLocation( pSoldier->ubID, TRUE, TRUE );
|
||||||
|
//shadooow: this fixes bug where the original aim location is lost if the attack is stopped due to interrupt
|
||||||
|
pSoldier->bAimMeleeLocation = pSoldier->bAimShotLocation;
|
||||||
|
|
||||||
if ( gfUIHandleShowMoveGrid )
|
if ( gfUIHandleShowMoveGrid )
|
||||||
{
|
{
|
||||||
|
|||||||
+14
-14
@@ -3917,7 +3917,7 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
iImpact = ( iImpact * WEAPON_STATUS_MOD( (*pObj)[0]->data.objectStatus) ) / 100;
|
iImpact = ( iImpact * WEAPON_STATUS_MOD( (*pObj)[0]->data.objectStatus) ) / 100;
|
||||||
|
|
||||||
// modify by hit location
|
// modify by hit location
|
||||||
AdjustImpactByHitLocation( iImpact, pSoldier->bAimShotLocation, &iImpact, &iImpactForCrits );
|
AdjustImpactByHitLocation( iImpact, pSoldier->bAimMeleeLocation, &iImpact, &iImpactForCrits );
|
||||||
|
|
||||||
// bonus for surprise
|
// bonus for surprise
|
||||||
if ( fSurpriseAttack )
|
if ( fSurpriseAttack )
|
||||||
@@ -4579,12 +4579,12 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
||||||
{
|
{
|
||||||
// Increased EXP for head strike
|
// Increased EXP for head strike
|
||||||
if (pSoldier->bAimShotLocation == AIM_SHOT_HEAD)
|
if (pSoldier->bAimMeleeLocation == AIM_SHOT_HEAD)
|
||||||
{
|
{
|
||||||
ubExpGain += 2;
|
ubExpGain += 2;
|
||||||
}
|
}
|
||||||
// Decreased EXP for leg strike
|
// Decreased EXP for leg strike
|
||||||
else if (pSoldier->bAimShotLocation == AIM_SHOT_LEGS)
|
else if (pSoldier->bAimMeleeLocation == AIM_SHOT_LEGS)
|
||||||
{
|
{
|
||||||
ubExpGain -= 4;
|
ubExpGain -= 4;
|
||||||
}
|
}
|
||||||
@@ -4629,12 +4629,12 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
||||||
{
|
{
|
||||||
// Increased EXP for head strike
|
// Increased EXP for head strike
|
||||||
if (pSoldier->bAimShotLocation == AIM_SHOT_HEAD)
|
if (pSoldier->bAimMeleeLocation == AIM_SHOT_HEAD)
|
||||||
{
|
{
|
||||||
ubExpGain += 1;
|
ubExpGain += 1;
|
||||||
}
|
}
|
||||||
// Decreased EXP for leg strike
|
// Decreased EXP for leg strike
|
||||||
else if (pSoldier->bAimShotLocation == AIM_SHOT_LEGS)
|
else if (pSoldier->bAimMeleeLocation == AIM_SHOT_LEGS)
|
||||||
{
|
{
|
||||||
ubExpGain -= 2;
|
ubExpGain -= 2;
|
||||||
}
|
}
|
||||||
@@ -4787,15 +4787,15 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
if (pTargetSoldier->bActionPoints >= MinAPsToAttack(pTargetSoldier, pSoldier->sGridNo, TRUE, 1, 0) && Chance(EffectiveStrength(pTargetSoldier, FALSE) / 4))
|
if (pTargetSoldier->bActionPoints >= MinAPsToAttack(pTargetSoldier, pSoldier->sGridNo, TRUE, 1, 0) && Chance(EffectiveStrength(pTargetSoldier, FALSE) / 4))
|
||||||
pTargetSoldier->aiData.bAimTime = 1;
|
pTargetSoldier->aiData.bAimTime = 1;
|
||||||
|
|
||||||
pTargetSoldier->bAimShotLocation = AIM_SHOT_RANDOM;
|
pTargetSoldier->bAimMeleeLocation = AIM_SHOT_RANDOM;
|
||||||
if (gAnimControl[pSoldier->usAnimState].ubEndHeight > ANIM_PRONE)
|
if (gAnimControl[pSoldier->usAnimState].ubEndHeight > ANIM_PRONE)
|
||||||
{
|
{
|
||||||
if (Chance((6 + EffectiveDexterity(pTargetSoldier, FALSE) / 10 + 5 * NUM_SKILL_TRAITS(pTargetSoldier, MARTIAL_ARTS_NT)) * 100 / (100 + pSoldier->bBreath)))
|
if (Chance((6 + EffectiveDexterity(pTargetSoldier, FALSE) / 10 + 5 * NUM_SKILL_TRAITS(pTargetSoldier, MARTIAL_ARTS_NT)) * 100 / (100 + pSoldier->bBreath)))
|
||||||
pTargetSoldier->bAimShotLocation = AIM_SHOT_HEAD;
|
pTargetSoldier->bAimMeleeLocation = AIM_SHOT_HEAD;
|
||||||
else if (Chance(pSoldier->bBreath * EffectiveWisdom(pTargetSoldier) / (100 + EffectiveDexterity(pTargetSoldier, FALSE))))
|
else if (Chance(pSoldier->bBreath * EffectiveWisdom(pTargetSoldier) / (100 + EffectiveDexterity(pTargetSoldier, FALSE))))
|
||||||
pTargetSoldier->bAimShotLocation = AIM_SHOT_LEGS;
|
pTargetSoldier->bAimMeleeLocation = AIM_SHOT_LEGS;
|
||||||
else
|
else
|
||||||
pTargetSoldier->bAimShotLocation = AIM_SHOT_TORSO;
|
pTargetSoldier->bAimMeleeLocation = AIM_SHOT_TORSO;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleItem(pTargetSoldier, pSoldier->sGridNo, pTargetSoldier->pathing.bLevel, pTargetSoldier->inv[HANDPOS].usItem, FALSE);
|
HandleItem(pTargetSoldier, pSoldier->sGridNo, pTargetSoldier->pathing.bLevel, pTargetSoldier->inv[HANDPOS].usItem, FALSE);
|
||||||
@@ -8760,11 +8760,11 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
|
|||||||
// Enhanced Close Combat System - aiming at body parts makes difference
|
// Enhanced Close Combat System - aiming at body parts makes difference
|
||||||
if ( !autoresolve && gGameExternalOptions.fEnhancedCloseCombatSystem)
|
if ( !autoresolve && gGameExternalOptions.fEnhancedCloseCombatSystem)
|
||||||
{
|
{
|
||||||
if ( pSoldier->bAimShotLocation == AIM_SHOT_HEAD )
|
if ( pSoldier->bAimMeleeLocation == AIM_SHOT_HEAD )
|
||||||
{
|
{
|
||||||
iBonus += 25; // Punch or kick to head deal more damage (vs -20% accuracy)
|
iBonus += 25; // Punch or kick to head deal more damage (vs -20% accuracy)
|
||||||
}
|
}
|
||||||
else if ( pSoldier->bAimShotLocation == AIM_SHOT_LEGS )
|
else if ( pSoldier->bAimMeleeLocation == AIM_SHOT_LEGS )
|
||||||
{
|
{
|
||||||
// Punch or kick to legs deal less damage but takes some AP per damage out of target adjusted by AP_MAXIMUM
|
// Punch or kick to legs deal less damage but takes some AP per damage out of target adjusted by AP_MAXIMUM
|
||||||
// NO, better to make hit to legs have a much better chance to hit, while only 50% damage is dealt
|
// NO, better to make hit to legs have a much better chance to hit, while only 50% damage is dealt
|
||||||
@@ -9546,12 +9546,12 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
|
|||||||
iChance += gSkillTraitValues.bMAAimedPunchCtHModifier * NUM_SKILL_TRAITS( pAttacker, MARTIAL_ARTS_NT );
|
iChance += gSkillTraitValues.bMAAimedPunchCtHModifier * NUM_SKILL_TRAITS( pAttacker, MARTIAL_ARTS_NT );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pAttacker->bAimShotLocation == AIM_SHOT_HEAD )
|
if ( pAttacker->bAimMeleeLocation == AIM_SHOT_HEAD )
|
||||||
{
|
{
|
||||||
// Harder to hit head (but higher damage there)
|
// Harder to hit head (but higher damage there)
|
||||||
iChance -= 20;
|
iChance -= 20;
|
||||||
}
|
}
|
||||||
else if( pAttacker->bAimShotLocation == AIM_SHOT_LEGS )
|
else if( pAttacker->bAimMeleeLocation == AIM_SHOT_LEGS )
|
||||||
{
|
{
|
||||||
// easy to hit legs (but low damage there)
|
// easy to hit legs (but low damage there)
|
||||||
iChance += 25;
|
iChance += 25;
|
||||||
@@ -9559,7 +9559,7 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( pAttacker->bAimShotLocation == AIM_SHOT_HEAD )
|
if ( pAttacker->bAimMeleeLocation == AIM_SHOT_HEAD )
|
||||||
{
|
{
|
||||||
// make this harder!
|
// make this harder!
|
||||||
iChance -= 20;
|
iChance -= 20;
|
||||||
|
|||||||
Reference in New Issue
Block a user