<NME> LARAMISC.C
<BEF> #include "LARAMISC.H"

#include "SPECIFIC.H"
#include "LARA.H"
#include "COLLIDE.H"
#if PSX_VERSION || PSXPC_VERSION
#include "CALCLARA.H"
#include "MATHS.H"
#include "FXTRIG.H"
#include "LARASURF.H"
#include "GETSTUFF.H"
#include "3D_GEN.H"
#include "COLLIDE_S.H"
#endif
#include "CONTROL.H"
#include "DRAW.H"
#include "EFFECT2.H"
#include "LARASWIM.H"

#ifdef PC_VERSION
#include "GAME.H"
#else
#include "SETUP.H"
#endif

#include INPUT_H
#include "OBJECTS.H"
#include "GAMEFLOW.H"
#include "HEALTH.H"
#include "NEWINV2.H"
#include "LARAFIRE.H"
#include "SPOTCAM.H"
#if !SAT_VERSION
#include <string.h>
#endif
#include "EFFECTS.H"
#include "SOUND.H"
#if PSXENGINE
#include "SFX.H"
#include "CD.H"
#endif

#if PSX_VERSION && !PSXPC_TEST
#include <STDIO.H>
#endif

#if DEBUG_VERSION
const char* states[131] =
{
	"WALK", "RUN", "STOP", "F JUMP", "POSE", "FASTBACK", "TURN R", "TURN L", "DEATH", 
	"FASTFALL", "HANG", "REACH", "SPLAT", "TREAD", "LAND", "COMPRESS", "BACK", "SWIM", 
	"GLIDE", "NULL", "FAST TURN", "STEP RIGHT", "STEP LEFT", "ROLL2", "SLIDE", "BJUMP", 
	"RJUMP", "LJUMP", "UP JUMP", "FALL BACK", "HANG LEFT", "HANG RIGHT", "SLIDE BACK", 
	"SURF TREAD", "SURF SWIM", "DIVE", "PUSHBLOCK", "PULLBLOCK", "PPREADY", "PICKUP", 
	"SWITCHON", "SWITCHOFF", "USE-KEY", "USE-PUZZLE", "UW_DEATH", "ROLL", "SPECIAL", 
	"SURFBACK", "SURFLEFT", "SURFRIGHT", "USE MIDAS", "DIE MIDAS", "SWANDIVE", "FASTDIVE", 
	"GYMNAST", "WATER OUT", "CLIMB STANCE", "CLIMBING", "CLIMB LEFT", "CLIMB END", 
	"CLIMB RIGHT", "CLIMB DOWN", "LARATEST1", "LARATEST2", "LARATEST3", "WADE", 
	"WATER-ROLL", "PICKUP FLARE", "TWIST", "KICK", "DEATHSLIDE", "DUCK", "DUCKROLL", 
	"DASH", "DASHDIVE", "HANG2", "MONKEYSWING", "MONKEYL", "MONKEYR", "MONKEY180", "ALL4S", 
	"CRAWL", "HANGTURNL", "HANGTURNR", "ALL4TURNL", "ALL4TURNR", "CRAWLBACK", "HANG2DUCK", 
	"CRAWL2HANG", "CONTROLLED", "CROWBAR", "?", "BLOCKSWITCH", "LIFT TRAPDOOR", 
	"PULL TRAPDOOR", "TURN SWITCH", "COG SWITCH", "RAIL SWITCH", "HIDDEN PICKUP", "ON POLE", 
	"POLE UP", "POLE DOWN", "POLE LEFT", "POLE RIGHT", "PULLEY", "DUCKROTL", "DUCKROTR", 
	"CORNEREXTL", "CORNEREXTR", "CORNERINTL", "CORNERINTR", "ON ROPE", "UP ROPE", "DOWN ROPE", 
	"SWING FWD", "SWING BACK", "116", "OPEN DOUBLE DOORS", "SWIMCHEAT", "TROPEPOSE", 
	"TROPETURN", "TROPEWALK", "TROPEFALL_L", "TROPEFALL_R", "TROPEGETON", "TROPEGETOFF", 
	"CROWDOVE", "TROPEUNDOFALL", "PBARS_SPIN", "PBARS_LEAPOFF", "LAST"
};

const char* quadrant_names[4] =
{
	"NORTH", "EAST", "SOUTH", "WEST"
};

const char* gunstates[6] =
{
	"ARMLESS", "HANDSBUSY", "DRAW", "UNDRAW", "READY", "SPECIAL"
};

const char* waterstates[5] =
{
	"ABOVEWATER", "UNDERWATER", "SURFACE", "CHEAT", "WADE"
};

const char* guntypes[9] =
{
	"UNARMED", "PISTOLS", "MAGNUMS", "UZIS", "SHOTGUN", "M16", "ROCKET", "HARPOON", "FLARE"
};

const char* coll_typess[8] =
{
	"NONE", "FRONT", "LEFT", "RIGHT", "TOP", "TOPBOTTOM", "TOPFRONT", "CLAMP"
};

const char* htypes[4] =
{
	"WALL", "SMALL_SLOPE", "BIG_SLOPE", "DIAGONAL"
};
#endif

static struct COLL_INFO *coll = &mycoll; // offset 0xA0B8C
short SubsuitAir = 0; // offset 0xA122E
struct COLL_INFO mycoll;
short cheat_hit_points; // offset 0xA3828

void GetLaraDeadlyBounds()//4B408(<), 4B86C (F)
{
#if PSX_VERSION || PSXPC_VERSION///@TODO PC subs not there yet.
	short* bounds;
	short tbounds[6];

	bounds = GetBoundsAccurate(lara_item);
	mPushUnitMatrix();
	mRotYXZ(lara_item->pos.y_rot, lara_item->pos.x_rot, lara_item->pos.z_rot);
	mSetTrans(0, 0, 0);
	mRotBoundingBoxNoPersp(bounds, &tbounds[0]);
	mPopMatrix();

	DeadlyBounds[0] = lara_item->pos.x_pos + tbounds[0];
	DeadlyBounds[1] = lara_item->pos.x_pos + tbounds[1];
	DeadlyBounds[2] = lara_item->pos.y_pos + tbounds[2];
	DeadlyBounds[3] = lara_item->pos.y_pos + tbounds[3];
	DeadlyBounds[4] = lara_item->pos.z_pos + tbounds[4];
	DeadlyBounds[5] = lara_item->pos.z_pos + tbounds[5];
#else
	UNIMPLEMENTED();
#endif
}

void DelAlignLaraToRope(struct ITEM_INFO* item)//4B3D8, 4B83C
{
	UNIMPLEMENTED();
}

void InitialiseLaraAnims(struct ITEM_INFO* item)//4B340(<), 4B7A4 (F)
{
	if (room[item->room_number].flags & RF_FILL_WATER)
	{
		lara.water_status = LW_UNDERWATER;
		item->goal_anim_state = STATE_LARA_UNDERWATER_STOP;
		item->current_anim_state = STATE_LARA_UNDERWATER_STOP;
		item->fallspeed = 0;
		item->anim_number = ANIMATION_LARA_UNDERWATER_IDLE;
		item->frame_number = anims[ANIMATION_LARA_UNDERWATER_IDLE].frame_base;
	}
	else
	{
		lara.water_status = LW_ABOVE_WATER;
		item->goal_anim_state = STATE_LARA_STOP;
		item->current_anim_state = STATE_LARA_STOP;
		item->anim_number = ANIMATION_LARA_STAY_SOLID;
		item->frame_number = anims[ANIMATION_LARA_STAY_SOLID].frame_base;
	}
}

void InitialiseLaraLoad(short item_num)//4B308, 4B76C (F)
{
	lara.item_number = item_num;
	lara_item = &items[item_num];
}

void LaraControl(short item_number)//4A838, 4AC9C
{
	long oldx; // $s7
	long oldy; // $fp
	long oldz; // stack offset -44
	struct ITEM_INFO* item; // $s0
	int wh; // $s3
	int wd; // $s4
	int hfw; // $s2
	int room_water_state; // $s5
	short room_number; // stack offset -48

	//a1 = &lara
	//a0 = lara.bitfield
	//v1 = lara.IsMoving
	//v0 = lara.MoveCount & 0xFF
	//v1 = lara.MoveCount + 1;

	item = lara_item;

	if (lara.IsMoving)
	{
		if (++lara.MoveCount > 90)
		{
			lara.IsMoving = 0;
			lara.gun_status = 0;
		}//loc_4A8B0
	}//loc_4A8B0

	//a1 = &lara
	if (!bDisableLaraControl)
	{
		//v1 = &lara
		lara.locationPad = -128;
	}//loc_4A8D0

	oldx = lara_item->pos.x_pos;//s7
	oldy = lara_item->pos.y_pos;//fp
	oldz = lara_item->pos.z_pos;//a0

	//a0 = lara_item
	if (lara.gun_status == 1 && lara_item->current_anim_state == 2 &&
		lara_item->goal_anim_state == 2 && lara_item->anim_number == 0x67 &&
		lara_item->gravity_status == 0)
	{
		lara.gun_status = 0;
	}//loc_4A944

	//a0 = &lara
	if (item->current_anim_state != 0x49 && DashTimer < 120)
	{
		DashTimer++;
	}//loc_4A978

	lara.IsDucked = 0;
	//v0 = &room[item->room_number]
	room_water_state = room[item->room_number].flags & RF_FILL_WATER;
	wd = GetWaterDepth(item->pos.x_pos, item->pos.y_pos, item->pos.z_pos, item->room_number);
	wh = GetWaterHeight(item->pos.x_pos, item->pos.y_pos, item->pos.z_pos, item->room_number);

	hfw = BAD_HEIGHT;
	if (wh != BAD_HEIGHT)
	{
		hfw = item->pos.y_pos - wh;
	}//loc_4A9F0
	lara.water_surface_dist = -hfw;
	WadeSplash(item, wh, wd);
	//s1 = &lara
	//a2 = lara.water_status

	switch (lara.water_status)
	{
	case 0:///@DONE
	{
		//loc_4AA4C
		if (hfw < 256)
		{
			//loc_4AF90
			break;
		}

		if (wd >= 475)
		{
			if (hfw >= 257 && room_water_state != 0)
			{
				lara.air = 1800;
				lara.water_status = LW_UNDERWATER;
				item->gravity_status = 0;

				UpdateLaraRoom(lara_item, 0);
				StopSoundEffect(SFX_LARA_FALL);

				if (item->current_anim_state == STATE_LARA_SWANDIVE_BEGIN)
				{
					item->goal_anim_state = STATE_LARA_UNDERWATER_DIVING;
					item->pos.x_rot = -0x1FFE;
					AnimateLara(item);
					item->fallspeed <<= 1;
				}//loc_4AABC
				else if (item->current_anim_state == STATE_LARA_SWANDIVE_END)
				{
					item->goal_anim_state = STATE_LARA_UNDERWATER_DIVING;
					item->pos.x_rot = -0x36CE;
					AnimateLara(item);
					item->fallspeed <<= 1;
				}
				else
				{
					item->pos.x_rot = -0x1FFE;
					item->current_anim_state = STATE_LARA_UNDERWATER_DIVING;
					item->anim_number = ANIMATION_LARA_FREE_FALL_TO_UNDERWATER;
					item->goal_anim_state = STATE_LARA_UNDERWATER_FORWARD;
					item->fallspeed = (((item->fallspeed << 1) + item->fallspeed) + (((item->fallspeed << 1) + item->fallspeed) >> 31)) >> 1;
					item->frame_number = anims[ANIMATION_LARA_FREE_FALL_TO_UNDERWATER].frame_base;
				}
				//loc_4AB38
				//a0 = lara_item
				//v0 = lara
				lara.torso_y_rot = 0;
				lara.torso_x_rot = 0;
				lara.head_y_rot = 0;
				lara.head_x_rot = 0;

				///Splash();
				//v0 = -0xFA4
				//loc_4AB94
				camera.target_elevation = -0xFA4;
				//v0 = lara
				if (hfw < 256)
				{
					lara.water_status = 0;
					//v1 = item->current_anim_state
					if (item->current_anim_state == 0x41)
					{
						item->goal_anim_state = 1;
					}

					//j loc_4AF90
				}//loc_4ABC4
				else if (hfw >= 0x2DB)
				{
					//a0 = lara
					//v1 = 2
					lara.water_status = 2;
					item->pos.y_pos = item->pos.y_pos - (hfw - 1);
					//v1 = 
					//v1 = item->current_anim_state
					if (item->current_anim_state == 0x10)
					{
						item->anim_number = 0x8C;
						item->goal_anim_state = 0x2F;
						item->current_anim_state = 0x2F;
						item->frame_number = anims[0x8C].frame_base;
						item->meshswap_meshbits &= -9;
						item->fallspeed = 0;
						lara.dive_count = 0;
						lara_item->pos.z_rot = 0;
						lara_item->pos.x_rot = 0;
						lara.torso_y_rot = 0;
						lara.torso_x_rot = 0;
						lara.head_y_rot = 0;
						lara.head_x_rot = 0;
						UpdateLaraRoom(item, 0);
					}
					else
					{
						//loc_4AC10
						if (item->current_anim_state == 0x15)
						{
							item->anim_number = 0x90;
							item->goal_anim_state = 0x31;
							item->current_anim_state = 0x31;
							item->frame_number = anims[0x90].frame_base;
							item->meshswap_meshbits &= -9;
							item->fallspeed = 0;
							lara.dive_count = 0;
							lara_item->pos.z_rot = 0;
							lara_item->pos.x_rot = 0;
							lara.torso_y_rot = 0;
							lara.torso_x_rot = 0;
							lara.head_y_rot = 0;
							lara.head_x_rot = 0;
							UpdateLaraRoom(item, 0);
						}
						else
						{
							if (item->current_anim_state == 0x16)
							{
								item->anim_number = 0x8F;
								item->goal_anim_state = 0x30;
								item->current_anim_state = 0x30;
								item->frame_number = anims[0x8F].frame_base;
								item->meshswap_meshbits &= -9;
								item->fallspeed = 0;
								lara.dive_count = 0;
								lara_item->pos.z_rot = 0;
								lara_item->pos.x_rot = 0;
								lara.torso_y_rot = 0;
								lara.torso_x_rot = 0;
								lara.head_y_rot = 0;
								lara.head_x_rot = 0;
								UpdateLaraRoom(item, 0);
							}
							else
							{
								item->anim_number = 0x74;
								item->goal_anim_state = 0x22;
								item->current_anim_state = 0x22;
								item->frame_number = anims[0x74].frame_base;
								item->meshswap_meshbits &= -9;
								item->fallspeed = 0;
								lara.dive_count = 0;
								lara_item->pos.z_rot = 0;
								lara_item->pos.x_rot = 0;
								lara.torso_y_rot = 0;
								lara.torso_x_rot = 0;
								lara.head_y_rot = 0;
								lara.head_x_rot = 0;
								UpdateLaraRoom(item, 0);
								
							}
						}
					}
				}
			}
			else
			{
				//loc_4AB90
				//v0 = -0xFA4
				camera.target_elevation = -0xFA4;
				if (hfw < 256)
				{
					lara.water_status = 0;
					if (item->current_anim_state == 0x41)
					{
						item->goal_anim_state = 1;
					}
				}
			}
		}
		else
		{
			//loc_4AB60
			if (hfw >= 257)
			{
				//v0 = -0xFA4
				//v1 = 4
				lara.water_status = LW_WADE;

				//v0 = -0xFA4
				if (!item->gravity_status)
				{
					item->goal_anim_state = STATE_LARA_STOP;
				}//loc_4AB94
			}//loc_4AB94

			camera.target_elevation = -0xFA4;

			if (hfw < 256)
			{
				//v0 = &lara
				lara.water_status = 0;

				if (lara.climb_status == 0x41)
				{
					item->goal_anim_state = 1;
				}
			}//loc_4ABC4

		}
		break;
	}
	case 1:///@TODO DEBUG TOMORROW FEB 2020
	{
		//loc_4AD88
		room_number = item->room_number;
		GetFloor(item->pos.x_pos, item->pos.y_pos - 256, item->pos.z_pos, &room_number);
		//v1 = room_number
		//a0 = room
		//v1 = room[room_number].flags
		//v0 = BAD_HEIGHT

		//a0 = item
		if (wd != BAD_HEIGHT && ABS(hfw) < 0x100
			&& !(room[room_number].flags & RF_FILL_WATER)
			&& item->anim_number != 0x72
			&& item->anim_number != 0x77)
		{
			lara.water_status = LW_SURFACE;
			//v0 = s3 + 1
			//v1 = anims
			//a1 = 0;
			item->pos.y_pos = wh + 1;
			//a2 = anims[114].frame_base;
			//v1 = lara_item
			item->goal_anim_state = STATE_LARA_ONWATER_STOP;
			item->current_anim_state = STATE_LARA_ONWATER_STOP;
			//v0 = 0xB
			item->anim_number = ANIMATION_LARA_UNDERWATER_TO_ONWATER;
			item->fallspeed = 0;
			item->frame_number = anims[ANIMATION_LARA_UNDERWATER_TO_ONWATER].frame_base;
			lara.dive_count = 0xB;
			lara_item->pos.z_rot = 0;
			item->pos.x_rot = 0;
			lara.torso_y_rot = 0;
			lara.torso_x_rot = 0;
			lara.head_y_rot = 0;
			lara.head_x_rot = 0;
			//j       loc_4AEFC
		}
		else
		{
			//loc_4AE70
			//v0 = BAD_HEIGHT
			if (room_water_state == 0)
			{
				//a2 = &lara
				if (wd != BAD_HEIGHT)
				{
					if (hfw < 0)
					{
						//a0 = item
						if (ABS(hfw) < 256)
						{
							//a1 = -381
							//a2 = &lara
							//v1 = anims
							//v0 = 2
							lara.water_status = LW_SURFACE;
							item->pos.y_pos = wh;
							//a3 = anims[114].frame_base
							//v1 = 0x21
							item->goal_anim_state = STATE_LARA_ONWATER_STOP;
							item->current_anim_state = STATE_LARA_ONWATER_STOP;
							//v1 = lara_item
							//v0 = 0x72
							item->anim_number = ANIMATION_LARA_UNDERWATER_TO_ONWATER;
							//v0 = 0xb
							item->fallspeed = 0;
							item->frame_number = anims[ANIMATION_LARA_UNDERWATER_TO_ONWATER].frame_base;
							lara.dive_count = 0xB;
							lara_item->pos.z_rot = 0;
							item->pos.x_rot = 0;
							lara.torso_y_rot = 0;
							lara.torso_x_rot = 0;
							lara.head_y_rot = 0;
							lara.head_x_rot = 0;
						}//loc_4AF24
					}//loc_4AE8C ***********************************************
				}//loc_4AF24
			}//loc_4AF90
		}
		break;
	}
	case 2:///@TODO
		//loc_4ACCC
		break;
	case 3:///@TODO
		break;
	case 4:///@TODO
		//loc_4AB94
		//v0 = -0xFA4
		camera.target_elevation = -0xFA4;

		//v0 = lara
		if (hfw < 256)
		{
			lara.water_status = 0;
			//v1 = item->current_anim_state
			if (item->current_anim_state == 0x41)
			{
				item->goal_anim_state = 1;
				//j       loc_4AF90
			}
			else
			{
				//loc_4AF90
				//v0 = 1
			}
		}
		else
		{
			//loc_4ABC4
			//a0 = lara
			if (hfw >= 0x2DB)
			{
				lara.water_status = 2;
				//v0 = item->pos.y_pos - (hfw - 1)
				//v1 = item->current_anim_state
				item->pos.y_pos = item->pos.y_pos - (hfw - 1);

				if (item->current_anim_state == 0x10)
				{
					//v0 = anims
					//v1 = 0x8C
					//a0 = anims[0x8C].frame_base
					//v0 = 0x2F
					//j loc_4AC6C
					item->anim_number = 0x8C;
					item->goal_anim_state = 0x2F;
					item->current_anim_state = 0x2F;
					item->frame_number = anims[0x8C].frame_base;
					item->meshswap_meshbits &= -9;
					item->fallspeed = 0;
					lara.dive_count = 0;
					lara_item->pos.z_rot = 0;
					lara_item->pos.x_rot = 0;
					lara.torso_y_rot = 0;
					lara.torso_x_rot = 0;
					lara.head_y_rot = 0;
					lara.head_x_rot = 0;
					UpdateLaraRoom(item, 0);
				}
				else
				{
					//loc_4AC10
					//v0 = 0x15
					if (item->current_anim_state == 0x15)
					{
						//v0 = anims
						//v1 = 0x90
						//a0 = anims[0x90].frame_base
						//v0 = 0x31
						//j       loc_4AC6C
						item->anim_number = 0x90;
						item->goal_anim_state = 0x31;
						item->current_anim_state = 0x31;
						item->frame_number = anims[0x90].frame_base;
						item->meshswap_meshbits &= -9;
						item->fallspeed = 0;
						lara.dive_count = 0;
						lara_item->pos.z_rot = 0;
						lara_item->pos.x_rot = 0;
						lara.torso_y_rot = 0;
						lara.torso_x_rot = 0;
						lara.head_y_rot = 0;
						lara.head_x_rot = 0;
						UpdateLaraRoom(item, 0);
					}
					else
					{
						//loc_4AC34
						//v1 = 0x74
						if (item->current_anim_state == 0x16)
						{
							//v0 = anims
							//v1 = 0x8F
							//a0 = anims[0x8F].frame_base
							//v0 = 0x30
							//j       loc_4AC6C
							item->anim_number = 0x8F;
							item->goal_anim_state = 0x30;
							item->current_anim_state = 0x30;
							item->frame_number = anims[0x8F].frame_base;
							item->meshswap_meshbits &= -9;
							item->fallspeed = 0;
							lara.dive_count = 0;
							lara_item->pos.z_rot = 0;
							lara_item->pos.x_rot = 0;
							lara.torso_y_rot = 0;
							lara.torso_x_rot = 0;
							lara.head_y_rot = 0;
							lara.head_x_rot = 0;
							UpdateLaraRoom(item, 0);
						}
						else
						{
							//loc_4AC58
							//v1 = 0x74
							//a0 = anims[0x74].frame_base
							//v0 = 0x22
							item->anim_number = 0x74;
							item->goal_anim_state = 0x22;
							item->current_anim_state = 0x22;
							item->frame_number = anims[0x74].frame_base;
							//a0 = item->flags
							item->meshswap_meshbits &= -9;
							//v1 = lara_item
							//a1 = 0
							item->fallspeed = 0;
							//v0 = lara
							lara.dive_count = 0;
							lara_item->pos.z_rot = 0;
							lara_item->pos.x_rot = 0;
							lara.torso_y_rot = 0;
							lara.torso_x_rot = 0;
							lara.head_y_rot = 0;
							lara.head_x_rot = 0;
							UpdateLaraRoom(item, 0);
						}
					}
				}
			}//loc_4AF90
		}
		break;
	}

	//loc_4AF90
	S_SetReverbType(room[item->room_number].ReverbType);

	if (item->hit_points <= 0)
	{
		item->hit_points = -1;

		if (lara.death_count == 0)
		{
			S_CDStop();
		}

		lara.death_count++;

		if ((lara_item->flags & 0x100))
		{
			lara.death_count++;
			return;
		}
	}

	//loc_4B020
	switch (lara.water_status)
	{
	case LW_ABOVE_WATER:
		//a0 = lara
		//v0 = lara
		if (lara.Gassed)
		{
			if (item->hit_points >= 0)
			{
				lara.air--;

				if (lara.air < 0)
				{
					lara.air = -1;
					item->hit_points -= 5;
				}
			}
		}
		else
		{
			//loc_4B0B0
			if (lara.air < 1800 && item->hit_points >= 0)
			{
				lara.air += 10;
			}

			if (lara.air > 1800)
			{
				lara.air = 1800;
			}
		}
		//loc_4B0F0
		LaraAboveWater(item, coll);
		break;
	case 1:
		if (item->hit_points >= 0)
		{
			//v1 = LaraDrawType
			//v0 = 5
			//v1 = lara
			if (LaraDrawType == 5)
			{
				//a0 = lara
				if (CheckCutPlayed(0x28))
				{
					//v1 = (lara.Anxiety + 8)
					SubsuitAir += (lara.Anxiety + 8);

					if (SubsuitAir >= 0x51)
					{
						//loc_4B164
						//v1 = lara.air
						//v0 = SubsuitAir
						do
						{
							lara.air--;
							SubsuitAir -= 0x50;
						} while (SubsuitAir >= 0x51);
					}
				}
			}
			else
			{
				//loc_4B198
				lara.air -= 1;
			}

			//loc_4B1A8
			//a0 = lara
			if (lara.air < 0)
			{
				if (LaraDrawType == 5)
				{
					//v1 = lara.Anxiety
					if (lara.Anxiety < 0xFB)
					{
						lara.Anxiety += 4;
					}//loc_4B1E8
				}//loc_4B1E8
				//a0 = lara
				//v1 = -1
				lara.air = -1;
				item->hit_points -= 5;
			}
		}//loc_4B204
		LaraUnderWater(item, coll);
		break;
	case 4:
		if (lara.Busy)
		{
			if (item->hit_points >= 0)
			{
				lara.air--;
				if (lara.air < 0)
				{
					lara.air = -1;
					item->hit_points -= 5;
				}//loc_4B0F0
			}
			//loc_4B0F0
		}
		else
		{
			//loc_4B0B0
			if (lara.air < 0x708)
			{
				if (item->frame_number >= 0)
				{
					lara.air += 10;
					if (lara.air >= 0x709)
					{
						lara.air = 0x708;
					}
				}
				//loc_4B0F0
			}//loc_4B0F0
		}
		LaraAboveWater(item, coll);
		break;
	}
}

void LaraCheat(struct ITEM_INFO* item, struct COLL_INFO* coll)//4A790(<), 4ABF4(<) (F)
{
	lara_item->hit_points = 1000;
	LaraUnderWater(item, coll);
	if (input & IN_WALK)
	{
		if (!(input & IN_LOOK))
		{
			lara.water_status = LW_ABOVE_WATER;
			item->frame_number = anims[ANIMATION_LARA_STAY_SOLID].frame_base;
			item->anim_number = ANIMATION_LARA_STAY_SOLID;
			item->pos.z_rot = 0;
			item->pos.x_rot = 0;
			lara.torso_y_rot = 0;
			lara.torso_x_rot = 0;
			lara.head_y_rot = 0;
			lara.head_x_rot = 0;
			lara.gun_status = LG_NO_ARMS;
			LaraInitialiseMeshes();
			lara.mesh_effects = 0;
			lara_item->hit_points = cheat_hit_points;
		}
	}
}

void LaraInitialiseMeshes()//4A684, 4AAE8 (F)
{
	int i;
	for(i = 0; i < 15; i++)
	{
		lara.mesh_ptrs[i] = meshes[objects[LARA].mesh_index + 2 * i] = meshes[objects[LARA_SKIN].mesh_index + 2 * i];
	}

	if (gfCurrentLevel >= LVL5_GALLOWS_TREE && gfCurrentLevel <= LVL5_OLD_MILL)
	{
		lara.mesh_ptrs[LM_TORSO] = meshes[objects[ANIMATING6_MIP].mesh_index + 2 * LM_TORSO];
	}

	if (lara.gun_type == WEAPON_HK)
	{
		lara.back_gun = WEAPON_HK;
	}
	else if (!lara.shotgun_type_carried)
	{
		if (lara.hk_type_carried)
		{
			lara.back_gun = WEAPON_HK;
		}
	}
	else
	{
		lara.back_gun = WEAPON_UZI;
	}

	lara.gun_status = LG_NO_ARMS;
	lara.left_arm.frame_number = 0;
	lara.right_arm.frame_number = 0;
	lara.target = 0;
	lara.right_arm.lock = 0;
	lara.left_arm.lock = 0;
}

void InitialiseLara(int restore)
{
	int i;
	short item;
	short gun;

	if (lara.item_number == -1)
		return;

	item = lara.item_number;

	lara_item->data = &lara;
	lara_item->collidable = FALSE;

	if (restore)
	{
		struct lara_info backup;
		memcpy(&backup, &lara, sizeof(lara));
		memset(&lara, 0, sizeof(lara));
		memcpy(&lara.pistols_type_carried, &backup.pistols_type_carried, 59);
	}
	else
	{
		memset(&lara, 0, sizeof(lara));
	}

	lara.look = TRUE;
	lara.item_number = item;
	lara.hit_direction = -1;
	lara.air = 1800;
	lara.weapon_item = -1;
	PoisonFlag = 0;
	lara.dpoisoned = 0;
	lara.poisoned = 0;
	lara.water_surface_dist = 100;
	lara.holster = 14;
	lara.location = -1;
	lara.highest_location = -1;
	lara.RopePtr = -1;
	lara_item->hit_points = 1000;

	for(i = 0; i < gfNumPickups; i++)
	{
		DEL_picked_up_object(convert_invobj_to_obj(gfPickups[i]));
	}

	gfNumPickups = 0;

	lara.gun_status = LG_NO_ARMS;

	gun = WEAPON_NONE;

	if (!(gfLevelFlags & GF_LVOP_YOUNG_LARA) && objects[PISTOLS_ITEM].loaded)
		gun = WEAPON_PISTOLS;

	if ((gfLevelFlags & GF_LVOP_TRAIN) && objects[HK_ITEM].loaded && (lara.hk_type_carried & WTYPE_PRESENT))
		gun = WEAPON_HK;

	lara.last_gun_type = lara.gun_type = lara.request_gun_type = gun;

	LaraInitialiseMeshes();

	lara.skelebob = 0;

	if (objects[PISTOLS_ITEM].loaded)
		lara.pistols_type_carried = WTYPE_PRESENT | WTYPE_AMMO_1;

	lara.binoculars = WTYPE_PRESENT;

	if (!restore)
	{
		if (objects[FLARE_INV_ITEM].loaded)
			lara.num_flares = 3;

		lara.num_small_medipack = 3;
		lara.num_large_medipack = 1;
	}

	lara.num_pistols_ammo = -1;

	InitialiseLaraAnims(lara_item);

	DashTimer = 120;

	for (i = 0; i < gfNumTakeaways; i++)
	{
		NailInvItem(convert_invobj_to_obj(gfTakeaways[i]));
	}

	gfNumTakeaways = 0;

	weapons[WEAPON_REVOLVER].damage = gfCurrentLevel >= LVL5_BASE ? 15 : 6;

	switch(gfCurrentLevel)
	{
	case 6u:
		lara.pickupitems &= 0xFFF7u;

		lara.puzzleitems[0] = 10;
		return;
	case 5u:
		lara.pickupitems = 0;
		lara.pickupitemscombo = 0;
		lara.keyitems = 0;
		lara.keyitemscombo = 0;
		lara.puzzleitemscombo = 0;

		memset(lara.puzzleitems, 0, 12);
		return;
	case 7u:	
		lara.pickupitems = 0;

		lara.puzzleitems[0] = 0;
		return;
	case 0xCu:
		lara.pickupitems &= 0xFFFEu;

		lara.puzzleitems[2] = 0;
		lara.puzzleitems[3] = 0;
		break;
	case 0xEu:
		lara.pickupitems &= 0xFFFDu;
		break;
	default:
		if (gfCurrentLevel < LVL5_THIRTEENTH_FLOOR || gfCurrentLevel > LVL5_RED_ALERT)
			lara.pickupitems &= 0xFFF7u;
		return;
	}

	lara.bottle = 0;
	lara.wetcloth = CLOTH_MISSING;
}
<MSG> [Game]: LaraControl Implement switch case 2.

<DFF> @@ -766,6 +766,23 @@ void LaraControl(short item_number)//4A838, 4AC9C
 		}//loc_4B204
 		LaraUnderWater(item, coll);
 		break;
+	case 2:
+		//loc_4B218
+		//v0 = item->hit_points
+		//v1 = lara
+		if (item->hit_points >= 0)
+		{
+			lara.air += 10;
+
+			if(lara.air >= 0x709)
+			{
+				lara.air = 0x708;
+			}
+
+		}
+		//loc_4B250
+		LaraSurface(item, coll);
+		break;
 	case 4:
 		if (lara.Busy)
 		{

{'commit': 'diff --git a/GAME/LARAMISC.C b/GAME/LARAMISC.C\nindex 1ddac396..08480f53 100644\n--- a/GAME/LARAMISC.C\n+++ b/GAME/LARAMISC.C\n@@ -766,6 +766,23 @@ void LaraControl(short item_number)//4A838, 4AC9C\n \t\t}//loc_4B204\n \t\tLaraUnderWater(item, coll);\n \t\tbreak;\n+\tcase 2:\n+\t\t//loc_4B218\n+\t\t//v0 = item->hit_points\n+\t\t//v1 = lara\n+\t\tif (item->hit_points >= 0)\n+\t\t{\n+\t\t\tlara.air += 10;\n+\n+\t\t\tif(lara.air >= 0x709)\n+\t\t\t{\n+\t\t\t\tlara.air = 0x708;\n+\t\t\t}\n+\n+\t\t}\n+\t\t//loc_4B250\n+\t\tLaraSurface(item, coll);\n+\t\tbreak;\n \tcase 4:\n \t\tif (lara.Busy)\n \t\t{\n', 'commit_subject': '[Game]: LaraControl Implement switch case 2.', 'repo_name': 'TOMB5/TOMB5', 'committer': {'name': 'Gh0stBlade', 'email': '19ffcc48b5297ad4998e7ea4f40eaa34eefb03dd@users.noreply.github.com', 'time_sec': '1603133555', 'tz_offset': '60', 'date': {'seconds': '1603133555'}}, 'commit_tree': '8d9229bda14a797d12381c00ad95c9d326a55fbf', 'commit_message': '[Game]: LaraControl Implement switch case 2.\n', 'language_name': 'C++', 'license': 'mit', 'hunks': '@@ -766,6 +766,23 @@ void LaraControl(short item_number)//4A838, 4AC9C\n \t\t}//loc_4B204\n \t\tLaraUnderWater(item, coll);\n \t\tbreak;\n+\tcase 2:\n+\t\t//loc_4B218\n+\t\t//v0 = item->hit_points\n+\t\t//v1 = lara\n+\t\tif (item->hit_points >= 0)\n+\t\t{\n+\t\t\tlara.air += 10;\n+\n+\t\t\tif(lara.air >= 0x709)\n+\t\t\t{\n+\t\t\t\tlara.air = 0x708;\n+\t\t\t}\n+\n+\t\t}\n+\t\t//loc_4B250\n+\t\tLaraSurface(item, coll);\n+\t\tbreak;\n \tcase 4:\n \t\tif (lara.Busy)\n \t\t{\n', 'addition_count': 17, 'deletion_count': 0, 'src_file': 'a/GAME/LARAMISC.C', 'tgt_file': 'b/GAME/LARAMISC.C', 'file_extension': '.C', 'before_file': '#include "LARAMISC.H"\n\n#include "SPECIFIC.H"\n#include "LARA.H"\n#include "COLLIDE.H"\n#if PSX_VERSION || PSXPC_VERSION\n#include "CALCLARA.H"\n#include "MATHS.H"\n#include "FXTRIG.H"\n#include "LARASURF.H"\n#include "GETSTUFF.H"\n#include "3D_GEN.H"\n#include "COLLIDE_S.H"\n#endif\n#include "CONTROL.H"\n#include "DRAW.H"\n#include "EFFECT2.H"\n#include "LARASWIM.H"\n\n#ifdef PC_VERSION\n#include "GAME.H"\n#else\n#include "SETUP.H"\n#endif\n\n#include INPUT_H\n#include "OBJECTS.H"\n#include "GAMEFLOW.H"\n#include "HEALTH.H"\n#include "NEWINV2.H"\n#include "LARAFIRE.H"\n#include "SPOTCAM.H"\n#if !SAT_VERSION\n#include <string.h>\n#endif\n#include "EFFECTS.H"\n#include "SOUND.H"\n#if PSXENGINE\n#include "SFX.H"\n#include "CD.H"\n#endif\n\n#if PSX_VERSION && !PSXPC_TEST\n#include <STDIO.H>\n#endif\n\n#if DEBUG_VERSION\nconst char* states[131] =\n{\n\t"WALK", "RUN", "STOP", "F JUMP", "POSE", "FASTBACK", "TURN R", "TURN L", "DEATH", \n\t"FASTFALL", "HANG", "REACH", "SPLAT", "TREAD", "LAND", "COMPRESS", "BACK", "SWIM", \n\t"GLIDE", "NULL", "FAST TURN", "STEP RIGHT", "STEP LEFT", "ROLL2", "SLIDE", "BJUMP", \n\t"RJUMP", "LJUMP", "UP JUMP", "FALL BACK", "HANG LEFT", "HANG RIGHT", "SLIDE BACK", \n\t"SURF TREAD", "SURF SWIM", "DIVE", "PUSHBLOCK", "PULLBLOCK", "PPREADY", "PICKUP", \n\t"SWITCHON", "SWITCHOFF", "USE-KEY", "USE-PUZZLE", "UW_DEATH", "ROLL", "SPECIAL", \n\t"SURFBACK", "SURFLEFT", "SURFRIGHT", "USE MIDAS", "DIE MIDAS", "SWANDIVE", "FASTDIVE", \n\t"GYMNAST", "WATER OUT", "CLIMB STANCE", "CLIMBING", "CLIMB LEFT", "CLIMB END", \n\t"CLIMB RIGHT", "CLIMB DOWN", "LARATEST1", "LARATEST2", "LARATEST3", "WADE", \n\t"WATER-ROLL", "PICKUP FLARE", "TWIST", "KICK", "DEATHSLIDE", "DUCK", "DUCKROLL", \n\t"DASH", "DASHDIVE", "HANG2", "MONKEYSWING", "MONKEYL", "MONKEYR", "MONKEY180", "ALL4S", \n\t"CRAWL", "HANGTURNL", "HANGTURNR", "ALL4TURNL", "ALL4TURNR", "CRAWLBACK", "HANG2DUCK", \n\t"CRAWL2HANG", "CONTROLLED", "CROWBAR", "?", "BLOCKSWITCH", "LIFT TRAPDOOR", \n\t"PULL TRAPDOOR", "TURN SWITCH", "COG SWITCH", "RAIL SWITCH", "HIDDEN PICKUP", "ON POLE", \n\t"POLE UP", "POLE DOWN", "POLE LEFT", "POLE RIGHT", "PULLEY", "DUCKROTL", "DUCKROTR", \n\t"CORNEREXTL", "CORNEREXTR", "CORNERINTL", "CORNERINTR", "ON ROPE", "UP ROPE", "DOWN ROPE", \n\t"SWING FWD", "SWING BACK", "116", "OPEN DOUBLE DOORS", "SWIMCHEAT", "TROPEPOSE", \n\t"TROPETURN", "TROPEWALK", "TROPEFALL_L", "TROPEFALL_R", "TROPEGETON", "TROPEGETOFF", \n\t"CROWDOVE", "TROPEUNDOFALL", "PBARS_SPIN", "PBARS_LEAPOFF", "LAST"\n};\n\nconst char* quadrant_names[4] =\n{\n\t"NORTH", "EAST", "SOUTH", "WEST"\n};\n\nconst char* gunstates[6] =\n{\n\t"ARMLESS", "HANDSBUSY", "DRAW", "UNDRAW", "READY", "SPECIAL"\n};\n\nconst char* waterstates[5] =\n{\n\t"ABOVEWATER", "UNDERWATER", "SURFACE", "CHEAT", "WADE"\n};\n\nconst char* guntypes[9] =\n{\n\t"UNARMED", "PISTOLS", "MAGNUMS", "UZIS", "SHOTGUN", "M16", "ROCKET", "HARPOON", "FLARE"\n};\n\nconst char* coll_typess[8] =\n{\n\t"NONE", "FRONT", "LEFT", "RIGHT", "TOP", "TOPBOTTOM", "TOPFRONT", "CLAMP"\n};\n\nconst char* htypes[4] =\n{\n\t"WALL", "SMALL_SLOPE", "BIG_SLOPE", "DIAGONAL"\n};\n#endif\n\nstatic struct COLL_INFO *coll = &mycoll; // offset 0xA0B8C\nshort SubsuitAir = 0; // offset 0xA122E\nstruct COLL_INFO mycoll;\nshort cheat_hit_points; // offset 0xA3828\n\nvoid GetLaraDeadlyBounds()//4B408(<), 4B86C (F)\n{\n#if PSX_VERSION || PSXPC_VERSION///@TODO PC subs not there yet.\n\tshort* bounds;\n\tshort tbounds[6];\n\n\tbounds = GetBoundsAccurate(lara_item);\n\tmPushUnitMatrix();\n\tmRotYXZ(lara_item->pos.y_rot, lara_item->pos.x_rot, lara_item->pos.z_rot);\n\tmSetTrans(0, 0, 0);\n\tmRotBoundingBoxNoPersp(bounds, &tbounds[0]);\n\tmPopMatrix();\n\n\tDeadlyBounds[0] = lara_item->pos.x_pos + tbounds[0];\n\tDeadlyBounds[1] = lara_item->pos.x_pos + tbounds[1];\n\tDeadlyBounds[2] = lara_item->pos.y_pos + tbounds[2];\n\tDeadlyBounds[3] = lara_item->pos.y_pos + tbounds[3];\n\tDeadlyBounds[4] = lara_item->pos.z_pos + tbounds[4];\n\tDeadlyBounds[5] = lara_item->pos.z_pos + tbounds[5];\n#else\n\tUNIMPLEMENTED();\n#endif\n}\n\nvoid DelAlignLaraToRope(struct ITEM_INFO* item)//4B3D8, 4B83C\n{\n\tUNIMPLEMENTED();\n}\n\nvoid InitialiseLaraAnims(struct ITEM_INFO* item)//4B340(<), 4B7A4 (F)\n{\n\tif (room[item->room_number].flags & RF_FILL_WATER)\n\t{\n\t\tlara.water_status = LW_UNDERWATER;\n\t\titem->goal_anim_state = STATE_LARA_UNDERWATER_STOP;\n\t\titem->current_anim_state = STATE_LARA_UNDERWATER_STOP;\n\t\titem->fallspeed = 0;\n\t\titem->anim_number = ANIMATION_LARA_UNDERWATER_IDLE;\n\t\titem->frame_number = anims[ANIMATION_LARA_UNDERWATER_IDLE].frame_base;\n\t}\n\telse\n\t{\n\t\tlara.water_status = LW_ABOVE_WATER;\n\t\titem->goal_anim_state = STATE_LARA_STOP;\n\t\titem->current_anim_state = STATE_LARA_STOP;\n\t\titem->anim_number = ANIMATION_LARA_STAY_SOLID;\n\t\titem->frame_number = anims[ANIMATION_LARA_STAY_SOLID].frame_base;\n\t}\n}\n\nvoid InitialiseLaraLoad(short item_num)//4B308, 4B76C (F)\n{\n\tlara.item_number = item_num;\n\tlara_item = &items[item_num];\n}\n\nvoid LaraControl(short item_number)//4A838, 4AC9C\n{\n\tlong oldx; // $s7\n\tlong oldy; // $fp\n\tlong oldz; // stack offset -44\n\tstruct ITEM_INFO* item; // $s0\n\tint wh; // $s3\n\tint wd; // $s4\n\tint hfw; // $s2\n\tint room_water_state; // $s5\n\tshort room_number; // stack offset -48\n\n\t//a1 = &lara\n\t//a0 = lara.bitfield\n\t//v1 = lara.IsMoving\n\t//v0 = lara.MoveCount & 0xFF\n\t//v1 = lara.MoveCount + 1;\n\n\titem = lara_item;\n\n\tif (lara.IsMoving)\n\t{\n\t\tif (++lara.MoveCount > 90)\n\t\t{\n\t\t\tlara.IsMoving = 0;\n\t\t\tlara.gun_status = 0;\n\t\t}//loc_4A8B0\n\t}//loc_4A8B0\n\n\t//a1 = &lara\n\tif (!bDisableLaraControl)\n\t{\n\t\t//v1 = &lara\n\t\tlara.locationPad = -128;\n\t}//loc_4A8D0\n\n\toldx = lara_item->pos.x_pos;//s7\n\toldy = lara_item->pos.y_pos;//fp\n\toldz = lara_item->pos.z_pos;//a0\n\n\t//a0 = lara_item\n\tif (lara.gun_status == 1 && lara_item->current_anim_state == 2 &&\n\t\tlara_item->goal_anim_state == 2 && lara_item->anim_number == 0x67 &&\n\t\tlara_item->gravity_status == 0)\n\t{\n\t\tlara.gun_status = 0;\n\t}//loc_4A944\n\n\t//a0 = &lara\n\tif (item->current_anim_state != 0x49 && DashTimer < 120)\n\t{\n\t\tDashTimer++;\n\t}//loc_4A978\n\n\tlara.IsDucked = 0;\n\t//v0 = &room[item->room_number]\n\troom_water_state = room[item->room_number].flags & RF_FILL_WATER;\n\twd = GetWaterDepth(item->pos.x_pos, item->pos.y_pos, item->pos.z_pos, item->room_number);\n\twh = GetWaterHeight(item->pos.x_pos, item->pos.y_pos, item->pos.z_pos, item->room_number);\n\n\thfw = BAD_HEIGHT;\n\tif (wh != BAD_HEIGHT)\n\t{\n\t\thfw = item->pos.y_pos - wh;\n\t}//loc_4A9F0\n\tlara.water_surface_dist = -hfw;\n\tWadeSplash(item, wh, wd);\n\t//s1 = &lara\n\t//a2 = lara.water_status\n\n\tswitch (lara.water_status)\n\t{\n\tcase 0:///@DONE\n\t{\n\t\t//loc_4AA4C\n\t\tif (hfw < 256)\n\t\t{\n\t\t\t//loc_4AF90\n\t\t\tbreak;\n\t\t}\n\n\t\tif (wd >= 475)\n\t\t{\n\t\t\tif (hfw >= 257 && room_water_state != 0)\n\t\t\t{\n\t\t\t\tlara.air = 1800;\n\t\t\t\tlara.water_status = LW_UNDERWATER;\n\t\t\t\titem->gravity_status = 0;\n\n\t\t\t\tUpdateLaraRoom(lara_item, 0);\n\t\t\t\tStopSoundEffect(SFX_LARA_FALL);\n\n\t\t\t\tif (item->current_anim_state == STATE_LARA_SWANDIVE_BEGIN)\n\t\t\t\t{\n\t\t\t\t\titem->goal_anim_state = STATE_LARA_UNDERWATER_DIVING;\n\t\t\t\t\titem->pos.x_rot = -0x1FFE;\n\t\t\t\t\tAnimateLara(item);\n\t\t\t\t\titem->fallspeed <<= 1;\n\t\t\t\t}//loc_4AABC\n\t\t\t\telse if (item->current_anim_state == STATE_LARA_SWANDIVE_END)\n\t\t\t\t{\n\t\t\t\t\titem->goal_anim_state = STATE_LARA_UNDERWATER_DIVING;\n\t\t\t\t\titem->pos.x_rot = -0x36CE;\n\t\t\t\t\tAnimateLara(item);\n\t\t\t\t\titem->fallspeed <<= 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titem->pos.x_rot = -0x1FFE;\n\t\t\t\t\titem->current_anim_state = STATE_LARA_UNDERWATER_DIVING;\n\t\t\t\t\titem->anim_number = ANIMATION_LARA_FREE_FALL_TO_UNDERWATER;\n\t\t\t\t\titem->goal_anim_state = STATE_LARA_UNDERWATER_FORWARD;\n\t\t\t\t\titem->fallspeed = (((item->fallspeed << 1) + item->fallspeed) + (((item->fallspeed << 1) + item->fallspeed) >> 31)) >> 1;\n\t\t\t\t\titem->frame_number = anims[ANIMATION_LARA_FREE_FALL_TO_UNDERWATER].frame_base;\n\t\t\t\t}\n\t\t\t\t//loc_4AB38\n\t\t\t\t//a0 = lara_item\n\t\t\t\t//v0 = lara\n\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\tlara.head_x_rot = 0;\n\n\t\t\t\t///Splash();\n\t\t\t\t//v0 = -0xFA4\n\t\t\t\t//loc_4AB94\n\t\t\t\tcamera.target_elevation = -0xFA4;\n\t\t\t\t//v0 = lara\n\t\t\t\tif (hfw < 256)\n\t\t\t\t{\n\t\t\t\t\tlara.water_status = 0;\n\t\t\t\t\t//v1 = item->current_anim_state\n\t\t\t\t\tif (item->current_anim_state == 0x41)\n\t\t\t\t\t{\n\t\t\t\t\t\titem->goal_anim_state = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t//j loc_4AF90\n\t\t\t\t}//loc_4ABC4\n\t\t\t\telse if (hfw >= 0x2DB)\n\t\t\t\t{\n\t\t\t\t\t//a0 = lara\n\t\t\t\t\t//v1 = 2\n\t\t\t\t\tlara.water_status = 2;\n\t\t\t\t\titem->pos.y_pos = item->pos.y_pos - (hfw - 1);\n\t\t\t\t\t//v1 = \n\t\t\t\t\t//v1 = item->current_anim_state\n\t\t\t\t\tif (item->current_anim_state == 0x10)\n\t\t\t\t\t{\n\t\t\t\t\t\titem->anim_number = 0x8C;\n\t\t\t\t\t\titem->goal_anim_state = 0x2F;\n\t\t\t\t\t\titem->current_anim_state = 0x2F;\n\t\t\t\t\t\titem->frame_number = anims[0x8C].frame_base;\n\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//loc_4AC10\n\t\t\t\t\t\tif (item->current_anim_state == 0x15)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem->anim_number = 0x90;\n\t\t\t\t\t\t\titem->goal_anim_state = 0x31;\n\t\t\t\t\t\t\titem->current_anim_state = 0x31;\n\t\t\t\t\t\t\titem->frame_number = anims[0x90].frame_base;\n\t\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (item->current_anim_state == 0x16)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titem->anim_number = 0x8F;\n\t\t\t\t\t\t\t\titem->goal_anim_state = 0x30;\n\t\t\t\t\t\t\t\titem->current_anim_state = 0x30;\n\t\t\t\t\t\t\t\titem->frame_number = anims[0x8F].frame_base;\n\t\t\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titem->anim_number = 0x74;\n\t\t\t\t\t\t\t\titem->goal_anim_state = 0x22;\n\t\t\t\t\t\t\t\titem->current_anim_state = 0x22;\n\t\t\t\t\t\t\t\titem->frame_number = anims[0x74].frame_base;\n\t\t\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//loc_4AB90\n\t\t\t\t//v0 = -0xFA4\n\t\t\t\tcamera.target_elevation = -0xFA4;\n\t\t\t\tif (hfw < 256)\n\t\t\t\t{\n\t\t\t\t\tlara.water_status = 0;\n\t\t\t\t\tif (item->current_anim_state == 0x41)\n\t\t\t\t\t{\n\t\t\t\t\t\titem->goal_anim_state = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//loc_4AB60\n\t\t\tif (hfw >= 257)\n\t\t\t{\n\t\t\t\t//v0 = -0xFA4\n\t\t\t\t//v1 = 4\n\t\t\t\tlara.water_status = LW_WADE;\n\n\t\t\t\t//v0 = -0xFA4\n\t\t\t\tif (!item->gravity_status)\n\t\t\t\t{\n\t\t\t\t\titem->goal_anim_state = STATE_LARA_STOP;\n\t\t\t\t}//loc_4AB94\n\t\t\t}//loc_4AB94\n\n\t\t\tcamera.target_elevation = -0xFA4;\n\n\t\t\tif (hfw < 256)\n\t\t\t{\n\t\t\t\t//v0 = &lara\n\t\t\t\tlara.water_status = 0;\n\n\t\t\t\tif (lara.climb_status == 0x41)\n\t\t\t\t{\n\t\t\t\t\titem->goal_anim_state = 1;\n\t\t\t\t}\n\t\t\t}//loc_4ABC4\n\n\t\t}\n\t\tbreak;\n\t}\n\tcase 1:///@TODO DEBUG TOMORROW FEB 2020\n\t{\n\t\t//loc_4AD88\n\t\troom_number = item->room_number;\n\t\tGetFloor(item->pos.x_pos, item->pos.y_pos - 256, item->pos.z_pos, &room_number);\n\t\t//v1 = room_number\n\t\t//a0 = room\n\t\t//v1 = room[room_number].flags\n\t\t//v0 = BAD_HEIGHT\n\n\t\t//a0 = item\n\t\tif (wd != BAD_HEIGHT && ABS(hfw) < 0x100\n\t\t\t&& !(room[room_number].flags & RF_FILL_WATER)\n\t\t\t&& item->anim_number != 0x72\n\t\t\t&& item->anim_number != 0x77)\n\t\t{\n\t\t\tlara.water_status = LW_SURFACE;\n\t\t\t//v0 = s3 + 1\n\t\t\t//v1 = anims\n\t\t\t//a1 = 0;\n\t\t\titem->pos.y_pos = wh + 1;\n\t\t\t//a2 = anims[114].frame_base;\n\t\t\t//v1 = lara_item\n\t\t\titem->goal_anim_state = STATE_LARA_ONWATER_STOP;\n\t\t\titem->current_anim_state = STATE_LARA_ONWATER_STOP;\n\t\t\t//v0 = 0xB\n\t\t\titem->anim_number = ANIMATION_LARA_UNDERWATER_TO_ONWATER;\n\t\t\titem->fallspeed = 0;\n\t\t\titem->frame_number = anims[ANIMATION_LARA_UNDERWATER_TO_ONWATER].frame_base;\n\t\t\tlara.dive_count = 0xB;\n\t\t\tlara_item->pos.z_rot = 0;\n\t\t\titem->pos.x_rot = 0;\n\t\t\tlara.torso_y_rot = 0;\n\t\t\tlara.torso_x_rot = 0;\n\t\t\tlara.head_y_rot = 0;\n\t\t\tlara.head_x_rot = 0;\n\t\t\t//j       loc_4AEFC\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//loc_4AE70\n\t\t\t//v0 = BAD_HEIGHT\n\t\t\tif (room_water_state == 0)\n\t\t\t{\n\t\t\t\t//a2 = &lara\n\t\t\t\tif (wd != BAD_HEIGHT)\n\t\t\t\t{\n\t\t\t\t\tif (hfw < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//a0 = item\n\t\t\t\t\t\tif (ABS(hfw) < 256)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//a1 = -381\n\t\t\t\t\t\t\t//a2 = &lara\n\t\t\t\t\t\t\t//v1 = anims\n\t\t\t\t\t\t\t//v0 = 2\n\t\t\t\t\t\t\tlara.water_status = LW_SURFACE;\n\t\t\t\t\t\t\titem->pos.y_pos = wh;\n\t\t\t\t\t\t\t//a3 = anims[114].frame_base\n\t\t\t\t\t\t\t//v1 = 0x21\n\t\t\t\t\t\t\titem->goal_anim_state = STATE_LARA_ONWATER_STOP;\n\t\t\t\t\t\t\titem->current_anim_state = STATE_LARA_ONWATER_STOP;\n\t\t\t\t\t\t\t//v1 = lara_item\n\t\t\t\t\t\t\t//v0 = 0x72\n\t\t\t\t\t\t\titem->anim_number = ANIMATION_LARA_UNDERWATER_TO_ONWATER;\n\t\t\t\t\t\t\t//v0 = 0xb\n\t\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\t\titem->frame_number = anims[ANIMATION_LARA_UNDERWATER_TO_ONWATER].frame_base;\n\t\t\t\t\t\t\tlara.dive_count = 0xB;\n\t\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\t\titem->pos.x_rot = 0;\n\t\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\t}//loc_4AF24\n\t\t\t\t\t}//loc_4AE8C ***********************************************\n\t\t\t\t}//loc_4AF24\n\t\t\t}//loc_4AF90\n\t\t}\n\t\tbreak;\n\t}\n\tcase 2:///@TODO\n\t\t//loc_4ACCC\n\t\tbreak;\n\tcase 3:///@TODO\n\t\tbreak;\n\tcase 4:///@TODO\n\t\t//loc_4AB94\n\t\t//v0 = -0xFA4\n\t\tcamera.target_elevation = -0xFA4;\n\n\t\t//v0 = lara\n\t\tif (hfw < 256)\n\t\t{\n\t\t\tlara.water_status = 0;\n\t\t\t//v1 = item->current_anim_state\n\t\t\tif (item->current_anim_state == 0x41)\n\t\t\t{\n\t\t\t\titem->goal_anim_state = 1;\n\t\t\t\t//j       loc_4AF90\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//loc_4AF90\n\t\t\t\t//v0 = 1\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//loc_4ABC4\n\t\t\t//a0 = lara\n\t\t\tif (hfw >= 0x2DB)\n\t\t\t{\n\t\t\t\tlara.water_status = 2;\n\t\t\t\t//v0 = item->pos.y_pos - (hfw - 1)\n\t\t\t\t//v1 = item->current_anim_state\n\t\t\t\titem->pos.y_pos = item->pos.y_pos - (hfw - 1);\n\n\t\t\t\tif (item->current_anim_state == 0x10)\n\t\t\t\t{\n\t\t\t\t\t//v0 = anims\n\t\t\t\t\t//v1 = 0x8C\n\t\t\t\t\t//a0 = anims[0x8C].frame_base\n\t\t\t\t\t//v0 = 0x2F\n\t\t\t\t\t//j loc_4AC6C\n\t\t\t\t\titem->anim_number = 0x8C;\n\t\t\t\t\titem->goal_anim_state = 0x2F;\n\t\t\t\t\titem->current_anim_state = 0x2F;\n\t\t\t\t\titem->frame_number = anims[0x8C].frame_base;\n\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//loc_4AC10\n\t\t\t\t\t//v0 = 0x15\n\t\t\t\t\tif (item->current_anim_state == 0x15)\n\t\t\t\t\t{\n\t\t\t\t\t\t//v0 = anims\n\t\t\t\t\t\t//v1 = 0x90\n\t\t\t\t\t\t//a0 = anims[0x90].frame_base\n\t\t\t\t\t\t//v0 = 0x31\n\t\t\t\t\t\t//j       loc_4AC6C\n\t\t\t\t\t\titem->anim_number = 0x90;\n\t\t\t\t\t\titem->goal_anim_state = 0x31;\n\t\t\t\t\t\titem->current_anim_state = 0x31;\n\t\t\t\t\t\titem->frame_number = anims[0x90].frame_base;\n\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//loc_4AC34\n\t\t\t\t\t\t//v1 = 0x74\n\t\t\t\t\t\tif (item->current_anim_state == 0x16)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//v0 = anims\n\t\t\t\t\t\t\t//v1 = 0x8F\n\t\t\t\t\t\t\t//a0 = anims[0x8F].frame_base\n\t\t\t\t\t\t\t//v0 = 0x30\n\t\t\t\t\t\t\t//j       loc_4AC6C\n\t\t\t\t\t\t\titem->anim_number = 0x8F;\n\t\t\t\t\t\t\titem->goal_anim_state = 0x30;\n\t\t\t\t\t\t\titem->current_anim_state = 0x30;\n\t\t\t\t\t\t\titem->frame_number = anims[0x8F].frame_base;\n\t\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//loc_4AC58\n\t\t\t\t\t\t\t//v1 = 0x74\n\t\t\t\t\t\t\t//a0 = anims[0x74].frame_base\n\t\t\t\t\t\t\t//v0 = 0x22\n\t\t\t\t\t\t\titem->anim_number = 0x74;\n\t\t\t\t\t\t\titem->goal_anim_state = 0x22;\n\t\t\t\t\t\t\titem->current_anim_state = 0x22;\n\t\t\t\t\t\t\titem->frame_number = anims[0x74].frame_base;\n\t\t\t\t\t\t\t//a0 = item->flags\n\t\t\t\t\t\t\titem->meshswap_meshbits &= -9;\n\t\t\t\t\t\t\t//v1 = lara_item\n\t\t\t\t\t\t\t//a1 = 0\n\t\t\t\t\t\t\titem->fallspeed = 0;\n\t\t\t\t\t\t\t//v0 = lara\n\t\t\t\t\t\t\tlara.dive_count = 0;\n\t\t\t\t\t\t\tlara_item->pos.z_rot = 0;\n\t\t\t\t\t\t\tlara_item->pos.x_rot = 0;\n\t\t\t\t\t\t\tlara.torso_y_rot = 0;\n\t\t\t\t\t\t\tlara.torso_x_rot = 0;\n\t\t\t\t\t\t\tlara.head_y_rot = 0;\n\t\t\t\t\t\t\tlara.head_x_rot = 0;\n\t\t\t\t\t\t\tUpdateLaraRoom(item, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//loc_4AF90\n\t\t}\n\t\tbreak;\n\t}\n\n\t//loc_4AF90\n\tS_SetReverbType(room[item->room_number].ReverbType);\n\n\tif (item->hit_points <= 0)\n\t{\n\t\titem->hit_points = -1;\n\n\t\tif (lara.death_count == 0)\n\t\t{\n\t\t\tS_CDStop();\n\t\t}\n\n\t\tlara.death_count++;\n\n\t\tif ((lara_item->flags & 0x100))\n\t\t{\n\t\t\tlara.death_count++;\n\t\t\treturn;\n\t\t}\n\t}\n\n\t//loc_4B020\n\tswitch (lara.water_status)\n\t{\n\tcase LW_ABOVE_WATER:\n\t\t//a0 = lara\n\t\t//v0 = lara\n\t\tif (lara.Gassed)\n\t\t{\n\t\t\tif (item->hit_points >= 0)\n\t\t\t{\n\t\t\t\tlara.air--;\n\n\t\t\t\tif (lara.air < 0)\n\t\t\t\t{\n\t\t\t\t\tlara.air = -1;\n\t\t\t\t\titem->hit_points -= 5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//loc_4B0B0\n\t\t\tif (lara.air < 1800 && item->hit_points >= 0)\n\t\t\t{\n\t\t\t\tlara.air += 10;\n\t\t\t}\n\n\t\t\tif (lara.air > 1800)\n\t\t\t{\n\t\t\t\tlara.air = 1800;\n\t\t\t}\n\t\t}\n\t\t//loc_4B0F0\n\t\tLaraAboveWater(item, coll);\n\t\tbreak;\n\tcase 1:\n\t\tif (item->hit_points >= 0)\n\t\t{\n\t\t\t//v1 = LaraDrawType\n\t\t\t//v0 = 5\n\t\t\t//v1 = lara\n\t\t\tif (LaraDrawType == 5)\n\t\t\t{\n\t\t\t\t//a0 = lara\n\t\t\t\tif (CheckCutPlayed(0x28))\n\t\t\t\t{\n\t\t\t\t\t//v1 = (lara.Anxiety + 8)\n\t\t\t\t\tSubsuitAir += (lara.Anxiety + 8);\n\n\t\t\t\t\tif (SubsuitAir >= 0x51)\n\t\t\t\t\t{\n\t\t\t\t\t\t//loc_4B164\n\t\t\t\t\t\t//v1 = lara.air\n\t\t\t\t\t\t//v0 = SubsuitAir\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlara.air--;\n\t\t\t\t\t\t\tSubsuitAir -= 0x50;\n\t\t\t\t\t\t} while (SubsuitAir >= 0x51);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//loc_4B198\n\t\t\t\tlara.air -= 1;\n\t\t\t}\n\n\t\t\t//loc_4B1A8\n\t\t\t//a0 = lara\n\t\t\tif (lara.air < 0)\n\t\t\t{\n\t\t\t\tif (LaraDrawType == 5)\n\t\t\t\t{\n\t\t\t\t\t//v1 = lara.Anxiety\n\t\t\t\t\tif (lara.Anxiety < 0xFB)\n\t\t\t\t\t{\n\t\t\t\t\t\tlara.Anxiety += 4;\n\t\t\t\t\t}//loc_4B1E8\n\t\t\t\t}//loc_4B1E8\n\t\t\t\t//a0 = lara\n\t\t\t\t//v1 = -1\n\t\t\t\tlara.air = -1;\n\t\t\t\titem->hit_points -= 5;\n\t\t\t}\n\t\t}//loc_4B204\n\t\tLaraUnderWater(item, coll);\n\t\tbreak;\n\tcase 4:\n\t\tif (lara.Busy)\n\t\t{\n\t\t\tif (item->hit_points >= 0)\n\t\t\t{\n\t\t\t\tlara.air--;\n\t\t\t\tif (lara.air < 0)\n\t\t\t\t{\n\t\t\t\t\tlara.air = -1;\n\t\t\t\t\titem->hit_points -= 5;\n\t\t\t\t}//loc_4B0F0\n\t\t\t}\n\t\t\t//loc_4B0F0\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//loc_4B0B0\n\t\t\tif (lara.air < 0x708)\n\t\t\t{\n\t\t\t\tif (item->frame_number >= 0)\n\t\t\t\t{\n\t\t\t\t\tlara.air += 10;\n\t\t\t\t\tif (lara.air >= 0x709)\n\t\t\t\t\t{\n\t\t\t\t\t\tlara.air = 0x708;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//loc_4B0F0\n\t\t\t}//loc_4B0F0\n\t\t}\n\t\tLaraAboveWater(item, coll);\n\t\tbreak;\n\t}\n}\n\nvoid LaraCheat(struct ITEM_INFO* item, struct COLL_INFO* coll)//4A790(<), 4ABF4(<) (F)\n{\n\tlara_item->hit_points = 1000;\n\tLaraUnderWater(item, coll);\n\tif (input & IN_WALK)\n\t{\n\t\tif (!(input & IN_LOOK))\n\t\t{\n\t\t\tlara.water_status = LW_ABOVE_WATER;\n\t\t\titem->frame_number = anims[ANIMATION_LARA_STAY_SOLID].frame_base;\n\t\t\titem->anim_number = ANIMATION_LARA_STAY_SOLID;\n\t\t\titem->pos.z_rot = 0;\n\t\t\titem->pos.x_rot = 0;\n\t\t\tlara.torso_y_rot = 0;\n\t\t\tlara.torso_x_rot = 0;\n\t\t\tlara.head_y_rot = 0;\n\t\t\tlara.head_x_rot = 0;\n\t\t\tlara.gun_status = LG_NO_ARMS;\n\t\t\tLaraInitialiseMeshes();\n\t\t\tlara.mesh_effects = 0;\n\t\t\tlara_item->hit_points = cheat_hit_points;\n\t\t}\n\t}\n}\n\nvoid LaraInitialiseMeshes()//4A684, 4AAE8 (F)\n{\n\tint i;\n\tfor(i = 0; i < 15; i++)\n\t{\n\t\tlara.mesh_ptrs[i] = meshes[objects[LARA].mesh_index + 2 * i] = meshes[objects[LARA_SKIN].mesh_index + 2 * i];\n\t}\n\n\tif (gfCurrentLevel >= LVL5_GALLOWS_TREE && gfCurrentLevel <= LVL5_OLD_MILL)\n\t{\n\t\tlara.mesh_ptrs[LM_TORSO] = meshes[objects[ANIMATING6_MIP].mesh_index + 2 * LM_TORSO];\n\t}\n\n\tif (lara.gun_type == WEAPON_HK)\n\t{\n\t\tlara.back_gun = WEAPON_HK;\n\t}\n\telse if (!lara.shotgun_type_carried)\n\t{\n\t\tif (lara.hk_type_carried)\n\t\t{\n\t\t\tlara.back_gun = WEAPON_HK;\n\t\t}\n\t}\n\telse\n\t{\n\t\tlara.back_gun = WEAPON_UZI;\n\t}\n\n\tlara.gun_status = LG_NO_ARMS;\n\tlara.left_arm.frame_number = 0;\n\tlara.right_arm.frame_number = 0;\n\tlara.target = 0;\n\tlara.right_arm.lock = 0;\n\tlara.left_arm.lock = 0;\n}\n\nvoid InitialiseLara(int restore)\n{\n\tint i;\n\tshort item;\n\tshort gun;\n\n\tif (lara.item_number == -1)\n\t\treturn;\n\n\titem = lara.item_number;\n\n\tlara_item->data = &lara;\n\tlara_item->collidable = FALSE;\n\n\tif (restore)\n\t{\n\t\tstruct lara_info backup;\n\t\tmemcpy(&backup, &lara, sizeof(lara));\n\t\tmemset(&lara, 0, sizeof(lara));\n\t\tmemcpy(&lara.pistols_type_carried, &backup.pistols_type_carried, 59);\n\t}\n\telse\n\t{\n\t\tmemset(&lara, 0, sizeof(lara));\n\t}\n\n\tlara.look = TRUE;\n\tlara.item_number = item;\n\tlara.hit_direction = -1;\n\tlara.air = 1800;\n\tlara.weapon_item = -1;\n\tPoisonFlag = 0;\n\tlara.dpoisoned = 0;\n\tlara.poisoned = 0;\n\tlara.water_surface_dist = 100;\n\tlara.holster = 14;\n\tlara.location = -1;\n\tlara.highest_location = -1;\n\tlara.RopePtr = -1;\n\tlara_item->hit_points = 1000;\n\n\tfor(i = 0; i < gfNumPickups; i++)\n\t{\n\t\tDEL_picked_up_object(convert_invobj_to_obj(gfPickups[i]));\n\t}\n\n\tgfNumPickups = 0;\n\n\tlara.gun_status = LG_NO_ARMS;\n\n\tgun = WEAPON_NONE;\n\n\tif (!(gfLevelFlags & GF_LVOP_YOUNG_LARA) && objects[PISTOLS_ITEM].loaded)\n\t\tgun = WEAPON_PISTOLS;\n\n\tif ((gfLevelFlags & GF_LVOP_TRAIN) && objects[HK_ITEM].loaded && (lara.hk_type_carried & WTYPE_PRESENT))\n\t\tgun = WEAPON_HK;\n\n\tlara.last_gun_type = lara.gun_type = lara.request_gun_type = gun;\n\n\tLaraInitialiseMeshes();\n\n\tlara.skelebob = 0;\n\n\tif (objects[PISTOLS_ITEM].loaded)\n\t\tlara.pistols_type_carried = WTYPE_PRESENT | WTYPE_AMMO_1;\n\n\tlara.binoculars = WTYPE_PRESENT;\n\n\tif (!restore)\n\t{\n\t\tif (objects[FLARE_INV_ITEM].loaded)\n\t\t\tlara.num_flares = 3;\n\n\t\tlara.num_small_medipack = 3;\n\t\tlara.num_large_medipack = 1;\n\t}\n\n\tlara.num_pistols_ammo = -1;\n\n\tInitialiseLaraAnims(lara_item);\n\n\tDashTimer = 120;\n\n\tfor (i = 0; i < gfNumTakeaways; i++)\n\t{\n\t\tNailInvItem(convert_invobj_to_obj(gfTakeaways[i]));\n\t}\n\n\tgfNumTakeaways = 0;\n\n\tweapons[WEAPON_REVOLVER].damage = gfCurrentLevel >= LVL5_BASE ? 15 : 6;\n\n\tswitch(gfCurrentLevel)\n\t{\n\tcase 6u:\n\t\tlara.pickupitems &= 0xFFF7u;\n\n\t\tlara.puzzleitems[0] = 10;\n\t\treturn;\n\tcase 5u:\n\t\tlara.pickupitems = 0;\n\t\tlara.pickupitemscombo = 0;\n\t\tlara.keyitems = 0;\n\t\tlara.keyitemscombo = 0;\n\t\tlara.puzzleitemscombo = 0;\n\n\t\tmemset(lara.puzzleitems, 0, 12);\n\t\treturn;\n\tcase 7u:\t\n\t\tlara.pickupitems = 0;\n\n\t\tlara.puzzleitems[0] = 0;\n\t\treturn;\n\tcase 0xCu:\n\t\tlara.pickupitems &= 0xFFFEu;\n\n\t\tlara.puzzleitems[2] = 0;\n\t\tlara.puzzleitems[3] = 0;\n\t\tbreak;\n\tcase 0xEu:\n\t\tlara.pickupitems &= 0xFFFDu;\n\t\tbreak;\n\tdefault:\n\t\tif (gfCurrentLevel < LVL5_THIRTEENTH_FLOOR || gfCurrentLevel > LVL5_RED_ALERT)\n\t\t\tlara.pickupitems &= 0xFFF7u;\n\t\treturn;\n\t}\n\n\tlara.bottle = 0;\n\tlara.wetcloth = CLOTH_MISSING;\n}', 'message': '[Game]: LaraControl Implement switch case 2.\n', 'author_name': 'Gh0stBlade', 'lang': 'C'}