- Added bayonet animations (standing against standing/crouched targets) for all merc bodytypes (by Taro)

- Initiating a bayonet attack immediately after running adds a melee damage bonus (+20%)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8489 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-10-02 10:38:12 +00:00
parent c3592c23f3
commit 3f057567dc
8 changed files with 58 additions and 46 deletions
+12
View File
@@ -100,6 +100,9 @@ static UINT16 LONG_JUMP_AnimationScript[MAX_FRAMES_PER_ANIM] = { 2,703,3,4,5,6,6
static UINT16 CRYO_DEATH_AnimationScript[MAX_FRAMES_PER_ANIM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 465, 440, 497, 442, 0, 0, 0, 0};
static UINT16 CRYO_DEATH_CROUCHED_AnimationScript[MAX_FRAMES_PER_ANIM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 465, 440, 497, 442, 0, 0, 0, 0};
// 1038 is the jump to READY_ALTERNATIVE_STAND
static UINT16 BAYONET_STAB_AnimationScript[MAX_FRAMES_PER_ANIM] = {757, 1, 2, 3, 4, 5, 6, 7, 727, 492, 8, 9, 430, 10, 11, 12, 13, 14, 15, 16, 17, 442, 1038, 494, 0};
ANI_SPEED_DEF gubAnimCrawlSpeeds[ TOTALBODYTYPES ];
//Block for anim file
UINT16 gusAnimInst[ MAX_ANIMATIONS ][ MAX_FRAMES_PER_ANIM ];
@@ -1085,6 +1088,9 @@ ANIMCONTROLTYPE gAnimControl[ NUMANIMATIONSTATES ] =
// CRYO_DEATH_CROUCHED
{"CRYO_DEATH_CROUCHED", 0, 150, (FLOAT)0, ANIM_STATIONARY | ANIM_NOMOVE_MARKER | ANIM_NO_EFFORT | ANIM_NONINTERRUPT | ANIM_NOCHANGE_WEAPON | ANIM_IGNORE_AUTOSTANCE | ANIM_ATTACK, ANIM_CROUCH, ANIM_CROUCH, -1},
//BAYONET_STAB
{ "BAYONET_STAB" , 0, 70, (FLOAT)0, ANIM_STATIONARY | ANIM_TURNING | ANIM_FASTTURN | ANIM_NORESTART | ANIM_LIGHT_EFFORT | ANIM_ATTACK , ANIM_STAND, ANIM_STAND, -1 },
};
ANI_SPEED_DEF gubAnimWalkSpeeds[ TOTALBODYTYPES ] =
@@ -1338,6 +1344,7 @@ void InitAnimationSurfacesPerBodytype( )
gubAnimSurfaceIndex[ REGMALE ][ SLICE ] = RGMSLICE;
gubAnimSurfaceIndex[ REGMALE ][ STAB ] = RGMSTAB;
gubAnimSurfaceIndex[ REGMALE ][ CROUCH_STAB ] = RGMCSTAB;
gubAnimSurfaceIndex[ REGMALE ][ BAYONET_STAB ] = RGMBAYONET;
gubAnimSurfaceIndex[ REGMALE ][ START_AID ] = RGMMEDIC;
gubAnimSurfaceIndex[ REGMALE ][ GIVING_AID ] = RGMMEDIC;
gubAnimSurfaceIndex[ REGMALE ][ END_AID ] = RGMMEDIC;
@@ -1785,6 +1792,7 @@ void InitAnimationSurfacesPerBodytype( )
gubAnimSurfaceIndex[ BIGMALE ][ SLICE ] = BGMSLICE;
gubAnimSurfaceIndex[ BIGMALE ][ STAB ] = BGMSTAB;
gubAnimSurfaceIndex[ BIGMALE ][ CROUCH_STAB ] = BGMCSTAB;
gubAnimSurfaceIndex[ BIGMALE ][ BAYONET_STAB ] = BGMBAYONET;
gubAnimSurfaceIndex[ BIGMALE ][ START_AID ] = BGMMEDIC;
gubAnimSurfaceIndex[ BIGMALE ][ GIVING_AID ] = BGMMEDIC;
gubAnimSurfaceIndex[ BIGMALE ][ END_AID ] = BGMMEDIC;
@@ -2250,6 +2258,7 @@ void InitAnimationSurfacesPerBodytype( )
gubAnimSurfaceIndex[ STOCKYMALE ][ SLICE ] = RGMSLICE;
gubAnimSurfaceIndex[ STOCKYMALE ][ STAB ] = RGMSTAB;
gubAnimSurfaceIndex[ STOCKYMALE ][ CROUCH_STAB ] = RGMCSTAB;
gubAnimSurfaceIndex[ STOCKYMALE ][ BAYONET_STAB ] = RGMBAYONET;
gubAnimSurfaceIndex[ STOCKYMALE ][ START_AID ] = RGMMEDIC;
gubAnimSurfaceIndex[ STOCKYMALE ][ GIVING_AID ] = RGMMEDIC;
gubAnimSurfaceIndex[ STOCKYMALE ][ END_AID ] = RGMMEDIC;
@@ -2692,6 +2701,7 @@ void InitAnimationSurfacesPerBodytype( )
gubAnimSurfaceIndex[ REGFEMALE ][ SLICE ] = RGFSLICE;
gubAnimSurfaceIndex[ REGFEMALE ][ STAB ] = RGFSTAB;
gubAnimSurfaceIndex[ REGFEMALE ][ CROUCH_STAB ] = RGFCSTAB;
gubAnimSurfaceIndex[ REGFEMALE ][ BAYONET_STAB ] = RGFBAYONET;
gubAnimSurfaceIndex[ REGFEMALE ][ START_AID ] = RGFMEDIC;
gubAnimSurfaceIndex[ REGFEMALE ][ GIVING_AID ] = RGFMEDIC;
gubAnimSurfaceIndex[ REGFEMALE ][ END_AID ] = RGFMEDIC;
@@ -3773,6 +3783,8 @@ BOOLEAN LoadAnimationStateInstructions( )
memcpy( gusAnimInst[CRYO_DEATH], CRYO_DEATH_AnimationScript, sizeof(CRYO_DEATH_AnimationScript) );
memcpy( gusAnimInst[CRYO_DEATH_CROUCHED], CRYO_DEATH_CROUCHED_AnimationScript, sizeof(CRYO_DEATH_CROUCHED_AnimationScript) );
memcpy(gusAnimInst[BAYONET_STAB], BAYONET_STAB_AnimationScript, sizeof(BAYONET_STAB_AnimationScript));
// NOTE: Careful here... keep in mind you have to increase MAX_ANIMATIONS whenever you would go over 399(currently) animation numbers
return( TRUE );
+2
View File
@@ -611,6 +611,8 @@ enum AnimationStates
CRYO_DEATH,
CRYO_DEATH_CROUCHED,
BAYONET_STAB,
NUMANIMATIONSTATES
+3 -2
View File
@@ -130,7 +130,7 @@ AnimationSurfaceType gAnimSurfaceDatabase[ NUMANIMATIONSURFACETYPES ] =
RGMPISTOLDRUNK, "ANIMS\\S_MERC\\S_N_DRNK.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGMCROWBAR, "ANIMS\\S_MERC\\S_CROBAR.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGMJUMPOVER, "ANIMS\\S_MERC\\S_N_RUN.STI", NO_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGMBAYONET, "ANIMS\\S_MERC\\S_BAYONET_S_S.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
BGMWALKING, "ANIMS\\M_MERC\\M_R_WALK.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
BGMSTANDING, "ANIMS\\M_MERC\\M_R_STD.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
@@ -224,7 +224,7 @@ AnimationSurfaceType gAnimSurfaceDatabase[ NUMANIMATIONSURFACETYPES ] =
BGMPISTOLDRUNK, "ANIMS\\M_MERC\\M_N_DRNK.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
BGMCROWBAR, "ANIMS\\M_MERC\\M_CROBAR.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
BGMJUMPOVER, "ANIMS\\M_MERC\\M_N_RUN.STI", NO_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
BGMBAYONET, "ANIMS\\M_MERC\\M_BAYONET_S_S.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGFWALKING, "ANIMS\\F_MERC\\F_R_WALK.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGFSTANDING, "ANIMS\\F_MERC\\F_BRETH2.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
@@ -312,6 +312,7 @@ AnimationSurfaceType gAnimSurfaceDatabase[ NUMANIMATIONSURFACETYPES ] =
RGFPISTOLDRUNK, "ANIMS\\F_MERC\\F_N_DRNK.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGFCROWBAR, "ANIMS\\F_MERC\\F_CROBAR.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGFJUMPOVER, "ANIMS\\F_MERC\\F_N_RUN.STI", NO_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
RGFBAYONET, "ANIMS\\F_MERC\\F_BAYONET_S_S.STI", S_STRUCT, 0, 8, TO_INIT, NULL, NULL, 0, -1,
CRYO_EXPLODE, "ANIMS\\S_MERC\\S_CRYO_DEATH_S.STI", S_STRUCT, 0, 1, TO_INIT, NULL, NULL, 0, -1,
CRYO_EXPLODE_CROUCHED, "ANIMS\\S_MERC\\S_CRYO_DEATH_C.STI", S_STRUCT, 0, 1, TO_INIT, NULL, NULL, 0, -1,
+3 -1
View File
@@ -171,6 +171,7 @@ typedef enum AnimationSurfaceTypes
RGMPISTOLDRUNK,
RGMCROWBAR,
RGMJUMPOVER,
RGMBAYONET,
BGMWALKING,
BGMSTANDING,
@@ -264,7 +265,7 @@ typedef enum AnimationSurfaceTypes
BGMPISTOLDRUNK,
BGMCROWBAR,
BGMJUMPOVER,
BGMBAYONET,
RGFWALKING,
RGFSTANDING,
@@ -352,6 +353,7 @@ typedef enum AnimationSurfaceTypes
RGFPISTOLDRUNK,
RGFCROWBAR,
RGFJUMPOVER,
RGFBAYONET,
CRYO_EXPLODE,
CRYO_EXPLODE_CROUCHED,
+7 -10
View File
@@ -2410,16 +2410,13 @@ void RemoveSMPanelButtons( )
}
RenderBackpackButtons(UNLOAD_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
UnloadButtonImage( iBurstButtonImages[ WM_NORMAL ] );
UnloadButtonImage( iBurstButtonImages[ WM_BURST ] );
UnloadButtonImage( iBurstButtonImages[ WM_AUTOFIRE ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_GL ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_GL_BURST ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_GL_AUTO ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_UB ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_UB_BURST ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_UB_AUTO ] );
UnloadButtonImage( iBurstButtonImages[ WM_ATTACHED_BAYONET ] );
for (int i = 0; i < NUM_WEAPON_MODES; ++i)
{
if ( iBurstButtonImages[i] != -1)
{
UnloadButtonImage(iBurstButtonImages[i]);
}
}
}
+23 -32
View File
@@ -12320,7 +12320,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginBladeAttack( INT32 sGridNo, UINT8 ubDirectio
{
GetSoldier( &pTSoldier, usSoldierIndex );
// Flugente: if we attack with a bayonet, we don't need to change stance if even if we are stadning and the target is prone...
// Flugente: if we attack with a bayonet, we don't need to change stance if even if we are standing and the target is prone...
// so we simulate here that the target is still standing
UINT8 targetheight = gAnimControl[pTSoldier->usAnimState].ubEndHeight;
#if 0//dnl ch73 031013 several reasons why disabling this; 1. no animation for bayonet, 2. if target is prone it look ridicules to swing through air instead stub target, 3. incorrect APs calculation
@@ -12332,42 +12332,32 @@ void SOLDIERTYPE::EVENT_SoldierBeginBladeAttack( INT32 sGridNo, UINT8 ubDirectio
{
case ANIM_STAND:
case ANIM_CROUCH:
// CHECK IF HE CAN SEE US, IF SO RANDOMIZE
if ( pTSoldier->aiData.bOppList[this->ubID] == 0 && pTSoldier->bTeam != this->bTeam )
// WE ARE SEEN
if ( this->bWeaponMode == WM_ATTACHED_BAYONET && gAnimControl[this->usAnimState].ubEndHeight == ANIM_STAND)
{
// WE ARE NOT SEEN
// SANDRO - use focused stab animation on aimed blade attacks
if ( gGameExternalOptions.fEnhancedCloseCombatSystem && (this->aiData.bAimTime > 0) )
{
this->EVENT_InitNewSoldierAnim( FOCUSED_STAB, 0, FALSE );
}
else
{
this->EVENT_InitNewSoldierAnim( STAB, 0, FALSE );
}
// if this attack happens directly after running, the attack is slightly more powerful due to extra force
if (this->usAnimState == RUNNING || this->usAnimState == RUNNING_W_PISTOL)
this->usSoldierFlagMask2 |= SOLDIER_BAYONET_RUNBONUS;
this->EVENT_InitNewSoldierAnim(BAYONET_STAB, 0, FALSE);
}
// SANDRO - use focused stab animation on aimed blade attacks
else if (gGameExternalOptions.fEnhancedCloseCombatSystem && (this->aiData.bAimTime > 0))
{
this->EVENT_InitNewSoldierAnim(FOCUSED_STAB, 0, FALSE);
}
else if ( Chance( 50 ) )
{
this->EVENT_InitNewSoldierAnim( STAB, 0, FALSE );
}
else
{
// WE ARE SEEN
// SANDRO - use focused stab animation on aimed blade attacks
if ( gGameExternalOptions.fEnhancedCloseCombatSystem && (this->aiData.bAimTime > 0) )
{
this->EVENT_InitNewSoldierAnim( FOCUSED_STAB, 0, FALSE );
}
else
{
// sevenfm: always use STAB attack for bayonet
if ( Random( 50 ) > 25 || this->bWeaponMode == WM_ATTACHED_BAYONET)
{
this->EVENT_InitNewSoldierAnim( STAB, 0, FALSE );
}
else
{
this->EVENT_InitNewSoldierAnim( SLICE, 0, FALSE );
}
}
this->EVENT_InitNewSoldierAnim( SLICE, 0, FALSE );
}
if (pTSoldier->aiData.bOppList[this->ubID] != 0 || pTSoldier->bTeam == this->bTeam)
{
// IF WE ARE SEEN, MAKE SURE GUY TURNS!
// Get direction to target
// IF WE ARE AN ANIMAL, CAR, MONSTER, DONT'T TURN
@@ -23050,6 +23040,7 @@ UINT16 GetSuspiciousAnimationAPDuration( UINT16 usAnimation )
case SLICE:
case STAB:
case CROUCH_STAB:
case BAYONET_STAB:
case PUNCH:
case PUNCH_BREATH:
case KICK_DOOR:
+1 -1
View File
@@ -416,7 +416,7 @@ enum
#define SOLDIER_COVERT_NOREDISGUISE 0x00001000 // this soldier does not want to be redisguised
#define SOLDIER_TRAIT_FOCUS 0x00002000 // 'focus' skill is active
#define SOLDIER_DRAG_CORPSE 0x00004000 // we are dragging a corpse, not a person
#define SOLDIER_BAYONET_RUNBONUS 0x00004000 // we are performing a bayonet attack after transitioning from running, giving our attack extra force
#define SOLDIER_INTERROGATE_ALL 0x000001F8 // all interrogation flags
// ----------------------------------------------------------------
+7
View File
@@ -9261,6 +9261,10 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
if( pSoldier->bWeaponMode == WM_ATTACHED_BAYONET )
{
iBonus += gSkillTraitValues.ubMEDamageBonusBlades; // +30% damage
// if this attack happens directly after running, the attack is slightly more powerful due to extra force
if (pSoldier->usSoldierFlagMask2 & SOLDIER_BAYONET_RUNBONUS)
iBonus += 20;
}
else if ( HAS_SKILL_TRAIT( pSoldier, MELEE_NT ) && ( gGameOptions.fNewTraitSystem ))
{
@@ -9297,6 +9301,9 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
}*/
}
// remove flag, regardless of whether it was used
pSoldier->usSoldierFlagMask2 &= ~SOLDIER_BAYONET_RUNBONUS;
// bonus damage for aggressive characters
if ( DoesMercHavePersonality( pSoldier, CHAR_TRAIT_AGGRESSIVE ) )
{