MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SpringBoardControl

Function SpringBoardControl

TombEngine/Objects/TR2/Trap/tr2_springboard.cpp:11–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace TEN::Animation;
10
11void SpringBoardControl(short itemNumber)
12{
13 auto& item = g_Level.Items[itemNumber];
14
15 if (item.Animation.ActiveState == 0 && LaraItem->Pose.Position.y == item.Pose.Position.y &&
16 (LaraItem->Pose.Position.x / BLOCK(1)) == (item.Pose.Position.x / BLOCK(1)) &&
17 (LaraItem->Pose.Position.z / BLOCK(1)) == (item.Pose.Position.z / BLOCK(1)))
18 {
19 if (LaraItem->HitPoints <= 0)
20 return;
21
22 if (LaraItem->Animation.ActiveState == LS_WALK_BACK ||
23 LaraItem->Animation.ActiveState == LS_RUN_BACK)
24 {
25 LaraItem->Animation.Velocity.z *= -1;
26 }
27
28 SetAnimation(LaraItem, LA_FALL_START);
29 LaraItem->Animation.IsAirborne = true;
30 LaraItem->Animation.Velocity.y = -240.0f;
31
32 item.Animation.TargetState = 1;
33 }
34
35 AnimateItem(item);
36}

Callers

nothing calls this directly

Calls 2

SetAnimationFunction · 0.85
AnimateItemFunction · 0.85

Tested by

no test coverage detected