From 888c76e65c4907258985cb83b1566a6f88eadaff Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 23 Oct 2012 21:29:56 +0000 Subject: [PATCH] zombies no longer kick in melee git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5641 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 646f2fefb..dec3c2980 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -11868,6 +11868,13 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio else { #endif + // Flugente: zombies do not kick + BOOLEAN nokick = FALSE; +#ifdef ENABLE_ZOMBIES + if ( this->IsZombie() ) + nokick = TRUE; +#endif + // Look at stance of target switch( gAnimControl[ pTSoldier->usAnimState ].ubEndHeight ) { @@ -11883,7 +11890,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio if ( gAnimControl[ pTSoldier->usAnimState ].ubEndHeight == ANIM_STAND ) { // if we aim for legs, always use kick - if ( this->bAimShotLocation == AIM_SHOT_LEGS && !(ubDirection & 1) ) + if ( this->bAimShotLocation == AIM_SHOT_LEGS && !(ubDirection & 1) && !nokick ) { this->EVENT_InitNewSoldierAnim( FOCUSED_HTH_KICK, 0 , FALSE ); } @@ -11895,7 +11902,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio // otherwise make it random, but favor the punch a bit else { - if ( Random(20) > 8 ) + if ( nokick || Random(20) > 8 ) this->EVENT_InitNewSoldierAnim( FOCUSED_PUNCH, 0 , FALSE ); else this->EVENT_InitNewSoldierAnim( FOCUSED_HTH_KICK, 0 , FALSE ); @@ -11904,9 +11911,9 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio else // if crouching enemy { // random if aiming on head, favor kick though - if ( this->bAimShotLocation == AIM_SHOT_HEAD || (ubDirection & 1) ) + if ( this->bAimShotLocation == AIM_SHOT_HEAD || (ubDirection & 1) || nokick ) { - if ( Random(20) > 12 || (ubDirection & 1)) + if ( nokick ||Random(20) > 12 || (ubDirection & 1)) this->EVENT_InitNewSoldierAnim( FOCUSED_PUNCH, 0 , FALSE ); else this->EVENT_InitNewSoldierAnim( FOCUSED_HTH_KICK, 0 , FALSE ); @@ -11923,7 +11930,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio if ( gAnimControl[ pTSoldier->usAnimState ].ubEndHeight == ANIM_STAND ) { // if we aim for legs, always use kick - if ( this->bAimShotLocation == AIM_SHOT_LEGS && !(ubDirection & 1)) + if ( this->bAimShotLocation == AIM_SHOT_LEGS && !(ubDirection & 1) && !nokick ) { this->EVENT_InitNewSoldierAnim( HTH_KICK, 0 , FALSE ); } @@ -11935,7 +11942,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio // otherwise make it random, but favor the punch a bit else { - if ( Random(20) > 8 ) + if ( nokick || Random(20) > 8 ) this->EVENT_InitNewSoldierAnim( PUNCH, 0 , FALSE ); else this->EVENT_InitNewSoldierAnim( HTH_KICK, 0 , FALSE ); @@ -11944,9 +11951,9 @@ void SOLDIERTYPE::EVENT_SoldierBeginPunchAttack( INT32 sGridNo, UINT8 ubDirectio else // if crouching enemy { // random if aiming on head, favor kick though - if ( this->bAimShotLocation == AIM_SHOT_HEAD || (ubDirection & 1)) + if ( this->bAimShotLocation == AIM_SHOT_HEAD || (ubDirection & 1) || nokick) { - if ( Random(20) > 12 || (ubDirection & 1)) + if ( nokick || Random(20) > 12 || (ubDirection & 1)) this->EVENT_InitNewSoldierAnim( PUNCH, 0 , FALSE ); else this->EVENT_InitNewSoldierAnim( HTH_KICK, 0 , FALSE );