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

Function LaraControl

TombEngine/Game/Lara/lara.cpp:142–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void LaraControl(ItemInfo* item, CollisionInfo* coll)
143{
144 auto& player = GetLaraInfo(*item);
145
146 // Alert nearby creatures.
147 if (player.Control.Weapon.HasFired)
148 {
149 AlertNearbyGuards(item);
150 player.Control.Weapon.HasFired = false;
151 }
152
153 // Handle object interation adjustment parameters.
154 if (player.Control.IsMoving)
155 {
156 if (player.Control.Count.PositionAdjust > PLAYER_POSITION_ADJUST_MAX_TIME)
157 {
158 player.Control.IsMoving = false;
159 player.Control.HandStatus = HandStatus::Free;
160 }
161
162 player.Control.Count.PositionAdjust++;
163 }
164 else
165 {
166 player.Control.Count.PositionAdjust = 0;
167 }
168
169 if (!player.Control.IsLocked)
170 player.LocationPad = NO_VALUE;
171
172 // FAILSAFE: Force hand status reset.
173 if (item->Animation.AnimNumber == LA_STAND_IDLE &&
174 item->Animation.ActiveState == LS_IDLE &&
175 item->Animation.TargetState == LS_IDLE &&
176 !item->Animation.IsAirborne &&
177 player.Control.HandStatus == HandStatus::Busy)
178 {
179 player.Control.HandStatus = HandStatus::Free;
180 }
181
182 HandlePlayerQuickActions(*item);
183 RumbleLaraHealthCondition(item);
184
185 auto water = GetPlayerWaterData(*item);
186 player.Context.WaterSurfaceDist = -water.HeightFromWater;
187
188 if (player.Context.Vehicle == NO_VALUE)
189 SpawnPlayerWaterSurfaceEffects(*item, water.WaterHeight, water.WaterDepth);
190
191 int headOffset = 0;
192 bool isWaterOnHeadspace = false;
193
194 // TODO: Move unrelated handling elsewhere.
195 // Handle environment state transition.
196 if (player.Context.Vehicle == NO_VALUE && player.ExtraAnim == NO_VALUE)
197 {
198 switch (player.Control.WaterStatus)
199 {

Callers 1

UpdateLaraFunction · 0.85

Calls 15

AlertNearbyGuardsFunction · 0.85
HandlePlayerQuickActionsFunction · 0.85
GetPlayerWaterDataFunction · 0.85
ANGLEFunction · 0.85
UpdateLaraRoomFunction · 0.85
StopSoundEffectFunction · 0.85
SetAnimationFunction · 0.85
ResetPlayerFlexFunction · 0.85
phd_sinFunction · 0.85
TestEnvironmentFunction · 0.85

Tested by

no test coverage detected