mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- New Feature: Possibility to pick up items in crouch position (by Sandro)
o Merc can stay crouched while picking up items and when stealing items from prone(/collapsed) enemy, he must crouch (will do automatically). It really feels much more intuitive. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5265 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1013,6 +1013,11 @@ ANIMCONTROLTYPE gAnimControl[ NUMANIMATIONSTATES ] =
|
||||
{"PRN GIVING AID" , 0, 120, (FLOAT)0, ANIM_STATIONARY | ANIM_TURNING | ANIM_FASTTURN | ANIM_NORESTART | ANIM_LIGHT_EFFORT , ANIM_PRONE, ANIM_PRONE, -1},
|
||||
{"PRN END AID" , 0, 90, (FLOAT)0, ANIM_STATIONARY | ANIM_TURNING | ANIM_FASTTURN | ANIM_NORESTART | ANIM_RAISE_WEAPON | ANIM_NO_EFFORT | ANIM_NOCHANGE_PENDINGCOUNT, ANIM_PRONE, ANIM_PRONE, -1},
|
||||
|
||||
//GET ADJACENT ITEM CROUCHED
|
||||
"GET ADJACENT ITEM CROUCHED" , 0, 100, (FLOAT)0, ANIM_STATIONARY | ANIM_TURNING | ANIM_FASTTURN | ANIM_NORESTART | ANIM_LOWER_WEAPON | ANIM_LIGHT_EFFORT, ANIM_CROUCH, ANIM_CROUCH, -1,
|
||||
//STEAL ITEM CROUCHED
|
||||
"STEAL ITEM CROUCHED" , 0, 100, (FLOAT)0, ANIM_STATIONARY | ANIM_TURNING | ANIM_FASTTURN | ANIM_NORESTART | ANIM_LOWER_WEAPON | ANIM_LIGHT_EFFORT, ANIM_CROUCH, ANIM_CROUCH, -1,
|
||||
|
||||
};
|
||||
|
||||
ANI_SPEED_DEF gubAnimWalkSpeeds[ TOTALBODYTYPES ] =
|
||||
@@ -1422,9 +1427,12 @@ void InitAnimationSurfacesPerBodytype( )
|
||||
gubAnimSurfaceIndex[ REGMALE ][ WALKING_RIFLE_RDY ] = RGMWALK_R_RDY;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ WALKING_DUAL_RDY ] = RGMWALK_D_RDY;
|
||||
|
||||
gubAnimSurfaceIndex[ REGMALE ][ START_AID_PRN ] = RGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ GIVING_AID_PRN ] = RGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ END_AID_PRN ] = RGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ START_AID_PRN ] = RGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ GIVING_AID_PRN ] = RGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ END_AID_PRN ] = RGMMEDICPRN;
|
||||
|
||||
gubAnimSurfaceIndex[ REGMALE ][ ADJACENT_GET_ITEM_CROUCHED ] = RGMMEDIC;
|
||||
gubAnimSurfaceIndex[ REGMALE ][ STEAL_ITEM_CROUCHED ] = RGMMEDIC;
|
||||
|
||||
gubAnimSurfaceMidWaterSubIndex[ REGMALE ][ STANDING][0] = RGMWATER_R_STD;
|
||||
gubAnimSurfaceMidWaterSubIndex[ REGMALE ][ WALKING ][0] = RGMWATER_R_WALK;
|
||||
@@ -1811,9 +1819,12 @@ void InitAnimationSurfacesPerBodytype( )
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ WALKING_RIFLE_RDY ] = BGMWALK_R_RDY;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ WALKING_DUAL_RDY ] = BGMWALK_D_RDY;
|
||||
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ START_AID_PRN ] = BGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ GIVING_AID_PRN ] = BGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ END_AID_PRN ] = BGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ START_AID_PRN ] = BGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ GIVING_AID_PRN ] = BGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ END_AID_PRN ] = BGMMEDICPRN;
|
||||
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ ADJACENT_GET_ITEM_CROUCHED ] = BGMMEDIC;
|
||||
gubAnimSurfaceIndex[ BIGMALE ][ STEAL_ITEM_CROUCHED ] = BGMMEDIC;
|
||||
|
||||
gubAnimSurfaceItemSubIndex[ BIGMALE ][ STANDING ] = BGMPISTOLBREATH;
|
||||
gubAnimSurfaceItemSubIndex[ BIGMALE ][ WALKING ] = BGMNOTHING_WALK;
|
||||
@@ -2220,6 +2231,9 @@ void InitAnimationSurfacesPerBodytype( )
|
||||
gubAnimSurfaceIndex[ STOCKYMALE ][ GIVING_AID_PRN ] = RGMMEDICPRN;
|
||||
gubAnimSurfaceIndex[ STOCKYMALE ][ END_AID_PRN ] = RGMMEDICPRN;
|
||||
|
||||
gubAnimSurfaceIndex[ STOCKYMALE ][ ADJACENT_GET_ITEM_CROUCHED ] = RGMMEDIC;
|
||||
gubAnimSurfaceIndex[ STOCKYMALE ][ STEAL_ITEM_CROUCHED ] = RGMMEDIC;
|
||||
|
||||
gubAnimSurfaceItemSubIndex[ STOCKYMALE ][ STANDING ] = RGMPISTOLBREATH;
|
||||
gubAnimSurfaceItemSubIndex[ STOCKYMALE ][ WALKING ] = RGMNOTHING_WALK;
|
||||
gubAnimSurfaceItemSubIndex[ STOCKYMALE ][ RUNNING] = RGMNOTHING_RUN;
|
||||
@@ -2604,6 +2618,9 @@ void InitAnimationSurfacesPerBodytype( )
|
||||
gubAnimSurfaceIndex[ REGFEMALE ][ GIVING_AID_PRN ] = RGFMEDICPRN;
|
||||
gubAnimSurfaceIndex[ REGFEMALE ][ END_AID_PRN ] = RGFMEDICPRN;
|
||||
|
||||
gubAnimSurfaceIndex[ REGFEMALE ][ ADJACENT_GET_ITEM_CROUCHED ] = RGFMEDIC;
|
||||
gubAnimSurfaceIndex[ REGFEMALE ][ STEAL_ITEM_CROUCHED ] = RGFMEDIC;
|
||||
|
||||
gubAnimSurfaceItemSubIndex[ REGFEMALE ][ STANDING ] = RGFPISTOLBREATH;
|
||||
gubAnimSurfaceItemSubIndex[ REGFEMALE ][ WALKING ] = RGFNOTHING_WALK;
|
||||
gubAnimSurfaceItemSubIndex[ REGFEMALE ][ RUNNING ] = RGFNOTHING_RUN;
|
||||
@@ -3349,6 +3366,9 @@ BOOLEAN LoadAnimationStateInstructions( )
|
||||
memcpy(gusAnimInst[GIVING_AID_PRN],PRONE_GIVE_FIRST_AID_AnimationScript,sizeof(PRONE_GIVE_FIRST_AID_AnimationScript));
|
||||
memcpy(gusAnimInst[END_AID_PRN],fuckTheBoundz[END_AID],sizeof(fuckTheBoundz[END_AID]));
|
||||
|
||||
memcpy(gusAnimInst[ADJACENT_GET_ITEM_CROUCHED],fuckTheBoundz[ADJACENT_GET_ITEM],sizeof(fuckTheBoundz[ADJACENT_GET_ITEM]));
|
||||
memcpy(gusAnimInst[STEAL_ITEM_CROUCHED],fuckTheBoundz[STEAL_ITEM],sizeof(fuckTheBoundz[STEAL_ITEM]));
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -575,6 +575,9 @@ enum AnimationStates
|
||||
GIVING_AID_PRN,
|
||||
END_AID_PRN,
|
||||
|
||||
ADJACENT_GET_ITEM_CROUCHED,
|
||||
STEAL_ITEM_CROUCHED,
|
||||
|
||||
NUMANIMATIONSTATES
|
||||
|
||||
};
|
||||
|
||||
@@ -6417,6 +6417,7 @@ BOOLEAN SelectedGuyInBusyAnimation( )
|
||||
pSoldier->usAnimState == END_OPEN_DOOR ||
|
||||
pSoldier->usAnimState == END_OPEN_LOCKED_DOOR ||
|
||||
pSoldier->usAnimState == ADJACENT_GET_ITEM ||
|
||||
pSoldier->usAnimState == ADJACENT_GET_ITEM_CROUCHED ||
|
||||
pSoldier->usAnimState == DROP_ADJACENT_OBJECT ||
|
||||
|
||||
pSoldier->usAnimState == OPEN_DOOR_CROUCHED ||
|
||||
|
||||
+25
-1
@@ -1572,8 +1572,32 @@ BOOLEAN ExecuteOverhead( )
|
||||
{
|
||||
//pSoldier->pathing.bDesiredDirection = pSoldier->aiData.bPendingActionData3;
|
||||
pSoldier->EVENT_SetSoldierDesiredDirection( pSoldier->aiData.bPendingActionData3 );
|
||||
// if we are crouching or prone, use steal in crouch
|
||||
if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE || gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_CROUCH )
|
||||
{
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM_CROUCHED, 0 , FALSE );
|
||||
}
|
||||
else // otherwise determine our target position
|
||||
{
|
||||
SOLDIERTYPE *pTarget;
|
||||
UINT16 usSoldierIndex;
|
||||
usSoldierIndex = WhoIsThere2( pSoldier->aiData.sPendingActionData2, pSoldier->pathing.bLevel );
|
||||
if ( usSoldierIndex != NOBODY )
|
||||
{
|
||||
pTarget = MercPtrs[ usSoldierIndex ];
|
||||
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM, 0 , FALSE );
|
||||
// we always need to crouch to prone target
|
||||
if ( gAnimControl[ pTarget->usAnimState ].ubEndHeight == ANIM_PRONE )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM_CROUCHED, 0 , FALSE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM, 0 , FALSE );
|
||||
}
|
||||
else // strange things can happe??
|
||||
{
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM, 0 , FALSE );
|
||||
}
|
||||
|
||||
}
|
||||
pSoldier->aiData.ubPendingAction = NO_PENDING_ACTION;
|
||||
}
|
||||
else if ( pSoldier->aiData.ubPendingAction == MERC_KNIFEATTACK)
|
||||
|
||||
@@ -2118,7 +2118,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
|| pSoldier->aiData.bAction == AI_ACTION_UNLOCK_DOOR
|
||||
|| pSoldier->aiData.bAction == AI_ACTION_LOCK_DOOR )
|
||||
{
|
||||
if ( pSoldier->usAnimState == PICKUP_ITEM || pSoldier->usAnimState == ADJACENT_GET_ITEM || pSoldier->usAnimState == DROP_ITEM || pSoldier->usAnimState == END_OPEN_DOOR || pSoldier->usAnimState == END_OPEN_DOOR_CROUCHED || pSoldier->usAnimState == CLOSE_DOOR || pSoldier->usAnimState == MONSTER_UP || pSoldier->usAnimState == AI_RADIO || pSoldier->usAnimState == AI_CR_RADIO || pSoldier->usAnimState == END_OPENSTRUCT || pSoldier->usAnimState == END_OPENSTRUCT_CROUCHED || pSoldier->usAnimState == QUEEN_CALL )
|
||||
if ( pSoldier->usAnimState == PICKUP_ITEM || pSoldier->usAnimState == ADJACENT_GET_ITEM || pSoldier->usAnimState == ADJACENT_GET_ITEM_CROUCHED || pSoldier->usAnimState == DROP_ITEM || pSoldier->usAnimState == END_OPEN_DOOR || pSoldier->usAnimState == END_OPEN_DOOR_CROUCHED || pSoldier->usAnimState == CLOSE_DOOR || pSoldier->usAnimState == MONSTER_UP || pSoldier->usAnimState == AI_RADIO || pSoldier->usAnimState == AI_CR_RADIO || pSoldier->usAnimState == END_OPENSTRUCT || pSoldier->usAnimState == END_OPENSTRUCT_CROUCHED || pSoldier->usAnimState == QUEEN_CALL )
|
||||
{
|
||||
FreeUpNPCFromPendingAction( pSoldier );
|
||||
}
|
||||
|
||||
@@ -2993,6 +2993,18 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
|
||||
}
|
||||
}
|
||||
|
||||
if ( usNewState == ADJACENT_GET_ITEM_CROUCHED )
|
||||
{
|
||||
if ( this->ubPendingDirection != NO_PENDING_DIRECTION )
|
||||
{
|
||||
EVENT_InternalSetSoldierDesiredDirection( this, this->ubPendingDirection, FALSE, this->usAnimState );
|
||||
this->ubPendingDirection = NO_PENDING_DIRECTION;
|
||||
this->usPendingAnimation = ADJACENT_GET_ITEM_CROUCHED;
|
||||
this->flags.fTurningUntilDone = TRUE;
|
||||
this->SoldierGotoStationaryStance( );
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
if ( usNewState == CLIMBUPROOF )
|
||||
{
|
||||
@@ -13636,7 +13648,8 @@ void PickPickupAnimation( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo
|
||||
INT8 bDirection;
|
||||
STRUCTURE *pStructure;
|
||||
BOOLEAN fDoNormalPickup = TRUE;
|
||||
|
||||
//SOLDIERTYPE *pTarget;
|
||||
//UINT16 usSoldierIndex;
|
||||
|
||||
// OK, Given the gridno, determine if it's the same one or different....
|
||||
if ( sGridNo != pSoldier->sGridNo )
|
||||
@@ -13646,7 +13659,25 @@ void PickPickupAnimation( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo
|
||||
pSoldier->ubPendingDirection = bDirection;
|
||||
|
||||
// Change to pickup animation
|
||||
pSoldier->EVENT_InitNewSoldierAnim( ADJACENT_GET_ITEM, 0 , FALSE );
|
||||
// SANDRO - determine which animation to choose, if we pickup item from struct, we can either stand or be crouched
|
||||
// when picking items from lying soldier (collapsed maybe), we need to be crouched always
|
||||
//usSoldierIndex = WhoIsThere2( sGridNo, this->pathing.bLevel );
|
||||
//if ( usSoldierIndex != NOBODY )
|
||||
/*{
|
||||
pTarget = MercPtrs[ usSoldierIndex ];
|
||||
|
||||
if ( gAnimControl[ pTarget->usAnimState ].ubEndHeight == ANIM_PRONE || gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_CROUCH || gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( ADJACENT_GET_ITEM_CROUCHED, 0 , FALSE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( ADJACENT_GET_ITEM, 0 , FALSE );
|
||||
}*/
|
||||
//else
|
||||
{
|
||||
if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_CROUCH || gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( ADJACENT_GET_ITEM_CROUCHED, 0 , FALSE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( ADJACENT_GET_ITEM, 0 , FALSE );
|
||||
}
|
||||
|
||||
if (!(pSoldier->flags.uiStatusFlags & SOLDIER_PC))
|
||||
{
|
||||
@@ -14137,7 +14168,11 @@ void MercStealFromMerc( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTarget )
|
||||
else
|
||||
{
|
||||
pSoldier->EVENT_SetSoldierDesiredDirection( ubDirection );
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM, 0 , FALSE );
|
||||
|
||||
if ( gAnimControl[ pTarget->usAnimState ].ubEndHeight == ANIM_PRONE || gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE || gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_CROUCH )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM_CROUCHED, 0 , FALSE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STEAL_ITEM, 0 , FALSE );
|
||||
}
|
||||
|
||||
// OK, set UI
|
||||
|
||||
@@ -1044,7 +1044,7 @@ void FreeUpNPCFromPendingAction( SOLDIERTYPE *pSoldier )
|
||||
TriggerNPCWithGivenApproach( pSoldier->ubProfile, APPROACH_DONE_OPEN_STRUCTURE, TRUE );
|
||||
//TriggerNPCWithGivenApproach( pSoldier->ubProfile, APPROACH_DONE_OPEN_STRUCTURE, FALSE );
|
||||
}
|
||||
else if (pSoldier->usAnimState == PICKUP_ITEM || pSoldier->usAnimState == ADJACENT_GET_ITEM )
|
||||
else if (pSoldier->usAnimState == PICKUP_ITEM || pSoldier->usAnimState == ADJACENT_GET_ITEM || pSoldier->usAnimState == ADJACENT_GET_ITEM_CROUCHED )
|
||||
{
|
||||
TriggerNPCWithGivenApproach( pSoldier->ubProfile, APPROACH_DONE_GET_ITEM, TRUE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user