2018-08-19 09:46:58 +02:00
|
|
|
#include "lara.h"
|
2018-11-12 20:15:55 +01:00
|
|
|
|
2018-08-19 09:46:58 +02:00
|
|
|
#include "control.h"
|
|
|
|
#include "items.h"
|
2018-09-16 15:05:16 +02:00
|
|
|
#include "collide.h"
|
2018-11-12 20:15:55 +01:00
|
|
|
#include "larafire.h"
|
|
|
|
|
2018-09-16 15:05:16 +02:00
|
|
|
#include "..\Objects\objects.h"
|
2018-11-12 20:15:55 +01:00
|
|
|
#include "..\Global\global.h"
|
2018-08-19 09:46:58 +02:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
LaraExtraInfo g_LaraExtra;
|
|
|
|
|
2018-09-16 15:05:16 +02:00
|
|
|
void __cdecl LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll)
|
|
|
|
{
|
|
|
|
coll->old.x = item->pos.xPos;
|
|
|
|
coll->old.y = item->pos.yPos;
|
|
|
|
coll->old.z = item->pos.zPos;
|
|
|
|
coll->oldAnimState = item->currentAnimState;
|
|
|
|
coll->enableBaddiePush = true;
|
|
|
|
coll->enableSpaz = true;
|
|
|
|
coll->slopesAreWalls = false;
|
|
|
|
coll->slopesArePits = false;
|
|
|
|
coll->lavaIsPit = false;
|
|
|
|
coll->oldAnimNumber = item->animNumber;
|
|
|
|
coll->oldFrameNumber = item->frameNumber;
|
|
|
|
coll->radius = 100;
|
|
|
|
coll->trigger = 0;
|
|
|
|
|
2018-11-12 20:15:55 +01:00
|
|
|
if ((TrInput & IN_LOOK) && !g_LaraExtra.extraAnim && Lara.look)
|
|
|
|
LookLeftRight();
|
2018-09-16 15:05:16 +02:00
|
|
|
else
|
|
|
|
ResetLook();
|
|
|
|
|
|
|
|
Lara.look = true;
|
|
|
|
|
|
|
|
// Process vehicles
|
2018-11-01 09:10:32 +01:00
|
|
|
if (g_LaraExtra.vehicle != NO_ITEM)
|
2018-09-16 15:05:16 +02:00
|
|
|
{
|
2018-11-01 09:10:32 +01:00
|
|
|
if (Items[g_LaraExtra.vehicle].objectNumber == ID_QUAD)
|
2018-09-16 15:05:16 +02:00
|
|
|
{
|
|
|
|
if (QuadBikeControl())
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Handle current Lara status
|
|
|
|
(*LaraControlRoutines[item->currentAnimState])(item, coll);
|
|
|
|
|
|
|
|
if (item->pos.zRot >= -ANGLE(1) && item->pos.zRot <= ANGLE(1))
|
|
|
|
item->pos.zRot = 0;
|
|
|
|
else if (item->pos.zRot < -ANGLE(1))
|
|
|
|
item->pos.zRot += ANGLE(1);
|
|
|
|
else
|
|
|
|
item->pos.zRot -= ANGLE(1);
|
|
|
|
|
|
|
|
if (Lara.turnRate >= -ANGLE(2) && Lara.turnRate <= ANGLE(2))
|
|
|
|
Lara.turnRate = 0;
|
|
|
|
else if (Lara.turnRate < -ANGLE(2))
|
|
|
|
Lara.turnRate += ANGLE(2);
|
|
|
|
else
|
|
|
|
Lara.turnRate -= ANGLE(2);
|
|
|
|
item->pos.yRot += Lara.turnRate;
|
|
|
|
|
|
|
|
// Animate Lara
|
|
|
|
AnimateLara(item);
|
|
|
|
|
|
|
|
// Check for collision with items
|
|
|
|
LaraBaddieCollision(item, coll);
|
|
|
|
|
|
|
|
// Handle Lara collision
|
|
|
|
(*LaraCollisionRoutines[item->currentAnimState])(item, coll);
|
|
|
|
|
|
|
|
UpdateLaraRoom(item, -381);
|
|
|
|
|
2018-11-12 20:15:55 +01:00
|
|
|
if (Lara.gunType == WEAPON_CROSSBOW && !LaserSight)
|
|
|
|
TrInput &= ~IN_ACTION;
|
2018-09-16 15:05:16 +02:00
|
|
|
|
|
|
|
// Handle weapons
|
|
|
|
LaraGun();
|
|
|
|
|
|
|
|
// Test if there's a trigger
|
|
|
|
TestTriggers(coll->trigger, 0, 0);
|
|
|
|
}
|
|
|
|
|
2018-08-19 09:46:58 +02:00
|
|
|
void Inject_Lara()
|
|
|
|
{
|
2018-11-12 20:15:55 +01:00
|
|
|
INJECT(0x00442E70, LaraAboveWater);
|
2018-08-19 09:46:58 +02:00
|
|
|
}
|