Brief: //dnl ch72

- Fixing bad APs deduction when using hand grenades, mortars, rocket launchers, grenade launchers and attached grenade launchers from different stances and need turn to your target.
Details:
- Add APs cost for stance change and turnover for mortar and rocket launchers.
- Rocket launchers cannot be fire from prone any more as there are no animation for that stance.
- Attached grenade launchers now take raise gun cost for launcher instead for gun.
- No more problems with APs for grenades from different stances and turnover, add proper costs for crouch too as someone add animation for that.
- Fix wrong APs deduction for grenade launcher from prone and turnover in general.
- Fix incorrect values for APs cost under throwing/launching cursor.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-09-27 22:03:42 +00:00
parent ebef9b6df3
commit f65719e801
6 changed files with 100 additions and 39 deletions
+19 -4
View File
@@ -4908,6 +4908,18 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
// Convert our grid-not into an XY
ConvertGridNoToXY( sTargetGridNo, &sTargetXPos, &sTargetYPos );
//dnl ch72 2509134
UINT16 usItem;
if(this->bWeaponMode == WM_ATTACHED_GL || this->bWeaponMode == WM_ATTACHED_GL_BURST || this->bWeaponMode == WM_ATTACHED_GL_AUTO)
usItem = GetAttachedGrenadeLauncher(&this->inv[HANDPOS]);
else
usItem = this->inv[HANDPOS].usItem;
if(Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar)
{
if(gAnimControl[this->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[this->usAnimState].ubEndHeight == ANIM_STAND)
SendChangeSoldierStanceEvent(this, ANIM_CROUCH);
fDoFireRightAway = TRUE;
}
// Change to fire animation
// Ready weapon
@@ -4960,6 +4972,7 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
}
else
{
#if 0//dnl ch72 250913 move this above as need to be done before calling SoldierReadyWeapon
// IF WE ARE IN REAl-TIME, FIRE IMMEDIATELY!
if ( ( ( gTacticalStatus.uiFlags & REALTIME ) || !( gTacticalStatus.uiFlags & INCOMBAT ) ) )
{
@@ -4978,7 +4991,7 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
fDoFireRightAway = TRUE;
// break;
//}
#endif
if ( fDoFireRightAway )
{
// Set to true so we don't get toasted twice for APs..
@@ -5391,15 +5404,17 @@ BOOLEAN SOLDIERTYPE::InternalSoldierReadyWeapon( UINT8 sFacingDir, BOOLEAN fEndR
{
usAnimState = this->usAnimState;
}
//dnl ch72 270913 ugly but fast fix for not charging turning APs as there is no fire ready animation for mortars and rocket launchers
UINT16 usItem = this->inv[HANDPOS].usItem;
if(Item[usItem].rocketlauncher || Item[usItem].mortar)
usForceAnimState = this->usAnimState;
EVENT_InternalSetSoldierDesiredDirection( this, sFacingDir, FALSE, usAnimState );
usForceAnimState = INVALID_ANIMATION;
// Check if facing dir is different from ours and change direction if so!
//if ( sFacingDir != this->ubDirection )
//{
// DeductPoints( this, APBPConstants[AP_CHANGE_FACING], 0 );
//}//
}
return( fReturnVal );