2020-08-10 00:21:45 -05:00
# include "framework.h"
2021-12-24 03:32:19 +03:00
# include "Game/Lara/lara_crawl.h"
# include "Game/animation.h"
# include "Game/camera.h"
# include "Game/collision/collide_room.h"
# include "Game/control/control.h"
# include "Game/control/los.h"
# include "Game/items.h"
2021-12-22 16:23:57 +03:00
# include "Game/Lara/lara.h"
# include "Game/Lara/lara_tests.h"
# include "Game/Lara/lara_collide.h"
# include "Game/Lara/lara_flare.h"
# include "Game/Lara/lara_helpers.h"
2021-12-24 03:32:19 +03:00
# include "Specific/input.h"
# include "Specific/level.h"
2021-12-01 15:18:47 +03:00
# include "Scripting/GameFlowScript.h"
2021-09-19 18:29:25 +03:00
2021-09-27 18:18:03 +10:00
// -----------------------------
2021-11-20 16:50:18 +11:00
// CRAWL & CROUCH
2021-09-26 20:59:16 +10:00
// Control & Collision Functions
2021-09-27 18:18:03 +10:00
// -----------------------------
2021-09-26 20:59:16 +10:00
2021-11-20 16:50:18 +11:00
// -------
// CROUCH:
// -------
2021-10-04 22:46:39 +11:00
2021-09-26 20:59:16 +10:00
// State: LS_CROUCH_IDLE (71)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crouch_idle()
void lara_as_crouch_idle ( ITEM_INFO * item , COLL_INFO * coll )
2021-09-26 20:59:16 +10:00
{
2021-10-14 01:17:21 +11:00
// TODO: Deplete air meter if Lara's head is below the water. Original implementation had a weird buffer zone before
2021-10-15 18:26:03 +11:00
// wade depth where Lara couldn't crouch at all, and if the player forced her into the crouched state by
2021-10-14 01:17:21 +11:00
// crouching into the region from a run as late as possible, she wasn't able to turn or begin crawling.
2021-11-19 22:48:47 +11:00
// Since Lara can now crawl at a considerable depth, a region of peril would make sense. @Sezz 2021.10.21
2021-10-14 01:17:21 +11:00
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-09-26 20:59:16 +10:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-12-10 22:31:34 +11:00
// TODO: Dispatch pickups from within states.
2022-02-02 20:16:16 +11:00
if ( item - > targetState = = LS_PICKUP )
2021-12-10 22:31:34 +11:00
return ;
2021-09-26 20:59:16 +10:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-09-26 20:59:16 +10:00
return ;
}
if ( TrInput & IN_LOOK )
LookUpDown ( ) ;
2021-10-30 13:42:55 +11:00
if ( TrInput & IN_LEFT )
2021-12-10 22:31:34 +11:00
info - > turnRate = - LARA_CRAWL_TURN_MAX ;
2021-10-30 13:42:55 +11:00
else if ( TrInput & IN_RIGHT )
2021-12-10 22:31:34 +11:00
info - > turnRate = LARA_CRAWL_TURN_MAX ;
2021-10-14 01:59:55 +11:00
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-14 21:01:50 +11:00
info - > waterStatus ! = LW_WADE )
2021-09-26 20:59:16 +10:00
{
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) & &
2021-11-25 23:38:59 +11:00
info - > gunStatus = = LG_HANDS_FREE & &
2021-12-02 12:47:07 +11:00
g_GameFlow - > Animations . CrouchRoll )
2021-09-26 20:59:16 +10:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_ROLL ;
2021-09-26 20:59:16 +10:00
return ;
}
2021-12-02 18:52:00 +11:00
if ( TrInput & ( IN_FORWARD | IN_BACK ) & & TestLaraCrouchToCrawl ( item ) )
2021-09-26 20:59:16 +10:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-09-26 20:59:16 +10:00
return ;
}
2021-10-13 19:50:46 +11:00
if ( TrInput & IN_LEFT )
2021-09-26 20:59:16 +10:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_TURN_LEFT ;
2021-09-26 20:59:16 +10:00
return ;
}
2021-10-13 19:50:46 +11:00
else if ( TrInput & IN_RIGHT )
2021-09-26 20:59:16 +10:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_TURN_RIGHT ;
2021-09-26 20:59:16 +10:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_IDLE ;
2021-09-26 20:59:16 +10:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_IDLE ;
2021-09-26 20:59:16 +10:00
}
// State: LS_CROUCH_IDLE (71)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crouch_idle()
void lara_col_crouch_idle ( ITEM_INFO * item , COLL_INFO * coll )
2021-09-26 20:59:16 +10:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2022-01-03 17:01:07 +11:00
info - > keepLow = TestLaraKeepLow ( item , coll ) ;
info - > isLow = true ;
2021-11-14 21:01:50 +11:00
info - > moveAngle = item - > pos . yRot ;
2021-12-13 18:05:52 +11:00
info - > torsoXrot = 0 ;
info - > torsoYrot = 0 ;
2022-01-21 23:23:10 +11:00
item - > airborne = false ;
2021-09-26 20:59:16 +10:00
item - > fallspeed = 0 ;
coll - > Setup . Height = LARA_HEIGHT_CRAWL ;
coll - > Setup . ForwardAngle = item - > pos . yRot ;
2022-02-01 21:46:58 +11:00
coll - > Setup . LowerFloorBound = CLICK ( 1 ) - 1 ;
coll - > Setup . UpperFloorBound = - ( CLICK ( 1 ) - 1 ) ;
2022-01-30 14:43:33 +11:00
coll - > Setup . LowerCeilingBound = 0 ;
coll - > Setup . FloorSlopeIsWall = true ;
coll - > Setup . FloorSlopeIsPit = true ;
2021-09-26 20:59:16 +10:00
GetCollisionInfo ( coll , item ) ;
2021-11-20 12:25:51 +11:00
if ( TestLaraFall ( item , coll ) )
2021-09-26 20:59:16 +10:00
{
SetLaraFallState ( item ) ;
2021-12-02 18:52:00 +11:00
info - > gunStatus = LG_HANDS_FREE ;
2021-09-26 20:59:16 +10:00
return ;
}
2021-11-05 21:29:00 +11:00
if ( TestLaraSlide ( item , coll ) )
2021-12-18 20:42:15 +11:00
{
SetLaraSlideState ( item , coll ) ;
2021-09-26 20:59:16 +10:00
return ;
2021-12-18 20:42:15 +11:00
}
2021-09-26 20:59:16 +10:00
2021-12-10 12:30:23 +11:00
ShiftItem ( item , coll ) ;
2021-12-01 02:11:14 +11:00
2022-01-27 20:56:05 +11:00
if ( TestLaraStep ( item , coll ) )
2021-12-01 02:11:14 +11:00
{
DoLaraStep ( item , coll ) ;
return ;
}
2021-09-26 20:59:16 +10:00
}
2021-09-27 18:18:03 +10:00
// State: LS_CROUCH_ROLL (72)
// Collision: lara_as_crouch_roll()
2021-09-26 20:59:16 +10:00
void lara_as_crouch_roll ( ITEM_INFO * item , COLL_INFO * coll )
2021-09-27 18:18:03 +10:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2021-12-13 18:05:52 +11:00
info - > look = false ;
2021-09-27 18:18:03 +10:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-09-27 18:18:03 +10:00
2021-10-28 16:13:56 +11:00
if ( TrInput & IN_LEFT )
2021-09-27 18:18:03 +10:00
{
2021-11-19 22:48:47 +11:00
info - > turnRate - = LARA_TURN_RATE ;
2021-12-10 22:31:34 +11:00
if ( info - > turnRate < - LARA_CROUCH_ROLL_TURN_MAX )
info - > turnRate = - LARA_CROUCH_ROLL_TURN_MAX ;
2021-09-27 18:18:03 +10:00
2021-11-17 15:59:51 +11:00
DoLaraLean ( item , coll , - LARA_LEAN_MAX , LARA_LEAN_RATE ) ;
2021-09-27 18:18:03 +10:00
}
2021-10-28 16:13:56 +11:00
else if ( TrInput & IN_RIGHT )
2021-09-27 18:18:03 +10:00
{
2021-11-19 22:48:47 +11:00
info - > turnRate + = LARA_TURN_RATE ;
2021-12-10 22:31:34 +11:00
if ( info - > turnRate > LARA_CROUCH_ROLL_TURN_MAX )
info - > turnRate = LARA_CROUCH_ROLL_TURN_MAX ;
2021-09-27 18:18:03 +10:00
2021-11-17 15:59:51 +11:00
DoLaraLean ( item , coll , LARA_LEAN_MAX , LARA_LEAN_RATE ) ;
2021-09-27 18:18:03 +10:00
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_IDLE ;
2021-09-27 18:18:03 +10:00
}
// State: LS_CROUCH_ROLL (72)
// Control: lara_as_crouch_roll()
2021-09-26 20:59:16 +10:00
void lara_col_crouch_roll ( ITEM_INFO * item , COLL_INFO * coll )
2021-09-27 18:18:03 +10:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2022-01-03 17:01:07 +11:00
info - > keepLow = TestLaraKeepLow ( item , coll ) ;
info - > isLow = true ;
2021-11-14 21:01:50 +11:00
info - > moveAngle = item - > pos . yRot ;
2022-01-21 23:23:10 +11:00
item - > airborne = 0 ;
2021-09-27 18:18:03 +10:00
item - > fallspeed = 0 ;
coll - > Setup . Height = LARA_HEIGHT_CRAWL ;
2022-02-01 21:46:58 +11:00
coll - > Setup . LowerFloorBound = CLICK ( 1 ) - 1 ;
coll - > Setup . UpperFloorBound = - ( CLICK ( 1 ) - 1 ) ;
2021-09-27 18:18:03 +10:00
coll - > Setup . ForwardAngle = item - > pos . yRot ;
2022-01-30 14:43:33 +11:00
coll - > Setup . LowerCeilingBound = 0 ;
coll - > Setup . FloorSlopeIsWall = true ;
2021-09-27 18:18:03 +10:00
GetCollisionInfo ( coll , item ) ;
2021-11-19 22:48:47 +11:00
// TODO: With sufficient speed, Lara can still roll off ledges. This is particularly a problem in the uncommon scenario where
// she becomes airborne within a crawlspace; collision handling will push her back very rapidly and potentially cause a softlock. @Sezz 2021.11.02
2021-11-12 00:17:29 +11:00
if ( LaraDeflectEdgeCrawl ( item , coll ) )
2021-10-14 01:17:21 +11:00
{
item - > pos . xPos = coll - > Setup . OldPosition . x ;
item - > pos . yPos = coll - > Setup . OldPosition . y ;
item - > pos . zPos = coll - > Setup . OldPosition . z ;
}
2021-11-20 12:25:51 +11:00
if ( TestLaraFall ( item , coll ) )
2021-09-27 18:18:03 +10:00
{
2021-12-02 18:52:00 +11:00
SetLaraFallState ( item ) ;
2021-11-25 23:38:59 +11:00
info - > gunStatus = LG_HANDS_FREE ;
2021-11-12 15:35:16 +11:00
item - > speed / = 3 ; // Truncate speed to prevent flying off.
2021-09-27 18:18:03 +10:00
return ;
}
2021-11-05 21:29:00 +11:00
if ( TestLaraSlide ( item , coll ) )
2021-12-18 20:42:15 +11:00
{
SetLaraSlideState ( item , coll ) ;
2021-09-27 18:18:03 +10:00
return ;
2021-12-18 20:42:15 +11:00
}
2021-09-27 18:18:03 +10:00
2021-12-10 12:30:23 +11:00
ShiftItem ( item , coll ) ;
2021-10-14 01:17:21 +11:00
if ( TestLaraHitCeiling ( coll ) )
2021-09-27 18:18:03 +10:00
{
2021-10-14 01:17:21 +11:00
SetLaraHitCeiling ( item , coll ) ;
2021-09-27 18:18:03 +10:00
return ;
}
2022-01-27 20:56:05 +11:00
if ( TestLaraStep ( item , coll ) )
2021-09-27 18:18:03 +10:00
{
2021-10-14 01:17:21 +11:00
DoLaraStep ( item , coll ) ;
2021-09-27 18:18:03 +10:00
return ;
}
2020-08-10 00:21:45 -05:00
}
2021-10-04 22:46:39 +11:00
// State: LS_CROUCH_TURN_LEFT (105)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crouch_turn_left()
void lara_as_crouch_turn_left ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-04 22:46:39 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2022-01-30 14:43:33 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-10-04 22:46:39 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-04 22:46:39 +11:00
return ;
}
if ( TrInput & IN_LOOK )
LookUpDown ( ) ;
2021-12-10 22:31:34 +11:00
info - > turnRate = - LARA_CRAWL_TURN_MAX ;
2021-10-04 22:46:39 +11:00
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-14 21:01:50 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-04 22:46:39 +11:00
{
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) & &
2021-12-02 12:47:07 +11:00
g_GameFlow - > Animations . CrouchRoll )
2021-10-04 22:46:39 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_ROLL ;
2021-10-04 22:46:39 +11:00
return ;
}
2021-12-02 18:52:00 +11:00
if ( TrInput & ( IN_FORWARD | IN_BACK ) & & TestLaraCrouchToCrawl ( item ) )
2021-10-04 22:46:39 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-04 22:46:39 +11:00
return ;
}
if ( TrInput & IN_LEFT )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_TURN_LEFT ;
2021-10-04 22:46:39 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_IDLE ;
2021-10-04 22:46:39 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_IDLE ;
2021-10-04 22:46:39 +11:00
}
2021-10-15 01:37:41 +11:00
// State: LS_CRAWL_TURN_LEFT (105)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crouch_turn_left()
void lara_col_crouch_turn_left ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-15 01:37:41 +11:00
{
2021-10-30 12:45:52 +11:00
lara_col_crouch_idle ( item , coll ) ;
2021-10-15 01:37:41 +11:00
}
2021-10-04 22:46:39 +11:00
// State: LS_CROUCH_TURN_RIGHT (106)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crouch_turn_right()
void lara_as_crouch_turn_right ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-04 22:46:39 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-10-04 22:46:39 +11:00
2022-01-30 14:43:33 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-10-04 22:46:39 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-04 22:46:39 +11:00
return ;
}
if ( TrInput & IN_LOOK )
LookUpDown ( ) ;
2021-12-10 22:31:34 +11:00
info - > turnRate = LARA_CRAWL_TURN_MAX ;
2021-10-04 22:46:39 +11:00
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-14 21:01:50 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-04 22:46:39 +11:00
{
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) & &
2021-12-02 12:47:07 +11:00
g_GameFlow - > Animations . CrouchRoll )
2021-10-04 22:46:39 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_ROLL ;
2021-10-04 22:46:39 +11:00
return ;
}
2021-12-02 18:52:00 +11:00
if ( TrInput & ( IN_FORWARD | IN_BACK ) & & TestLaraCrouchToCrawl ( item ) )
2021-10-04 22:46:39 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-04 22:46:39 +11:00
return ;
}
if ( TrInput & IN_RIGHT )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_TURN_RIGHT ;
2021-10-04 22:46:39 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_IDLE ;
2021-10-04 22:46:39 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_IDLE ;
2021-10-04 22:46:39 +11:00
}
2021-10-15 01:37:41 +11:00
// State: LS_CRAWL_TURN_RIGHT (106)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crouch_turn_right()
void lara_col_crouch_turn_right ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-04 22:46:39 +11:00
{
2021-10-30 12:45:52 +11:00
lara_col_crouch_idle ( item , coll ) ;
2021-10-04 22:46:39 +11:00
}
2021-11-20 16:50:18 +11:00
// ------
// CRAWL:
// ------
2021-10-04 22:46:39 +11:00
2021-10-16 20:50:16 +11:00
// State: LS_CRAWL_IDLE (80)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crawl_idle()
void lara_as_crawl_idle ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-16 20:50:16 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
info - > gunStatus = LG_HANDS_BUSY ;
2021-10-16 20:50:16 +11:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-12-10 22:31:34 +11:00
// TODO: Dispatch pickups from within states.
2022-02-02 20:16:16 +11:00
if ( item - > targetState = = LS_PICKUP )
2021-12-10 22:31:34 +11:00
return ;
2021-10-16 20:50:16 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-16 20:50:16 +11:00
return ;
}
if ( TrInput & IN_LOOK )
LookUpDown ( ) ;
2021-11-01 17:57:43 +11:00
if ( TrInput & IN_LEFT )
2021-12-10 22:31:34 +11:00
info - > turnRate = - LARA_CRAWL_TURN_MAX ;
2021-11-01 17:57:43 +11:00
else if ( TrInput & IN_RIGHT )
2021-12-10 22:31:34 +11:00
info - > turnRate = LARA_CRAWL_TURN_MAX ;
2021-11-01 17:57:43 +11:00
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-14 21:01:50 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-16 20:50:16 +11:00
{
// TODO: Flare not working.
2021-11-11 23:31:04 +11:00
if ( ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) ) | |
2021-11-19 22:48:47 +11:00
( TrInput & ( IN_DRAW | IN_FLARE ) & &
! IsStandingWeapon ( info - > gunType ) & &
2021-11-23 13:53:35 +11:00
item - > animNumber ! = LA_CROUCH_TO_CRAWL_START ) ) // Hack.
2021-10-16 20:50:16 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_IDLE ;
2021-12-02 18:52:00 +11:00
info - > gunStatus = LG_HANDS_FREE ;
2021-10-16 20:50:16 +11:00
return ;
}
2021-10-28 23:22:28 +11:00
if ( TrInput & IN_FORWARD )
2021-10-16 20:50:16 +11:00
{
2022-02-04 20:23:39 +11:00
auto crawlVaultResult = TestLaraCrawlVault ( item , coll ) ;
if ( TrInput & ( IN_ACTION | IN_JUMP ) & &
crawlVaultResult . Success & &
2021-12-02 12:47:07 +11:00
g_GameFlow - > Animations . CrawlExtended )
2021-10-16 20:50:16 +11:00
{
2022-02-04 20:23:39 +11:00
item - > targetState = crawlVaultResult . TargetState ;
ResetLaraFlex ( item ) ;
2021-10-22 00:07:24 +11:00
return ;
2021-10-16 20:50:16 +11:00
}
2021-11-26 13:22:51 +11:00
else if ( TestLaraCrawlForward ( item , coll ) ) [[likely]]
2021-10-22 00:07:24 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_FORWARD ;
2021-10-22 00:07:24 +11:00
return ;
}
2021-10-16 20:50:16 +11:00
}
else if ( TrInput & IN_BACK )
{
2021-12-02 18:52:00 +11:00
if ( TrInput & ( IN_ACTION | IN_JUMP ) & & TestLaraCrawlToHang ( item , coll ) )
2021-10-17 22:10:01 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_TO_HANG ;
2021-12-02 18:52:00 +11:00
DoLaraCrawlToHangSnap ( item , coll ) ;
2021-10-22 00:07:24 +11:00
return ;
2021-10-17 22:10:01 +11:00
}
2021-10-24 20:43:02 +11:00
else if ( TestLaraCrawlBack ( item , coll ) ) [[likely]]
2021-10-22 00:07:24 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_BACK ;
2021-10-22 00:07:24 +11:00
return ;
}
2021-10-16 20:50:16 +11:00
}
if ( TrInput & IN_LEFT )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_TURN_LEFT ;
2021-10-16 20:50:16 +11:00
return ;
}
else if ( TrInput & IN_RIGHT )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_TURN_RIGHT ;
2021-10-16 20:50:16 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-16 20:50:16 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CROUCH_IDLE ;
2021-12-02 18:52:00 +11:00
info - > gunStatus = LG_HANDS_FREE ;
2021-10-16 20:50:16 +11:00
}
// State: LS_CRAWL_IDLE (80)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crawl_idle()
void lara_col_crawl_idle ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-16 20:50:16 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2022-01-03 17:01:07 +11:00
info - > keepLow = TestLaraKeepLow ( item , coll ) ;
info - > isLow = true ;
2021-11-14 21:01:50 +11:00
info - > moveAngle = item - > pos . yRot ;
2021-11-19 22:48:47 +11:00
info - > torsoXrot = 0 ;
2021-11-14 21:01:50 +11:00
info - > torsoYrot = 0 ;
2021-10-16 20:50:16 +11:00
item - > fallspeed = 0 ;
2022-01-21 23:23:10 +11:00
item - > airborne = false ;
2021-11-14 21:01:50 +11:00
coll - > Setup . ForwardAngle = info - > moveAngle ;
2021-10-16 20:50:16 +11:00
coll - > Setup . Radius = LARA_RAD_CRAWL ;
coll - > Setup . Height = LARA_HEIGHT_CRAWL ;
2022-02-01 21:46:58 +11:00
coll - > Setup . LowerFloorBound = CLICK ( 1 ) - 1 ;
coll - > Setup . UpperFloorBound = - ( CLICK ( 1 ) - 1 ) ;
2022-01-30 14:43:33 +11:00
coll - > Setup . LowerCeilingBound = LARA_HEIGHT_CRAWL ;
coll - > Setup . FloorSlopeIsWall = true ;
coll - > Setup . FloorSlopeIsPit = true ;
2021-10-16 20:50:16 +11:00
GetCollisionInfo ( coll , item ) ;
2021-11-20 12:25:51 +11:00
if ( TestLaraFall ( item , coll ) )
2021-10-16 20:50:16 +11:00
{
SetLaraFallState ( item ) ;
return ;
}
if ( TestLaraSlide ( item , coll ) )
2021-12-18 20:42:15 +11:00
{
SetLaraSlideState ( item , coll ) ;
2021-10-16 20:50:16 +11:00
return ;
2021-12-18 20:42:15 +11:00
}
2021-10-16 20:50:16 +11:00
2021-12-10 12:30:23 +11:00
ShiftItem ( item , coll ) ;
2021-12-01 02:11:14 +11:00
2022-01-27 20:56:05 +11:00
if ( TestLaraStep ( item , coll ) )
2021-12-01 02:11:14 +11:00
{
DoLaraStep ( item , coll ) ;
return ;
}
2021-10-16 20:50:16 +11:00
}
2021-10-04 23:52:23 +11:00
// State: LS_CRAWL_FORWARD (81)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crawl_forward()
void lara_as_crawl_forward ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-04 23:52:23 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2021-11-14 21:01:50 +11:00
info - > gunStatus = LG_HANDS_BUSY ;
2021-10-04 23:52:23 +11:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-10-04 23:52:23 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-04 23:52:23 +11:00
return ;
}
if ( TrInput & IN_LEFT )
{
2021-11-27 20:35:16 +11:00
info - > turnRate - = LARA_CRAWL_MOVE_TURN_RATE ;
2021-12-10 22:31:34 +11:00
if ( info - > turnRate < - LARA_CRAWL_MOVE_TURN_MAX )
info - > turnRate = - LARA_CRAWL_MOVE_TURN_MAX ;
2021-11-27 20:35:16 +11:00
2021-12-11 19:03:13 +11:00
DoLaraCrawlFlex ( item , coll , - LARA_CRAWL_FLEX_MAX , LARA_CRAWL_FLEX_RATE ) ;
2021-10-04 23:52:23 +11:00
}
else if ( TrInput & IN_RIGHT )
{
2021-11-27 20:35:16 +11:00
info - > turnRate + = LARA_CRAWL_MOVE_TURN_RATE ;
2021-12-10 22:31:34 +11:00
if ( info - > turnRate > LARA_CRAWL_MOVE_TURN_MAX )
info - > turnRate = LARA_CRAWL_MOVE_TURN_MAX ;
2021-11-27 20:35:16 +11:00
2021-12-11 19:03:13 +11:00
DoLaraCrawlFlex ( item , coll , LARA_CRAWL_FLEX_MAX , LARA_CRAWL_FLEX_RATE ) ;
2021-10-04 23:52:23 +11:00
}
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-14 21:01:50 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-04 23:52:23 +11:00
{
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) )
2021-10-28 15:25:25 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-28 15:25:25 +11:00
return ;
}
2021-10-04 23:52:23 +11:00
if ( TrInput & IN_FORWARD )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_FORWARD ;
2021-12-10 12:30:23 +11:00
return ;
2021-10-04 23:52:23 +11:00
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-04 23:52:23 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-04 23:52:23 +11:00
}
2021-10-11 23:16:02 +11:00
// State: LS_CRAWL_FORWARD (81)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crawl_forward()
void lara_col_crawl_forward ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-11 23:16:02 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2022-01-03 17:01:07 +11:00
info - > keepLow = TestLaraKeepLow ( item , coll ) ;
info - > isLow = true ;
2021-11-14 21:01:50 +11:00
info - > moveAngle = item - > pos . yRot ;
info - > torsoXrot = 0 ;
info - > torsoYrot = 0 ;
2022-01-21 23:23:10 +11:00
item - > airborne = false ;
2021-10-11 23:16:02 +11:00
item - > fallspeed = 0 ;
coll - > Setup . Radius = LARA_RAD_CRAWL ;
coll - > Setup . Height = LARA_HEIGHT_CRAWL ;
2022-02-01 21:46:58 +11:00
coll - > Setup . LowerFloorBound = CLICK ( 1 ) - 1 ; // Offset of 1 is required or Lara will crawl up/down steps.
coll - > Setup . UpperFloorBound = - ( CLICK ( 1 ) - 1 ) ; // TODO: Stepping approach is different from walk/run because crawl step anims do not submerge Lara. Resolve this someday. @Sezz 2021.10.31
2022-01-30 14:43:33 +11:00
coll - > Setup . LowerCeilingBound = LARA_HEIGHT_CRAWL ;
coll - > Setup . FloorSlopeIsPit = true ;
coll - > Setup . FloorSlopeIsWall = true ;
2021-12-01 01:13:22 +11:00
coll - > Setup . DeathFlagIsPit = true ;
2021-11-14 21:01:50 +11:00
coll - > Setup . ForwardAngle = info - > moveAngle ;
2021-10-11 23:16:02 +11:00
GetCollisionInfo ( coll , item , true ) ;
2021-11-12 00:17:29 +11:00
if ( LaraDeflectEdgeCrawl ( item , coll ) )
2021-11-08 22:24:49 +11:00
LaraCollideStopCrawl ( item , coll ) ;
2021-10-11 23:16:02 +11:00
2021-11-20 12:25:51 +11:00
if ( TestLaraFall ( item , coll ) )
2021-10-11 23:16:02 +11:00
{
SetLaraFallState ( item ) ;
return ;
}
if ( TestLaraSlide ( item , coll ) )
2021-12-18 20:42:15 +11:00
{
SetLaraSlideState ( item , coll ) ;
2021-10-11 23:16:02 +11:00
return ;
2021-12-18 20:42:15 +11:00
}
2021-10-11 23:16:02 +11:00
2021-12-10 12:30:23 +11:00
ShiftItem ( item , coll ) ;
2021-10-11 23:16:02 +11:00
2022-01-27 20:56:05 +11:00
if ( TestLaraStep ( item , coll ) )
2021-10-11 23:16:02 +11:00
{
DoLaraStep ( item , coll ) ;
return ;
}
2020-09-26 03:28:30 +10:00
}
2020-08-10 00:21:45 -05:00
2021-10-11 23:16:02 +11:00
// State: LS_CRAWL_BACK (86)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crawl_back()
void lara_as_crawl_back ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-05 00:12:22 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2021-11-14 21:01:50 +11:00
info - > look = false ;
info - > gunStatus = LG_HANDS_BUSY ;
2021-10-05 00:12:22 +11:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-10-05 00:12:22 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-05 00:12:22 +11:00
return ;
}
if ( TrInput & IN_LEFT )
{
2021-11-27 20:35:16 +11:00
info - > turnRate - = LARA_CRAWL_MOVE_TURN_RATE ;
2021-12-10 22:31:34 +11:00
if ( info - > turnRate < - LARA_CRAWL_MOVE_TURN_MAX )
info - > turnRate = - LARA_CRAWL_MOVE_TURN_MAX ;
2021-11-27 20:35:16 +11:00
2021-12-11 19:03:13 +11:00
DoLaraCrawlFlex ( item , coll , LARA_CRAWL_FLEX_MAX , LARA_CRAWL_FLEX_RATE ) ;
2021-10-05 00:12:22 +11:00
}
else if ( TrInput & IN_RIGHT )
{
2021-11-27 20:35:16 +11:00
info - > turnRate + = LARA_CRAWL_MOVE_TURN_RATE ;
2021-12-10 22:31:34 +11:00
if ( info - > turnRate > LARA_CRAWL_MOVE_TURN_MAX )
info - > turnRate = LARA_CRAWL_MOVE_TURN_MAX ;
2021-11-27 20:35:16 +11:00
2021-12-11 19:03:13 +11:00
DoLaraCrawlFlex ( item , coll , - LARA_CRAWL_FLEX_MAX , LARA_CRAWL_FLEX_RATE ) ;
2021-10-05 00:12:22 +11:00
}
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-26 13:22:51 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-05 00:12:22 +11:00
{
if ( TrInput & IN_BACK )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_BACK ;
2021-12-04 21:00:03 +11:00
return ;
2021-10-05 00:12:22 +11:00
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-05 00:12:22 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-05 00:12:22 +11:00
}
2021-10-11 23:16:02 +11:00
// State: LS_CRAWL_BACK (86)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crawl_back()
void lara_col_crawl_back ( ITEM_INFO * item , COLL_INFO * coll )
2020-09-26 05:06:08 +10:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2022-01-03 17:01:07 +11:00
info - > keepLow = TestLaraKeepLow ( item , coll ) ;
info - > isLow = true ;
2021-11-14 21:01:50 +11:00
info - > moveAngle = item - > pos . yRot + ANGLE ( 180.0f ) ;
2022-01-21 23:23:10 +11:00
item - > airborne = false ;
2021-10-11 23:16:02 +11:00
item - > fallspeed = 0 ;
coll - > Setup . Radius = LARA_RAD_CRAWL ;
coll - > Setup . Height = LARA_HEIGHT_CRAWL ;
2022-02-01 21:46:58 +11:00
coll - > Setup . LowerFloorBound = CLICK ( 1 ) - 1 ; // Offset of 1 is required or Lara will crawl up/down steps.
coll - > Setup . UpperFloorBound = - ( CLICK ( 1 ) - 1 ) ;
2022-01-30 14:43:33 +11:00
coll - > Setup . LowerCeilingBound = LARA_HEIGHT_CRAWL ;
coll - > Setup . FloorSlopeIsPit = true ;
coll - > Setup . FloorSlopeIsWall = true ;
2021-12-01 01:13:22 +11:00
coll - > Setup . DeathFlagIsPit = true ;
2021-11-14 21:01:50 +11:00
coll - > Setup . ForwardAngle = info - > moveAngle ;
2021-10-11 23:16:02 +11:00
GetCollisionInfo ( coll , item , true ) ;
2021-11-12 00:17:29 +11:00
if ( LaraDeflectEdgeCrawl ( item , coll ) )
2021-11-08 22:24:49 +11:00
LaraCollideStopCrawl ( item , coll ) ;
2020-08-10 00:21:45 -05:00
2021-11-20 12:25:51 +11:00
if ( TestLaraFall ( item , coll ) )
2021-10-11 23:16:02 +11:00
{
SetLaraFallState ( item ) ;
return ;
}
2020-08-10 00:21:45 -05:00
2021-10-11 23:16:02 +11:00
if ( TestLaraSlide ( item , coll ) )
2021-12-18 20:42:15 +11:00
{
SetLaraSlideState ( item , coll ) ;
2021-10-11 23:16:02 +11:00
return ;
2021-12-18 20:42:15 +11:00
}
2021-10-11 23:16:02 +11:00
2021-12-10 12:30:23 +11:00
ShiftItem ( item , coll ) ;
2021-10-11 23:16:02 +11:00
2022-01-27 20:56:05 +11:00
if ( TestLaraStep ( item , coll ) )
2020-08-10 00:21:45 -05:00
{
2021-10-11 23:16:02 +11:00
DoLaraStep ( item , coll ) ;
return ;
2020-08-10 00:21:45 -05:00
}
}
2021-10-05 15:53:21 +11:00
2021-10-05 17:33:32 +11:00
// State: LS_CRAWL_TURN_LEFT (84)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crawl_turn_left()
void lara_as_crawl_turn_left ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-05 17:33:32 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2021-11-14 21:01:50 +11:00
info - > gunStatus = LG_HANDS_BUSY ;
2021-10-05 17:33:32 +11:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-10-05 17:33:32 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-05 17:33:32 +11:00
return ;
}
2021-12-10 22:31:34 +11:00
info - > turnRate = - LARA_CRAWL_TURN_MAX ;
2021-10-05 17:33:32 +11:00
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-26 13:22:51 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-05 17:33:32 +11:00
{
2021-11-11 23:31:04 +11:00
if ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) )
2021-10-28 15:25:25 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-28 15:25:25 +11:00
return ;
}
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_FORWARD & & TestLaraCrawlForward ( item , coll ) )
2021-10-05 17:33:32 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_FORWARD ;
2021-10-28 15:25:25 +11:00
return ;
2021-10-05 17:33:32 +11:00
}
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_BACK & & TestLaraCrawlBack ( item , coll ) )
2021-10-05 17:33:32 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_BACK ;
2021-10-05 17:33:32 +11:00
return ;
}
if ( TrInput & IN_LEFT )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_TURN_LEFT ;
2021-10-05 17:33:32 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-05 17:33:32 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-05 17:33:32 +11:00
}
2021-10-15 01:37:41 +11:00
// State: LS_CRAWL_TURN_LEFT (84)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crawl_turn_left()
void lara_col_crawl_turn_left ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-15 01:37:41 +11:00
{
2021-10-30 12:45:52 +11:00
lara_col_crawl_idle ( item , coll ) ;
2021-10-15 01:37:41 +11:00
}
2021-10-05 17:33:32 +11:00
// State: LS_CRAWL_TURN_RIGHT (85)
2021-10-30 12:45:52 +11:00
// Collision: lara_col_crawl_turn_right()
void lara_as_crawl_turn_right ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-05 17:33:32 +11:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2021-11-20 12:25:51 +11:00
2021-11-14 21:01:50 +11:00
info - > gunStatus = LG_HANDS_BUSY ;
2021-10-05 17:33:32 +11:00
coll - > Setup . EnableObjectPush = true ;
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-08 22:24:49 +11:00
Camera . targetElevation = - ANGLE ( 24.0f ) ;
2021-10-05 17:33:32 +11:00
if ( item - > hitPoints < = 0 )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_DEATH ;
2021-10-05 17:33:32 +11:00
return ;
}
2021-12-10 22:31:34 +11:00
info - > turnRate = LARA_CRAWL_TURN_MAX ;
2021-10-05 17:33:32 +11:00
2022-02-02 18:32:52 +11:00
if ( ( TrInput & IN_CROUCH | | info - > keepLow ) & &
2021-11-26 13:22:51 +11:00
info - > waterStatus ! = LW_WADE )
2021-10-05 17:33:32 +11:00
{
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_SPRINT & & TestLaraCrouchRoll ( item , coll ) )
2021-10-28 15:25:25 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-28 15:25:25 +11:00
return ;
}
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_FORWARD & & TestLaraCrawlForward ( item , coll ) )
2021-10-05 17:33:32 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_FORWARD ;
2021-10-28 15:25:25 +11:00
return ;
2021-10-05 17:33:32 +11:00
}
2021-12-02 18:52:00 +11:00
if ( TrInput & IN_BACK & & TestLaraCrawlBack ( item , coll ) )
2021-10-05 17:33:32 +11:00
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_BACK ;
2021-10-05 17:33:32 +11:00
return ;
}
if ( TrInput & IN_RIGHT )
{
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_TURN_RIGHT ;
2021-10-05 17:33:32 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-05 17:33:32 +11:00
return ;
}
2022-02-02 20:16:16 +11:00
item - > targetState = LS_CRAWL_IDLE ;
2021-10-05 17:33:32 +11:00
}
2021-10-15 01:37:41 +11:00
// State: LS_CRAWL_TURN_RIGHT (85)
2021-10-30 12:45:52 +11:00
// Control: lara_as_crawl_turn_right()
void lara_col_crawl_turn_right ( ITEM_INFO * item , COLL_INFO * coll )
2021-10-11 23:16:02 +11:00
{
2021-10-30 12:45:52 +11:00
lara_col_crawl_idle ( item , coll ) ;
2021-10-11 23:16:02 +11:00
}
2021-12-04 14:41:17 +11:00
void lara_col_crawl_to_hang ( ITEM_INFO * item , COLL_INFO * coll )
2020-08-11 03:55:34 -05:00
{
2021-11-14 21:01:50 +11:00
LaraInfo * & info = item - > data ;
2020-08-11 03:55:34 -05:00
2022-02-04 22:18:55 +11:00
coll - > Setup . EnableObjectPush = true ;
2022-01-30 14:43:33 +11:00
coll - > Setup . EnableSpasm = false ;
2021-11-14 21:01:50 +11:00
Camera . targetAngle = 0 ;
Camera . targetElevation = - ANGLE ( 45.0f ) ;
2020-08-11 03:55:34 -05:00
if ( item - > animNumber = = LA_CRAWL_TO_HANG_END )
{
2021-11-19 22:48:47 +11:00
info - > moveAngle = item - > pos . yRot ;
2021-09-19 06:42:24 +03:00
coll - > Setup . Height = LARA_HEIGHT_STRETCH ;
2022-01-30 14:43:33 +11:00
coll - > Setup . LowerFloorBound = NO_LOWER_BOUND ;
coll - > Setup . UpperFloorBound = - STEPUP_HEIGHT ;
coll - > Setup . LowerCeilingBound = BAD_JUMP_CEILING ;
2021-11-14 21:01:50 +11:00
coll - > Setup . ForwardAngle = info - > moveAngle ;
2020-09-26 05:06:08 +10:00
2022-02-01 21:46:58 +11:00
MoveItem ( item , item - > pos . yRot , - CLICK ( 1 ) ) ;
2021-09-19 06:42:24 +03:00
GetCollisionInfo ( coll , item ) ;
2021-10-26 18:05:16 +03:00
SnapItemToLedge ( item , coll ) ;
2022-01-13 03:13:18 +11:00
SetAnimation ( item , LA_REACH_TO_HANG , 12 ) ;
2020-08-11 03:55:34 -05:00
2021-10-26 18:05:16 +03:00
GetCollisionInfo ( coll , item ) ;
2021-11-19 22:48:47 +11:00
info - > gunStatus = LG_HANDS_BUSY ;
2021-10-26 18:05:16 +03:00
item - > pos . yPos + = coll - > Front . Floor - GetBoundsAccurate ( item ) - > Y1 - 20 ;
2022-01-21 23:23:10 +11:00
item - > airborne = true ;
2021-10-26 18:05:16 +03:00
item - > speed = 2 ;
item - > fallspeed = 1 ;
2020-08-11 03:55:34 -05:00
}
}