mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 09:47:58 +03:00
Refactor poison effect on Lara; LaraInfo cleanup; general cleanup; update savegame schema
This commit is contained in:
parent
165dccb2d4
commit
6978cb94f0
83 changed files with 1303 additions and 1147 deletions
|
@ -402,19 +402,19 @@ void LaraControl(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (lara->Control.WeaponControl.HasFired)
|
||||
if (lara->Control.Weapon.HasFired)
|
||||
{
|
||||
AlertNearbyGuards(item);
|
||||
lara->Control.WeaponControl.HasFired = false;
|
||||
lara->Control.Weapon.HasFired = false;
|
||||
}
|
||||
|
||||
if (lara->Poisoned)
|
||||
if (lara->PoisonPotency)
|
||||
{
|
||||
if (lara->Poisoned > 4096)
|
||||
lara->Poisoned = 4096;
|
||||
if (lara->PoisonPotency > LARA_POISON_POTENCY_MAX)
|
||||
lara->PoisonPotency = LARA_POISON_POTENCY_MAX;
|
||||
|
||||
if (lara->Poisoned >= 256 && !(Wibble & 0xFF))
|
||||
item->HitPoints -= lara->Poisoned >> 8;
|
||||
if (!(Wibble & 0xFF))
|
||||
item->HitPoints -= lara->PoisonPotency;
|
||||
}
|
||||
|
||||
if (lara->Control.IsMoving)
|
||||
|
@ -429,7 +429,7 @@ void LaraControl(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (!lara->Control.Locked)
|
||||
lara->locationPad = 128;
|
||||
lara->LocationPad = 128;
|
||||
|
||||
int oldX = item->Position.xPos;
|
||||
int oldY = item->Position.yPos;
|
||||
|
@ -954,7 +954,7 @@ void LaraUnderWater(ITEM_INFO* item, COLL_INFO* coll)
|
|||
item->Position.zRot = -ANGLE(22.0f);
|
||||
}
|
||||
|
||||
if (lara->Control.WaterCurrentActive && lara->Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
if (lara->WaterCurrentActive && lara->Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
LaraWaterCurrent(item, coll);
|
||||
|
||||
AnimateLara(item);
|
||||
|
@ -1020,7 +1020,7 @@ void LaraSurface(ITEM_INFO* item, COLL_INFO* coll)
|
|||
item->Position.zRot += item->Position.zRot / -8;
|
||||
}
|
||||
|
||||
if (lara->Control.WaterCurrentActive && lara->Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
if (lara->WaterCurrentActive && lara->Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
LaraWaterCurrent(item, coll);
|
||||
|
||||
AnimateLara(item);
|
||||
|
|
|
@ -55,6 +55,7 @@ constexpr auto LARA_FREEFALL_VELOCITY = 131;
|
|||
constexpr auto LARA_DAMAGE_VELOCITY = 141;
|
||||
constexpr auto LARA_DEATH_VELOCITY = 155;
|
||||
constexpr auto LARA_DIVE_DEATH_VELOCITY = 134;
|
||||
constexpr auto LARA_TERMINAL_VELOCITY = CLICK(10);
|
||||
|
||||
constexpr auto LARA_RUN_JUMP_TIME = 22; // Frames to count before a running jump is possible.
|
||||
constexpr auto LARA_POSE_TIME = 30 * 30; // 30 frames * 30 = 30 seconds to AFK pose.
|
||||
|
@ -62,6 +63,7 @@ constexpr auto LARA_POSE_TIME = 30 * 30; // 30 frames * 30 = 30 seconds to AFK p
|
|||
constexpr auto LARA_HEALTH_MAX = 1000.0f;
|
||||
constexpr auto LARA_AIR_MAX = 1800.0f;
|
||||
constexpr auto LARA_SPRINT_MAX = 120.0f;
|
||||
constexpr auto LARA_POISON_POTENCY_MAX = 16;
|
||||
|
||||
extern LaraInfo Lara;
|
||||
extern ITEM_INFO* LaraItem;
|
||||
|
|
|
@ -303,7 +303,7 @@ void lara_as_run_forward(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)) &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)) &&
|
||||
lara->Control.WaterStatus != WaterStatus::Wade)
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
|
@ -469,7 +469,7 @@ void lara_as_idle(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)))
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)))
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
return;
|
||||
|
@ -537,8 +537,8 @@ void lara_as_idle(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
if (TrInput & IN_SPRINT ||
|
||||
lara->Control.TurnRate <= -LARA_SLOW_TURN_MAX ||
|
||||
(lara->Control.HandStatus == HandStatus::WeaponReady && lara->Control.WeaponControl.GunType != WEAPON_TORCH) ||
|
||||
(lara->Control.HandStatus == HandStatus::DrawWeapon && lara->Control.WeaponControl.GunType != WEAPON_FLARE))
|
||||
(lara->Control.HandStatus == HandStatus::WeaponReady && lara->Control.Weapon.GunType != WEAPON_TORCH) ||
|
||||
(lara->Control.HandStatus == HandStatus::DrawWeapon && lara->Control.Weapon.GunType != WEAPON_FLARE))
|
||||
{
|
||||
item->TargetState = LS_TURN_LEFT_FAST;
|
||||
}
|
||||
|
@ -551,8 +551,8 @@ void lara_as_idle(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
if (TrInput & IN_SPRINT ||
|
||||
lara->Control.TurnRate >= LARA_SLOW_TURN_MAX ||
|
||||
(lara->Control.HandStatus == HandStatus::WeaponReady && lara->Control.WeaponControl.GunType != WEAPON_TORCH) ||
|
||||
(lara->Control.HandStatus == HandStatus::DrawWeapon && lara->Control.WeaponControl.GunType != WEAPON_FLARE))
|
||||
(lara->Control.HandStatus == HandStatus::WeaponReady && lara->Control.Weapon.GunType != WEAPON_TORCH) ||
|
||||
(lara->Control.HandStatus == HandStatus::DrawWeapon && lara->Control.Weapon.GunType != WEAPON_FLARE))
|
||||
{
|
||||
item->TargetState = LS_TURN_RIGHT_FAST;
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ void lara_as_turn_right_slow(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)))
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)))
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
return;
|
||||
|
@ -1147,7 +1147,7 @@ void lara_as_turn_left_slow(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)))
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)))
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
return;
|
||||
|
@ -1363,6 +1363,8 @@ void lara_as_death(ITEM_INFO* item, COLL_INFO* coll)
|
|||
item->MeshBits = -1;
|
||||
lara->IsBusy = false;
|
||||
}
|
||||
|
||||
CalculateItemRotationToSurface(item);
|
||||
}
|
||||
|
||||
// State: LS_DEATH (8)
|
||||
|
@ -1593,7 +1595,7 @@ void lara_as_turn_right_fast(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)) &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)) &&
|
||||
lara->Control.WaterStatus != WaterStatus::Wade)
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
|
@ -1719,7 +1721,7 @@ void lara_as_turn_left_fast(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)) &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)) &&
|
||||
lara->Control.WaterStatus != WaterStatus::Wade)
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
|
@ -2321,7 +2323,7 @@ void lara_as_sprint(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
|
||||
if (TrInput & IN_CROUCH &&
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.WeaponControl.GunType)))
|
||||
(lara->Control.HandStatus == HandStatus::Free || !IsStandingWeapon(lara->Control.Weapon.GunType)))
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
return;
|
||||
|
|
|
@ -80,7 +80,7 @@ void LaraCheatyBits(ITEM_INFO* item)
|
|||
|
||||
ResetLaraFlex(item);
|
||||
lara->Control.WaterStatus = WaterStatus::FlyCheat;
|
||||
lara->Poisoned = 0;
|
||||
lara->PoisonPotency = 0;
|
||||
lara->Air = 1800;
|
||||
lara->Control.Count.Death = 0;
|
||||
}
|
||||
|
@ -112,13 +112,13 @@ void LaraCheatGetStuff(ITEM_INFO* item)
|
|||
lara->Lasersight = true;
|
||||
|
||||
if (Objects[ID_CLOCKWORK_BEETLE].loaded)
|
||||
lara->hasBeetleThings |= 1;
|
||||
lara->HasBeetleThings |= 1;
|
||||
|
||||
if (Objects[ID_WATERSKIN1_EMPTY].loaded)
|
||||
lara->smallWaterskin = 1;
|
||||
lara->SmallWaterskin = 1;
|
||||
|
||||
if (Objects[ID_WATERSKIN2_EMPTY].loaded)
|
||||
lara->bigWaterskin = 1;
|
||||
lara->BigWaterskin = 1;
|
||||
|
||||
if (Objects[ID_REVOLVER_ITEM].loaded)
|
||||
{
|
||||
|
|
|
@ -375,7 +375,7 @@ void lara_as_crawl_idle(ITEM_INFO* item, COLL_INFO* coll)
|
|||
// TODO: Flare not working.
|
||||
if ((TrInput & IN_SPRINT && TestLaraCrouchRoll(item, coll)) ||
|
||||
(TrInput & (IN_DRAW | IN_FLARE) &&
|
||||
!IsStandingWeapon(lara->Control.WeaponControl.GunType) &&
|
||||
!IsStandingWeapon(lara->Control.Weapon.GunType) &&
|
||||
item->AnimNumber != LA_CROUCH_TO_CRAWL_START)) // Hack.
|
||||
{
|
||||
item->TargetState = LS_CROUCH_IDLE;
|
||||
|
|
|
@ -349,7 +349,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
if (laraInfo->RightArm.FlashGun > 0)
|
||||
--laraInfo->RightArm.FlashGun;
|
||||
|
||||
if (laraInfo->Control.WeaponControl.GunType == WEAPON_TORCH)
|
||||
if (laraInfo->Control.Weapon.GunType == WEAPON_TORCH)
|
||||
{
|
||||
DoFlameTorch();
|
||||
return;
|
||||
|
@ -361,12 +361,12 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
{
|
||||
// Draw weapon.
|
||||
if (TrInput & IN_DRAW)
|
||||
laraInfo->Control.WeaponControl.RequestGunType = laraInfo->Control.WeaponControl.LastGunType;
|
||||
laraInfo->Control.Weapon.RequestGunType = laraInfo->Control.Weapon.LastGunType;
|
||||
// Draw flare.
|
||||
else if (TrInput & IN_FLARE &&
|
||||
(g_GameFlow->GetLevel(CurrentLevel)->LaraType != LaraType::Young))
|
||||
{
|
||||
if (laraInfo->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (laraInfo->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
// if (!laraInfo->leftArm.frameNumber) // NO
|
||||
{
|
||||
|
@ -378,32 +378,32 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
if (laraInfo->NumFlares != -1)
|
||||
laraInfo->NumFlares--;
|
||||
|
||||
laraInfo->Control.WeaponControl.RequestGunType = WEAPON_FLARE;
|
||||
laraInfo->Control.Weapon.RequestGunType = WEAPON_FLARE;
|
||||
}
|
||||
}
|
||||
|
||||
if (TrInput & IN_DRAW ||
|
||||
laraInfo->Control.WeaponControl.RequestGunType != laraInfo->Control.WeaponControl.GunType)
|
||||
laraInfo->Control.Weapon.RequestGunType != laraInfo->Control.Weapon.GunType)
|
||||
{
|
||||
if ((laraItem->ActiveState == LS_CROUCH_IDLE ||
|
||||
laraItem->ActiveState == LS_CROUCH_TURN_LEFT ||
|
||||
laraItem->ActiveState == LS_CROUCH_TURN_RIGHT) &&
|
||||
(laraInfo->Control.WeaponControl.RequestGunType == WEAPON_HK ||
|
||||
laraInfo->Control.WeaponControl.RequestGunType == WEAPON_CROSSBOW ||
|
||||
laraInfo->Control.WeaponControl.RequestGunType == WEAPON_SHOTGUN ||
|
||||
laraInfo->Control.WeaponControl.RequestGunType == WEAPON_HARPOON_GUN))
|
||||
(laraInfo->Control.Weapon.RequestGunType == WEAPON_HK ||
|
||||
laraInfo->Control.Weapon.RequestGunType == WEAPON_CROSSBOW ||
|
||||
laraInfo->Control.Weapon.RequestGunType == WEAPON_SHOTGUN ||
|
||||
laraInfo->Control.Weapon.RequestGunType == WEAPON_HARPOON_GUN))
|
||||
{
|
||||
if (laraInfo->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
laraInfo->Control.WeaponControl.RequestGunType = WEAPON_FLARE;
|
||||
if (laraInfo->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
laraInfo->Control.Weapon.RequestGunType = WEAPON_FLARE;
|
||||
}
|
||||
else if (laraInfo->Control.WeaponControl.RequestGunType == WEAPON_FLARE ||
|
||||
else if (laraInfo->Control.Weapon.RequestGunType == WEAPON_FLARE ||
|
||||
(laraInfo->Vehicle == NO_ITEM &&
|
||||
(laraInfo->Control.WeaponControl.RequestGunType == WEAPON_HARPOON_GUN ||
|
||||
(laraInfo->Control.Weapon.RequestGunType == WEAPON_HARPOON_GUN ||
|
||||
laraInfo->Control.WaterStatus == WaterStatus::Dry ||
|
||||
(laraInfo->Control.WaterStatus == WaterStatus::Wade &&
|
||||
laraInfo->WaterSurfaceDist > -Weapons[laraInfo->Control.WeaponControl.GunType].GunHeight))))
|
||||
laraInfo->WaterSurfaceDist > -Weapons[laraInfo->Control.Weapon.GunType].GunHeight))))
|
||||
{
|
||||
if (laraInfo->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (laraInfo->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, 0);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
|
@ -411,7 +411,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
laraInfo->Flare.Life = 0;
|
||||
}
|
||||
|
||||
laraInfo->Control.WeaponControl.GunType = laraInfo->Control.WeaponControl.RequestGunType;
|
||||
laraInfo->Control.Weapon.GunType = laraInfo->Control.Weapon.RequestGunType;
|
||||
InitialiseNewWeapon(laraItem);
|
||||
laraInfo->RightArm.FrameNumber = 0;
|
||||
laraInfo->LeftArm.FrameNumber = 0;
|
||||
|
@ -419,26 +419,26 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
}
|
||||
else
|
||||
{
|
||||
laraInfo->Control.WeaponControl.LastGunType = laraInfo->Control.WeaponControl.RequestGunType;
|
||||
laraInfo->Control.Weapon.LastGunType = laraInfo->Control.Weapon.RequestGunType;
|
||||
|
||||
if (laraInfo->Control.WeaponControl.GunType != WEAPON_FLARE)
|
||||
laraInfo->Control.WeaponControl.GunType = laraInfo->Control.WeaponControl.RequestGunType;
|
||||
if (laraInfo->Control.Weapon.GunType != WEAPON_FLARE)
|
||||
laraInfo->Control.Weapon.GunType = laraInfo->Control.Weapon.RequestGunType;
|
||||
else
|
||||
laraInfo->Control.WeaponControl.RequestGunType = WEAPON_FLARE;
|
||||
laraInfo->Control.Weapon.RequestGunType = WEAPON_FLARE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (laraInfo->Control.HandStatus == HandStatus::WeaponReady)
|
||||
{
|
||||
if (TrInput & IN_DRAW ||
|
||||
laraInfo->Control.WeaponControl.RequestGunType != laraInfo->Control.WeaponControl.GunType)
|
||||
laraInfo->Control.Weapon.RequestGunType != laraInfo->Control.Weapon.GunType)
|
||||
{
|
||||
laraInfo->Control.HandStatus = HandStatus::UndrawWeapon;
|
||||
}
|
||||
else if (laraInfo->Control.WeaponControl.GunType != WEAPON_HARPOON_GUN &&
|
||||
else if (laraInfo->Control.Weapon.GunType != WEAPON_HARPOON_GUN &&
|
||||
laraInfo->Control.WaterStatus != WaterStatus::Dry &&
|
||||
(laraInfo->Control.WaterStatus != WaterStatus::Wade ||
|
||||
laraInfo->WaterSurfaceDist < -Weapons[laraInfo->Control.WeaponControl.GunType].GunHeight))
|
||||
laraInfo->WaterSurfaceDist < -Weapons[laraInfo->Control.Weapon.GunType].GunHeight))
|
||||
{
|
||||
laraInfo->Control.HandStatus = HandStatus::UndrawWeapon;
|
||||
}
|
||||
|
@ -448,19 +448,19 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
laraItem->ActiveState == LS_CRAWL_IDLE &&
|
||||
laraItem->AnimNumber == LA_CRAWL_IDLE)
|
||||
{
|
||||
laraInfo->Control.WeaponControl.RequestGunType = WEAPON_FLARE;
|
||||
laraInfo->Control.Weapon.RequestGunType = WEAPON_FLARE;
|
||||
}
|
||||
|
||||
switch (laraInfo->Control.HandStatus)
|
||||
{
|
||||
case HandStatus::DrawWeapon:
|
||||
if (laraInfo->Control.WeaponControl.GunType != WEAPON_FLARE &&
|
||||
laraInfo->Control.WeaponControl.GunType != WEAPON_NONE)
|
||||
if (laraInfo->Control.Weapon.GunType != WEAPON_FLARE &&
|
||||
laraInfo->Control.Weapon.GunType != WEAPON_NONE)
|
||||
{
|
||||
laraInfo->Control.WeaponControl.LastGunType = laraInfo->Control.WeaponControl.GunType;
|
||||
laraInfo->Control.Weapon.LastGunType = laraInfo->Control.Weapon.GunType;
|
||||
}
|
||||
|
||||
switch (laraInfo->Control.WeaponControl.GunType)
|
||||
switch (laraInfo->Control.Weapon.GunType)
|
||||
{
|
||||
case WEAPON_PISTOLS:
|
||||
case WEAPON_REVOLVER:
|
||||
|
@ -468,7 +468,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
if (Camera.type != CameraType::Look && Camera.type != CameraType::Heavy)
|
||||
Camera.type = CameraType::Combat;
|
||||
|
||||
DrawPistols(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
DrawPistols(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
break;
|
||||
|
||||
case WEAPON_SHOTGUN:
|
||||
|
@ -480,7 +480,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
if (Camera.type != CameraType::Look && Camera.type != CameraType::Heavy)
|
||||
Camera.type = CameraType::Combat;
|
||||
|
||||
DrawShotgun(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
DrawShotgun(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
break;
|
||||
|
||||
case WEAPON_FLARE:
|
||||
|
@ -499,14 +499,14 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
break;
|
||||
|
||||
case HandStatus::UndrawWeapon:
|
||||
laraInfo->meshPtrs[LM_HEAD] = Objects[ID_LARA_SKIN].meshIndex + LM_HEAD;
|
||||
laraInfo->MeshPtrs[LM_HEAD] = Objects[ID_LARA_SKIN].meshIndex + LM_HEAD;
|
||||
|
||||
switch (laraInfo->Control.WeaponControl.GunType)
|
||||
switch (laraInfo->Control.Weapon.GunType)
|
||||
{
|
||||
case WEAPON_PISTOLS:
|
||||
case WEAPON_REVOLVER:
|
||||
case WEAPON_UZI:
|
||||
UndrawPistols(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
UndrawPistols(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
break;
|
||||
|
||||
case WEAPON_SHOTGUN:
|
||||
|
@ -515,7 +515,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
case WEAPON_GRENADE_LAUNCHER:
|
||||
case WEAPON_ROCKET_LAUNCHER:
|
||||
case WEAPON_HARPOON_GUN:
|
||||
UndrawShotgun(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
UndrawShotgun(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
break;
|
||||
|
||||
case WEAPON_FLARE:
|
||||
|
@ -530,9 +530,9 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
|
||||
case HandStatus::WeaponReady:
|
||||
if (!(TrInput & IN_ACTION))
|
||||
laraInfo->meshPtrs[LM_HEAD] = Objects[ID_LARA_SKIN].meshIndex + LM_HEAD;
|
||||
laraInfo->MeshPtrs[LM_HEAD] = Objects[ID_LARA_SKIN].meshIndex + LM_HEAD;
|
||||
else
|
||||
laraInfo->meshPtrs[LM_HEAD] = Objects[ID_LARA_SCREAM].meshIndex + LM_HEAD;
|
||||
laraInfo->MeshPtrs[LM_HEAD] = Objects[ID_LARA_SCREAM].meshIndex + LM_HEAD;
|
||||
|
||||
if (Camera.type != CameraType::Look &&
|
||||
Camera.type != CameraType::Heavy)
|
||||
|
@ -542,18 +542,18 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
|
||||
if (TrInput & IN_ACTION)
|
||||
{
|
||||
if (!GetAmmo(laraItem, laraInfo->Control.WeaponControl.GunType))
|
||||
if (!GetAmmo(laraItem, laraInfo->Control.Weapon.GunType))
|
||||
{
|
||||
laraInfo->Control.WeaponControl.RequestGunType = Objects[ID_PISTOLS_ITEM].loaded ? WEAPON_PISTOLS : WEAPON_NONE;
|
||||
laraInfo->Control.Weapon.RequestGunType = Objects[ID_PISTOLS_ITEM].loaded ? WEAPON_PISTOLS : WEAPON_NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (laraInfo->Control.WeaponControl.GunType)
|
||||
switch (laraInfo->Control.Weapon.GunType)
|
||||
{
|
||||
case WEAPON_PISTOLS:
|
||||
case WEAPON_UZI:
|
||||
PistolHandler(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
PistolHandler(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -564,7 +564,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
case WEAPON_ROCKET_LAUNCHER:
|
||||
case WEAPON_HARPOON_GUN:
|
||||
case WEAPON_REVOLVER:
|
||||
RifleHandler(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
RifleHandler(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -574,7 +574,7 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
break;
|
||||
|
||||
case HandStatus::Free:
|
||||
if (laraInfo->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (laraInfo->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
if (laraInfo->Vehicle != NO_ITEM ||
|
||||
CheckForHoldingState((LaraState)laraItem->ActiveState))
|
||||
|
@ -603,9 +603,9 @@ void LaraGun(ITEM_INFO* laraItem)
|
|||
break;
|
||||
|
||||
case HandStatus::Busy:
|
||||
if (laraInfo->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (laraInfo->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
if (laraInfo->meshPtrs[LM_LHAND] == Objects[ID_LARA_FLARE_ANIM].meshIndex + LM_LHAND)
|
||||
if (laraInfo->MeshPtrs[LM_LHAND] == Objects[ID_LARA_FLARE_ANIM].meshIndex + LM_LHAND)
|
||||
{
|
||||
laraInfo->Flare.ControlLeft = (laraInfo->Vehicle != NO_ITEM || CheckForHoldingState((LaraState)laraItem->ActiveState));
|
||||
DoFlareInHand(laraItem, laraInfo->Flare.Life);
|
||||
|
@ -638,7 +638,7 @@ void InitialiseNewWeapon(ITEM_INFO* laraItem)
|
|||
laraInfo->LeftArm.FlashGun = 0;
|
||||
laraInfo->RightArm.FlashGun = 0;
|
||||
|
||||
switch (laraInfo->Control.WeaponControl.GunType)
|
||||
switch (laraInfo->Control.Weapon.GunType)
|
||||
{
|
||||
case WEAPON_PISTOLS:
|
||||
case WEAPON_UZI:
|
||||
|
@ -646,7 +646,7 @@ void InitialiseNewWeapon(ITEM_INFO* laraItem)
|
|||
laraInfo->LeftArm.FrameBase = Objects[ID_PISTOLS_ANIM].frameBase;
|
||||
|
||||
if (laraInfo->Control.HandStatus != HandStatus::Free)
|
||||
DrawPistolMeshes(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
DrawPistolMeshes(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -656,11 +656,11 @@ void InitialiseNewWeapon(ITEM_INFO* laraItem)
|
|||
case WEAPON_GRENADE_LAUNCHER:
|
||||
case WEAPON_HARPOON_GUN:
|
||||
case WEAPON_ROCKET_LAUNCHER:
|
||||
laraInfo->RightArm.FrameBase = Objects[WeaponObject(laraInfo->Control.WeaponControl.GunType)].frameBase;
|
||||
laraInfo->LeftArm.FrameBase = Objects[WeaponObject(laraInfo->Control.WeaponControl.GunType)].frameBase;
|
||||
laraInfo->RightArm.FrameBase = Objects[WeaponObject(laraInfo->Control.Weapon.GunType)].frameBase;
|
||||
laraInfo->LeftArm.FrameBase = Objects[WeaponObject(laraInfo->Control.Weapon.GunType)].frameBase;
|
||||
|
||||
if (laraInfo->Control.HandStatus != HandStatus::Free)
|
||||
DrawShotgunMeshes(laraItem, laraInfo->Control.WeaponControl.GunType);
|
||||
DrawShotgunMeshes(laraItem, laraInfo->Control.Weapon.GunType);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -735,9 +735,9 @@ void HitTarget(ITEM_INFO* laraItem, ITEM_INFO* target, GAME_VECTOR* hitPos, int
|
|||
case HIT_BLOOD:
|
||||
if (target->ObjectNumber == ID_BADDY2 &&
|
||||
(target->ActiveState == 8 || GetRandomControl() & 1) &&
|
||||
(laraInfo->Control.WeaponControl.GunType == WEAPON_PISTOLS ||
|
||||
laraInfo->Control.WeaponControl.GunType == WEAPON_SHOTGUN ||
|
||||
laraInfo->Control.WeaponControl.GunType == WEAPON_UZI))
|
||||
(laraInfo->Control.Weapon.GunType == WEAPON_PISTOLS ||
|
||||
laraInfo->Control.Weapon.GunType == WEAPON_SHOTGUN ||
|
||||
laraInfo->Control.Weapon.GunType == WEAPON_UZI))
|
||||
{
|
||||
// Baddy2 gun hitting sword
|
||||
SoundEffect(SFX_TR4_BAD_SWORD_RICO, &target->Position, 0);
|
||||
|
@ -835,8 +835,8 @@ FireWeaponType FireWeapon(LaraWeaponType weaponType, ITEM_INFO* target, ITEM_INF
|
|||
}
|
||||
}
|
||||
|
||||
laraInfo->Control.WeaponControl.HasFired = true;
|
||||
laraInfo->Control.WeaponControl.Fired = true;
|
||||
laraInfo->Control.Weapon.HasFired = true;
|
||||
laraInfo->Control.Weapon.Fired = true;
|
||||
|
||||
GAME_VECTOR vSrc;
|
||||
vSrc.x = pos.x;
|
||||
|
|
|
@ -99,14 +99,14 @@ void UndrawFlareMeshes(ITEM_INFO* laraItem)
|
|||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
lara->meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
lara->MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void DrawFlareMeshes(ITEM_INFO* laraItem)
|
||||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
lara->meshPtrs[LM_LHAND] = Objects[ID_LARA_FLARE_ANIM].meshIndex + LM_LHAND;
|
||||
lara->MeshPtrs[LM_LHAND] = Objects[ID_LARA_FLARE_ANIM].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void UndrawFlare(ITEM_INFO* laraItem)
|
||||
|
@ -134,8 +134,8 @@ void UndrawFlare(ITEM_INFO* laraItem)
|
|||
|
||||
if (flareFrame >= g_Level.Anims[laraItem->AnimNumber].frameBase + 31) // Last frame.
|
||||
{
|
||||
lara->Control.WeaponControl.RequestGunType = lara->Control.WeaponControl.LastGunType;
|
||||
lara->Control.WeaponControl.GunType = lara->Control.WeaponControl.LastGunType;
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.Weapon.GunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
|
||||
InitialiseNewWeapon(laraItem);
|
||||
|
@ -188,8 +188,8 @@ void UndrawFlare(ITEM_INFO* laraItem)
|
|||
{
|
||||
armFrame = 0;
|
||||
|
||||
lara->Control.WeaponControl.RequestGunType = lara->Control.WeaponControl.LastGunType;
|
||||
lara->Control.WeaponControl.GunType = lara->Control.WeaponControl.LastGunType;
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.Weapon.GunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
|
||||
InitialiseNewWeapon(laraItem);
|
||||
|
|
|
@ -167,61 +167,61 @@ void DoLaraFallDamage(ITEM_INFO* item)
|
|||
void DoLaraTightropeBalance(ITEM_INFO* item)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
const int factor = ((lara->Control.TightropeControl.TimeOnTightrope >> 7) & 0xFF) * 128;
|
||||
const int factor = ((lara->Control.Tightrope.TimeOnTightrope >> 7) & 0xFF) * 128;
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
lara->Control.TightropeControl.Balance += ANGLE(1.4f);
|
||||
lara->Control.Tightrope.Balance += ANGLE(1.4f);
|
||||
if (TrInput & IN_RIGHT)
|
||||
lara->Control.TightropeControl.Balance -= ANGLE(1.4f);
|
||||
lara->Control.Tightrope.Balance -= ANGLE(1.4f);
|
||||
|
||||
if (lara->Control.TightropeControl.Balance < 0)
|
||||
if (lara->Control.Tightrope.Balance < 0)
|
||||
{
|
||||
lara->Control.TightropeControl.Balance -= factor;
|
||||
if (lara->Control.TightropeControl.Balance <= -ANGLE(45.0f))
|
||||
lara->Control.TightropeControl.Balance = ANGLE(45.0f);
|
||||
lara->Control.Tightrope.Balance -= factor;
|
||||
if (lara->Control.Tightrope.Balance <= -ANGLE(45.0f))
|
||||
lara->Control.Tightrope.Balance = ANGLE(45.0f);
|
||||
|
||||
}
|
||||
else if (lara->Control.TightropeControl.Balance > 0)
|
||||
else if (lara->Control.Tightrope.Balance > 0)
|
||||
{
|
||||
lara->Control.TightropeControl.Balance += factor;
|
||||
if (lara->Control.TightropeControl.Balance >= ANGLE(45.0f))
|
||||
lara->Control.TightropeControl.Balance = ANGLE(45.0f);
|
||||
lara->Control.Tightrope.Balance += factor;
|
||||
if (lara->Control.Tightrope.Balance >= ANGLE(45.0f))
|
||||
lara->Control.Tightrope.Balance = ANGLE(45.0f);
|
||||
}
|
||||
else
|
||||
lara->Control.TightropeControl.Balance = GetRandomControl() & 1 ? -1 : 1;
|
||||
lara->Control.Tightrope.Balance = GetRandomControl() & 1 ? -1 : 1;
|
||||
}
|
||||
|
||||
void DoLaraTightropeLean(ITEM_INFO* item)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
item->Position.zRot = lara->Control.TightropeControl.Balance / 4;
|
||||
lara->ExtraTorsoRot.zRot = -lara->Control.TightropeControl.Balance;
|
||||
item->Position.zRot = lara->Control.Tightrope.Balance / 4;
|
||||
lara->ExtraTorsoRot.zRot = -lara->Control.Tightrope.Balance;
|
||||
}
|
||||
|
||||
void DoLaraTightropeBalanceRegen(ITEM_INFO* item)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (lara->Control.TightropeControl.TimeOnTightrope <= 32)
|
||||
lara->Control.TightropeControl.TimeOnTightrope = 0;
|
||||
if (lara->Control.Tightrope.TimeOnTightrope <= 32)
|
||||
lara->Control.Tightrope.TimeOnTightrope = 0;
|
||||
else
|
||||
lara->Control.TightropeControl.TimeOnTightrope -= 32;
|
||||
lara->Control.Tightrope.TimeOnTightrope -= 32;
|
||||
|
||||
if (lara->Control.TightropeControl.Balance > 0)
|
||||
if (lara->Control.Tightrope.Balance > 0)
|
||||
{
|
||||
if (lara->Control.TightropeControl.Balance <= ANGLE(0.75f))
|
||||
lara->Control.TightropeControl.Balance = 0;
|
||||
if (lara->Control.Tightrope.Balance <= ANGLE(0.75f))
|
||||
lara->Control.Tightrope.Balance = 0;
|
||||
else
|
||||
lara->Control.TightropeControl.Balance -= ANGLE(0.75f);
|
||||
lara->Control.Tightrope.Balance -= ANGLE(0.75f);
|
||||
}
|
||||
|
||||
if (lara->Control.TightropeControl.Balance < 0)
|
||||
if (lara->Control.Tightrope.Balance < 0)
|
||||
{
|
||||
if (lara->Control.TightropeControl.Balance >= -ANGLE(0.75f))
|
||||
lara->Control.TightropeControl.Balance = 0;
|
||||
if (lara->Control.Tightrope.Balance >= -ANGLE(0.75f))
|
||||
lara->Control.Tightrope.Balance = 0;
|
||||
else
|
||||
lara->Control.TightropeControl.Balance += ANGLE(0.75f);
|
||||
lara->Control.Tightrope.Balance += ANGLE(0.75f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,12 +256,10 @@ short GetLaraSlideDirection(ITEM_INFO* item, COLL_INFO* coll)
|
|||
|
||||
void ModulateLaraSlideVelocity(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
// TODO: Make slope speed dynamic.
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
auto probe = GetCollisionResult(item);
|
||||
|
||||
// TODO
|
||||
/*if (g_GameFlow->Animations.HasSlideExtended)
|
||||
{
|
||||
|
||||
|
@ -272,11 +270,15 @@ void ModulateLaraSlideVelocity(ITEM_INFO* item, COLL_INFO* coll)
|
|||
lara->ExtraVelocity.x += velocity;
|
||||
}*/
|
||||
|
||||
constexpr int velocity = 50;
|
||||
// TODO
|
||||
constexpr int minVelocity = 50; // Apply only when landing?
|
||||
constexpr int maxVelocity = LARA_TERMINAL_VELOCITY;
|
||||
constexpr int VelocityIncreasePerStep = 1;
|
||||
|
||||
short steepness = GetSurfaceSteepnessAngle(probe.FloorTilt.x, probe.FloorTilt.y);
|
||||
short direction = GetSurfaceBearingAngle(probe.FloorTilt.x, probe.FloorTilt.y);
|
||||
|
||||
lara->ExtraVelocity.x += velocity;
|
||||
lara->ExtraVelocity.x += minVelocity;
|
||||
}
|
||||
|
||||
void SetLaraJumpDirection(ITEM_INFO* item, COLL_INFO* coll)
|
||||
|
|
|
@ -36,33 +36,33 @@ void InitialiseLara(int restore)
|
|||
|
||||
Lara.Control.CanLook = true;
|
||||
Lara.ItemNumber = itemNumber;
|
||||
Lara.hitDirection = -1;
|
||||
Lara.HitDirection = -1;
|
||||
Lara.SprintEnergy = LARA_SPRINT_MAX;
|
||||
Lara.Air = LARA_AIR_MAX;
|
||||
Lara.Control.WeaponControl.WeaponItem = NO_ITEM;
|
||||
Lara.Control.Weapon.WeaponItem = NO_ITEM;
|
||||
PoisonFlag = 0;
|
||||
Lara.Poisoned = 0;
|
||||
Lara.PoisonPotency = 0;
|
||||
Lara.WaterSurfaceDist = 100;
|
||||
|
||||
if (Lara.Weapons[static_cast<int>(LaraWeaponType::WEAPON_PISTOLS)].Present)
|
||||
{
|
||||
Lara.Control.WeaponControl.HolsterInfo.LeftHolster = HolsterSlot::Pistols;
|
||||
Lara.Control.WeaponControl.HolsterInfo.RightHolster = HolsterSlot::Pistols;
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = HolsterSlot::Pistols;
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = HolsterSlot::Pistols;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lara.Control.WeaponControl.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
Lara.Control.WeaponControl.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
}
|
||||
|
||||
if (Lara.Weapons[static_cast<int>(LaraWeaponType::WEAPON_SHOTGUN)].Present)
|
||||
Lara.Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlot::Shotgun;
|
||||
Lara.Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Shotgun;
|
||||
else
|
||||
Lara.Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
Lara.Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
|
||||
Lara.location = -1;
|
||||
Lara.highestLocation = -1;
|
||||
Lara.Control.RopeControl.Ptr = -1;
|
||||
Lara.Location = -1;
|
||||
Lara.HighestLocation = -1;
|
||||
Lara.Control.Rope.Ptr = -1;
|
||||
LaraItem->HitPoints = LARA_HEALTH_MAX;
|
||||
Lara.Control.HandStatus = HandStatus::Free;
|
||||
|
||||
|
@ -74,7 +74,7 @@ void InitialiseLara(int restore)
|
|||
if (Objects[ID_PISTOLS_ITEM].loaded)
|
||||
weapon = WEAPON_PISTOLS;
|
||||
|
||||
Lara.Control.WeaponControl.LastGunType = Lara.Control.WeaponControl.GunType = Lara.Control.WeaponControl.RequestGunType = weapon;
|
||||
Lara.Control.Weapon.LastGunType = Lara.Control.Weapon.GunType = Lara.Control.Weapon.RequestGunType = weapon;
|
||||
|
||||
LaraInitialiseMeshes(LaraItem);
|
||||
|
||||
|
@ -112,20 +112,20 @@ void LaraInitialiseMeshes(ITEM_INFO* item)
|
|||
{
|
||||
//Meshes[i] = Meshes[MESHES(ID_LARA_SKIN, i)];
|
||||
//LARA_MESHES(ID_LARA, MESHES(ID_LARA_SKIN, i));
|
||||
lara->meshPtrs[i] = Objects[ID_LARA_SKIN].meshIndex + i;
|
||||
lara->MeshPtrs[i] = Objects[ID_LARA_SKIN].meshIndex + i;
|
||||
}
|
||||
|
||||
/* Hardcoded code */
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_HK)
|
||||
lara->Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlot::HK;
|
||||
if (lara->Control.Weapon.GunType == WEAPON_HK)
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::HK;
|
||||
else if (!lara->Weapons[WEAPON_SHOTGUN].Present)
|
||||
{
|
||||
if (lara->Weapons[WEAPON_HK].Present)
|
||||
lara->Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlot::HK;
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::HK;
|
||||
}
|
||||
else
|
||||
lara->Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
lara->LeftArm.FrameNumber = 0;
|
||||
|
|
|
@ -243,7 +243,7 @@ void lara_col_reach(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (lara->Control.RopeControl.Ptr == -1)
|
||||
if (lara->Control.Rope.Ptr == -1)
|
||||
item->Airborne = true;
|
||||
|
||||
lara->Control.MoveAngle = item->Position.yRot;
|
||||
|
|
|
@ -362,16 +362,16 @@ void lara_as_tightrope_walk(ITEM_INFO* item, COLL_INFO* coll)
|
|||
return;
|
||||
}
|
||||
|
||||
lara->Control.TightropeControl.TimeOnTightrope++;
|
||||
lara->Control.Tightrope.TimeOnTightrope++;
|
||||
DoLaraTightropeBalance(item);
|
||||
DoLaraTightropeLean(item);
|
||||
|
||||
if (lara->Control.TightropeControl.Balance >= 8000)
|
||||
if (lara->Control.Tightrope.Balance >= 8000)
|
||||
{
|
||||
item->TargetState = LS_TIGHTROPE_UNBALANCE_RIGHT;
|
||||
return;
|
||||
}
|
||||
else if (lara->Control.TightropeControl.Balance <= -8000)
|
||||
else if (lara->Control.Tightrope.Balance <= -8000)
|
||||
{
|
||||
item->TargetState = LS_TIGHTROPE_UNBALANCE_LEFT;
|
||||
return;
|
||||
|
@ -554,7 +554,7 @@ void lara_as_rope_turn_clockwise(ITEM_INFO* item, COLL_INFO* coll)
|
|||
if (TrInput & IN_ACTION)
|
||||
{
|
||||
if (TrInput & IN_LEFT)
|
||||
lara->Control.RopeControl.Y += ANGLE(1.4f);
|
||||
lara->Control.Rope.Y += ANGLE(1.4f);
|
||||
else
|
||||
item->TargetState = LS_ROPE_IDLE;
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ void lara_as_rope_turn_counter_clockwise(ITEM_INFO* item, COLL_INFO* coll)
|
|||
if (TrInput & IN_ACTION)
|
||||
{
|
||||
if (TrInput & IN_RIGHT)
|
||||
lara->Control.RopeControl.Y -= ANGLE(1.4f);
|
||||
lara->Control.Rope.Y -= ANGLE(1.4f);
|
||||
else
|
||||
item->TargetState = LS_ROPE_IDLE;
|
||||
}
|
||||
|
@ -603,16 +603,16 @@ void lara_col_rope_idle(ITEM_INFO* item, COLL_INFO* coll)
|
|||
if (TrInput & IN_SPRINT)
|
||||
{
|
||||
item->TargetState = LS_ROPE_SWING;
|
||||
lara->Control.RopeControl.DFrame = (g_Level.Anims[LA_ROPE_SWING].frameBase + 32) << 8;
|
||||
lara->Control.RopeControl.Frame = lara->Control.RopeControl.DFrame;
|
||||
lara->Control.Rope.DFrame = (g_Level.Anims[LA_ROPE_SWING].frameBase + 32) << 8;
|
||||
lara->Control.Rope.Frame = lara->Control.Rope.DFrame;
|
||||
}
|
||||
else if (TrInput & IN_FORWARD && lara->Control.RopeControl.Segment > 4)
|
||||
else if (TrInput & IN_FORWARD && lara->Control.Rope.Segment > 4)
|
||||
item->TargetState = LS_ROPE_UP;
|
||||
else if (TrInput & IN_BACK && lara->Control.RopeControl.Segment < 21)
|
||||
else if (TrInput & IN_BACK && lara->Control.Rope.Segment < 21)
|
||||
{
|
||||
item->TargetState = LS_ROPE_DOWN;
|
||||
lara->Control.RopeControl.Flag = 0;
|
||||
lara->Control.RopeControl.Count = 0;
|
||||
lara->Control.Rope.Flag = 0;
|
||||
lara->Control.Rope.Count = 0;
|
||||
}
|
||||
else if (TrInput & IN_LEFT)
|
||||
item->TargetState = LS_ROPE_TURN_CLOCKWISE;
|
||||
|
@ -639,36 +639,36 @@ void lara_col_rope_swing(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
int velocity;
|
||||
|
||||
if (abs(lara->Control.RopeControl.LastX) < 9000)
|
||||
velocity = 192 * (9000 - abs(lara->Control.RopeControl.LastX)) / 9000;
|
||||
if (abs(lara->Control.Rope.LastX) < 9000)
|
||||
velocity = 192 * (9000 - abs(lara->Control.Rope.LastX)) / 9000;
|
||||
else
|
||||
velocity = 0;
|
||||
|
||||
ApplyVelocityToRope(
|
||||
lara->Control.RopeControl.Segment - 2,
|
||||
item->Position.yRot + (lara->Control.RopeControl.Direction ? 0 : ANGLE(180.0f)),
|
||||
lara->Control.Rope.Segment - 2,
|
||||
item->Position.yRot + (lara->Control.Rope.Direction ? 0 : ANGLE(180.0f)),
|
||||
velocity >> 5);
|
||||
}
|
||||
|
||||
if (lara->Control.RopeControl.Frame > lara->Control.RopeControl.DFrame)
|
||||
if (lara->Control.Rope.Frame > lara->Control.Rope.DFrame)
|
||||
{
|
||||
lara->Control.RopeControl.Frame -= (unsigned short)lara->Control.RopeControl.FrameRate;
|
||||
if (lara->Control.RopeControl.Frame < lara->Control.RopeControl.DFrame)
|
||||
lara->Control.RopeControl.Frame = lara->Control.RopeControl.DFrame;
|
||||
lara->Control.Rope.Frame -= (unsigned short)lara->Control.Rope.FrameRate;
|
||||
if (lara->Control.Rope.Frame < lara->Control.Rope.DFrame)
|
||||
lara->Control.Rope.Frame = lara->Control.Rope.DFrame;
|
||||
}
|
||||
else if (lara->Control.RopeControl.Frame < lara->Control.RopeControl.DFrame)
|
||||
else if (lara->Control.Rope.Frame < lara->Control.Rope.DFrame)
|
||||
{
|
||||
lara->Control.RopeControl.Frame += (unsigned short)lara->Control.RopeControl.FrameRate;
|
||||
if (lara->Control.RopeControl.Frame > lara->Control.RopeControl.DFrame)
|
||||
lara->Control.RopeControl.Frame = lara->Control.RopeControl.DFrame;
|
||||
lara->Control.Rope.Frame += (unsigned short)lara->Control.Rope.FrameRate;
|
||||
if (lara->Control.Rope.Frame > lara->Control.Rope.DFrame)
|
||||
lara->Control.Rope.Frame = lara->Control.Rope.DFrame;
|
||||
}
|
||||
|
||||
item->FrameNumber = lara->Control.RopeControl.Frame >> 8;
|
||||
item->FrameNumber = lara->Control.Rope.Frame >> 8;
|
||||
|
||||
if (!(TrInput & IN_SPRINT) &&
|
||||
item->FrameNumber == g_Level.Anims[LA_ROPE_SWING].frameBase + 32 &&
|
||||
lara->Control.RopeControl.MaxXBackward < 6750 &&
|
||||
lara->Control.RopeControl.MaxXForward < 6750)
|
||||
lara->Control.Rope.MaxXBackward < 6750 &&
|
||||
lara->Control.Rope.MaxXForward < 6750)
|
||||
{
|
||||
item->TargetState = LS_ROPE_IDLE;
|
||||
item->ActiveState = LS_ROPE_IDLE;
|
||||
|
@ -680,7 +680,7 @@ void lara_col_rope_swing(ITEM_INFO* item, COLL_INFO* coll)
|
|||
JumpOffRope(item);
|
||||
}
|
||||
else if (item->FrameNumber == g_Level.Anims[LA_ROPE_IDLE_TO_SWING].frameBase + 15)
|
||||
ApplyVelocityToRope(lara->Control.RopeControl.Segment, item->Position.yRot, 128);
|
||||
ApplyVelocityToRope(lara->Control.Rope.Segment, item->Position.yRot, 128);
|
||||
}
|
||||
|
||||
// State: LS_ROPE_UP (112)
|
||||
|
@ -698,10 +698,10 @@ void lara_as_rope_up(ITEM_INFO* item, COLL_INFO* coll)
|
|||
if (g_Level.Anims[item->AnimNumber].frameEnd == item->FrameNumber)
|
||||
{
|
||||
item->FrameNumber = g_Level.Anims[item->AnimNumber].frameBase;
|
||||
lara->Control.RopeControl.Segment -= 2;
|
||||
lara->Control.Rope.Segment -= 2;
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_FORWARD) || lara->Control.RopeControl.Segment <= 4)
|
||||
if (!(TrInput & IN_FORWARD) || lara->Control.Rope.Segment <= 4)
|
||||
item->TargetState = LS_ROPE_IDLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ void AnimateShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
TriggerGunSmoke(pos.x, pos.y, pos.z, 0, 0, 0, 0, SmokeWeapon, SmokeCountL);
|
||||
}
|
||||
|
||||
auto* item = &g_Level.Items[lara->Control.WeaponControl.WeaponItem];
|
||||
auto* item = &g_Level.Items[lara->Control.Weapon.WeaponItem];
|
||||
bool running = (weaponType == WEAPON_HK && laraItem->Velocity != 0);
|
||||
bool harpoonFired = false;
|
||||
|
||||
|
@ -332,10 +332,10 @@ void DrawShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
|
||||
ITEM_INFO* item;
|
||||
|
||||
if (lara->Control.WeaponControl.WeaponItem == NO_ITEM)
|
||||
if (lara->Control.Weapon.WeaponItem == NO_ITEM)
|
||||
{
|
||||
lara->Control.WeaponControl.WeaponItem = CreateItem();
|
||||
item = &g_Level.Items[lara->Control.WeaponControl.WeaponItem];
|
||||
lara->Control.Weapon.WeaponItem = CreateItem();
|
||||
item = &g_Level.Items[lara->Control.Weapon.WeaponItem];
|
||||
item->ObjectNumber = WeaponObject(weaponType);
|
||||
|
||||
if (weaponType == WEAPON_ROCKET_LAUNCHER)
|
||||
|
@ -355,7 +355,7 @@ void DrawShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
lara->LeftArm.FrameBase = lara->RightArm.FrameBase;
|
||||
}
|
||||
else
|
||||
item = &g_Level.Items[lara->Control.WeaponControl.WeaponItem];
|
||||
item = &g_Level.Items[lara->Control.Weapon.WeaponItem];
|
||||
|
||||
AnimateItem(item);
|
||||
|
||||
|
@ -378,7 +378,7 @@ void UndrawShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
auto* item = &g_Level.Items[lara->Control.WeaponControl.WeaponItem];
|
||||
auto* item = &g_Level.Items[lara->Control.Weapon.WeaponItem];
|
||||
item->TargetState = 3;
|
||||
|
||||
AnimateItem(item);
|
||||
|
@ -389,8 +389,8 @@ void UndrawShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
lara->TargetEntity = nullptr;
|
||||
lara->RightArm.Locked = false;
|
||||
lara->LeftArm.Locked = false;
|
||||
KillItem(lara->Control.WeaponControl.WeaponItem);
|
||||
lara->Control.WeaponControl.WeaponItem = NO_ITEM;
|
||||
KillItem(lara->Control.Weapon.WeaponItem);
|
||||
lara->Control.Weapon.WeaponItem = NO_ITEM;
|
||||
lara->RightArm.FrameNumber = 0;
|
||||
lara->LeftArm.FrameNumber = 0;
|
||||
}
|
||||
|
@ -409,16 +409,16 @@ void DrawShotgunMeshes(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
lara->Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
lara->meshPtrs[LM_RHAND] = Objects[WeaponObjectMesh(laraItem, weaponType)].meshIndex + LM_RHAND;
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[WeaponObjectMesh(laraItem, weaponType)].meshIndex + LM_RHAND;
|
||||
}
|
||||
|
||||
void UndrawShotgunMeshes(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
||||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
lara->Control.WeaponControl.HolsterInfo.BackHolster = HolsterSlotForWeapon(weaponType);
|
||||
lara->meshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlotForWeapon(weaponType);
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
}
|
||||
|
||||
void FireHarpoon(ITEM_INFO* laraItem)
|
||||
|
@ -429,7 +429,7 @@ void FireHarpoon(ITEM_INFO* laraItem)
|
|||
if (!ammos)
|
||||
return;
|
||||
|
||||
lara->Control.WeaponControl.HasFired = true;
|
||||
lara->Control.Weapon.HasFired = true;
|
||||
|
||||
// Create a new item for harpoon
|
||||
short itemNumber = CreateItem();
|
||||
|
@ -647,7 +647,7 @@ void FireGrenade(ITEM_INFO* laraItem)
|
|||
if (!ammo)
|
||||
return;
|
||||
|
||||
lara->Control.WeaponControl.HasFired = true;
|
||||
lara->Control.Weapon.HasFired = true;
|
||||
|
||||
short itemNumber = CreateItem();
|
||||
if (itemNumber != NO_ITEM)
|
||||
|
@ -1108,7 +1108,7 @@ void FireRocket(ITEM_INFO* laraItem)
|
|||
if (!ammos)
|
||||
return;
|
||||
|
||||
lara->Control.WeaponControl.HasFired = true;
|
||||
lara->Control.Weapon.HasFired = true;
|
||||
|
||||
short itemNumber = CreateItem();
|
||||
if (itemNumber != NO_ITEM)
|
||||
|
@ -1381,7 +1381,7 @@ void FireCrossbow(ITEM_INFO* laraItem, PHD_3DPOS* pos)
|
|||
if (!ammos)
|
||||
return;
|
||||
|
||||
lara->Control.WeaponControl.HasFired = true;
|
||||
lara->Control.Weapon.HasFired = true;
|
||||
|
||||
short itemNumber = CreateItem();
|
||||
if (itemNumber != NO_ITEM)
|
||||
|
|
|
@ -1084,7 +1084,6 @@ struct WeaponControlData
|
|||
bool HasFired;
|
||||
bool Fired;
|
||||
|
||||
// TODO: Savegame
|
||||
bool UziLeft;
|
||||
bool UziRight;
|
||||
|
||||
|
@ -1140,6 +1139,12 @@ struct SubsuitControlData
|
|||
unsigned short HitCount;
|
||||
};
|
||||
|
||||
struct MinecartControlData
|
||||
{
|
||||
bool Left;
|
||||
bool Right;
|
||||
};
|
||||
|
||||
struct LaraCountData
|
||||
{
|
||||
unsigned int RunJump;
|
||||
|
@ -1158,11 +1163,7 @@ struct LaraControlData
|
|||
JumpDirection JumpDirection;
|
||||
HandStatus HandStatus;
|
||||
WaterStatus WaterStatus;
|
||||
|
||||
WeaponControlData WeaponControl;
|
||||
RopeControlData RopeControl;
|
||||
TightropeControlData TightropeControl;
|
||||
SubsuitControlData SubsuitControl;
|
||||
LaraCountData Count;
|
||||
|
||||
bool CanLook;
|
||||
bool IsMoving;
|
||||
|
@ -1174,9 +1175,11 @@ struct LaraControlData
|
|||
bool RunJumpQueued;
|
||||
bool Locked;
|
||||
|
||||
short WaterCurrentActive;
|
||||
|
||||
LaraCountData Count;
|
||||
WeaponControlData Weapon;
|
||||
RopeControlData Rope;
|
||||
TightropeControlData Tightrope;
|
||||
SubsuitControlData Subsuit;
|
||||
MinecartControlData Minecart;
|
||||
};
|
||||
|
||||
struct LaraInfo
|
||||
|
@ -1190,55 +1193,57 @@ struct LaraInfo
|
|||
PHD_3DPOS ExtraHeadRot;
|
||||
PHD_3DPOS ExtraTorsoRot;
|
||||
PHD_VECTOR ExtraVelocity;
|
||||
short WaterCurrentActive;
|
||||
PHD_VECTOR WaterCurrentPull;
|
||||
|
||||
ArmInfo LeftArm;
|
||||
ArmInfo RightArm;
|
||||
ITEM_INFO* TargetEntity; // TODO: savegame
|
||||
ITEM_INFO* TargetEntity;
|
||||
CreatureInfo* Creature; // Unused?
|
||||
short TargetArmAngles[2]; // TODO: savegame
|
||||
short TargetArmAngles[2];
|
||||
|
||||
int Air;
|
||||
int SprintEnergy;
|
||||
short Poisoned;
|
||||
int PoisonPotency;
|
||||
|
||||
int hitFrame;
|
||||
int hitDirection;
|
||||
int HitFrame;
|
||||
int HitDirection;
|
||||
FX_INFO* SpasmEffect;
|
||||
int SpasmEffectCount;
|
||||
unsigned int SpasmEffectCount;
|
||||
|
||||
int ProjectedFloorHeight;
|
||||
short TargetAngle; // TODO: Expand this feature for other applications.
|
||||
short TargetAngle; // Target facing angle.
|
||||
int WaterSurfaceDist;
|
||||
short InteractedItem;
|
||||
PHD_3DPOS NextCornerPos;
|
||||
|
||||
// TODO: Use BurnType in place of burn, burnBlue, and burnSmoke. Core didn't make replacing them easy.
|
||||
// TODO: Use BurnType in place of Burn, BurnBlue, and BurnSmoke. Core didn't make replacing them easy.
|
||||
BurnType BurnType;
|
||||
unsigned int BurnCount;
|
||||
bool burn;
|
||||
byte burnBlue;
|
||||
bool Burn;
|
||||
byte BurnBlue;
|
||||
bool BurnSmoke;
|
||||
|
||||
byte wet[NUM_LARA_MESHES];
|
||||
int meshPtrs[NUM_LARA_MESHES];
|
||||
signed char location;
|
||||
signed char highestLocation;
|
||||
signed char locationPad;
|
||||
byte Wet[NUM_LARA_MESHES];
|
||||
int MeshPtrs[NUM_LARA_MESHES];
|
||||
signed char Location;
|
||||
signed char HighestLocation;
|
||||
signed char LocationPad;
|
||||
|
||||
// Inventory-related?
|
||||
bool IsBusy;
|
||||
bool OldBusy;
|
||||
|
||||
// NEW:
|
||||
|
||||
byte BeetleLife;
|
||||
short hasBeetleThings; // & 1 -> beetle. & 2 -> combo1. & 4 ->combo2
|
||||
byte smallWaterskin; // 1 = has the waterskin. 2 = has the waterskin and it has 1 liter. etc. max value is 4: has skin + 3 = 4
|
||||
byte bigWaterskin; // 1 = has the waterskin. 2 = has the waterskin and it has 1 liter. etc. max value is 6: has skin + 5 liters = 6
|
||||
short HasBeetleThings; // & 1 -> beetle. & 2 -> combo1. & 4 ->combo2
|
||||
byte SmallWaterskin; // 1 = has the waterskin. 2 = has the waterskin and it has 1 liter. etc. max value is 4: has skin + 3 = 4
|
||||
byte BigWaterskin; // 1 = has the waterskin. 2 = has the waterskin and it has 1 liter. etc. max value is 6: has skin + 5 liters = 6
|
||||
short Vehicle;
|
||||
short ExtraAnim;
|
||||
bool mineL;
|
||||
bool mineR;
|
||||
CarriedWeaponInfo Weapons[static_cast<int>(LaraWeaponType::NUM_WEAPONS)];
|
||||
|
||||
DiaryInfo Diary;
|
||||
int Puzzles[NUM_PUZZLES];
|
||||
int Keys[NUM_KEYS];
|
||||
|
|
|
@ -191,40 +191,40 @@ void UpdateSubsuitAngles(ITEM_INFO* item)
|
|||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (lara->Control.SubsuitControl.VerticalVelocity != 0)
|
||||
if (lara->Control.Subsuit.VerticalVelocity != 0)
|
||||
{
|
||||
item->Position.yPos += lara->Control.SubsuitControl.VerticalVelocity / 4;
|
||||
lara->Control.SubsuitControl.VerticalVelocity = ceil((15 / 16) * lara->Control.SubsuitControl.VerticalVelocity - 1);
|
||||
item->Position.yPos += lara->Control.Subsuit.VerticalVelocity / 4;
|
||||
lara->Control.Subsuit.VerticalVelocity = ceil((15 / 16) * lara->Control.Subsuit.VerticalVelocity - 1);
|
||||
}
|
||||
|
||||
lara->Control.SubsuitControl.Velocity[0] = -4 * item->VerticalVelocity;
|
||||
lara->Control.SubsuitControl.Velocity[1] = -4 * item->VerticalVelocity;
|
||||
lara->Control.Subsuit.Velocity[0] = -4 * item->VerticalVelocity;
|
||||
lara->Control.Subsuit.Velocity[1] = -4 * item->VerticalVelocity;
|
||||
|
||||
if (lara->Control.SubsuitControl.XRot >= lara->Control.SubsuitControl.DXRot)
|
||||
if (lara->Control.Subsuit.XRot >= lara->Control.Subsuit.DXRot)
|
||||
{
|
||||
if (lara->Control.SubsuitControl.XRot > lara->Control.SubsuitControl.DXRot)
|
||||
if (lara->Control.Subsuit.XRot > lara->Control.Subsuit.DXRot)
|
||||
{
|
||||
if (lara->Control.SubsuitControl.XRot > 0 && lara->Control.SubsuitControl.DXRot < 0)
|
||||
lara->Control.SubsuitControl.XRot = ceil(0.75 * lara->Control.SubsuitControl.XRot);
|
||||
if (lara->Control.Subsuit.XRot > 0 && lara->Control.Subsuit.DXRot < 0)
|
||||
lara->Control.Subsuit.XRot = ceil(0.75 * lara->Control.Subsuit.XRot);
|
||||
|
||||
lara->Control.SubsuitControl.XRot -= ANGLE(2.0f);
|
||||
if (lara->Control.SubsuitControl.XRot < lara->Control.SubsuitControl.DXRot)
|
||||
lara->Control.SubsuitControl.XRot = lara->Control.SubsuitControl.DXRot;
|
||||
lara->Control.Subsuit.XRot -= ANGLE(2.0f);
|
||||
if (lara->Control.Subsuit.XRot < lara->Control.Subsuit.DXRot)
|
||||
lara->Control.Subsuit.XRot = lara->Control.Subsuit.DXRot;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lara->Control.SubsuitControl.XRot < 0 && lara->Control.SubsuitControl.DXRot > 0)
|
||||
lara->Control.SubsuitControl.XRot = ceil(0.75 * lara->Control.SubsuitControl.XRot);
|
||||
if (lara->Control.Subsuit.XRot < 0 && lara->Control.Subsuit.DXRot > 0)
|
||||
lara->Control.Subsuit.XRot = ceil(0.75 * lara->Control.Subsuit.XRot);
|
||||
|
||||
lara->Control.SubsuitControl.XRot += ANGLE(2.0f);
|
||||
if (lara->Control.SubsuitControl.XRot > lara->Control.SubsuitControl.DXRot)
|
||||
lara->Control.SubsuitControl.XRot = lara->Control.SubsuitControl.DXRot;
|
||||
lara->Control.Subsuit.XRot += ANGLE(2.0f);
|
||||
if (lara->Control.Subsuit.XRot > lara->Control.Subsuit.DXRot)
|
||||
lara->Control.Subsuit.XRot = lara->Control.Subsuit.DXRot;
|
||||
}
|
||||
|
||||
if (lara->Control.SubsuitControl.DXRot != 0)
|
||||
if (lara->Control.Subsuit.DXRot != 0)
|
||||
{
|
||||
short rotation = lara->Control.SubsuitControl.DXRot >> 3;
|
||||
short rotation = lara->Control.Subsuit.DXRot >> 3;
|
||||
if (rotation < -ANGLE(2.0f))
|
||||
rotation = -ANGLE(2.0f);
|
||||
else if (rotation > ANGLE(2.0f))
|
||||
|
@ -233,22 +233,22 @@ void UpdateSubsuitAngles(ITEM_INFO* item)
|
|||
item->Position.xRot += rotation;
|
||||
}
|
||||
|
||||
lara->Control.SubsuitControl.Velocity[0] += abs(lara->Control.SubsuitControl.XRot >> 3);
|
||||
lara->Control.SubsuitControl.Velocity[1] += abs(lara->Control.SubsuitControl.XRot >> 3);
|
||||
lara->Control.Subsuit.Velocity[0] += abs(lara->Control.Subsuit.XRot >> 3);
|
||||
lara->Control.Subsuit.Velocity[1] += abs(lara->Control.Subsuit.XRot >> 3);
|
||||
|
||||
if (lara->Control.TurnRate > 0)
|
||||
lara->Control.SubsuitControl.Velocity[0] += 2 * abs(lara->Control.TurnRate);
|
||||
lara->Control.Subsuit.Velocity[0] += 2 * abs(lara->Control.TurnRate);
|
||||
else if (lara->Control.TurnRate < 0)
|
||||
lara->Control.SubsuitControl.Velocity[1] += 2 * abs(lara->Control.TurnRate);
|
||||
lara->Control.Subsuit.Velocity[1] += 2 * abs(lara->Control.TurnRate);
|
||||
|
||||
if (lara->Control.SubsuitControl.Velocity[0] > SECTOR(1.5f))
|
||||
lara->Control.SubsuitControl.Velocity[0] = SECTOR(1.5f);
|
||||
if (lara->Control.Subsuit.Velocity[0] > SECTOR(1.5f))
|
||||
lara->Control.Subsuit.Velocity[0] = SECTOR(1.5f);
|
||||
|
||||
if (lara->Control.SubsuitControl.Velocity[1] > SECTOR(1.5f))
|
||||
lara->Control.SubsuitControl.Velocity[1] = SECTOR(1.5f);
|
||||
if (lara->Control.Subsuit.Velocity[1] > SECTOR(1.5f))
|
||||
lara->Control.Subsuit.Velocity[1] = SECTOR(1.5f);
|
||||
|
||||
if (lara->Control.SubsuitControl.Velocity[0] != 0 || lara->Control.SubsuitControl.Velocity[1] != 0)
|
||||
SoundEffect(SFX_TR5_LARA_UNDERWATER_ENGINE, &item->Position, (((lara->Control.SubsuitControl.Velocity[0] + lara->Control.SubsuitControl.Velocity[1]) * 4) & 0x1F00) + 10);
|
||||
if (lara->Control.Subsuit.Velocity[0] != 0 || lara->Control.Subsuit.Velocity[1] != 0)
|
||||
SoundEffect(SFX_TR5_LARA_UNDERWATER_ENGINE, &item->Position, (((lara->Control.Subsuit.Velocity[0] + lara->Control.Subsuit.Velocity[1]) * 4) & 0x1F00) + 10);
|
||||
}
|
||||
|
||||
void SwimTurnSubsuit(ITEM_INFO* item)
|
||||
|
@ -256,14 +256,14 @@ void SwimTurnSubsuit(ITEM_INFO* item)
|
|||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (item->Position.yPos < 14080)
|
||||
lara->Control.SubsuitControl.VerticalVelocity += (14080 - item->Position.yPos) >> 4;
|
||||
lara->Control.Subsuit.VerticalVelocity += (14080 - item->Position.yPos) >> 4;
|
||||
|
||||
if (TrInput & IN_FORWARD && item->Position.xRot > -ANGLE(85.0f))
|
||||
lara->Control.SubsuitControl.DXRot = -ANGLE(45.0f);
|
||||
lara->Control.Subsuit.DXRot = -ANGLE(45.0f);
|
||||
else if (TrInput & IN_BACK && item->Position.xRot < ANGLE(85.0f))
|
||||
lara->Control.SubsuitControl.DXRot = ANGLE(45.0f);
|
||||
lara->Control.Subsuit.DXRot = ANGLE(45.0f);
|
||||
else
|
||||
lara->Control.SubsuitControl.DXRot = 0;
|
||||
lara->Control.Subsuit.DXRot = 0;
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
|
@ -325,13 +325,13 @@ void LaraWaterCurrent(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (lara->Control.WaterCurrentActive)
|
||||
if (lara->WaterCurrentActive)
|
||||
{
|
||||
auto* sink = &g_Level.Sinks[lara->Control.WaterCurrentActive - 1];
|
||||
auto* sink = &g_Level.Sinks[lara->WaterCurrentActive - 1];
|
||||
|
||||
short angle = mGetAngle(sink->x, sink->z, item->Position.xPos, item->Position.zPos);
|
||||
lara->ExtraVelocity.x += (sink->strength * SECTOR(1) * phd_sin(angle - ANGLE(90.0f)) - lara->ExtraVelocity.x) / 16;
|
||||
lara->ExtraVelocity.z += (sink->strength * SECTOR(1) * phd_cos(angle - ANGLE(90.0f)) - lara->ExtraVelocity.z) / 16;
|
||||
lara->WaterCurrentPull.x += (sink->strength * SECTOR(1) * phd_sin(angle - ANGLE(90.0f)) - lara->WaterCurrentPull.x) / 16;
|
||||
lara->WaterCurrentPull.z += (sink->strength * SECTOR(1) * phd_cos(angle - ANGLE(90.0f)) - lara->WaterCurrentPull.z) / 16;
|
||||
|
||||
item->Position.yPos += (sink->y - item->Position.yPos) >> 4;
|
||||
}
|
||||
|
@ -339,31 +339,31 @@ void LaraWaterCurrent(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
int shift = 0;
|
||||
|
||||
if (abs(lara->ExtraVelocity.x) <= 16)
|
||||
shift = (abs(lara->ExtraVelocity.x) > 8) + 2;
|
||||
if (abs(lara->WaterCurrentPull.x) <= 16)
|
||||
shift = (abs(lara->WaterCurrentPull.x) > 8) + 2;
|
||||
else
|
||||
shift = 4;
|
||||
lara->ExtraVelocity.x -= lara->ExtraVelocity.x >> shift;
|
||||
lara->WaterCurrentPull.x -= lara->WaterCurrentPull.x >> shift;
|
||||
|
||||
if (abs(lara->ExtraVelocity.x) < 4)
|
||||
lara->ExtraVelocity.x = 0;
|
||||
if (abs(lara->WaterCurrentPull.x) < 4)
|
||||
lara->WaterCurrentPull.x = 0;
|
||||
|
||||
if (abs(lara->ExtraVelocity.z) <= 16)
|
||||
shift = (abs(lara->ExtraVelocity.z) > 8) + 2;
|
||||
if (abs(lara->WaterCurrentPull.z) <= 16)
|
||||
shift = (abs(lara->WaterCurrentPull.z) > 8) + 2;
|
||||
else
|
||||
shift = 4;
|
||||
lara->ExtraVelocity.z -= lara->ExtraVelocity.z >> shift;
|
||||
lara->WaterCurrentPull.z -= lara->WaterCurrentPull.z >> shift;
|
||||
|
||||
if (abs(lara->ExtraVelocity.z) < 4)
|
||||
lara->ExtraVelocity.z = 0;
|
||||
if (abs(lara->WaterCurrentPull.z) < 4)
|
||||
lara->WaterCurrentPull.z = 0;
|
||||
|
||||
if (!lara->ExtraVelocity.x && !lara->ExtraVelocity.z)
|
||||
if (!lara->WaterCurrentPull.x && !lara->WaterCurrentPull.z)
|
||||
return;
|
||||
}
|
||||
|
||||
item->Position.xPos += lara->ExtraVelocity.x >> 8;
|
||||
item->Position.zPos += lara->ExtraVelocity.z >> 8;
|
||||
lara->Control.WaterCurrentActive = 0;
|
||||
item->Position.xPos += lara->WaterCurrentPull.x >> 8;
|
||||
item->Position.zPos += lara->WaterCurrentPull.z >> 8;
|
||||
lara->WaterCurrentActive = 0;
|
||||
|
||||
coll->Setup.ForwardAngle = phd_atan(item->Position.zPos - coll->Setup.OldPosition.z, item->Position.xPos - coll->Setup.OldPosition.x);
|
||||
coll->Setup.Height = LARA_HEIGHT_CRAWL;
|
||||
|
|
|
@ -1006,7 +1006,7 @@ bool TestLaraWaterClimbOut(ITEM_INFO* item, COLL_INFO* coll)
|
|||
return false;
|
||||
|
||||
if (lara->Control.HandStatus != HandStatus::Free &&
|
||||
(lara->Control.HandStatus != HandStatus::WeaponReady || lara->Control.WeaponControl.GunType != WEAPON_FLARE))
|
||||
(lara->Control.HandStatus != HandStatus::WeaponReady || lara->Control.Weapon.GunType != WEAPON_FLARE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1091,7 +1091,7 @@ bool TestLaraLadderClimbOut(ITEM_INFO* item, COLL_INFO* coll) // NEW function fo
|
|||
}
|
||||
|
||||
if (lara->Control.HandStatus != HandStatus::Free &&
|
||||
(lara->Control.HandStatus != HandStatus::WeaponReady || lara->Control.WeaponControl.GunType != WEAPON_FLARE))
|
||||
(lara->Control.HandStatus != HandStatus::WeaponReady || lara->Control.Weapon.GunType != WEAPON_FLARE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1298,7 +1298,7 @@ bool TestLaraPose(ITEM_INFO* item, COLL_INFO* coll)
|
|||
|
||||
if (!(TrInput & (IN_FLARE | IN_DRAW)) && // Avoid unsightly concurrent actions.
|
||||
lara->Control.HandStatus == HandStatus::Free && // Hands are free.
|
||||
(lara->Control.WeaponControl.GunType != WEAPON_FLARE || // Flare is not being handled. TODO: Will she pose with weapons drawn?
|
||||
(lara->Control.Weapon.GunType != WEAPON_FLARE || // Flare is not being handled. TODO: Will she pose with weapons drawn?
|
||||
lara->Flare.Life) &&
|
||||
lara->Vehicle == NO_ITEM) // Not in a vehicle.
|
||||
{
|
||||
|
@ -1660,7 +1660,7 @@ bool TestLaraCrouchRoll(ITEM_INFO* item, COLL_INFO* coll)
|
|||
(probe.Position.Ceiling - y) < -LARA_HEIGHT_CRAWL && // Within lowest ceiling bound.
|
||||
!probe.Position.FloorSlope && // Not a slope.
|
||||
lara->WaterSurfaceDist >= -CLICK(1) && // Water depth is optically permissive.
|
||||
(lara->Control.WeaponControl.GunType != WEAPON_FLARE || // Not handling flare.
|
||||
(lara->Control.Weapon.GunType != WEAPON_FLARE || // Not handling flare.
|
||||
lara->Flare.Life))
|
||||
{
|
||||
return true;
|
||||
|
@ -1675,7 +1675,7 @@ bool TestLaraCrouchToCrawl(ITEM_INFO* item)
|
|||
|
||||
if (!(TrInput & (IN_FLARE | IN_DRAW)) && // Avoid unsightly concurrent actions.
|
||||
lara->Control.HandStatus == HandStatus::Free && // Hands are free.
|
||||
(lara->Control.WeaponControl.GunType != WEAPON_FLARE || // Not handling flare.
|
||||
(lara->Control.Weapon.GunType != WEAPON_FLARE || // Not handling flare.
|
||||
lara->Flare.Life))
|
||||
{
|
||||
return true;
|
||||
|
@ -2439,7 +2439,7 @@ bool TestLaraTightropeDismount(ITEM_INFO* item, COLL_INFO* coll)
|
|||
auto probe = GetCollisionResult(item);
|
||||
|
||||
if (probe.Position.Floor == item->Position.yPos &&
|
||||
lara->Control.TightropeControl.CanDismount)
|
||||
lara->Control.Tightrope.CanDismount)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
auto* weapon = &Weapons[(int)weaponType];
|
||||
auto* p = &PistolsTable[(int)lara->Control.WeaponControl.GunType];
|
||||
auto* p = &PistolsTable[(int)lara->Control.Weapon.GunType];
|
||||
|
||||
int soundPlayed = false;
|
||||
short angleLeft[2], angleRight[2];
|
||||
|
@ -128,7 +128,7 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
soundPlayed = true;
|
||||
|
||||
if (weaponType == LaraWeaponType::WEAPON_UZI)
|
||||
lara->Control.WeaponControl.UziRight = true;
|
||||
lara->Control.Weapon.UziRight = true;
|
||||
|
||||
Statistics.Game.AmmoUsed++;
|
||||
}
|
||||
|
@ -137,10 +137,10 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
// go to (3) SHOOT_CONTINUE start frame
|
||||
frameRight = p->RecoilAnim;
|
||||
}
|
||||
else if (lara->Control.WeaponControl.UziRight)
|
||||
else if (lara->Control.Weapon.UziRight)
|
||||
{
|
||||
SoundEffect(weapon->SampleNum + 1, &laraItem->Position, 0);
|
||||
lara->Control.WeaponControl.UziRight = false;
|
||||
lara->Control.Weapon.UziRight = false;
|
||||
}
|
||||
}
|
||||
// at or beyond (3) SHOOT_CONTINUE start frame
|
||||
|
@ -149,7 +149,7 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
if (weaponType == LaraWeaponType::WEAPON_UZI)
|
||||
{
|
||||
SoundEffect(weapon->SampleNum, &laraItem->Position, 0);
|
||||
lara->Control.WeaponControl.UziRight = true;
|
||||
lara->Control.Weapon.UziRight = true;
|
||||
}
|
||||
|
||||
// increment toward (3) SHOOT_CONTINUE end frame (finish recoil before allowing to shoot again)
|
||||
|
@ -180,10 +180,10 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
//else if ((frameRight > 0) && (frameRight <= p->draw1Anim2))
|
||||
// frameRight--;
|
||||
|
||||
if (lara->Control.WeaponControl.UziRight)
|
||||
if (lara->Control.Weapon.UziRight)
|
||||
{
|
||||
SoundEffect(weapon->SampleNum + 1, &laraItem->Position, 0);
|
||||
lara->Control.WeaponControl.UziRight = false;
|
||||
lara->Control.Weapon.UziRight = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,17 +225,17 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
}
|
||||
|
||||
if (weaponType == LaraWeaponType::WEAPON_UZI)
|
||||
lara->Control.WeaponControl.UziLeft = true;
|
||||
lara->Control.Weapon.UziLeft = true;
|
||||
|
||||
Statistics.Game.AmmoUsed++;
|
||||
}
|
||||
|
||||
frameLeft = p->RecoilAnim;
|
||||
}
|
||||
else if (lara->Control.WeaponControl.UziLeft)
|
||||
else if (lara->Control.Weapon.UziLeft)
|
||||
{
|
||||
SoundEffect(weapon->SampleNum + 1, &laraItem->Position, 0);
|
||||
lara->Control.WeaponControl.UziLeft = false;
|
||||
lara->Control.Weapon.UziLeft = false;
|
||||
}
|
||||
}
|
||||
else if (frameLeft >= p->RecoilAnim)
|
||||
|
@ -243,7 +243,7 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
if (weaponType == LaraWeaponType::WEAPON_UZI)
|
||||
{
|
||||
SoundEffect(weapon->SampleNum, &laraItem->Position, 0);
|
||||
lara->Control.WeaponControl.UziLeft = true;
|
||||
lara->Control.Weapon.UziLeft = true;
|
||||
}
|
||||
|
||||
frameLeft++;
|
||||
|
@ -267,10 +267,10 @@ void AnimatePistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
//else if (frameLeft > 0 && frameLeft <= p->draw1Anim2)
|
||||
// frameLeft--; // UnLock ARM
|
||||
|
||||
if (lara->Control.WeaponControl.UziLeft)
|
||||
if (lara->Control.Weapon.UziLeft)
|
||||
{
|
||||
SoundEffect(weapon->SampleNum + 1, &laraItem->Position, 0);
|
||||
lara->Control.WeaponControl.UziLeft = false;
|
||||
lara->Control.Weapon.UziLeft = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ void ReadyPistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
void DrawPistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
||||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
auto* p = &PistolsTable[(int)lara->Control.WeaponControl.GunType];
|
||||
auto* p = &PistolsTable[(int)lara->Control.Weapon.GunType];
|
||||
|
||||
int frame = lara->LeftArm.FrameNumber + 1;
|
||||
|
||||
|
@ -372,7 +372,7 @@ void UndrawPistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
auto* weapon = &Weapons[(int)weaponType];
|
||||
auto* p = &PistolsTable[(int)lara->Control.WeaponControl.GunType];
|
||||
auto* p = &PistolsTable[(int)lara->Control.Weapon.GunType];
|
||||
|
||||
int frameLeft = lara->LeftArm.FrameNumber;
|
||||
|
||||
|
@ -473,7 +473,7 @@ void UndrawPistols(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
void SetArmInfo(ITEM_INFO* laraItem, ArmInfo* arm, int frame)
|
||||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
auto* p = &PistolsTable[(int)lara->Control.WeaponControl.GunType];
|
||||
auto* p = &PistolsTable[(int)lara->Control.Weapon.GunType];
|
||||
|
||||
int animBase = Objects[(int)p->ObjectNumber].animIndex;
|
||||
|
||||
|
@ -495,21 +495,21 @@ void DrawPistolMeshes(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
if (weaponType != LaraWeaponType::WEAPON_REVOLVER)
|
||||
lara->Control.WeaponControl.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
lara->Control.Weapon.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
|
||||
lara->Control.WeaponControl.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
lara->Control.Weapon.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
|
||||
lara->meshPtrs[LM_RHAND] = Objects[WeaponObjectMesh(laraItem, weaponType)].meshIndex + LM_RHAND;
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[WeaponObjectMesh(laraItem, weaponType)].meshIndex + LM_RHAND;
|
||||
if (weaponType != LaraWeaponType::WEAPON_REVOLVER)
|
||||
lara->meshPtrs[LM_LHAND] = Objects[WeaponObjectMesh(laraItem, weaponType)].meshIndex + LM_LHAND;
|
||||
lara->MeshPtrs[LM_LHAND] = Objects[WeaponObjectMesh(laraItem, weaponType)].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void UndrawPistolMeshRight(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
||||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
lara->meshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
lara->Control.WeaponControl.HolsterInfo.RightHolster = HolsterSlotForWeapon(weaponType);
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
lara->Control.Weapon.HolsterInfo.RightHolster = HolsterSlotForWeapon(weaponType);
|
||||
}
|
||||
|
||||
void UndrawPistolMeshLeft(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
||||
|
@ -518,7 +518,7 @@ void UndrawPistolMeshLeft(ITEM_INFO* laraItem, LaraWeaponType weaponType)
|
|||
|
||||
if (weaponType != LaraWeaponType::WEAPON_REVOLVER)
|
||||
{
|
||||
lara->meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
lara->Control.WeaponControl.HolsterInfo.LeftHolster = HolsterSlotForWeapon(weaponType);
|
||||
lara->MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
lara->Control.Weapon.HolsterInfo.LeftHolster = HolsterSlotForWeapon(weaponType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ void AnimateLara(ITEM_INFO* item)
|
|||
item->VerticalVelocity += lara->ExtraVelocity.y;
|
||||
item->LateralVelocity += lara->ExtraVelocity.z;
|
||||
|
||||
if (lara->Control.RopeControl.Ptr != -1)
|
||||
if (lara->Control.Rope.Ptr != -1)
|
||||
DelAlignLaraToRope(item);
|
||||
|
||||
if (!lara->Control.IsMoving)
|
||||
|
|
|
@ -1230,7 +1230,7 @@ void BinocularCamera(ITEM_INFO* item)
|
|||
if (LaserSight)
|
||||
{
|
||||
int firing = 0;
|
||||
Ammo& ammo = GetAmmo(item, lara->Control.WeaponControl.GunType);
|
||||
Ammo& ammo = GetAmmo(item, lara->Control.Weapon.GunType);
|
||||
|
||||
if (!(InputBusy & IN_ACTION) ||
|
||||
WeaponDelay ||
|
||||
|
@ -1238,7 +1238,7 @@ void BinocularCamera(ITEM_INFO* item)
|
|||
{
|
||||
if (!(InputBusy & IN_ACTION))
|
||||
{
|
||||
if (lara->Control.WeaponControl.GunType != WEAPON_CROSSBOW)
|
||||
if (lara->Control.Weapon.GunType != WEAPON_CROSSBOW)
|
||||
WeaponDelay = 0;
|
||||
|
||||
LSHKShotsFired = 0;
|
||||
|
@ -1247,7 +1247,7 @@ void BinocularCamera(ITEM_INFO* item)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
{
|
||||
firing = 1;
|
||||
WeaponDelay = 16;
|
||||
|
@ -1258,7 +1258,7 @@ void BinocularCamera(ITEM_INFO* item)
|
|||
|
||||
Camera.bounce = -16 - (GetRandomControl() & 0x1F);
|
||||
}
|
||||
else if (lara->Control.WeaponControl.GunType == WEAPON_CROSSBOW)
|
||||
else if (lara->Control.Weapon.GunType == WEAPON_CROSSBOW)
|
||||
{
|
||||
firing = 1;
|
||||
WeaponDelay = 32;
|
||||
|
|
|
@ -721,9 +721,9 @@ bool ItemPushItem(ITEM_INFO* item, ITEM_INFO* item2, COLL_INFO* coll, bool spazo
|
|||
dx -= c * rx + s * rz;
|
||||
dz -= c * rz - s * rx;
|
||||
|
||||
lara->hitDirection = (item2->Position.yRot - phd_atan(dz, dz) - ANGLE(135)) / 16384;
|
||||
lara->HitDirection = (item2->Position.yRot - phd_atan(dz, dz) - ANGLE(135)) / 16384;
|
||||
|
||||
if (!lara->hitFrame && !lara->SpasmEffectCount)
|
||||
if (!lara->HitFrame && !lara->SpasmEffectCount)
|
||||
{
|
||||
SoundEffect(SFX_TR4_LARA_INJURY, &item2->Position, 0);
|
||||
lara->SpasmEffectCount = GenerateInt(15, 35);
|
||||
|
@ -732,9 +732,9 @@ bool ItemPushItem(ITEM_INFO* item, ITEM_INFO* item2, COLL_INFO* coll, bool spazo
|
|||
if (lara->SpasmEffectCount)
|
||||
lara->SpasmEffectCount--;
|
||||
|
||||
lara->hitFrame++;
|
||||
if (lara->hitFrame > 34)
|
||||
lara->hitFrame = 34;
|
||||
lara->HitFrame++;
|
||||
if (lara->HitFrame > 34)
|
||||
lara->HitFrame = 34;
|
||||
}
|
||||
|
||||
coll->Setup.LowerFloorBound = NO_LOWER_BOUND;
|
||||
|
@ -1672,7 +1672,7 @@ void DoObjectCollision(ITEM_INFO* l, COLL_INFO* coll) // previously LaraBaddieCo
|
|||
coll->HitStatic = false;
|
||||
|
||||
if (l == LaraItem)
|
||||
Lara.hitDirection = -1;
|
||||
Lara.HitDirection = -1;
|
||||
|
||||
if (l->HitPoints > 0)
|
||||
{
|
||||
|
@ -1718,8 +1718,8 @@ void DoObjectCollision(ITEM_INFO* l, COLL_INFO* coll) // previously LaraBaddieCo
|
|||
}
|
||||
}
|
||||
|
||||
if (l == LaraItem && Lara.hitDirection == -1)
|
||||
Lara.hitFrame = 0;
|
||||
if (l == LaraItem && Lara.HitDirection == -1)
|
||||
Lara.HitFrame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1776,11 +1776,11 @@ void CreatureCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
if (frame->boundingBox.Y2 - frame->boundingBox.Y1 > STEP_SIZE)
|
||||
{
|
||||
int angle = (l->Position.yRot - phd_atan(z - c * rx - s * rz, x - c * rx + s * rz) - ANGLE(135)) / 16384;
|
||||
Lara.hitDirection = (short)angle;
|
||||
Lara.HitDirection = (short)angle;
|
||||
// TODO: check if a second Lara.hitFrame++; is required there !
|
||||
Lara.hitFrame++;
|
||||
if (Lara.hitFrame > 30)
|
||||
Lara.hitFrame = 30;
|
||||
Lara.HitFrame++;
|
||||
if (Lara.HitFrame > 30)
|
||||
Lara.HitFrame = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,8 +242,8 @@ void CreatureKill(ITEM_INFO* item, int killAnim, int killState, int laraKillStat
|
|||
|
||||
Lara.ExtraAnim = 1;
|
||||
Lara.Control.HandStatus = HandStatus::Busy;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
Lara.hitDirection = -1;
|
||||
Lara.Control.Weapon.GunType = WEAPON_NONE;
|
||||
Lara.HitDirection = -1;
|
||||
Lara.Air = -1;
|
||||
|
||||
Camera.pos.roomNumber = LaraItem->RoomNumber;
|
||||
|
|
|
@ -251,9 +251,9 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode)
|
|||
}
|
||||
else if (BinocularRange == 0)
|
||||
{
|
||||
if (Lara.Control.HandStatus == HandStatus::WeaponReady && ((Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER && Lara.Weapons[WEAPON_REVOLVER].HasLasersight) ||
|
||||
(Lara.Control.WeaponControl.GunType == WEAPON_HK) ||
|
||||
(Lara.Control.WeaponControl.GunType == WEAPON_CROSSBOW && Lara.Weapons[WEAPON_CROSSBOW].HasLasersight)))
|
||||
if (Lara.Control.HandStatus == HandStatus::WeaponReady && ((Lara.Control.Weapon.GunType == WEAPON_REVOLVER && Lara.Weapons[WEAPON_REVOLVER].HasLasersight) ||
|
||||
(Lara.Control.Weapon.GunType == WEAPON_HK) ||
|
||||
(Lara.Control.Weapon.GunType == WEAPON_CROSSBOW && Lara.Weapons[WEAPON_CROSSBOW].HasLasersight)))
|
||||
{
|
||||
BinocularRange = 128;
|
||||
BinocularOldCamera = Camera.oldType;
|
||||
|
@ -612,7 +612,7 @@ GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame)
|
|||
Camera.target.y = LaraItem->Position.yPos;
|
||||
Camera.target.z = LaraItem->Position.zPos;
|
||||
|
||||
int x = Lara.Control.WeaponControl.WeaponItem;
|
||||
int x = Lara.Control.Weapon.WeaponItem;
|
||||
|
||||
RequiredStartPos = false;
|
||||
InitialiseGame = false;
|
||||
|
|
|
@ -85,12 +85,12 @@ void FlashOrange(ITEM_INFO* item)
|
|||
|
||||
void MeshSwapToPour(ITEM_INFO* item)
|
||||
{
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[item->ItemFlags[2]].meshIndex + LM_LHAND;
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[item->ItemFlags[2]].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void MeshSwapFromPour(ITEM_INFO* item)
|
||||
{
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void Pickup(ITEM_INFO* item)
|
||||
|
@ -135,29 +135,29 @@ void SetFog(ITEM_INFO* item)
|
|||
|
||||
void DrawLeftPistol(ITEM_INFO* item)
|
||||
{
|
||||
if (Lara.meshPtrs[LM_LHAND] == Objects[ID_LARA_SKIN].meshIndex + LM_LHAND)
|
||||
if (Lara.MeshPtrs[LM_LHAND] == Objects[ID_LARA_SKIN].meshIndex + LM_LHAND)
|
||||
{
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[WeaponObjectMesh(LaraItem, WEAPON_PISTOLS)].meshIndex + LM_LHAND;
|
||||
Lara.Control.WeaponControl.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[WeaponObjectMesh(LaraItem, WEAPON_PISTOLS)].meshIndex + LM_LHAND;
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
Lara.Control.WeaponControl.HolsterInfo.LeftHolster = HolsterSlotForWeapon(static_cast<LaraWeaponType>(WEAPON_PISTOLS));
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = HolsterSlotForWeapon(static_cast<LaraWeaponType>(WEAPON_PISTOLS));
|
||||
}
|
||||
}
|
||||
|
||||
void DrawRightPistol(ITEM_INFO* item)
|
||||
{
|
||||
if (Lara.meshPtrs[LM_RHAND] == Objects[ID_LARA_SKIN].meshIndex + LM_RHAND)
|
||||
if (Lara.MeshPtrs[LM_RHAND] == Objects[ID_LARA_SKIN].meshIndex + LM_RHAND)
|
||||
{
|
||||
Lara.meshPtrs[LM_RHAND] = Objects[WeaponObjectMesh(LaraItem, WEAPON_PISTOLS)].meshIndex + LM_RHAND;
|
||||
Lara.Control.WeaponControl.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
Lara.MeshPtrs[LM_RHAND] = Objects[WeaponObjectMesh(LaraItem, WEAPON_PISTOLS)].meshIndex + LM_RHAND;
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lara.meshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
Lara.Control.WeaponControl.HolsterInfo.RightHolster = HolsterSlotForWeapon(static_cast<LaraWeaponType>(WEAPON_PISTOLS));
|
||||
Lara.MeshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = HolsterSlotForWeapon(static_cast<LaraWeaponType>(WEAPON_PISTOLS));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,17 +210,17 @@ void LaraLocationPad(ITEM_INFO* item)
|
|||
{
|
||||
FlipEffect = -1;
|
||||
|
||||
Lara.location = TriggerTimer;
|
||||
Lara.locationPad = TriggerTimer;
|
||||
Lara.Location = TriggerTimer;
|
||||
Lara.LocationPad = TriggerTimer;
|
||||
}
|
||||
|
||||
void LaraLocation(ITEM_INFO* item)
|
||||
{
|
||||
FlipEffect = -1;
|
||||
|
||||
Lara.location = TriggerTimer;
|
||||
if (Lara.highestLocation < TriggerTimer)
|
||||
Lara.highestLocation = TriggerTimer;
|
||||
Lara.Location = TriggerTimer;
|
||||
if (Lara.HighestLocation < TriggerTimer)
|
||||
Lara.HighestLocation = TriggerTimer;
|
||||
}
|
||||
|
||||
void ExplosionFX(ITEM_INFO* item)
|
||||
|
@ -232,10 +232,10 @@ void ExplosionFX(ITEM_INFO* item)
|
|||
|
||||
void SwapCrowbar(ITEM_INFO* item)
|
||||
{
|
||||
if (Lara.meshPtrs[LM_RHAND] == Objects[ID_LARA_SKIN].meshIndex + LM_RHAND)
|
||||
Lara.meshPtrs[LM_RHAND] = Objects[ID_LARA_CROWBAR_ANIM].meshIndex + LM_RHAND;
|
||||
if (Lara.MeshPtrs[LM_RHAND] == Objects[ID_LARA_SKIN].meshIndex + LM_RHAND)
|
||||
Lara.MeshPtrs[LM_RHAND] = Objects[ID_LARA_CROWBAR_ANIM].meshIndex + LM_RHAND;
|
||||
else
|
||||
Lara.meshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
Lara.MeshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
}
|
||||
|
||||
void ActivateKey(ITEM_INFO* item)
|
||||
|
|
|
@ -86,10 +86,10 @@ bool GetTargetOnLOS(GAME_VECTOR* src, GAME_VECTOR* dest, int drawTarget, int fir
|
|||
|
||||
if (firing && LaserSight)
|
||||
{
|
||||
Lara.Control.WeaponControl.HasFired = true;
|
||||
Lara.Control.WeaponControl.Fired = true;
|
||||
Lara.Control.Weapon.HasFired = true;
|
||||
Lara.Control.Weapon.Fired = true;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
SoundEffect(SFX_TR4_DESSERT_EAGLE_FIRE, NULL, 0);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ bool GetTargetOnLOS(GAME_VECTOR* src, GAME_VECTOR* dest, int drawTarget, int fir
|
|||
|
||||
if (firing)
|
||||
{
|
||||
if (Lara.Control.WeaponControl.GunType != WEAPON_CROSSBOW)
|
||||
if (Lara.Control.Weapon.GunType != WEAPON_CROSSBOW)
|
||||
{
|
||||
if (itemNumber < 0)
|
||||
{
|
||||
|
@ -170,11 +170,11 @@ bool GetTargetOnLOS(GAME_VECTOR* src, GAME_VECTOR* dest, int drawTarget, int fir
|
|||
}
|
||||
else
|
||||
{
|
||||
if (drawTarget && (Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER ||
|
||||
Lara.Control.WeaponControl.GunType == WEAPON_HK))
|
||||
if (drawTarget && (Lara.Control.Weapon.GunType == WEAPON_REVOLVER ||
|
||||
Lara.Control.Weapon.GunType == WEAPON_HK))
|
||||
{
|
||||
if (Objects[item->ObjectNumber].intelligent)
|
||||
HitTarget(LaraItem, item, &target, Weapons[Lara.Control.WeaponControl.GunType].Damage, 0);
|
||||
HitTarget(LaraItem, item, &target, Weapons[Lara.Control.Weapon.GunType].Damage, 0);
|
||||
else
|
||||
{
|
||||
// TR5
|
||||
|
@ -197,7 +197,7 @@ bool GetTargetOnLOS(GAME_VECTOR* src, GAME_VECTOR* dest, int drawTarget, int fir
|
|||
|
||||
item->HitStatus = true;
|
||||
if (!Objects[item->ObjectNumber].undead)
|
||||
item->HitPoints -= Weapons[Lara.Control.WeaponControl.GunType].Damage;
|
||||
item->HitPoints -= Weapons[Lara.Control.Weapon.GunType].Damage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ bool GetTargetOnLOS(GAME_VECTOR* src, GAME_VECTOR* dest, int drawTarget, int fir
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_CROSSBOW)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_CROSSBOW)
|
||||
{
|
||||
if (firing && LaserSight)
|
||||
FireCrossBowFromLaserSight(LaraItem, src, &target);
|
||||
|
|
|
@ -624,7 +624,7 @@ void TestTriggers(FLOOR_INFO* floor, int x, int y, int z, bool heavy, int heavyF
|
|||
break;
|
||||
|
||||
case TO_SINK:
|
||||
Lara.Control.WaterCurrentActive = value + 1;
|
||||
Lara.WaterCurrentActive = value + 1;
|
||||
break;
|
||||
|
||||
case TO_FLIPMAP:
|
||||
|
|
|
@ -291,7 +291,7 @@ void UpdateSparks()
|
|||
float alpha = (spark->sLife - spark->life) / (float)spark->sLife;
|
||||
spark->size = lerp(spark->sSize, spark->dSize, alpha);
|
||||
|
||||
if (spark->flags & SP_FIRE && !Lara.burn || spark->flags & SP_DAMAGE)
|
||||
if (spark->flags & SP_FIRE && !Lara.Burn || spark->flags & SP_DAMAGE)
|
||||
{
|
||||
ds = spark->size * (spark->scalar / 2.0);
|
||||
|
||||
|
|
|
@ -60,9 +60,9 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
|
||||
if (framePtr == NULL)
|
||||
{
|
||||
if (lara->hitDirection >= 0)
|
||||
if (lara->HitDirection >= 0)
|
||||
{
|
||||
switch (lara->hitDirection)
|
||||
switch (lara->HitDirection)
|
||||
{
|
||||
case NORTH:
|
||||
if (lara->Control.IsLow)
|
||||
|
@ -93,7 +93,7 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
break;
|
||||
}
|
||||
|
||||
frame = &g_Level.Frames[g_Level.Anims[spaz].framePtr + lara->hitFrame];
|
||||
frame = &g_Level.Frames[g_Level.Anims[spaz].framePtr + lara->HitFrame];
|
||||
}
|
||||
else
|
||||
frame = GetBestFrame(item);
|
||||
|
@ -104,7 +104,7 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
}
|
||||
|
||||
// Get Lara's spheres in absolute coords, for head, torso, hips and upper arms
|
||||
MESH* mesh = &g_Level.Meshes[lara->meshPtrs[LM_HIPS]];
|
||||
MESH* mesh = &g_Level.Meshes[lara->MeshPtrs[LM_HIPS]];
|
||||
PHD_VECTOR pos = { (int)mesh->sphere.Center.x, (int)mesh->sphere.Center.y, (int)mesh->sphere.Center.z };
|
||||
GetLaraJointPosition(&pos, LM_HIPS);
|
||||
sphere[0].x = pos.x;
|
||||
|
@ -112,7 +112,7 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
sphere[0].z = pos.z;
|
||||
sphere[0].r = (int)mesh->sphere.Radius;
|
||||
|
||||
mesh = &g_Level.Meshes[lara->meshPtrs[LM_TORSO]];
|
||||
mesh = &g_Level.Meshes[lara->MeshPtrs[LM_TORSO]];
|
||||
pos = { (int)mesh->sphere.Center.x - 10, (int)mesh->sphere.Center.y, (int)mesh->sphere.Center.z + 25 }; // Repositioning sphere - from tomb5
|
||||
GetLaraJointPosition(&pos, LM_TORSO);
|
||||
sphere[1].x = pos.x;
|
||||
|
@ -122,7 +122,7 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
if (youngLara)
|
||||
sphere[1].r = sphere[1].r - ((sphere[1].r >> 2) + (sphere[1].r >> 3));
|
||||
|
||||
mesh = &g_Level.Meshes[lara->meshPtrs[LM_HEAD]];
|
||||
mesh = &g_Level.Meshes[lara->MeshPtrs[LM_HEAD]];
|
||||
pos = { (int)mesh->sphere.Center.x - 2, (int)mesh->sphere.Center.y, (int)mesh->sphere.Center.z }; // Repositioning sphere - from tomb5
|
||||
GetLaraJointPosition(&pos, LM_HEAD);
|
||||
sphere[2].x = pos.x;
|
||||
|
@ -130,7 +130,7 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
sphere[2].z = pos.z;
|
||||
sphere[2].r = (int)mesh->sphere.Radius;
|
||||
|
||||
mesh = &g_Level.Meshes[lara->meshPtrs[LM_RINARM]];
|
||||
mesh = &g_Level.Meshes[lara->MeshPtrs[LM_RINARM]];
|
||||
pos = { (int)mesh->sphere.Center.x, (int)mesh->sphere.Center.y, (int)mesh->sphere.Center.z };
|
||||
GetLaraJointPosition(&pos, LM_RINARM);
|
||||
sphere[3].x = pos.x;
|
||||
|
@ -138,7 +138,7 @@ void HairControl(ITEM_INFO* item, int ponytail, ANIM_FRAME* framePtr)
|
|||
sphere[3].z = pos.z;
|
||||
sphere[3].r = (int)(4.0f * mesh->sphere.Radius / 3.0f); // Resizing sphere - from tomb5
|
||||
|
||||
mesh = &g_Level.Meshes[lara->meshPtrs[LM_LINARM]];
|
||||
mesh = &g_Level.Meshes[lara->MeshPtrs[LM_LINARM]];
|
||||
pos = { (int)mesh->sphere.Center.x, (int)mesh->sphere.Center.y, (int)mesh->sphere.Center.z };
|
||||
GetLaraJointPosition(&pos, LM_LINARM);
|
||||
sphere[4].x = pos.x;
|
||||
|
|
|
@ -21,13 +21,13 @@ namespace TEN::Effects::Lara
|
|||
|
||||
auto lara = (LaraInfo*&)item->Data;
|
||||
|
||||
if (!lara->burn && !lara->BurnSmoke)
|
||||
if (!lara->Burn && !lara->BurnSmoke)
|
||||
{
|
||||
short fxNum = CreateNewEffect(item->RoomNumber);
|
||||
if (fxNum != NO_ITEM)
|
||||
{
|
||||
EffectList[fxNum].objectNumber = ID_FLAME;
|
||||
lara->burn = true;
|
||||
lara->Burn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1167,11 +1167,11 @@ void TriggerLaraDrips(ITEM_INFO* item)
|
|||
auto room = GetRoom(item->Location, pos.x, pos.y, pos.z).roomNumber;
|
||||
|
||||
if (g_Level.Rooms[room].flags & ENV_FLAG_WATER)
|
||||
Lara.wet[i] = UCHAR_MAX;
|
||||
Lara.Wet[i] = UCHAR_MAX;
|
||||
|
||||
if (Lara.wet[i]
|
||||
if (Lara.Wet[i]
|
||||
&& !LaraNodeUnderwater[i]
|
||||
&& (GetRandomControl() & 0x1FF) < Lara.wet[i])
|
||||
&& (GetRandomControl() & 0x1FF) < Lara.Wet[i])
|
||||
{
|
||||
|
||||
pos.x = (GetRandomControl() & 0x1F) - 16;
|
||||
|
@ -1192,10 +1192,10 @@ void TriggerLaraDrips(ITEM_INFO* item)
|
|||
dptr->life = (GetRandomControl() & 0x1F) + 8;
|
||||
dptr->roomNumber = LaraItem->RoomNumber;
|
||||
|
||||
if (Lara.wet[i] >= 4)
|
||||
Lara.wet[i] -= 4;
|
||||
if (Lara.Wet[i] >= 4)
|
||||
Lara.Wet[i] -= 4;
|
||||
else
|
||||
Lara.wet[i] = 0;
|
||||
Lara.Wet[i] = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1707,23 +1707,23 @@ void GuiController::ConstructObjectList()
|
|||
if (Lara.Crowbar)
|
||||
InsertObjectIntoList(INV_OBJECT_CROWBAR);
|
||||
|
||||
if (Lara.hasBeetleThings)
|
||||
if (Lara.HasBeetleThings)
|
||||
{
|
||||
if (Lara.hasBeetleThings & 1)
|
||||
if (Lara.HasBeetleThings & 1)
|
||||
InsertObjectIntoList(INV_OBJECT_BEETLE);
|
||||
|
||||
if (Lara.hasBeetleThings & 2)
|
||||
if (Lara.HasBeetleThings & 2)
|
||||
InsertObjectIntoList(INV_OBJECT_BEETLE_PART1);
|
||||
|
||||
if (Lara.hasBeetleThings & 4)
|
||||
if (Lara.HasBeetleThings & 4)
|
||||
InsertObjectIntoList(INV_OBJECT_BEETLE_PART2);
|
||||
}
|
||||
|
||||
if (Lara.smallWaterskin)
|
||||
InsertObjectIntoList((Lara.smallWaterskin - 1) + INV_OBJECT_SMOL_WATERSKIN);
|
||||
if (Lara.SmallWaterskin)
|
||||
InsertObjectIntoList((Lara.SmallWaterskin - 1) + INV_OBJECT_SMOL_WATERSKIN);
|
||||
|
||||
if (Lara.bigWaterskin)
|
||||
InsertObjectIntoList((Lara.bigWaterskin - 1) + INV_OBJECT_BIG_WATERSKIN);
|
||||
if (Lara.BigWaterskin)
|
||||
InsertObjectIntoList((Lara.BigWaterskin - 1) + INV_OBJECT_BIG_WATERSKIN);
|
||||
|
||||
for (int i = 0; i < NUM_PUZZLES; i++)
|
||||
if (Lara.Puzzles[i])
|
||||
|
@ -1811,20 +1811,20 @@ void GuiController::ConstructCombineObjectList()
|
|||
InsertObjectIntoList_v2(INV_OBJECT_SILENCER);
|
||||
}
|
||||
|
||||
if (Lara.hasBeetleThings)
|
||||
if (Lara.HasBeetleThings)
|
||||
{
|
||||
if (Lara.hasBeetleThings & 2)
|
||||
if (Lara.HasBeetleThings & 2)
|
||||
InsertObjectIntoList_v2(INV_OBJECT_BEETLE_PART1);
|
||||
|
||||
if (Lara.hasBeetleThings & 4)
|
||||
if (Lara.HasBeetleThings & 4)
|
||||
InsertObjectIntoList_v2(INV_OBJECT_BEETLE_PART2);
|
||||
}
|
||||
|
||||
if (Lara.smallWaterskin)
|
||||
InsertObjectIntoList_v2(Lara.smallWaterskin - 1 + INV_OBJECT_SMOL_WATERSKIN);
|
||||
if (Lara.SmallWaterskin)
|
||||
InsertObjectIntoList_v2(Lara.SmallWaterskin - 1 + INV_OBJECT_SMOL_WATERSKIN);
|
||||
|
||||
if (Lara.bigWaterskin)
|
||||
InsertObjectIntoList_v2(Lara.bigWaterskin - 1 + INV_OBJECT_BIG_WATERSKIN);
|
||||
if (Lara.BigWaterskin)
|
||||
InsertObjectIntoList_v2(Lara.BigWaterskin - 1 + INV_OBJECT_BIG_WATERSKIN);
|
||||
|
||||
for (int i = 0; i < NUM_PUZZLE_PIECES; i++)
|
||||
if (Lara.PuzzlesCombo[i])
|
||||
|
@ -2008,12 +2008,12 @@ void GuiController::UseCurrentItem()
|
|||
{
|
||||
if (gmeobject == ID_PISTOLS_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_PISTOLS;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_PISTOLS;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_PISTOLS)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_PISTOLS)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
|
@ -2021,12 +2021,12 @@ void GuiController::UseCurrentItem()
|
|||
|
||||
if (gmeobject == ID_UZI_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_UZI;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_UZI;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_UZI)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_UZI)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
|
@ -2047,7 +2047,7 @@ void GuiController::UseCurrentItem()
|
|||
LaraItem->ActiveState != LS_CRAWL_BACK &&
|
||||
LaraItem->ActiveState != LS_CRAWL_TO_HANG)
|
||||
{
|
||||
if (Lara.Control.WeaponControl.GunType != WEAPON_FLARE)
|
||||
if (Lara.Control.Weapon.GunType != WEAPON_FLARE)
|
||||
{
|
||||
TrInput = IN_FLARE;
|
||||
LaraGun(LaraItem);
|
||||
|
@ -2087,7 +2087,7 @@ void GuiController::UseCurrentItem()
|
|||
|
||||
case INV_OBJECT_SMALL_MEDIPACK:
|
||||
|
||||
if ((LaraItem->HitPoints <= 0 || LaraItem->HitPoints >= 1000) && !Lara.Poisoned)
|
||||
if ((LaraItem->HitPoints <= 0 || LaraItem->HitPoints >= 1000) && !Lara.PoisonPotency)
|
||||
{
|
||||
SayNo();
|
||||
return;
|
||||
|
@ -2098,7 +2098,7 @@ void GuiController::UseCurrentItem()
|
|||
if (Lara.NumSmallMedipacks != -1)
|
||||
Lara.NumSmallMedipacks--;
|
||||
|
||||
Lara.Poisoned = 0;
|
||||
Lara.PoisonPotency = 0;
|
||||
LaraItem->HitPoints += 500;
|
||||
|
||||
if (LaraItem->HitPoints > 1000)
|
||||
|
@ -2114,7 +2114,7 @@ void GuiController::UseCurrentItem()
|
|||
|
||||
case INV_OBJECT_LARGE_MEDIPACK:
|
||||
|
||||
if ((LaraItem->HitPoints <= 0 || LaraItem->HitPoints >= 1000) && !Lara.Poisoned)
|
||||
if ((LaraItem->HitPoints <= 0 || LaraItem->HitPoints >= 1000) && !Lara.PoisonPotency)
|
||||
{
|
||||
SayNo();
|
||||
return;
|
||||
|
@ -2125,7 +2125,7 @@ void GuiController::UseCurrentItem()
|
|||
if (Lara.NumLargeMedipacks != -1)
|
||||
Lara.NumLargeMedipacks--;
|
||||
|
||||
Lara.Poisoned = 0;
|
||||
Lara.PoisonPotency = 0;
|
||||
LaraItem->HitPoints = 1000;
|
||||
|
||||
SoundEffect(SFX_TR4_MENU_MEDI, 0, SFX_ALWAYS);
|
||||
|
@ -2166,12 +2166,12 @@ void GuiController::UseCurrentItem()
|
|||
|
||||
if (gmeobject == ID_SHOTGUN_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_SHOTGUN;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_SHOTGUN;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_SHOTGUN)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
|
@ -2179,72 +2179,72 @@ void GuiController::UseCurrentItem()
|
|||
|
||||
if (gmeobject == ID_REVOLVER_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_REVOLVER;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_REVOLVER;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
}
|
||||
else if (gmeobject == ID_HK_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_HK;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_HK;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_HK)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_HK)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
}
|
||||
else if (gmeobject == ID_CROSSBOW_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_CROSSBOW;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_CROSSBOW;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_CROSSBOW)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_CROSSBOW)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
}
|
||||
else if (gmeobject == ID_GRENADE_GUN_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_GRENADE_LAUNCHER;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_GRENADE_LAUNCHER;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_GRENADE_LAUNCHER)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_GRENADE_LAUNCHER)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
}
|
||||
else if (gmeobject == ID_HARPOON_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_HARPOON_GUN;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_HARPOON_GUN;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_HARPOON_GUN)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_HARPOON_GUN)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
}
|
||||
else if (gmeobject == ID_ROCKET_LAUNCHER_ITEM)
|
||||
{
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_ROCKET_LAUNCHER;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_ROCKET_LAUNCHER;
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free)
|
||||
return;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_ROCKET_LAUNCHER)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_ROCKET_LAUNCHER)
|
||||
Lara.Control.HandStatus = HandStatus::DrawWeapon;
|
||||
|
||||
return;
|
||||
|
@ -3413,7 +3413,7 @@ void combine_revolver_lasersight(int flag)
|
|||
Lara.Weapons[WEAPON_REVOLVER].HasLasersight = 1;
|
||||
}
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free && Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
if (Lara.Control.HandStatus != HandStatus::Free && Lara.Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
{
|
||||
UndrawPistolMeshRight(LaraItem, WEAPON_REVOLVER);
|
||||
DrawPistolMeshes(LaraItem, WEAPON_REVOLVER);
|
||||
|
@ -3433,7 +3433,7 @@ void combine_crossbow_lasersight(int flag)
|
|||
Lara.Weapons[WEAPON_CROSSBOW].HasLasersight = 1;
|
||||
}
|
||||
|
||||
if (Lara.Control.HandStatus != HandStatus::Free && Lara.Control.WeaponControl.GunType == WEAPON_CROSSBOW)
|
||||
if (Lara.Control.HandStatus != HandStatus::Free && Lara.Control.Weapon.GunType == WEAPON_CROSSBOW)
|
||||
{
|
||||
UndrawShotgunMeshes(LaraItem, WEAPON_CROSSBOW);
|
||||
DrawShotgunMeshes(LaraItem, WEAPON_CROSSBOW);
|
||||
|
@ -3849,9 +3849,9 @@ void combine_Examine8(int flag)
|
|||
|
||||
void combine_ClockWorkBeetle(int flag)
|
||||
{
|
||||
Lara.hasBeetleThings &= 2;//remove combo1
|
||||
Lara.hasBeetleThings &= 4;//remove combo2
|
||||
Lara.hasBeetleThings |= 1;//get beetle
|
||||
Lara.HasBeetleThings &= 2;//remove combo1
|
||||
Lara.HasBeetleThings &= 4;//remove combo2
|
||||
Lara.HasBeetleThings |= 1;//get beetle
|
||||
}
|
||||
|
||||
bool GuiController::PerformWaterskinCombine(int flag)
|
||||
|
@ -3859,14 +3859,14 @@ bool GuiController::PerformWaterskinCombine(int flag)
|
|||
short small_liters, big_liters, small_capacity, big_capacity;
|
||||
int i;
|
||||
|
||||
small_liters = Lara.smallWaterskin - 1;//how many liters in the small one?
|
||||
big_liters = Lara.bigWaterskin - 1;//how many liters in the big one?
|
||||
small_liters = Lara.SmallWaterskin - 1;//how many liters in the small one?
|
||||
big_liters = Lara.BigWaterskin - 1;//how many liters in the big one?
|
||||
small_capacity = 3 - small_liters;//how many more liters can we fit in the small one?
|
||||
big_capacity = 5 - big_liters;//how many more liters can we fit in the big one?
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (Lara.bigWaterskin != 1 && small_capacity)//if the big one isn't empty and the small one isn't full
|
||||
if (Lara.BigWaterskin != 1 && small_capacity)//if the big one isn't empty and the small one isn't full
|
||||
{
|
||||
i = big_liters;
|
||||
|
||||
|
@ -3883,17 +3883,17 @@ bool GuiController::PerformWaterskinCombine(int flag)
|
|||
|
||||
} while (i);
|
||||
|
||||
Lara.smallWaterskin = small_liters + 1;
|
||||
Lara.bigWaterskin = big_liters + 1;
|
||||
Lara.SmallWaterskin = small_liters + 1;
|
||||
Lara.BigWaterskin = big_liters + 1;
|
||||
combine_obj1 = (small_liters + 1) + (INV_OBJECT_SMOL_WATERSKIN - 1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Lara.smallWaterskin != 1 && big_capacity)//if the small one isn't empty and the big one isn't full
|
||||
if (Lara.SmallWaterskin != 1 && big_capacity)//if the small one isn't empty and the big one isn't full
|
||||
{
|
||||
i = Lara.smallWaterskin - 1;
|
||||
i = Lara.SmallWaterskin - 1;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -3908,8 +3908,8 @@ bool GuiController::PerformWaterskinCombine(int flag)
|
|||
|
||||
} while (i);
|
||||
|
||||
Lara.smallWaterskin = small_liters + 1;
|
||||
Lara.bigWaterskin = big_liters + 1;
|
||||
Lara.SmallWaterskin = small_liters + 1;
|
||||
Lara.BigWaterskin = big_liters + 1;
|
||||
combine_obj1 = (big_liters + 1) + (INV_OBJECT_BIG_WATERSKIN - 1);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -38,12 +38,12 @@ void DrawHealthBarOverlay(ITEM_INFO* item, int value)
|
|||
if (CurrentLevel)
|
||||
{
|
||||
int color2 = 0;
|
||||
if (lara->Poisoned)
|
||||
if (lara->PoisonPotency)
|
||||
color2 = 0xA0A000;
|
||||
else
|
||||
color2 = 0xA00000;
|
||||
|
||||
g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter, lara->Poisoned);
|
||||
g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter, lara->PoisonPotency);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ void DrawHealthBar(ITEM_INFO* item, float value)
|
|||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (CurrentLevel)
|
||||
g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter, lara->Poisoned);
|
||||
g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter, lara->PoisonPotency);
|
||||
}
|
||||
|
||||
void UpdateHealthBar(ITEM_INFO* item, int flash)
|
||||
|
@ -125,8 +125,8 @@ void UpdateHealthBar(ITEM_INFO* item, int flash)
|
|||
}
|
||||
else if (HealthBarTimer > 0 || HealthBar <= 0 ||
|
||||
lara->Control.HandStatus == HandStatus::WeaponReady &&
|
||||
lara->Control.WeaponControl.GunType != WEAPON_TORCH ||
|
||||
lara->Poisoned >= 256)
|
||||
lara->Control.Weapon.GunType != WEAPON_TORCH ||
|
||||
lara->PoisonPotency)
|
||||
{
|
||||
if (!BinocularRange)
|
||||
DrawHealthBar(item, HealthBar / LARA_HEALTH_MAX);
|
||||
|
|
|
@ -175,8 +175,8 @@ void DoPickup(ITEM_INFO* character)
|
|||
{
|
||||
if (character->ActiveState == LA_UNDERWATER_PICKUP_FLARE)
|
||||
{
|
||||
lara->Control.WeaponControl.RequestGunType = WEAPON_FLARE;
|
||||
lara->Control.WeaponControl.GunType = WEAPON_FLARE;
|
||||
lara->Control.Weapon.RequestGunType = WEAPON_FLARE;
|
||||
lara->Control.Weapon.GunType = WEAPON_FLARE;
|
||||
InitialiseNewWeapon(character);
|
||||
lara->Control.HandStatus = HandStatus::Special;
|
||||
lara->Flare.Life = (int)(item->Data) & 0x7FFF;
|
||||
|
@ -191,8 +191,8 @@ void DoPickup(ITEM_INFO* character)
|
|||
}
|
||||
else if (character->ActiveState == LS_PICKUP_FLARE)
|
||||
{
|
||||
lara->Control.WeaponControl.RequestGunType = WEAPON_FLARE;
|
||||
lara->Control.WeaponControl.GunType = WEAPON_FLARE;
|
||||
lara->Control.Weapon.RequestGunType = WEAPON_FLARE;
|
||||
lara->Control.Weapon.GunType = WEAPON_FLARE;
|
||||
InitialiseNewWeapon(character);
|
||||
lara->Control.HandStatus = HandStatus::Special;
|
||||
lara->Flare.Life = (short)(item->Data) & 0x7FFF;
|
||||
|
@ -276,7 +276,7 @@ void PickupCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
|
||||
auto lara = (LaraInfo*&)l->Data;
|
||||
|
||||
if (item->ObjectNumber == ID_FLARE_ITEM && lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (item->ObjectNumber == ID_FLARE_ITEM && lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
return;
|
||||
|
||||
item->Position.yRot = l->Position.yRot;
|
||||
|
@ -1080,9 +1080,9 @@ bool UseSpecialItem(ITEM_INFO* item)
|
|||
if (use != ID_WATERSKIN1_3 && use != ID_WATERSKIN2_5 && (LaraItem->Position.yPos > Lara.WaterSurfaceDist))
|
||||
{
|
||||
if (use < ID_WATERSKIN1_3)
|
||||
Lara.smallWaterskin = 4;
|
||||
Lara.SmallWaterskin = 4;
|
||||
else
|
||||
Lara.bigWaterskin = 6;
|
||||
Lara.BigWaterskin = 6;
|
||||
|
||||
flag = 1;
|
||||
}
|
||||
|
@ -1090,13 +1090,13 @@ bool UseSpecialItem(ITEM_INFO* item)
|
|||
{
|
||||
if (use <= ID_WATERSKIN1_3)
|
||||
{
|
||||
item->ItemFlags[3] = Lara.smallWaterskin - 1;
|
||||
Lara.smallWaterskin = 1;
|
||||
item->ItemFlags[3] = Lara.SmallWaterskin - 1;
|
||||
Lara.SmallWaterskin = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->ItemFlags[3] = Lara.bigWaterskin - 1;
|
||||
Lara.bigWaterskin = 1;
|
||||
item->ItemFlags[3] = Lara.BigWaterskin - 1;
|
||||
Lara.BigWaterskin = 1;
|
||||
}
|
||||
|
||||
flag = 2;
|
||||
|
|
|
@ -47,11 +47,11 @@ static bool TryModifyMiscCount(LaraInfo & lara, GAME_OBJECT_ID obj, bool add)
|
|||
{
|
||||
if (add)
|
||||
{
|
||||
lara.hasBeetleThings |= 1 << bit;
|
||||
lara.HasBeetleThings |= 1 << bit;
|
||||
}
|
||||
else
|
||||
{
|
||||
lara.hasBeetleThings &= ~(1 << bit);
|
||||
lara.HasBeetleThings &= ~(1 << bit);
|
||||
}
|
||||
};
|
||||
switch (obj) {
|
||||
|
@ -72,34 +72,34 @@ static bool TryModifyMiscCount(LaraInfo & lara, GAME_OBJECT_ID obj, bool add)
|
|||
lara.Diary.Present = add;
|
||||
break;
|
||||
case ID_WATERSKIN1_EMPTY:
|
||||
modifyWaterSkinAmount(lara.smallWaterskin, 1);
|
||||
modifyWaterSkinAmount(lara.SmallWaterskin, 1);
|
||||
break;
|
||||
case ID_WATERSKIN1_1:
|
||||
modifyWaterSkinAmount(lara.smallWaterskin, 2);
|
||||
modifyWaterSkinAmount(lara.SmallWaterskin, 2);
|
||||
break;
|
||||
case ID_WATERSKIN1_2:
|
||||
modifyWaterSkinAmount(lara.smallWaterskin, 3);
|
||||
modifyWaterSkinAmount(lara.SmallWaterskin, 3);
|
||||
break;
|
||||
case ID_WATERSKIN1_3:
|
||||
modifyWaterSkinAmount(lara.smallWaterskin, 4);
|
||||
modifyWaterSkinAmount(lara.SmallWaterskin, 4);
|
||||
break;
|
||||
case ID_WATERSKIN2_EMPTY:
|
||||
modifyWaterSkinAmount(lara.bigWaterskin, 1);
|
||||
modifyWaterSkinAmount(lara.BigWaterskin, 1);
|
||||
break;
|
||||
case ID_WATERSKIN2_1:
|
||||
modifyWaterSkinAmount(lara.bigWaterskin, 2);
|
||||
modifyWaterSkinAmount(lara.BigWaterskin, 2);
|
||||
break;
|
||||
case ID_WATERSKIN2_2:
|
||||
modifyWaterSkinAmount(lara.bigWaterskin, 3);
|
||||
modifyWaterSkinAmount(lara.BigWaterskin, 3);
|
||||
break;
|
||||
case ID_WATERSKIN2_3:
|
||||
modifyWaterSkinAmount(lara.bigWaterskin, 4);
|
||||
modifyWaterSkinAmount(lara.BigWaterskin, 4);
|
||||
break;
|
||||
case ID_WATERSKIN2_4:
|
||||
modifyWaterSkinAmount(lara.bigWaterskin, 5);
|
||||
modifyWaterSkinAmount(lara.BigWaterskin, 5);
|
||||
break;
|
||||
case ID_WATERSKIN2_5:
|
||||
modifyWaterSkinAmount(lara.bigWaterskin, 6);
|
||||
modifyWaterSkinAmount(lara.BigWaterskin, 6);
|
||||
break;
|
||||
case ID_CLOCKWORK_BEETLE:
|
||||
modifyBeetleCount(0);
|
||||
|
@ -130,7 +130,7 @@ std::optional<bool> HasMiscItem(LaraInfo& lara, GAME_OBJECT_ID obj)
|
|||
{
|
||||
auto HasBeetle = [&](int bit)
|
||||
{
|
||||
return lara.hasBeetleThings &= 1 << bit;
|
||||
return lara.HasBeetleThings &= 1 << bit;
|
||||
};
|
||||
|
||||
switch (obj) {
|
||||
|
@ -146,25 +146,25 @@ std::optional<bool> HasMiscItem(LaraInfo& lara, GAME_OBJECT_ID obj)
|
|||
case ID_DIARY_ITEM:
|
||||
return lara.Diary.Present;
|
||||
case ID_WATERSKIN1_EMPTY:
|
||||
return lara.smallWaterskin == 1;
|
||||
return lara.SmallWaterskin == 1;
|
||||
case ID_WATERSKIN1_1:
|
||||
return lara.smallWaterskin == 2;
|
||||
return lara.SmallWaterskin == 2;
|
||||
case ID_WATERSKIN1_2:
|
||||
return lara.smallWaterskin == 3;
|
||||
return lara.SmallWaterskin == 3;
|
||||
case ID_WATERSKIN1_3:
|
||||
return lara.smallWaterskin == 4;
|
||||
return lara.SmallWaterskin == 4;
|
||||
case ID_WATERSKIN2_EMPTY:
|
||||
return lara.bigWaterskin == 1;
|
||||
return lara.BigWaterskin == 1;
|
||||
case ID_WATERSKIN2_1:
|
||||
return lara.bigWaterskin == 2;
|
||||
return lara.BigWaterskin == 2;
|
||||
case ID_WATERSKIN2_2:
|
||||
return lara.bigWaterskin == 3;
|
||||
return lara.BigWaterskin == 3;
|
||||
case ID_WATERSKIN2_3:
|
||||
return lara.bigWaterskin == 4;
|
||||
return lara.BigWaterskin == 4;
|
||||
case ID_WATERSKIN2_4:
|
||||
return lara.bigWaterskin == 5;
|
||||
return lara.BigWaterskin == 5;
|
||||
case ID_WATERSKIN2_5:
|
||||
return lara.bigWaterskin == 6;
|
||||
return lara.BigWaterskin == 6;
|
||||
case ID_CLOCKWORK_BEETLE:
|
||||
return HasBeetle(0);
|
||||
case ID_CLOCKWORK_BEETLE_COMBO1:
|
||||
|
|
|
@ -159,12 +159,12 @@ bool SaveGame::Save(int slot)
|
|||
|
||||
std::vector<int> meshPtrs;
|
||||
for (int i = 0; i < 15; i++)
|
||||
meshPtrs.push_back(Lara.meshPtrs[i]);
|
||||
meshPtrs.push_back(Lara.MeshPtrs[i]);
|
||||
auto meshPtrsOffset = fbb.CreateVector(meshPtrs);
|
||||
|
||||
std::vector<byte> wet;
|
||||
for (int i = 0; i < 15; i++)
|
||||
wet.push_back(Lara.wet[i] == 1);
|
||||
wet.push_back(Lara.Wet[i] == 1);
|
||||
auto wetOffset = fbb.CreateVector(wet);
|
||||
|
||||
Save::Vector3 nextCornerPos = Save::Vector3(Lara.NextCornerPos.xPos, Lara.NextCornerPos.yPos, Lara.NextCornerPos.zPos);
|
||||
|
@ -176,6 +176,7 @@ bool SaveGame::Save(int slot)
|
|||
Save::Vector3 extraHeadRot = Save::Vector3(Lara.ExtraHeadRot.xRot, Lara.ExtraHeadRot.yRot, Lara.ExtraHeadRot.zRot);
|
||||
Save::Vector3 extraTorsoRot = Save::Vector3(Lara.ExtraTorsoRot.xRot, Lara.ExtraTorsoRot.yRot, Lara.ExtraTorsoRot.zRot);
|
||||
Save::Vector3 extraVelocity = Save::Vector3(Lara.ExtraVelocity.x, Lara.ExtraVelocity.y, Lara.ExtraVelocity.z);
|
||||
Save::Vector3 waterCurrentPull = Save::Vector3(Lara.WaterCurrentPull.x, Lara.WaterCurrentPull.y, Lara.WaterCurrentPull.z);
|
||||
|
||||
Save::ArmInfoBuilder leftArm{ fbb };
|
||||
leftArm.add_anim_number(Lara.LeftArm.AnimNumber);
|
||||
|
@ -201,14 +202,14 @@ bool SaveGame::Save(int slot)
|
|||
auto laraTargetAnglesOffset = fbb.CreateVector(laraTargetAngles);
|
||||
|
||||
std::vector<int> subsuitVelocity{};
|
||||
subsuitVelocity.push_back(Lara.Control.SubsuitControl.Velocity[0]);
|
||||
subsuitVelocity.push_back(Lara.Control.SubsuitControl.Velocity[1]);
|
||||
subsuitVelocity.push_back(Lara.Control.Subsuit.Velocity[0]);
|
||||
subsuitVelocity.push_back(Lara.Control.Subsuit.Velocity[1]);
|
||||
auto subsuitVelocityOffset = fbb.CreateVector(subsuitVelocity);
|
||||
|
||||
Save::HolsterInfoBuilder holsterInfo{ fbb };
|
||||
holsterInfo.add_back_holster((int)Lara.Control.WeaponControl.HolsterInfo.BackHolster);
|
||||
holsterInfo.add_left_holster((int)Lara.Control.WeaponControl.HolsterInfo.LeftHolster);
|
||||
holsterInfo.add_right_holster((int)Lara.Control.WeaponControl.HolsterInfo.RightHolster);
|
||||
holsterInfo.add_back_holster((int)Lara.Control.Weapon.HolsterInfo.BackHolster);
|
||||
holsterInfo.add_left_holster((int)Lara.Control.Weapon.HolsterInfo.LeftHolster);
|
||||
holsterInfo.add_right_holster((int)Lara.Control.Weapon.HolsterInfo.RightHolster);
|
||||
auto holsterInfoOffset = holsterInfo.Finish();
|
||||
|
||||
Save::FlareDataBuilder flare{ fbb };
|
||||
|
@ -218,50 +219,57 @@ bool SaveGame::Save(int slot)
|
|||
auto flareOffset = flare.Finish();
|
||||
|
||||
Save::WeaponControlDataBuilder weaponControl{ fbb };
|
||||
weaponControl.add_weapon_item(Lara.Control.WeaponControl.WeaponItem);
|
||||
weaponControl.add_has_fired(Lara.Control.WeaponControl.HasFired);
|
||||
weaponControl.add_fired(Lara.Control.WeaponControl.Fired);
|
||||
weaponControl.add_gun_type(Lara.Control.WeaponControl.GunType);
|
||||
weaponControl.add_request_gun_type(Lara.Control.WeaponControl.RequestGunType);
|
||||
weaponControl.add_last_gun_type(Lara.Control.WeaponControl.LastGunType);
|
||||
weaponControl.add_weapon_item(Lara.Control.Weapon.WeaponItem);
|
||||
weaponControl.add_has_fired(Lara.Control.Weapon.HasFired);
|
||||
weaponControl.add_fired(Lara.Control.Weapon.Fired);
|
||||
weaponControl.add_uzi_left(Lara.Control.Weapon.UziLeft);
|
||||
weaponControl.add_uzi_right(Lara.Control.Weapon.UziRight);
|
||||
weaponControl.add_gun_type(Lara.Control.Weapon.GunType);
|
||||
weaponControl.add_request_gun_type(Lara.Control.Weapon.RequestGunType);
|
||||
weaponControl.add_last_gun_type(Lara.Control.Weapon.LastGunType);
|
||||
weaponControl.add_holster_info(holsterInfoOffset);
|
||||
auto weaponControlOffset = weaponControl.Finish();
|
||||
|
||||
Save::RopeControlDataBuilder ropeControl{ fbb };
|
||||
ropeControl.add_segment(Lara.Control.RopeControl.Segment);
|
||||
ropeControl.add_direction(Lara.Control.RopeControl.Direction);
|
||||
ropeControl.add_arc_front(Lara.Control.RopeControl.ArcFront);
|
||||
ropeControl.add_arc_back(Lara.Control.RopeControl.ArcBack);
|
||||
ropeControl.add_last_x(Lara.Control.RopeControl.LastX);
|
||||
ropeControl.add_max_x_forward(Lara.Control.RopeControl.MaxXForward);
|
||||
ropeControl.add_max_x_backward(Lara.Control.RopeControl.MaxXBackward);
|
||||
ropeControl.add_dframe(Lara.Control.RopeControl.DFrame);
|
||||
ropeControl.add_frame(Lara.Control.RopeControl.Frame);
|
||||
ropeControl.add_frame_rate(Lara.Control.RopeControl.FrameRate);
|
||||
ropeControl.add_y(Lara.Control.RopeControl.Y);
|
||||
ropeControl.add_ptr(Lara.Control.RopeControl.Ptr);
|
||||
ropeControl.add_offset(Lara.Control.RopeControl.Offset);
|
||||
ropeControl.add_down_vel(Lara.Control.RopeControl.DownVel);
|
||||
ropeControl.add_flag(Lara.Control.RopeControl.Flag);
|
||||
ropeControl.add_count(Lara.Control.RopeControl.Count);
|
||||
ropeControl.add_segment(Lara.Control.Rope.Segment);
|
||||
ropeControl.add_direction(Lara.Control.Rope.Direction);
|
||||
ropeControl.add_arc_front(Lara.Control.Rope.ArcFront);
|
||||
ropeControl.add_arc_back(Lara.Control.Rope.ArcBack);
|
||||
ropeControl.add_last_x(Lara.Control.Rope.LastX);
|
||||
ropeControl.add_max_x_forward(Lara.Control.Rope.MaxXForward);
|
||||
ropeControl.add_max_x_backward(Lara.Control.Rope.MaxXBackward);
|
||||
ropeControl.add_dframe(Lara.Control.Rope.DFrame);
|
||||
ropeControl.add_frame(Lara.Control.Rope.Frame);
|
||||
ropeControl.add_frame_rate(Lara.Control.Rope.FrameRate);
|
||||
ropeControl.add_y(Lara.Control.Rope.Y);
|
||||
ropeControl.add_ptr(Lara.Control.Rope.Ptr);
|
||||
ropeControl.add_offset(Lara.Control.Rope.Offset);
|
||||
ropeControl.add_down_vel(Lara.Control.Rope.DownVel);
|
||||
ropeControl.add_flag(Lara.Control.Rope.Flag);
|
||||
ropeControl.add_count(Lara.Control.Rope.Count);
|
||||
auto ropeControlOffset = ropeControl.Finish();
|
||||
|
||||
Save::TightropeControlDataBuilder tightropeControl{ fbb };
|
||||
tightropeControl.add_balance(Lara.Control.TightropeControl.Balance);
|
||||
tightropeControl.add_can_dismount(Lara.Control.TightropeControl.CanDismount);
|
||||
tightropeControl.add_tightrope_item(Lara.Control.TightropeControl.TightropeItem);
|
||||
tightropeControl.add_time_on_tightrope(Lara.Control.TightropeControl.TimeOnTightrope);
|
||||
tightropeControl.add_balance(Lara.Control.Tightrope.Balance);
|
||||
tightropeControl.add_can_dismount(Lara.Control.Tightrope.CanDismount);
|
||||
tightropeControl.add_tightrope_item(Lara.Control.Tightrope.TightropeItem);
|
||||
tightropeControl.add_time_on_tightrope(Lara.Control.Tightrope.TimeOnTightrope);
|
||||
auto tightropeControlOffset = tightropeControl.Finish();
|
||||
|
||||
Save::SubsuitControlDataBuilder subsuitControl{ fbb };
|
||||
subsuitControl.add_x_rot(Lara.Control.SubsuitControl.XRot);
|
||||
subsuitControl.add_d_x_rot(Lara.Control.SubsuitControl.DXRot);
|
||||
subsuitControl.add_x_rot(Lara.Control.Subsuit.XRot);
|
||||
subsuitControl.add_d_x_rot(Lara.Control.Subsuit.DXRot);
|
||||
subsuitControl.add_velocity(subsuitVelocityOffset);
|
||||
subsuitControl.add_vertical_velocity(Lara.Control.SubsuitControl.VerticalVelocity);
|
||||
subsuitControl.add_x_rot_vel(Lara.Control.SubsuitControl.XRotVel);
|
||||
subsuitControl.add_hit_count(Lara.Control.SubsuitControl.HitCount);
|
||||
subsuitControl.add_vertical_velocity(Lara.Control.Subsuit.VerticalVelocity);
|
||||
subsuitControl.add_x_rot_vel(Lara.Control.Subsuit.XRotVel);
|
||||
subsuitControl.add_hit_count(Lara.Control.Subsuit.HitCount);
|
||||
auto subsuitControlOffset = subsuitControl.Finish();
|
||||
|
||||
Save::MinecartControlDataBuilder minecartControl{ fbb };
|
||||
minecartControl.add_left(Lara.Control.Minecart.Left);
|
||||
minecartControl.add_right(Lara.Control.Minecart.Right);
|
||||
auto minecartControlOffset = minecartControl.Finish();
|
||||
|
||||
Save::LaraCountDataBuilder count{ fbb };
|
||||
count.add_death(Lara.Control.Count.Death);
|
||||
count.add_dive(Lara.Control.Count.Dive);
|
||||
|
@ -288,11 +296,11 @@ bool SaveGame::Save(int slot)
|
|||
control.add_is_climbing_ladder(Lara.Control.IsClimbingLadder);
|
||||
control.add_can_monkey_swing(Lara.Control.CanMonkeySwing);
|
||||
control.add_locked(Lara.Control.Locked);
|
||||
control.add_water_current_active(Lara.Control.WaterCurrentActive);
|
||||
control.add_weapon_control(weaponControlOffset);
|
||||
control.add_rope_control(ropeControlOffset);
|
||||
control.add_subsuit_control(subsuitControlOffset);
|
||||
control.add_tightrope_control(tightropeControlOffset);
|
||||
control.add_minecart(minecartControlOffset);
|
||||
control.add_rope(ropeControlOffset);
|
||||
control.add_subsuit(subsuitControlOffset);
|
||||
control.add_tightrope(tightropeControlOffset);
|
||||
control.add_weapon(weaponControlOffset);
|
||||
auto controlOffset = control.Finish();
|
||||
|
||||
std::vector<flatbuffers::Offset<Save::CarriedWeaponInfo>> carriedWeapons;
|
||||
|
@ -326,12 +334,12 @@ bool SaveGame::Save(int slot)
|
|||
Save::LaraBuilder lara{ fbb };
|
||||
lara.add_air(Lara.Air);
|
||||
lara.add_beetle_life(Lara.BeetleLife);
|
||||
lara.add_big_waterskin(Lara.bigWaterskin);
|
||||
lara.add_big_waterskin(Lara.BigWaterskin);
|
||||
lara.add_binoculars(Lara.Binoculars);
|
||||
lara.add_burn_count(Lara.BurnCount);
|
||||
lara.add_burn_type((int)Lara.BurnType);
|
||||
lara.add_burn(Lara.burn);
|
||||
lara.add_burn_blue(Lara.burnBlue);
|
||||
lara.add_burn(Lara.Burn);
|
||||
lara.add_burn_blue(Lara.BurnBlue);
|
||||
lara.add_burn_smoke(Lara.BurnSmoke);
|
||||
lara.add_control(controlOffset);
|
||||
lara.add_next_corner_position(&nextCornerPos);
|
||||
|
@ -344,10 +352,10 @@ bool SaveGame::Save(int slot)
|
|||
lara.add_extra_torso_rot(&extraTorsoRot);
|
||||
lara.add_extra_velocity(&extraVelocity);
|
||||
lara.add_flare(flareOffset);
|
||||
lara.add_has_beetle_things(Lara.hasBeetleThings);
|
||||
lara.add_highest_location(Lara.highestLocation);
|
||||
lara.add_hit_direction(Lara.hitDirection);
|
||||
lara.add_hit_frame(Lara.hitFrame);
|
||||
lara.add_has_beetle_things(Lara.HasBeetleThings);
|
||||
lara.add_highest_location(Lara.HighestLocation);
|
||||
lara.add_hit_direction(Lara.HitDirection);
|
||||
lara.add_hit_frame(Lara.HitFrame);
|
||||
lara.add_interacted_item(Lara.InteractedItem);
|
||||
lara.add_is_busy(Lara.IsBusy);
|
||||
lara.add_item_number(Lara.ItemNumber);
|
||||
|
@ -356,32 +364,32 @@ bool SaveGame::Save(int slot)
|
|||
lara.add_lasersight(Lara.Lasersight);
|
||||
lara.add_left_arm(leftArmOffset);
|
||||
lara.add_lit_torch(Lara.LitTorch);
|
||||
lara.add_location(Lara.location);
|
||||
lara.add_location_pad(Lara.locationPad);
|
||||
lara.add_location(Lara.Location);
|
||||
lara.add_location_pad(Lara.LocationPad);
|
||||
lara.add_mesh_ptrs(meshPtrsOffset);
|
||||
lara.add_mine_l(Lara.mineL);
|
||||
lara.add_mine_r(Lara.mineR);
|
||||
lara.add_num_flares(Lara.NumFlares);
|
||||
lara.add_num_small_medipacks(Lara.NumSmallMedipacks);
|
||||
lara.add_num_large_medipacks(Lara.NumLargeMedipacks);
|
||||
lara.add_old_busy(Lara.OldBusy);
|
||||
lara.add_puzzles(puzzlesOffset);
|
||||
lara.add_puzzles_combo(puzzlesComboOffset);
|
||||
lara.add_poisoned(Lara.Poisoned);
|
||||
lara.add_poison_potency(Lara.PoisonPotency);
|
||||
lara.add_pickups(pickupsOffset);
|
||||
lara.add_pickups_combo(pickupsComboOffset);
|
||||
lara.add_projected_floor_height(Lara.ProjectedFloorHeight);
|
||||
lara.add_right_arm(rightArmOffset);
|
||||
lara.add_secrets(Lara.Secrets);
|
||||
lara.add_silencer(Lara.Silencer);
|
||||
lara.add_small_waterskin(Lara.smallWaterskin);
|
||||
lara.add_small_waterskin(Lara.SmallWaterskin);
|
||||
lara.add_spasm_effect_count(Lara.SpasmEffectCount);
|
||||
lara.add_sprint_energy(Lara.SprintEnergy);
|
||||
lara.add_target_angle(Lara.TargetAngle);
|
||||
lara.add_target_angles(laraTargetAnglesOffset);
|
||||
lara.add_target_arm_angles(laraTargetAnglesOffset);
|
||||
lara.add_target_item_number(Lara.TargetEntity - g_Level.Items.data());
|
||||
lara.add_torch(Lara.Torch);
|
||||
lara.add_vehicle(Lara.Vehicle);
|
||||
lara.add_water_current_active(Lara.WaterCurrentActive);
|
||||
lara.add_water_current_pull(&waterCurrentPull);
|
||||
lara.add_water_surface_dist(Lara.WaterSurfaceDist);
|
||||
lara.add_weapons(carriedWeaponsOffset);
|
||||
lara.add_wet(wetOffset);
|
||||
|
@ -659,9 +667,9 @@ bool SaveGame::Save(int slot)
|
|||
flatbuffers::Offset<Save::Pendulum> pendulumOffset;
|
||||
flatbuffers::Offset<Save::Pendulum> alternatePendulumOffset;
|
||||
|
||||
if (Lara.Control.RopeControl.Ptr != -1)
|
||||
if (Lara.Control.Rope.Ptr != -1)
|
||||
{
|
||||
ROPE_STRUCT* rope = &Ropes[Lara.Control.RopeControl.Ptr];
|
||||
ROPE_STRUCT* rope = &Ropes[Lara.Control.Rope.Ptr];
|
||||
|
||||
std::vector<const Save::Vector3*> segments;
|
||||
for (int i = 0; i < ROPE_SEGMENTS; i++)
|
||||
|
@ -770,7 +778,7 @@ bool SaveGame::Save(int slot)
|
|||
sgb.add_sinks(sinksOffset);
|
||||
sgb.add_flyby_cameras(flybyCamerasOffset);
|
||||
|
||||
if (Lara.Control.RopeControl.Ptr != -1)
|
||||
if (Lara.Control.Rope.Ptr != -1)
|
||||
{
|
||||
sgb.add_rope(ropeOffset);
|
||||
sgb.add_pendulum(pendulumOffset);
|
||||
|
@ -1186,22 +1194,22 @@ bool SaveGame::Load(int slot)
|
|||
|
||||
for (int i = 0; i < s->lara()->mesh_ptrs()->size(); i++)
|
||||
{
|
||||
Lara.meshPtrs[i] = s->lara()->mesh_ptrs()->Get(i);
|
||||
Lara.MeshPtrs[i] = s->lara()->mesh_ptrs()->Get(i);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
Lara.wet[i] = s->lara()->wet()->Get(i);
|
||||
Lara.Wet[i] = s->lara()->wet()->Get(i);
|
||||
}
|
||||
|
||||
Lara.Air = s->lara()->air();
|
||||
Lara.BeetleLife = s->lara()->beetle_life();
|
||||
Lara.bigWaterskin = s->lara()->big_waterskin();
|
||||
Lara.BigWaterskin = s->lara()->big_waterskin();
|
||||
Lara.Binoculars = s->lara()->binoculars();
|
||||
Lara.BurnCount = s->lara()->burn_count();
|
||||
Lara.BurnType = (BurnType)s->lara()->burn_type();
|
||||
Lara.burn = s->lara()->burn();
|
||||
Lara.burnBlue = s->lara()->burn_blue();
|
||||
Lara.Burn = s->lara()->burn();
|
||||
Lara.BurnBlue = s->lara()->burn_blue();
|
||||
Lara.BurnSmoke = s->lara()->burn_smoke();
|
||||
Lara.Control.CalculatedJumpVelocity = s->lara()->control()->calculated_jump_velocity();
|
||||
Lara.Control.CanMonkeySwing = s->lara()->control()->can_monkey_swing();
|
||||
|
@ -1224,16 +1232,17 @@ bool SaveGame::Load(int slot)
|
|||
Lara.Control.TurnRate = s->lara()->control()->turn_rate();
|
||||
Lara.Control.Locked = s->lara()->control()->locked();
|
||||
Lara.Control.HandStatus = (HandStatus)s->lara()->control()->hand_status();
|
||||
Lara.Control.WaterCurrentActive = s->lara()->control()->water_current_active();
|
||||
Lara.Control.WeaponControl.GunType = (LaraWeaponType)s->lara()->control()->weapon_control()->gun_type();
|
||||
Lara.Control.WeaponControl.HasFired = s->lara()->control()->weapon_control()->has_fired();
|
||||
Lara.Control.WeaponControl.Fired = s->lara()->control()->weapon_control()->fired();
|
||||
Lara.Control.WeaponControl.LastGunType = (LaraWeaponType)s->lara()->control()->weapon_control()->last_gun_type();
|
||||
Lara.Control.WeaponControl.RequestGunType = (LaraWeaponType)s->lara()->control()->weapon_control()->request_gun_type();
|
||||
Lara.Control.WeaponControl.WeaponItem = s->lara()->control()->weapon_control()->weapon_item();
|
||||
Lara.Control.WeaponControl.HolsterInfo.BackHolster = (HolsterSlot)s->lara()->control()->weapon_control()->holster_info()->back_holster();
|
||||
Lara.Control.WeaponControl.HolsterInfo.LeftHolster = (HolsterSlot)s->lara()->control()->weapon_control()->holster_info()->left_holster();
|
||||
Lara.Control.WeaponControl.HolsterInfo.RightHolster = (HolsterSlot)s->lara()->control()->weapon_control()->holster_info()->right_holster();
|
||||
Lara.Control.Weapon.GunType = (LaraWeaponType)s->lara()->control()->weapon()->gun_type();
|
||||
Lara.Control.Weapon.HasFired = s->lara()->control()->weapon()->has_fired();
|
||||
Lara.Control.Weapon.Fired = s->lara()->control()->weapon()->fired();
|
||||
Lara.Control.Weapon.LastGunType = (LaraWeaponType)s->lara()->control()->weapon()->last_gun_type();
|
||||
Lara.Control.Weapon.RequestGunType = (LaraWeaponType)s->lara()->control()->weapon()->request_gun_type();
|
||||
Lara.Control.Weapon.WeaponItem = s->lara()->control()->weapon()->weapon_item();
|
||||
Lara.Control.Weapon.HolsterInfo.BackHolster = (HolsterSlot)s->lara()->control()->weapon()->holster_info()->back_holster();
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = (HolsterSlot)s->lara()->control()->weapon()->holster_info()->left_holster();
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = (HolsterSlot)s->lara()->control()->weapon()->holster_info()->right_holster();
|
||||
Lara.Control.Weapon.UziLeft = s->lara()->control()->weapon()->uzi_left();
|
||||
Lara.Control.Weapon.UziRight = s->lara()->control()->weapon()->uzi_right();
|
||||
Lara.Crowbar = s->lara()->crowbar();
|
||||
Lara.ExtraAnim = s->lara()->extra_anim();
|
||||
Lara.ExtraHeadRot.xRot = s->lara()->extra_head_rot()->x();
|
||||
|
@ -1245,13 +1254,17 @@ bool SaveGame::Load(int slot)
|
|||
Lara.ExtraVelocity.x = s->lara()->extra_velocity()->x();
|
||||
Lara.ExtraVelocity.y = s->lara()->extra_velocity()->y();
|
||||
Lara.ExtraVelocity.z = s->lara()->extra_velocity()->z();
|
||||
Lara.WaterCurrentActive = s->lara()->water_current_active();
|
||||
Lara.WaterCurrentPull.x = s->lara()->water_current_pull()->x();
|
||||
Lara.WaterCurrentPull.y = s->lara()->water_current_pull()->y();
|
||||
Lara.WaterCurrentPull.z = s->lara()->water_current_pull()->z();
|
||||
Lara.Flare.Life = s->lara()->flare()->life();
|
||||
Lara.Flare.ControlLeft = s->lara()->flare()->control_left();
|
||||
Lara.Flare.Frame = s->lara()->flare()->frame();
|
||||
Lara.hasBeetleThings = s->lara()->has_beetle_things();
|
||||
Lara.highestLocation = s->lara()->highest_location();
|
||||
Lara.hitDirection = s->lara()->hit_direction();
|
||||
Lara.hitFrame = s->lara()->hit_frame();
|
||||
Lara.HasBeetleThings = s->lara()->has_beetle_things();
|
||||
Lara.HighestLocation = s->lara()->highest_location();
|
||||
Lara.HitDirection = s->lara()->hit_direction();
|
||||
Lara.HitFrame = s->lara()->hit_frame();
|
||||
Lara.InteractedItem = s->lara()->interacted_item();
|
||||
Lara.IsBusy = s->lara()->is_busy();
|
||||
Lara.ItemNumber = s->lara()->item_number();
|
||||
|
@ -1265,10 +1278,8 @@ bool SaveGame::Load(int slot)
|
|||
Lara.LeftArm.Rotation.yRot = s->lara()->left_arm()->rotation()->y();
|
||||
Lara.LeftArm.Rotation.zRot = s->lara()->left_arm()->rotation()->z();
|
||||
Lara.LitTorch = s->lara()->lit_torch();
|
||||
Lara.location = s->lara()->location();
|
||||
Lara.locationPad = s->lara()->location_pad();
|
||||
Lara.mineL = s->lara()->mine_l();
|
||||
Lara.mineR = s->lara()->mine_r();
|
||||
Lara.Location = s->lara()->location();
|
||||
Lara.LocationPad = s->lara()->location_pad();
|
||||
Lara.NextCornerPos = PHD_3DPOS(
|
||||
s->lara()->next_corner_position()->x(),
|
||||
s->lara()->next_corner_position()->y(),
|
||||
|
@ -1280,7 +1291,7 @@ bool SaveGame::Load(int slot)
|
|||
Lara.NumLargeMedipacks = s->lara()->num_large_medipacks();
|
||||
Lara.NumSmallMedipacks = s->lara()->num_small_medipacks();
|
||||
Lara.OldBusy = s->lara()->old_busy();
|
||||
Lara.Poisoned = s->lara()->poisoned();
|
||||
Lara.PoisonPotency = s->lara()->poison_potency();
|
||||
Lara.ProjectedFloorHeight = s->lara()->projected_floor_height();
|
||||
Lara.RightArm.AnimNumber = s->lara()->right_arm()->anim_number();
|
||||
Lara.RightArm.FlashGun = s->lara()->right_arm()->flash_gun();
|
||||
|
@ -1290,46 +1301,48 @@ bool SaveGame::Load(int slot)
|
|||
Lara.RightArm.Rotation.xRot = s->lara()->right_arm()->rotation()->x();
|
||||
Lara.RightArm.Rotation.yRot = s->lara()->right_arm()->rotation()->y();
|
||||
Lara.RightArm.Rotation.zRot = s->lara()->right_arm()->rotation()->z();
|
||||
Lara.Control.RopeControl.Segment = s->lara()->control()->rope_control()->segment();
|
||||
Lara.Control.RopeControl.Direction = s->lara()->control()->rope_control()->direction();
|
||||
Lara.Control.RopeControl.ArcFront = s->lara()->control()->rope_control()->arc_front();
|
||||
Lara.Control.RopeControl.ArcBack = s->lara()->control()->rope_control()->arc_back();
|
||||
Lara.Control.RopeControl.LastX = s->lara()->control()->rope_control()->last_x();
|
||||
Lara.Control.RopeControl.MaxXForward = s->lara()->control()->rope_control()->max_x_forward();
|
||||
Lara.Control.RopeControl.MaxXBackward = s->lara()->control()->rope_control()->max_x_backward();
|
||||
Lara.Control.RopeControl.DFrame = s->lara()->control()->rope_control()->dframe();
|
||||
Lara.Control.RopeControl.Frame = s->lara()->control()->rope_control()->frame();
|
||||
Lara.Control.RopeControl.FrameRate = s->lara()->control()->rope_control()->frame_rate();
|
||||
Lara.Control.RopeControl.Y = s->lara()->control()->rope_control()->y();
|
||||
Lara.Control.RopeControl.Ptr = s->lara()->control()->rope_control()->ptr();
|
||||
Lara.Control.RopeControl.Offset = s->lara()->control()->rope_control()->offset();
|
||||
Lara.Control.RopeControl.DownVel = s->lara()->control()->rope_control()->down_vel();
|
||||
Lara.Control.RopeControl.Flag = s->lara()->control()->rope_control()->flag();
|
||||
Lara.Control.RopeControl.Count = s->lara()->control()->rope_control()->count();
|
||||
Lara.Control.SubsuitControl.XRot = s->lara()->control()->subsuit_control()->x_rot();
|
||||
Lara.Control.SubsuitControl.DXRot = s->lara()->control()->subsuit_control()->d_x_rot();
|
||||
Lara.Control.SubsuitControl.Velocity[0] = s->lara()->control()->subsuit_control()->velocity()->Get(0);
|
||||
Lara.Control.SubsuitControl.Velocity[1] = s->lara()->control()->subsuit_control()->velocity()->Get(1);
|
||||
Lara.Control.SubsuitControl.VerticalVelocity = s->lara()->control()->subsuit_control()->vertical_velocity();
|
||||
Lara.Control.SubsuitControl.XRotVel = s->lara()->control()->subsuit_control()->x_rot_vel();
|
||||
Lara.Control.SubsuitControl.HitCount = s->lara()->control()->subsuit_control()->hit_count();
|
||||
Lara.Control.TightropeControl.CanDismount = s->lara()->control()->tightrope_control()->can_dismount();
|
||||
Lara.Control.TightropeControl.TightropeItem = s->lara()->control()->tightrope_control()->tightrope_item();
|
||||
Lara.Control.TightropeControl.TimeOnTightrope = s->lara()->control()->tightrope_control()->time_on_tightrope();
|
||||
Lara.Control.Minecart.Left = s->lara()->control()->minecart()->left();
|
||||
Lara.Control.Minecart.Right = s->lara()->control()->minecart()->right();
|
||||
Lara.Control.Rope.Segment = s->lara()->control()->rope()->segment();
|
||||
Lara.Control.Rope.Direction = s->lara()->control()->rope()->direction();
|
||||
Lara.Control.Rope.ArcFront = s->lara()->control()->rope()->arc_front();
|
||||
Lara.Control.Rope.ArcBack = s->lara()->control()->rope()->arc_back();
|
||||
Lara.Control.Rope.LastX = s->lara()->control()->rope()->last_x();
|
||||
Lara.Control.Rope.MaxXForward = s->lara()->control()->rope()->max_x_forward();
|
||||
Lara.Control.Rope.MaxXBackward = s->lara()->control()->rope()->max_x_backward();
|
||||
Lara.Control.Rope.DFrame = s->lara()->control()->rope()->dframe();
|
||||
Lara.Control.Rope.Frame = s->lara()->control()->rope()->frame();
|
||||
Lara.Control.Rope.FrameRate = s->lara()->control()->rope()->frame_rate();
|
||||
Lara.Control.Rope.Y = s->lara()->control()->rope()->y();
|
||||
Lara.Control.Rope.Ptr = s->lara()->control()->rope()->ptr();
|
||||
Lara.Control.Rope.Offset = s->lara()->control()->rope()->offset();
|
||||
Lara.Control.Rope.DownVel = s->lara()->control()->rope()->down_vel();
|
||||
Lara.Control.Rope.Flag = s->lara()->control()->rope()->flag();
|
||||
Lara.Control.Rope.Count = s->lara()->control()->rope()->count();
|
||||
Lara.Control.Subsuit.XRot = s->lara()->control()->subsuit()->x_rot();
|
||||
Lara.Control.Subsuit.DXRot = s->lara()->control()->subsuit()->d_x_rot();
|
||||
Lara.Control.Subsuit.Velocity[0] = s->lara()->control()->subsuit()->velocity()->Get(0);
|
||||
Lara.Control.Subsuit.Velocity[1] = s->lara()->control()->subsuit()->velocity()->Get(1);
|
||||
Lara.Control.Subsuit.VerticalVelocity = s->lara()->control()->subsuit()->vertical_velocity();
|
||||
Lara.Control.Subsuit.XRotVel = s->lara()->control()->subsuit()->x_rot_vel();
|
||||
Lara.Control.Subsuit.HitCount = s->lara()->control()->subsuit()->hit_count();
|
||||
Lara.Control.Tightrope.Balance = s->lara()->control()->tightrope()->balance();
|
||||
Lara.Control.Tightrope.CanDismount = s->lara()->control()->tightrope()->can_dismount();
|
||||
Lara.Control.Tightrope.TightropeItem = s->lara()->control()->tightrope()->tightrope_item();
|
||||
Lara.Control.Tightrope.TimeOnTightrope = s->lara()->control()->tightrope()->time_on_tightrope();
|
||||
Lara.Secrets = s->lara()->secrets();
|
||||
Lara.Silencer = s->lara()->silencer();
|
||||
Lara.smallWaterskin = s->lara()->small_waterskin();
|
||||
Lara.SmallWaterskin = s->lara()->small_waterskin();
|
||||
Lara.SpasmEffectCount = s->lara()->spasm_effect_count();
|
||||
Lara.SprintEnergy = s->lara()->sprint_energy();
|
||||
Lara.TargetEntity = (s->lara()->target_item_number() >= 0 ? &g_Level.Items[s->lara()->target_item_number()] : nullptr);
|
||||
Lara.TargetAngle = s->lara()->target_angle();
|
||||
Lara.TargetArmAngles[0] = s->lara()->target_angles()->Get(0);
|
||||
Lara.TargetArmAngles[1] = s->lara()->target_angles()->Get(1);
|
||||
Lara.TargetArmAngles[0] = s->lara()->target_arm_angles()->Get(0);
|
||||
Lara.TargetArmAngles[1] = s->lara()->target_arm_angles()->Get(1);
|
||||
Lara.Torch = s->lara()->torch();
|
||||
Lara.Vehicle = s->lara()->vehicle();
|
||||
Lara.Control.WaterStatus = (WaterStatus)s->lara()->water_status();
|
||||
Lara.WaterSurfaceDist = s->lara()->water_surface_dist();
|
||||
Lara.Control.TightropeControl.Balance = s->lara()->control()->tightrope_control()->balance();
|
||||
|
||||
for (int i = 0; i < s->lara()->weapons()->size(); i++)
|
||||
{
|
||||
|
@ -1361,9 +1374,9 @@ bool SaveGame::Load(int slot)
|
|||
}
|
||||
|
||||
// Rope
|
||||
if (Lara.Control.RopeControl.Ptr >= 0)
|
||||
if (Lara.Control.Rope.Ptr >= 0)
|
||||
{
|
||||
ROPE_STRUCT* rope = &Ropes[Lara.Control.RopeControl.Ptr];
|
||||
ROPE_STRUCT* rope = &Ropes[Lara.Control.Rope.Ptr];
|
||||
|
||||
for (int i = 0; i < ROPE_SEGMENTS; i++)
|
||||
{
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace TEN::Entities::Effects
|
|||
|
||||
SoundEffect(SFX_TR4_LOOP_FOR_SMALL_FIRES, &item->Position, 0);
|
||||
|
||||
if (!Lara.burn
|
||||
if (!Lara.Burn
|
||||
&& ItemNearLara(&item->Position, 600)
|
||||
&& (SQUARE(LaraItem->Position.xPos - item->Position.xPos) +
|
||||
SQUARE(LaraItem->Position.zPos - item->Position.zPos) < SQUARE(512))
|
||||
|
@ -283,7 +283,7 @@ namespace TEN::Entities::Effects
|
|||
|
||||
if (!Lara.BurnSmoke)
|
||||
{
|
||||
if (Lara.burnBlue == 0)
|
||||
if (Lara.BurnBlue == 0)
|
||||
{
|
||||
TriggerDynamicLight(
|
||||
pos.x,
|
||||
|
@ -294,7 +294,7 @@ namespace TEN::Entities::Effects
|
|||
(GetRandomControl() & 0x1F) + 96,
|
||||
0);
|
||||
}
|
||||
else if (Lara.burnBlue == 1)
|
||||
else if (Lara.BurnBlue == 1)
|
||||
{
|
||||
TriggerDynamicLight(
|
||||
pos.x,
|
||||
|
@ -305,7 +305,7 @@ namespace TEN::Entities::Effects
|
|||
(GetRandomControl() & 0x1F) + 96,
|
||||
(GetRandomControl() & 0x3F) + 192);
|
||||
}
|
||||
else if (Lara.burnBlue == 2)
|
||||
else if (Lara.BurnBlue == 2)
|
||||
{
|
||||
TriggerDynamicLight(
|
||||
pos.x,
|
||||
|
@ -333,7 +333,7 @@ namespace TEN::Entities::Effects
|
|||
EffectNewRoom(fxNumber, LaraItem->RoomNumber);
|
||||
|
||||
int wh = GetWaterHeight(fx->pos.xPos, fx->pos.yPos, fx->pos.zPos, fx->roomNumber);
|
||||
if (wh == NO_HEIGHT || fx->pos.yPos <= wh || Lara.burnBlue)
|
||||
if (wh == NO_HEIGHT || fx->pos.yPos <= wh || Lara.BurnBlue)
|
||||
{
|
||||
SoundEffect(SFX_TR4_LOOP_FOR_SMALL_FIRES, &fx->pos, 0);
|
||||
|
||||
|
@ -343,13 +343,13 @@ namespace TEN::Entities::Effects
|
|||
else
|
||||
{
|
||||
KillEffect(fxNumber);
|
||||
Lara.burn = false;
|
||||
Lara.Burn = false;
|
||||
}
|
||||
|
||||
if (Lara.Control.WaterStatus == WaterStatus::FlyCheat)
|
||||
{
|
||||
KillEffect(fxNumber);
|
||||
Lara.burn = false;
|
||||
Lara.Burn = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -620,7 +620,7 @@ namespace TEN::Entities::Effects
|
|||
|
||||
if (ItemNearLara(&pos, 600))
|
||||
{
|
||||
if ((!Lara.burn) && Lara.Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
if ((!Lara.Burn) && Lara.Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
{
|
||||
LaraItem->HitPoints -= 5;
|
||||
LaraItem->HitStatus = true;
|
||||
|
@ -640,7 +640,7 @@ namespace TEN::Entities::Effects
|
|||
{
|
||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType != WEAPON_TORCH
|
||||
if (Lara.Control.Weapon.GunType != WEAPON_TORCH
|
||||
|| Lara.Control.HandStatus != HandStatus::WeaponReady
|
||||
|| Lara.LeftArm.Locked
|
||||
|| Lara.LitTorch == (item->Status & 1)
|
||||
|
|
|
@ -233,7 +233,7 @@ void ElectricityWiresControl(short itemNumber)
|
|||
if (collItem->Data.is<LaraInfo*>())
|
||||
{
|
||||
auto lara = (LaraInfo*&)collItem->Data;
|
||||
lara->burnBlue = 1;
|
||||
lara->BurnBlue = 1;
|
||||
lara->BurnCount = 48;
|
||||
|
||||
if (!isWaterNearby)
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace TEN::Entities::Generic
|
|||
switch (Lara.LeftArm.Locked)
|
||||
{
|
||||
case 0:
|
||||
if (Lara.Control.WeaponControl.RequestGunType != Lara.Control.WeaponControl.GunType)
|
||||
if (Lara.Control.Weapon.RequestGunType != Lara.Control.Weapon.GunType)
|
||||
{
|
||||
Lara.LeftArm.Locked = true;
|
||||
Lara.LeftArm.FrameNumber = 31;
|
||||
|
@ -112,13 +112,13 @@ namespace TEN::Entities::Generic
|
|||
Lara.LitTorch = false;
|
||||
Lara.Flare.ControlLeft = false;
|
||||
Lara.LeftArm.Locked = false;
|
||||
Lara.Control.WeaponControl.GunType = Lara.Control.WeaponControl.LastGunType;
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.GunType = Lara.Control.Weapon.LastGunType;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_NONE;
|
||||
Lara.Control.HandStatus = HandStatus::Free;
|
||||
}
|
||||
else if (Lara.LeftArm.FrameNumber == 12)
|
||||
{
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
CreateFlare(LaraItem, ID_BURNING_TORCH_ITEM, true);
|
||||
}
|
||||
}
|
||||
|
@ -132,13 +132,13 @@ namespace TEN::Entities::Generic
|
|||
Lara.LitTorch = false;
|
||||
Lara.Flare.ControlLeft = false;
|
||||
Lara.LeftArm.Locked = false;
|
||||
Lara.Control.WeaponControl.LastGunType = WEAPON_NONE;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.LastGunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.GunType = WEAPON_NONE;
|
||||
Lara.Control.HandStatus = HandStatus::Free;
|
||||
}
|
||||
else if (Lara.LeftArm.FrameNumber == 36)
|
||||
{
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
CreateFlare(LaraItem, ID_BURNING_TORCH_ITEM, false);
|
||||
}
|
||||
|
||||
|
@ -181,11 +181,11 @@ namespace TEN::Entities::Generic
|
|||
|
||||
void GetFlameTorch()
|
||||
{
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_FLARE)
|
||||
CreateFlare(LaraItem, ID_FLARE_ITEM, false);
|
||||
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_TORCH;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_TORCH;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_TORCH;
|
||||
Lara.Control.Weapon.GunType = WEAPON_TORCH;
|
||||
Lara.Flare.ControlLeft = true;
|
||||
Lara.LeftArm.AnimNumber = Objects[ID_LARA_TORCH_ANIM].animIndex;
|
||||
Lara.Control.HandStatus = HandStatus::WeaponReady;
|
||||
|
@ -193,7 +193,7 @@ namespace TEN::Entities::Generic
|
|||
Lara.LeftArm.FrameNumber = 0;
|
||||
Lara.LeftArm.FrameBase = g_Level.Anims[Lara.LeftArm.AnimNumber].framePtr;
|
||||
|
||||
Lara.meshPtrs[LM_LHAND] = Objects[ID_LARA_TORCH_ANIM].meshIndex + LM_LHAND;
|
||||
Lara.MeshPtrs[LM_LHAND] = Objects[ID_LARA_TORCH_ANIM].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void TorchControl(short itemNumber)
|
||||
|
@ -295,7 +295,7 @@ namespace TEN::Entities::Generic
|
|||
laraItem->ActiveState != LS_IDLE ||
|
||||
laraItem->AnimNumber != LA_STAND_IDLE ||
|
||||
laraItem->Airborne ||
|
||||
laraInfo->Control.WeaponControl.GunType != WEAPON_TORCH ||
|
||||
laraInfo->Control.Weapon.GunType != WEAPON_TORCH ||
|
||||
laraInfo->Control.HandStatus != HandStatus::WeaponReady ||
|
||||
laraInfo->LeftArm.Locked ||
|
||||
laraInfo->LitTorch == (torchItem->Status == ITEM_ACTIVE) ||
|
||||
|
|
|
@ -131,19 +131,19 @@ void TightropeCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
#ifdef NEW_TIGHTROPE
|
||||
if (laraItem->ActiveState == LS_TIGHTROPE_WALK &&
|
||||
laraItem->TargetState != LS_TIGHTROPE_DISMOUNT &&
|
||||
!laraInfo->Control.TightropeControl.CanDismount)
|
||||
!laraInfo->Control.Tightrope.CanDismount)
|
||||
{
|
||||
if (tightropeItem->Position.yRot == laraItem->Position.yRot)
|
||||
{
|
||||
if (abs(tightropeItem->Position.xPos - laraItem->Position.xPos) + abs(tightropeItem->Position.zPos - laraItem->Position.zPos) < 640)
|
||||
laraInfo->Control.TightropeControl.CanDismount = true;
|
||||
laraInfo->Control.Tightrope.CanDismount = true;
|
||||
}
|
||||
}
|
||||
|
||||
#else // !NEW_TIGHTROPE
|
||||
if (laraItem->ActiveState == LS_TIGHTROPE_WALK &&
|
||||
laraItem->TargetState != LS_TIGHTROPE_DISMOUNT &&
|
||||
!laraInfo->Control.TightropeControl.Off)
|
||||
!laraInfo->Control.Tightrope.Off)
|
||||
{
|
||||
if (item->Position.yRot == laraItem->Position.yRot)
|
||||
{
|
||||
|
@ -167,14 +167,14 @@ void TightropeCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
laraInfo->Control.IsMoving = false;
|
||||
ResetLaraFlex(laraItem);
|
||||
#ifdef NEW_TIGHTROPE
|
||||
laraInfo->Control.TightropeControl.Balance = 0;
|
||||
laraInfo->Control.TightropeControl.CanDismount = false;
|
||||
laraInfo->Control.TightropeControl.TightropeItem = itemNumber;
|
||||
laraInfo->Control.TightropeControl.TimeOnTightrope = 0;
|
||||
laraInfo->Control.Tightrope.Balance = 0;
|
||||
laraInfo->Control.Tightrope.CanDismount = false;
|
||||
laraInfo->Control.Tightrope.TightropeItem = itemNumber;
|
||||
laraInfo->Control.Tightrope.TimeOnTightrope = 0;
|
||||
#else // !NEW_TIGHTROPE
|
||||
laraInfo->Control.TightropeControl.OnCount = 60;
|
||||
laraInfo->Control.TightropeControl.Off = 0;
|
||||
laraInfo->Control.TightropeControl.Fall = 0;
|
||||
laraInfo->Control.Tightrope.OnCount = 60;
|
||||
laraInfo->Control.Tightrope.Off = 0;
|
||||
laraInfo->Control.Tightrope.Fall = 0;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
|
@ -197,8 +197,8 @@ namespace TEN::Entities::Generic
|
|||
{
|
||||
laraItem->AnimNumber = LA_REACH_TO_ROPE_SWING;
|
||||
laraItem->ActiveState = LS_ROPE_SWING;
|
||||
laraInfo->Control.RopeControl.Frame = g_Level.Anims[LA_ROPE_SWING].frameBase + 32 << 8;
|
||||
laraInfo->Control.RopeControl.DFrame = g_Level.Anims[LA_ROPE_SWING].frameBase + 60 << 8;
|
||||
laraInfo->Control.Rope.Frame = g_Level.Anims[LA_ROPE_SWING].frameBase + 32 << 8;
|
||||
laraInfo->Control.Rope.DFrame = g_Level.Anims[LA_ROPE_SWING].frameBase + 60 << 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -211,9 +211,9 @@ namespace TEN::Entities::Generic
|
|||
laraItem->Airborne = false;
|
||||
|
||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||
laraInfo->Control.RopeControl.Ptr = ropeItem->TriggerFlags;
|
||||
laraInfo->Control.RopeControl.Segment = segment;
|
||||
laraInfo->Control.RopeControl.Y = laraItem->Position.yRot;
|
||||
laraInfo->Control.Rope.Ptr = ropeItem->TriggerFlags;
|
||||
laraInfo->Control.Rope.Segment = segment;
|
||||
laraInfo->Control.Rope.Y = laraItem->Position.yRot;
|
||||
|
||||
DelAlignLaraToRope(laraItem);
|
||||
|
||||
|
@ -242,19 +242,19 @@ namespace TEN::Entities::Generic
|
|||
}
|
||||
}
|
||||
|
||||
if (Lara.Control.RopeControl.Ptr != -1 && rope == &Ropes[Lara.Control.RopeControl.Ptr])
|
||||
if (Lara.Control.Rope.Ptr != -1 && rope == &Ropes[Lara.Control.Rope.Ptr])
|
||||
{
|
||||
pendulumPointer = &CurrentPendulum;
|
||||
if (CurrentPendulum.node != Lara.Control.RopeControl.Segment + 1)
|
||||
if (CurrentPendulum.node != Lara.Control.Rope.Segment + 1)
|
||||
{
|
||||
SetPendulumPoint(rope, Lara.Control.RopeControl.Segment + 1);
|
||||
SetPendulumPoint(rope, Lara.Control.Rope.Segment + 1);
|
||||
flag = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pendulumPointer = &AlternatePendulum;
|
||||
if (Lara.Control.RopeControl.Ptr == -1 && CurrentPendulum.rope)
|
||||
if (Lara.Control.Rope.Ptr == -1 && CurrentPendulum.rope)
|
||||
{
|
||||
for (int i = 0; i < CurrentPendulum.node; i++)
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ namespace TEN::Entities::Generic
|
|||
}
|
||||
}
|
||||
|
||||
if (Lara.Control.RopeControl.Ptr != -1)
|
||||
if (Lara.Control.Rope.Ptr != -1)
|
||||
{
|
||||
vec.x = pendulumPointer->position.x - rope->segment[0].x;
|
||||
vec.y = pendulumPointer->position.y - rope->segment[0].y;
|
||||
|
@ -380,7 +380,7 @@ namespace TEN::Entities::Generic
|
|||
NormaliseRopeVector(&rope->normalisedSegment[i]);
|
||||
}
|
||||
|
||||
if (Lara.Control.RopeControl.Ptr != -1 && rope != &Ropes[Lara.Control.RopeControl.Ptr])
|
||||
if (Lara.Control.Rope.Ptr != -1 && rope != &Ropes[Lara.Control.Rope.Ptr])
|
||||
{
|
||||
rope->meshSegment[0].x = rope->segment[0].x;
|
||||
rope->meshSegment[0].y = rope->segment[0].y;
|
||||
|
@ -521,24 +521,24 @@ namespace TEN::Entities::Generic
|
|||
|
||||
void UpdateRopeSwing(ITEM_INFO* item)
|
||||
{
|
||||
if (Lara.Control.RopeControl.MaxXForward > 9000)
|
||||
Lara.Control.RopeControl.MaxXForward = 9000;
|
||||
if (Lara.Control.Rope.MaxXForward > 9000)
|
||||
Lara.Control.Rope.MaxXForward = 9000;
|
||||
|
||||
if (Lara.Control.RopeControl.MaxXBackward > 9000)
|
||||
Lara.Control.RopeControl.MaxXBackward = 9000;
|
||||
if (Lara.Control.Rope.MaxXBackward > 9000)
|
||||
Lara.Control.Rope.MaxXBackward = 9000;
|
||||
|
||||
if (Lara.Control.RopeControl.Direction)
|
||||
if (Lara.Control.Rope.Direction)
|
||||
{
|
||||
if (item->Position.xRot > 0 && item->Position.xRot - Lara.Control.RopeControl.LastX < -100)
|
||||
if (item->Position.xRot > 0 && item->Position.xRot - Lara.Control.Rope.LastX < -100)
|
||||
{
|
||||
Lara.Control.RopeControl.ArcFront = Lara.Control.RopeControl.LastX;
|
||||
Lara.Control.RopeControl.Direction = 0;
|
||||
Lara.Control.RopeControl.MaxXBackward = 0;
|
||||
int frame = 15 * Lara.Control.RopeControl.MaxXForward / 18000 + g_Level.Anims[LA_ROPE_SWING].frameBase + 47 << 8;
|
||||
Lara.Control.Rope.ArcFront = Lara.Control.Rope.LastX;
|
||||
Lara.Control.Rope.Direction = 0;
|
||||
Lara.Control.Rope.MaxXBackward = 0;
|
||||
int frame = 15 * Lara.Control.Rope.MaxXForward / 18000 + g_Level.Anims[LA_ROPE_SWING].frameBase + 47 << 8;
|
||||
|
||||
if (frame > Lara.Control.RopeControl.DFrame)
|
||||
if (frame > Lara.Control.Rope.DFrame)
|
||||
{
|
||||
Lara.Control.RopeControl.DFrame = frame;
|
||||
Lara.Control.Rope.DFrame = frame;
|
||||
RopeSwing = 1;
|
||||
}
|
||||
else
|
||||
|
@ -546,30 +546,30 @@ namespace TEN::Entities::Generic
|
|||
|
||||
SoundEffect(SFX_TR4_LARA_ROPE_CREAK, &item->Position, 0);
|
||||
}
|
||||
else if (Lara.Control.RopeControl.LastX < 0 && Lara.Control.RopeControl.Frame == Lara.Control.RopeControl.DFrame)
|
||||
else if (Lara.Control.Rope.LastX < 0 && Lara.Control.Rope.Frame == Lara.Control.Rope.DFrame)
|
||||
{
|
||||
RopeSwing = 0;
|
||||
Lara.Control.RopeControl.DFrame = 15 * Lara.Control.RopeControl.MaxXBackward / 18000 + g_Level.Anims[LA_ROPE_SWING].frameBase + 47 << 8;
|
||||
Lara.Control.RopeControl.FrameRate = 15 * Lara.Control.RopeControl.MaxXBackward / 9000 + 1;
|
||||
Lara.Control.Rope.DFrame = 15 * Lara.Control.Rope.MaxXBackward / 18000 + g_Level.Anims[LA_ROPE_SWING].frameBase + 47 << 8;
|
||||
Lara.Control.Rope.FrameRate = 15 * Lara.Control.Rope.MaxXBackward / 9000 + 1;
|
||||
}
|
||||
else if (Lara.Control.RopeControl.FrameRate < 512)
|
||||
else if (Lara.Control.Rope.FrameRate < 512)
|
||||
{
|
||||
int num = RopeSwing ? 31 : 7;
|
||||
Lara.Control.RopeControl.FrameRate += num * Lara.Control.RopeControl.MaxXBackward / 9000 + 1;
|
||||
Lara.Control.Rope.FrameRate += num * Lara.Control.Rope.MaxXBackward / 9000 + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item->Position.xRot < 0 && item->Position.xRot - Lara.Control.RopeControl.LastX > 100)
|
||||
if (item->Position.xRot < 0 && item->Position.xRot - Lara.Control.Rope.LastX > 100)
|
||||
{
|
||||
Lara.Control.RopeControl.ArcBack = Lara.Control.RopeControl.LastX;
|
||||
Lara.Control.RopeControl.Direction = 1;
|
||||
Lara.Control.RopeControl.MaxXForward = 0;
|
||||
Lara.Control.Rope.ArcBack = Lara.Control.Rope.LastX;
|
||||
Lara.Control.Rope.Direction = 1;
|
||||
Lara.Control.Rope.MaxXForward = 0;
|
||||
|
||||
int frame = g_Level.Anims[LA_ROPE_SWING].frameBase - 15 * Lara.Control.RopeControl.MaxXBackward / 18000 + 17 << 8;
|
||||
if (frame < Lara.Control.RopeControl.DFrame)
|
||||
int frame = g_Level.Anims[LA_ROPE_SWING].frameBase - 15 * Lara.Control.Rope.MaxXBackward / 18000 + 17 << 8;
|
||||
if (frame < Lara.Control.Rope.DFrame)
|
||||
{
|
||||
Lara.Control.RopeControl.DFrame = frame;
|
||||
Lara.Control.Rope.DFrame = frame;
|
||||
RopeSwing = 1;
|
||||
}
|
||||
else
|
||||
|
@ -577,35 +577,35 @@ namespace TEN::Entities::Generic
|
|||
|
||||
SoundEffect(SFX_TR4_LARA_ROPE_CREAK, &item->Position, 0);
|
||||
}
|
||||
else if (Lara.Control.RopeControl.LastX > 0 && Lara.Control.RopeControl.Frame == Lara.Control.RopeControl.DFrame)
|
||||
else if (Lara.Control.Rope.LastX > 0 && Lara.Control.Rope.Frame == Lara.Control.Rope.DFrame)
|
||||
{
|
||||
RopeSwing = 0;
|
||||
Lara.Control.RopeControl.DFrame = g_Level.Anims[LA_ROPE_SWING].frameBase - 15 * Lara.Control.RopeControl.MaxXForward / 18000 + 17 << 8;
|
||||
Lara.Control.RopeControl.FrameRate = 15 * Lara.Control.RopeControl.MaxXForward / 9000 + 1;
|
||||
Lara.Control.Rope.DFrame = g_Level.Anims[LA_ROPE_SWING].frameBase - 15 * Lara.Control.Rope.MaxXForward / 18000 + 17 << 8;
|
||||
Lara.Control.Rope.FrameRate = 15 * Lara.Control.Rope.MaxXForward / 9000 + 1;
|
||||
}
|
||||
else if (Lara.Control.RopeControl.FrameRate < 512)
|
||||
else if (Lara.Control.Rope.FrameRate < 512)
|
||||
{
|
||||
int num = RopeSwing ? 31 : 7;
|
||||
Lara.Control.RopeControl.FrameRate += num * Lara.Control.RopeControl.MaxXForward / 9000 + 1;
|
||||
Lara.Control.Rope.FrameRate += num * Lara.Control.Rope.MaxXForward / 9000 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
Lara.Control.RopeControl.LastX = item->Position.xRot;
|
||||
if (Lara.Control.RopeControl.Direction)
|
||||
Lara.Control.Rope.LastX = item->Position.xRot;
|
||||
if (Lara.Control.Rope.Direction)
|
||||
{
|
||||
if (item->Position.xRot > Lara.Control.RopeControl.MaxXForward)
|
||||
Lara.Control.RopeControl.MaxXForward = item->Position.xRot;
|
||||
if (item->Position.xRot > Lara.Control.Rope.MaxXForward)
|
||||
Lara.Control.Rope.MaxXForward = item->Position.xRot;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item->Position.xRot < -Lara.Control.RopeControl.MaxXBackward)
|
||||
Lara.Control.RopeControl.MaxXBackward = abs(item->Position.xRot);
|
||||
if (item->Position.xRot < -Lara.Control.Rope.MaxXBackward)
|
||||
Lara.Control.Rope.MaxXBackward = abs(item->Position.xRot);
|
||||
}
|
||||
}
|
||||
|
||||
void JumpOffRope(ITEM_INFO* item)
|
||||
{
|
||||
if (Lara.Control.RopeControl.Ptr != -1)
|
||||
if (Lara.Control.Rope.Ptr != -1)
|
||||
{
|
||||
if (item->Position.xRot >= 0)
|
||||
{
|
||||
|
@ -633,7 +633,7 @@ namespace TEN::Entities::Generic
|
|||
item->FrameNumber = g_Level.Anims[item->AnimNumber].frameBase;
|
||||
item->ActiveState = LS_REACH;
|
||||
item->TargetState = LS_REACH;
|
||||
Lara.Control.RopeControl.Ptr = -1;
|
||||
Lara.Control.Rope.Ptr = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -652,7 +652,7 @@ namespace TEN::Entities::Generic
|
|||
item->Airborne = true;
|
||||
|
||||
Lara.Control.HandStatus = HandStatus::Free;
|
||||
Lara.Control.RopeControl.Ptr = -1;
|
||||
Lara.Control.Rope.Ptr = -1;
|
||||
}
|
||||
|
||||
void LaraClimbRope(ITEM_INFO* item, COLL_INFO* coll)
|
||||
|
@ -663,29 +663,29 @@ namespace TEN::Entities::Generic
|
|||
{
|
||||
Camera.targetAngle = ANGLE(30.0f);
|
||||
|
||||
if (Lara.Control.RopeControl.Count)
|
||||
if (Lara.Control.Rope.Count)
|
||||
{
|
||||
if (!Lara.Control.RopeControl.Flag)
|
||||
if (!Lara.Control.Rope.Flag)
|
||||
{
|
||||
--Lara.Control.RopeControl.Count;
|
||||
Lara.Control.RopeControl.Offset += Lara.Control.RopeControl.DownVel;
|
||||
--Lara.Control.Rope.Count;
|
||||
Lara.Control.Rope.Offset += Lara.Control.Rope.DownVel;
|
||||
|
||||
if (!Lara.Control.RopeControl.Count)
|
||||
Lara.Control.RopeControl.Flag = 1;
|
||||
if (!Lara.Control.Rope.Count)
|
||||
Lara.Control.Rope.Flag = 1;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Lara.Control.RopeControl.Flag)
|
||||
if (!Lara.Control.Rope.Flag)
|
||||
{
|
||||
ROPE_STRUCT* rope = &Ropes[Lara.Control.RopeControl.Ptr];
|
||||
Lara.Control.RopeControl.Offset = 0;
|
||||
Lara.Control.RopeControl.DownVel = (unsigned int)(rope->meshSegment[Lara.Control.RopeControl.Segment + 1].y - rope->meshSegment[Lara.Control.RopeControl.Segment].y) >> 17;
|
||||
Lara.Control.RopeControl.Count = 0;
|
||||
Lara.Control.RopeControl.Offset += Lara.Control.RopeControl.DownVel;
|
||||
Lara.Control.RopeControl.Flag = 1;
|
||||
ROPE_STRUCT* rope = &Ropes[Lara.Control.Rope.Ptr];
|
||||
Lara.Control.Rope.Offset = 0;
|
||||
Lara.Control.Rope.DownVel = (unsigned int)(rope->meshSegment[Lara.Control.Rope.Segment + 1].y - rope->meshSegment[Lara.Control.Rope.Segment].y) >> 17;
|
||||
Lara.Control.Rope.Count = 0;
|
||||
Lara.Control.Rope.Offset += Lara.Control.Rope.DownVel;
|
||||
Lara.Control.Rope.Flag = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -694,12 +694,12 @@ namespace TEN::Entities::Generic
|
|||
{
|
||||
SoundEffect(SFX_TR4_LARA_POLE_LOOP, &LaraItem->Position, 0);
|
||||
item->FrameNumber = g_Level.Anims[item->AnimNumber].frameBase;
|
||||
Lara.Control.RopeControl.Flag = 0;
|
||||
++Lara.Control.RopeControl.Segment;
|
||||
Lara.Control.RopeControl.Offset = 0;
|
||||
Lara.Control.Rope.Flag = 0;
|
||||
++Lara.Control.Rope.Segment;
|
||||
Lara.Control.Rope.Offset = 0;
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_BACK) || Lara.Control.RopeControl.Segment >= 21)
|
||||
if (!(TrInput & IN_BACK) || Lara.Control.Rope.Segment >= 21)
|
||||
item->TargetState = LS_ROPE_IDLE;
|
||||
}
|
||||
}
|
||||
|
@ -718,11 +718,11 @@ namespace TEN::Entities::Generic
|
|||
vec.z = 0;
|
||||
|
||||
frame = (ANIM_FRAME*)GetBestFrame(item);
|
||||
ropeY = Lara.Control.RopeControl.Y - ANGLE(90);
|
||||
rope = &Ropes[Lara.Control.RopeControl.Ptr];
|
||||
ropeY = Lara.Control.Rope.Y - ANGLE(90);
|
||||
rope = &Ropes[Lara.Control.Rope.Ptr];
|
||||
|
||||
GetRopePos(rope, (Lara.Control.RopeControl.Segment - 1 << 7) + frame->offsetY, &pos.x, &pos.y, &pos.z);
|
||||
GetRopePos(rope, (Lara.Control.RopeControl.Segment - 1 << 7) + frame->offsetY - 192, &pos2.x, &pos2.y, &pos2.z);
|
||||
GetRopePos(rope, (Lara.Control.Rope.Segment - 1 << 7) + frame->offsetY, &pos.x, &pos.y, &pos.z);
|
||||
GetRopePos(rope, (Lara.Control.Rope.Segment - 1 << 7) + frame->offsetY - 192, &pos2.x, &pos2.y, &pos2.z);
|
||||
|
||||
diff.x = pos.x - pos2.x << 16;
|
||||
diff.y = pos.y - pos2.y << 16;
|
||||
|
@ -787,9 +787,9 @@ namespace TEN::Entities::Generic
|
|||
|
||||
phd_GetMatrixAngles(matrix, angle);
|
||||
|
||||
item->Position.xPos = rope->position.x + (rope->meshSegment[Lara.Control.RopeControl.Segment].x >> FP_SHIFT);
|
||||
item->Position.yPos = rope->position.y + (rope->meshSegment[Lara.Control.RopeControl.Segment].y >> FP_SHIFT) + Lara.Control.RopeControl.Offset;
|
||||
item->Position.zPos = rope->position.z + (rope->meshSegment[Lara.Control.RopeControl.Segment].z >> FP_SHIFT);
|
||||
item->Position.xPos = rope->position.x + (rope->meshSegment[Lara.Control.Rope.Segment].x >> FP_SHIFT);
|
||||
item->Position.yPos = rope->position.y + (rope->meshSegment[Lara.Control.Rope.Segment].y >> FP_SHIFT) + Lara.Control.Rope.Offset;
|
||||
item->Position.zPos = rope->position.z + (rope->meshSegment[Lara.Control.Rope.Segment].z >> FP_SHIFT);
|
||||
|
||||
Matrix rotMatrix = Matrix::CreateFromYawPitchRoll(
|
||||
TO_RAD(angle[1]),
|
||||
|
|
|
@ -10,26 +10,26 @@ namespace TEN::Entities::Traps
|
|||
{
|
||||
void DartControl(short itemNumber)
|
||||
{
|
||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
||||
auto* item = &g_Level.Items[itemNumber];
|
||||
|
||||
if (item->TouchBits)
|
||||
{
|
||||
LaraItem->HitPoints -= 25;
|
||||
LaraItem->HitStatus = true;
|
||||
Lara.Poisoned += 160;
|
||||
Lara.PoisonPotency += 1; // Was 160 with the total poison potency later shifted right by 8 when applied to Lara's health. The effect was that each dart contributed a mere fraction to the potency. @Sezz 2022.03.09
|
||||
DoBloodSplat(item->Position.xPos, item->Position.yPos, item->Position.zPos, (GetRandomControl() & 3) + 4, LaraItem->Position.yRot, LaraItem->RoomNumber);
|
||||
KillItem(itemNumber);
|
||||
}
|
||||
else
|
||||
{
|
||||
int oldX = item->Position.xPos;
|
||||
int oldZ = item->Position.zPos-1000;
|
||||
int oldZ = item->Position.zPos - 1000;
|
||||
|
||||
int speed = item->Velocity * phd_cos(item->Position.xRot);
|
||||
int velocity = item->Velocity * phd_cos(item->Position.xRot);
|
||||
|
||||
item->Position.xPos += speed * phd_sin(item->Position.yRot);
|
||||
item->Position.xPos += velocity * phd_sin(item->Position.yRot);
|
||||
item->Position.yPos -= item->Velocity * phd_sin(item->Position.xRot);
|
||||
item->Position.zPos += speed * phd_cos(item->Position.yRot);
|
||||
item->Position.zPos += velocity * phd_cos(item->Position.yRot);
|
||||
|
||||
short roomNumber = item->RoomNumber;
|
||||
FLOOR_INFO* floor = GetFloor(item->Position.xPos, item->Position.yPos, item->Position.zPos, &roomNumber);
|
||||
|
@ -43,9 +43,7 @@ namespace TEN::Entities::Traps
|
|||
if (item->Position.yPos >= height)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
TriggerDartSmoke(oldX, item->Position.yPos, oldZ, 0, 0, true);
|
||||
}
|
||||
|
||||
KillItem(itemNumber);
|
||||
}
|
||||
|
@ -64,10 +62,8 @@ namespace TEN::Entities::Traps
|
|||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->Timer = 24;
|
||||
}
|
||||
}
|
||||
|
||||
short dartItemNumber = CreateItem();
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ void DoppelgangerControl(short itemNumber)
|
|||
if (item->HitPoints < 1000)
|
||||
{
|
||||
item->HitPoints = 1000;
|
||||
LaraItem->HitPoints -= GetWeaponDamage(Lara.Control.WeaponControl.GunType);
|
||||
LaraItem->HitPoints -= GetWeaponDamage(Lara.Control.Weapon.GunType);
|
||||
}
|
||||
|
||||
auto* reference = FindReference(item, ID_BACON_REFERENCE);
|
||||
|
|
|
@ -209,7 +209,7 @@ void GiantMutantControl(short itemNumber)
|
|||
LaraItem->HitPoints = -1;
|
||||
Lara.Air = -1;
|
||||
Lara.Control.HandStatus = HandStatus::Busy;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -212,9 +212,9 @@ void DragonCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
|
||||
Lara.ExtraAnim = 1;
|
||||
Lara.Control.HandStatus = HandStatus::Busy;
|
||||
Lara.hitDirection = -1;
|
||||
Lara.HitDirection = -1;
|
||||
|
||||
Lara.meshPtrs[LM_RHAND] = Objects[ID_LARA_EXTRA_ANIMS].meshIndex + LM_RHAND;
|
||||
Lara.MeshPtrs[LM_RHAND] = Objects[ID_LARA_EXTRA_ANIMS].meshIndex + LM_RHAND;
|
||||
|
||||
((CreatureInfo*)g_Level.Items[(short)item->Data].Data)->Flags = -1;
|
||||
|
||||
|
|
|
@ -300,12 +300,12 @@ void SkidooCollision(short itemNum, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
|
||||
lara->Vehicle = itemNum;
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, false);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
lara->Flare.ControlLeft = 0;
|
||||
lara->Control.WeaponControl.RequestGunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.RequestGunType = WEAPON_NONE;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,24 +59,24 @@ void CobraControl(short itemNumber)
|
|||
}
|
||||
else
|
||||
{
|
||||
AI_INFO aiInfo;
|
||||
CreatureAIInfo(item, &aiInfo);
|
||||
AI_INFO AI;
|
||||
CreatureAIInfo(item, &AI);
|
||||
|
||||
aiInfo.angle += 0xC00;
|
||||
AI.angle += ANGLE(16.8f);
|
||||
|
||||
GetCreatureMood(item, &aiInfo, 1);
|
||||
CreatureMood(item, &aiInfo, 1);
|
||||
GetCreatureMood(item, &AI, 1);
|
||||
CreatureMood(item, &AI, 1);
|
||||
|
||||
info->Target.x = LaraItem->Position.xPos;
|
||||
info->Target.z = LaraItem->Position.zPos;
|
||||
angle = CreatureTurn(item, info->MaxTurn);
|
||||
|
||||
if (aiInfo.ahead)
|
||||
head = aiInfo.angle;
|
||||
if (AI.ahead)
|
||||
head = AI.angle;
|
||||
|
||||
if (abs(aiInfo.angle) < ANGLE(10.0f))
|
||||
item->Position.yRot += aiInfo.angle;
|
||||
else if (aiInfo.angle < 0)
|
||||
if (abs(AI.angle) < ANGLE(10.0f))
|
||||
item->Position.yRot += AI.angle;
|
||||
else if (AI.angle < 0)
|
||||
item->Position.yRot -= ANGLE(10.0f);
|
||||
else
|
||||
item->Position.yRot += ANGLE(10.0f);
|
||||
|
@ -85,10 +85,11 @@ void CobraControl(short itemNumber)
|
|||
{
|
||||
case 1:
|
||||
info->Flags = 0;
|
||||
if (aiInfo.distance > pow(SECTOR(2.5f), 2))
|
||||
|
||||
if (AI.distance > pow(SECTOR(2.5f), 2))
|
||||
item->TargetState = 3;
|
||||
else if (LaraItem->HitPoints > 0 &&
|
||||
((aiInfo.ahead && aiInfo.distance < pow(SECTOR(1), 2)) || item->HitStatus || LaraItem->Velocity > 15))
|
||||
((AI.ahead && AI.distance < pow(SECTOR(1), 2)) || item->HitStatus || LaraItem->Velocity > 15))
|
||||
{
|
||||
item->TargetState = 2;
|
||||
}
|
||||
|
@ -97,12 +98,13 @@ void CobraControl(short itemNumber)
|
|||
|
||||
case 3:
|
||||
info->Flags = 0;
|
||||
|
||||
if (item->HitPoints != -16384)
|
||||
{
|
||||
item->ItemFlags[2] = item->HitPoints;
|
||||
item->HitPoints = -16384;
|
||||
}
|
||||
if (aiInfo.distance < pow(SECTOR(1.5f), 2) && LaraItem->HitPoints > 0)
|
||||
if (AI.distance < pow(SECTOR(1.5f), 2) && LaraItem->HitPoints > 0)
|
||||
{
|
||||
item->TargetState = 0;
|
||||
item->HitPoints = item->ItemFlags[2];
|
||||
|
@ -113,13 +115,12 @@ void CobraControl(short itemNumber)
|
|||
case 2:
|
||||
if (info->Flags != 1 && item->TouchBits & 0x2000)
|
||||
{
|
||||
CreatureEffect(item, &CobraBite, DoBloodSplat);
|
||||
info->Flags = 1;
|
||||
|
||||
LaraItem->HitPoints -= 80;
|
||||
LaraItem->HitStatus = true;
|
||||
Lara.Poisoned = 0x100;
|
||||
|
||||
CreatureEffect(item, &CobraBite, DoBloodSplat);
|
||||
Lara.PoisonPotency += 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -131,7 +132,7 @@ void CobraControl(short itemNumber)
|
|||
}
|
||||
|
||||
CreatureTilt(item, tilt);
|
||||
CreatureJoint(item, 0, head >> 1);
|
||||
CreatureJoint(item, 1, head >> 1);
|
||||
CreatureJoint(item, 0, head / 2);
|
||||
CreatureJoint(item, 1, head / 2);
|
||||
CreatureAnimation(itemNumber, angle, tilt);
|
||||
}
|
||||
|
|
|
@ -422,7 +422,7 @@ void ControlTonyFireBall(short fxNumber)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!Lara.burn)
|
||||
if (!Lara.Burn)
|
||||
{
|
||||
if (ItemNearLara(&fx->pos, 200))
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ void LaraTRexDeath(ITEM_INFO* tRexItem, ITEM_INFO* laraItem)
|
|||
laraItem->HitPoints = -16384;
|
||||
Lara.Air = -1;
|
||||
Lara.Control.HandStatus = HandStatus::Busy;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.GunType = WEAPON_NONE;
|
||||
|
||||
Camera.flags = 1;
|
||||
Camera.targetAngle = ANGLE(170.0f);
|
||||
|
|
|
@ -324,8 +324,8 @@ void TribemanDartsControl(short itemNum)
|
|||
if (!CreatureActive(itemNum))
|
||||
return;
|
||||
|
||||
ITEM_INFO* item = &g_Level.Items[itemNum];
|
||||
CreatureInfo* creature = (CreatureInfo *)item->Data;
|
||||
auto* item = &g_Level.Items[itemNum];
|
||||
auto* creature = (CreatureInfo *)item->Data;
|
||||
|
||||
short headX = 0;
|
||||
short headY = 0;
|
||||
|
@ -351,35 +351,35 @@ void TribemanDartsControl(short itemNum)
|
|||
if (item->AIBits)
|
||||
GetAITarget(creature);
|
||||
|
||||
AI_INFO info;
|
||||
CreatureAIInfo(item, &info);
|
||||
AI_INFO AI;
|
||||
CreatureAIInfo(item, &AI);
|
||||
|
||||
GetCreatureMood(item, &info, (info.zoneNumber == info.enemyZone ? VIOLENT : TIMID));
|
||||
GetCreatureMood(item, &AI, (AI.zoneNumber == AI.enemyZone ? VIOLENT : TIMID));
|
||||
|
||||
if (item->HitStatus && Lara.Poisoned >= 0x100 && creature->Mood == MoodType::Bored)
|
||||
if (item->HitStatus && Lara.PoisonPotency && creature->Mood == MoodType::Bored)
|
||||
creature->Mood = MoodType::Escape;
|
||||
|
||||
CreatureMood(item, &info, TIMID);
|
||||
CreatureMood(item, &AI, TIMID);
|
||||
|
||||
angle = CreatureTurn(item, creature->Mood == MoodType::Bored ? ANGLE(2) : creature->MaxTurn);
|
||||
if (info.ahead)
|
||||
if (AI.ahead)
|
||||
{
|
||||
headY = info.angle / 2;
|
||||
torsoY = info.angle / 2;
|
||||
headY = AI.angle / 2;
|
||||
torsoY = AI.angle / 2;
|
||||
}
|
||||
|
||||
if (item->HitStatus ||
|
||||
(creature->Enemy == LaraItem && (info.distance < 1024 ||
|
||||
TargetVisible(item, &info)) && (abs(LaraItem->Position.yPos - item->Position.yPos) < 2048)))
|
||||
(creature->Enemy == LaraItem && (AI.distance < 1024 ||
|
||||
TargetVisible(item, &AI)) && (abs(LaraItem->Position.yPos - item->Position.yPos) < 2048)))
|
||||
AlertAllGuards(itemNum);
|
||||
|
||||
switch (item->ActiveState)
|
||||
{
|
||||
case 1:
|
||||
if (info.ahead)
|
||||
if (AI.ahead)
|
||||
{
|
||||
torsoY = info.angle;
|
||||
torsoX = info.xAngle / 2;
|
||||
torsoY = AI.angle;
|
||||
torsoX = AI.xAngle / 2;
|
||||
}
|
||||
creature->Flags &= 0x0FFF;
|
||||
creature->MaxTurn = ANGLE(2);
|
||||
|
@ -395,16 +395,16 @@ void TribemanDartsControl(short itemNum)
|
|||
}
|
||||
else if (creature->Mood == MoodType::Escape)
|
||||
{
|
||||
if (Lara.TargetEntity != item && info.ahead && !item->HitStatus)
|
||||
if (Lara.TargetEntity != item && AI.ahead && !item->HitStatus)
|
||||
item->TargetState = 1;
|
||||
else
|
||||
item->TargetState = 3;
|
||||
}
|
||||
else if (info.bite && info.distance < SQUARE(WALL_SIZE / 2))
|
||||
else if (AI.bite && AI.distance < SQUARE(WALL_SIZE / 2))
|
||||
item->TargetState = 11;
|
||||
else if (info.bite && info.distance < SQUARE(WALL_SIZE * 2))
|
||||
else if (AI.bite && AI.distance < SQUARE(WALL_SIZE * 2))
|
||||
item->TargetState = 2;
|
||||
else if (Targetable(item, &info) && info.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
else if (Targetable(item, &AI) && AI.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
item->TargetState = 4;
|
||||
else if (creature->Mood == MoodType::Bored)
|
||||
{
|
||||
|
@ -432,16 +432,16 @@ void TribemanDartsControl(short itemNum)
|
|||
}
|
||||
else if (creature->Mood == MoodType::Escape)
|
||||
{
|
||||
if (Lara.TargetEntity != item && info.ahead && !item->HitStatus)
|
||||
if (Lara.TargetEntity != item && AI.ahead && !item->HitStatus)
|
||||
item->TargetState = 1;
|
||||
else
|
||||
item->TargetState = 3;
|
||||
}
|
||||
else if (info.bite && info.distance < SQUARE(WALL_SIZE / 2))
|
||||
else if (AI.bite && AI.distance < SQUARE(WALL_SIZE / 2))
|
||||
item->TargetState = 6;
|
||||
else if (info.bite && info.distance < SQUARE(WALL_SIZE * 2))
|
||||
else if (AI.bite && AI.distance < SQUARE(WALL_SIZE * 2))
|
||||
item->TargetState = 2;
|
||||
else if (Targetable(item, &info) && info.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
else if (Targetable(item, &AI) && AI.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
item->TargetState = 1;
|
||||
else if (creature->Mood == MoodType::Bored && GetRandomControl() < 0x200)
|
||||
item->TargetState = 2;
|
||||
|
@ -452,11 +452,11 @@ void TribemanDartsControl(short itemNum)
|
|||
case 2:
|
||||
creature->MaxTurn = ANGLE(9);
|
||||
|
||||
if (info.bite && info.distance < SQUARE(WALL_SIZE / 2))
|
||||
if (AI.bite && AI.distance < SQUARE(WALL_SIZE / 2))
|
||||
item->TargetState = 11;
|
||||
else if (info.bite && info.distance < SQUARE(WALL_SIZE * 2))
|
||||
else if (AI.bite && AI.distance < SQUARE(WALL_SIZE * 2))
|
||||
item->TargetState = 2;
|
||||
else if (Targetable(item, &info) && info.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
else if (Targetable(item, &AI) && AI.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
item->TargetState = 1;
|
||||
else if (creature->Mood == MoodType::Escape)
|
||||
item->TargetState = 3;
|
||||
|
@ -469,7 +469,7 @@ void TribemanDartsControl(short itemNum)
|
|||
else
|
||||
item->TargetState = 1;
|
||||
}
|
||||
else if (info.distance > SQUARE(2048))
|
||||
else if (AI.distance > SQUARE(2048))
|
||||
item->TargetState = 3;
|
||||
break;
|
||||
|
||||
|
@ -478,35 +478,35 @@ void TribemanDartsControl(short itemNum)
|
|||
creature->MaxTurn = ANGLE(6);
|
||||
tilt = angle / 4;
|
||||
|
||||
if (info.bite && info.distance < SQUARE(WALL_SIZE / 2))
|
||||
if (AI.bite && AI.distance < SQUARE(WALL_SIZE / 2))
|
||||
item->TargetState = 11;
|
||||
else if (Targetable(item, &info) && info.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
else if (Targetable(item, &AI) && AI.distance < SQUARE(MAX_VISIBILITY_DISTANCE))
|
||||
item->TargetState = 1;
|
||||
if (item->AIBits & GUARD)
|
||||
item->TargetState = 11;
|
||||
else if (creature->Mood == MoodType::Escape && Lara.TargetEntity != item && info.ahead)
|
||||
else if (creature->Mood == MoodType::Escape && Lara.TargetEntity != item && AI.ahead)
|
||||
item->TargetState = 11;
|
||||
else if (creature->Mood == MoodType::Bored)
|
||||
item->TargetState = 1;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
if (!info.bite || info.distance > SQUARE(512))
|
||||
if (!AI.bite || AI.distance > SQUARE(512))
|
||||
item->TargetState = 11;
|
||||
else
|
||||
item->TargetState = 6;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (info.ahead)
|
||||
if (AI.ahead)
|
||||
{
|
||||
torsoY = info.angle;
|
||||
torsoX = info.xAngle;
|
||||
torsoY = AI.angle;
|
||||
torsoX = AI.xAngle;
|
||||
}
|
||||
creature->MaxTurn = 0;
|
||||
if (abs(info.angle) < ANGLE(2))
|
||||
item->Position.yRot += info.angle;
|
||||
else if (info.angle < 0)
|
||||
if (abs(AI.angle) < ANGLE(2))
|
||||
item->Position.yRot += AI.angle;
|
||||
else if (AI.angle < 0)
|
||||
item->Position.yRot -= ANGLE(2);
|
||||
else
|
||||
item->Position.yRot += ANGLE(2);
|
||||
|
|
|
@ -121,8 +121,8 @@ void TrainCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
|
||||
laraInfo->ExtraAnim = 1;
|
||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||
laraInfo->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
laraInfo->hitDirection = -1;
|
||||
laraInfo->Control.Weapon.GunType = WEAPON_NONE;
|
||||
laraInfo->HitDirection = -1;
|
||||
laraInfo->Air = -1;
|
||||
|
||||
trainItem->ItemFlags[1] = 160;
|
||||
|
|
|
@ -152,14 +152,14 @@ void BigGunCollision(short itemNum, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
{
|
||||
lara->Vehicle = itemNum;
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, false);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
|
||||
lara->Flare.ControlLeft = false;
|
||||
lara->Control.WeaponControl.RequestGunType = WEAPON_NONE;
|
||||
lara->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.RequestGunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
laraItem->AnimNumber = Objects[ID_BIGGUN_ANIMS].animIndex + BGUN_ANIM_MOUNT;
|
||||
|
|
|
@ -380,9 +380,9 @@ void KayakDoCurrent(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
auto* lara = GetLaraInfo(laraItem);
|
||||
auto* room = &g_Level.Rooms[kayakItem->RoomNumber];
|
||||
|
||||
if (!lara->Control.WaterCurrentActive)
|
||||
if (!lara->WaterCurrentActive)
|
||||
{
|
||||
int absVelocity = abs(lara->ExtraVelocity.x);
|
||||
int absVelocity = abs(lara->WaterCurrentPull.x);
|
||||
int shift;
|
||||
|
||||
if (absVelocity > 16)
|
||||
|
@ -392,12 +392,12 @@ void KayakDoCurrent(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
else
|
||||
shift = 2;
|
||||
|
||||
lara->ExtraVelocity.x -= lara->ExtraVelocity.x >> shift;
|
||||
lara->WaterCurrentPull.x -= lara->WaterCurrentPull.x >> shift;
|
||||
|
||||
if (abs(lara->ExtraVelocity.x) < 4)
|
||||
lara->ExtraVelocity.x = 0;
|
||||
if (abs(lara->WaterCurrentPull.x) < 4)
|
||||
lara->WaterCurrentPull.x = 0;
|
||||
|
||||
absVelocity = abs(lara->ExtraVelocity.z);
|
||||
absVelocity = abs(lara->WaterCurrentPull.z);
|
||||
if (absVelocity > 16)
|
||||
shift = 4;
|
||||
else if (absVelocity > 8)
|
||||
|
@ -405,16 +405,16 @@ void KayakDoCurrent(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
else
|
||||
shift = 2;
|
||||
|
||||
lara->ExtraVelocity.z -= lara->ExtraVelocity.z >> shift;
|
||||
if (abs(lara->ExtraVelocity.z) < 4)
|
||||
lara->ExtraVelocity.z = 0;
|
||||
lara->WaterCurrentPull.z -= lara->WaterCurrentPull.z >> shift;
|
||||
if (abs(lara->WaterCurrentPull.z) < 4)
|
||||
lara->WaterCurrentPull.z = 0;
|
||||
|
||||
if (lara->ExtraVelocity.x == 0 && lara->ExtraVelocity.z == 0)
|
||||
if (lara->WaterCurrentPull.x == 0 && lara->WaterCurrentPull.z == 0)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
int sinkval = lara->Control.WaterCurrentActive - 1;
|
||||
int sinkval = lara->WaterCurrentActive - 1;
|
||||
|
||||
PHD_VECTOR target;
|
||||
target.x = g_Level.Sinks[sinkval].x;
|
||||
|
@ -430,14 +430,14 @@ void KayakDoCurrent(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
dx = phd_sin(angle * 16) * velocity * 1024;
|
||||
dz = phd_cos(angle * 16) * velocity * 1024;
|
||||
|
||||
lara->ExtraVelocity.x += (dx - lara->ExtraVelocity.x) / 16;
|
||||
lara->ExtraVelocity.z += (dz - lara->ExtraVelocity.z) / 16;
|
||||
lara->WaterCurrentPull.x += (dx - lara->WaterCurrentPull.x) / 16;
|
||||
lara->WaterCurrentPull.z += (dz - lara->WaterCurrentPull.z) / 16;
|
||||
}
|
||||
|
||||
kayakItem->Position.xPos += lara->ExtraVelocity.x / 256;
|
||||
kayakItem->Position.zPos += lara->ExtraVelocity.z / 256;
|
||||
kayakItem->Position.xPos += lara->WaterCurrentPull.x / 256;
|
||||
kayakItem->Position.zPos += lara->WaterCurrentPull.z / 256;
|
||||
|
||||
lara->Control.WaterCurrentActive = 0;
|
||||
lara->WaterCurrentActive = 0;
|
||||
}
|
||||
|
||||
int KayakTestHeight(ITEM_INFO* kayakItem, int x, int z, PHD_VECTOR* pos)
|
||||
|
@ -746,8 +746,8 @@ void KayakUserInput(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
{
|
||||
case KAYAK_STATE_IDLE:
|
||||
if (TrInput & KAYAK_IN_DISMOUNT &&
|
||||
!lara->Control.WaterCurrentActive &&
|
||||
!lara->ExtraVelocity.x && !lara->ExtraVelocity.z)
|
||||
!lara->WaterCurrentActive &&
|
||||
!lara->WaterCurrentPull.x && !lara->WaterCurrentPull.z)
|
||||
{
|
||||
if (TrInput & KAYAK_IN_LEFT && KayakCanGetOut(kayakItem, -1))
|
||||
{
|
||||
|
@ -793,15 +793,15 @@ void KayakUserInput(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
}
|
||||
else if (TrInput & KAYAK_IN_HOLD_LEFT &&
|
||||
(kayak->Velocity ||
|
||||
lara->ExtraVelocity.x ||
|
||||
lara->ExtraVelocity.z))
|
||||
lara->WaterCurrentPull.x ||
|
||||
lara->WaterCurrentPull.z))
|
||||
{
|
||||
laraItem->TargetState = KAYAK_STATE_HOLD_LEFT;
|
||||
}
|
||||
else if (TrInput & KAYAK_IN_HOLD_RIGHT &&
|
||||
(kayak->Velocity ||
|
||||
lara->ExtraVelocity.x ||
|
||||
lara->ExtraVelocity.z))
|
||||
lara->WaterCurrentPull.x ||
|
||||
lara->WaterCurrentPull.z))
|
||||
{
|
||||
laraItem->TargetState = KAYAK_STATE_HOLD_RIGHT;
|
||||
}
|
||||
|
@ -958,8 +958,8 @@ void KayakUserInput(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
case KAYAK_STATE_HOLD_LEFT:
|
||||
if (!(TrInput & KAYAK_IN_HOLD_LEFT) ||
|
||||
(!kayak->Velocity &&
|
||||
!lara->ExtraVelocity.x &&
|
||||
!lara->ExtraVelocity.z))
|
||||
!lara->WaterCurrentPull.x &&
|
||||
!lara->WaterCurrentPull.z))
|
||||
{
|
||||
laraItem->TargetState = KAYAK_STATE_IDLE;
|
||||
}
|
||||
|
@ -994,8 +994,8 @@ void KayakUserInput(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
case KAYAK_STATE_HOLD_RIGHT:
|
||||
if (!(TrInput & KAYAK_IN_HOLD_RIGHT) ||
|
||||
(!kayak->Velocity &&
|
||||
!lara->ExtraVelocity.x &&
|
||||
!lara->ExtraVelocity.z))
|
||||
!lara->WaterCurrentPull.x &&
|
||||
!lara->WaterCurrentPull.z))
|
||||
{
|
||||
laraItem->TargetState = KAYAK_STATE_IDLE;
|
||||
}
|
||||
|
@ -1033,7 +1033,7 @@ void KayakUserInput(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
!(kayak->Flags & 0x80))
|
||||
{
|
||||
kayak->Flags |= 0x80;
|
||||
lara->meshPtrs[LM_RHAND] = Objects[ID_KAYAK_LARA_ANIMS].meshIndex + LM_RHAND;
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[ID_KAYAK_LARA_ANIMS].meshIndex + LM_RHAND;
|
||||
laraItem->MeshBits &= ~LARA_LEG_BITS;
|
||||
}
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ void KayakUserInput(ITEM_INFO* laraItem, ITEM_INFO* kayakItem)
|
|||
kayak->Flags & 0x80)
|
||||
{
|
||||
kayak->Flags &= ~0x80;
|
||||
lara->meshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_RHAND;
|
||||
laraItem->MeshBits |= LARA_LEG_BITS;
|
||||
}
|
||||
|
||||
|
@ -1200,8 +1200,8 @@ void KayakLaraRapidsDrown(ITEM_INFO* laraItem)
|
|||
|
||||
lara->ExtraAnim = 1;
|
||||
lara->Control.HandStatus = HandStatus::Busy;
|
||||
lara->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
lara->hitDirection = -1;
|
||||
lara->Control.Weapon.GunType = WEAPON_NONE;
|
||||
lara->HitDirection = -1;
|
||||
}
|
||||
|
||||
void KayakCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
||||
|
@ -1218,12 +1218,12 @@ void KayakCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
{
|
||||
lara->Vehicle = itemNumber;
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, 0);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
lara->Flare.ControlLeft = 0;
|
||||
lara->Control.WeaponControl.RequestGunType = lara->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
if (mountType == KayakMountType::Right)
|
||||
|
@ -1353,8 +1353,8 @@ bool KayakControl(ITEM_INFO* laraItem)
|
|||
}
|
||||
|
||||
if (!kayakItem->Velocity &&
|
||||
!lara->ExtraVelocity.x &&
|
||||
!lara->ExtraVelocity.z)
|
||||
!lara->WaterCurrentPull.x &&
|
||||
!lara->WaterCurrentPull.z)
|
||||
{
|
||||
if (kayak->WakeShade)
|
||||
kayak->WakeShade--;
|
||||
|
|
|
@ -297,7 +297,7 @@ static void MoveCart(ITEM_INFO* laraItem, ITEM_INFO* minecartItem)
|
|||
if (minecart->StopDelay)
|
||||
minecart->StopDelay--;
|
||||
|
||||
if ((lara->mineL && lara->mineR && !minecart->StopDelay) &&
|
||||
if ((lara->Control.Minecart.Left && lara->Control.Minecart.Right && !minecart->StopDelay) &&
|
||||
(minecartItem->Position.xPos & 0x380 == 512 ||
|
||||
minecartItem->Position.zRot & 0x380 == 512))
|
||||
{
|
||||
|
@ -312,13 +312,13 @@ static void MoveCart(ITEM_INFO* laraItem, ITEM_INFO* minecartItem)
|
|||
minecart->StopDelay = 16;
|
||||
}
|
||||
|
||||
if ((lara->mineL || lara->mineR) &&
|
||||
!(lara->mineL && lara->mineR) &&
|
||||
if ((lara->Control.Minecart.Left || lara->Control.Minecart.Right) &&
|
||||
!(lara->Control.Minecart.Left && lara->Control.Minecart.Right) &&
|
||||
!minecart->StopDelay &&
|
||||
!(minecart->Flags & (CART_FLAG_TURNING_LEFT | CART_FLAG_TURNING_RIGHT)))
|
||||
{
|
||||
short angle;
|
||||
unsigned short rotation = (((unsigned short)minecartItem->Position.yRot) / ANGLE(90.0f)) | (lara->mineL * 4);
|
||||
unsigned short rotation = (((unsigned short)minecartItem->Position.yRot) / ANGLE(90.0f)) | (lara->Control.Minecart.Left * 4);
|
||||
|
||||
switch (rotation)
|
||||
{
|
||||
|
@ -380,7 +380,7 @@ static void MoveCart(ITEM_INFO* laraItem, ITEM_INFO* minecartItem)
|
|||
minecart->TurnLen = angle;
|
||||
}
|
||||
|
||||
minecart->Flags |= (lara->mineL) ? CART_FLAG_TURNING_LEFT : CART_FLAG_TURNING_RIGHT;
|
||||
minecart->Flags |= (lara->Control.Minecart.Left) ? CART_FLAG_TURNING_LEFT : CART_FLAG_TURNING_RIGHT;
|
||||
}
|
||||
|
||||
if (minecart->Velocity < CART_MIN_SPEED)
|
||||
|
@ -446,8 +446,8 @@ static void MoveCart(ITEM_INFO* laraItem, ITEM_INFO* minecartItem)
|
|||
x = phd_sin(degree);
|
||||
z = phd_cos(degree);
|
||||
break;
|
||||
case 2:
|
||||
|
||||
case 2:
|
||||
x = phd_cos(degree);
|
||||
z = -phd_sin(degree);
|
||||
break;
|
||||
|
@ -666,7 +666,7 @@ static void DoUserInput(ITEM_INFO* minecartItem, ITEM_INFO* laraItem, MinecartIn
|
|||
if (laraItem->FrameNumber == GetFrameNumber(minecartItem, 20) &&
|
||||
minecart->Flags & CART_FLAG_MESH)
|
||||
{
|
||||
lara->meshPtrs[LM_RHAND] = Objects[ID_MINECART_LARA_ANIMS].meshIndex + LM_RHAND;
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[ID_MINECART_LARA_ANIMS].meshIndex + LM_RHAND;
|
||||
minecart->Flags &= ~CART_FLAG_MESH;
|
||||
}
|
||||
|
||||
|
@ -727,10 +727,10 @@ static void DoUserInput(ITEM_INFO* minecartItem, ITEM_INFO* laraItem, MinecartIn
|
|||
laraItem->FrameNumber == GetFrameNumber(minecartItem, 20) &&
|
||||
!minecart->Flags & CART_FLAG_MESH)
|
||||
{
|
||||
MESH tmp = g_Level.Meshes[lara->meshPtrs[LM_RHAND]];
|
||||
auto temp = g_Level.Meshes[lara->MeshPtrs[LM_RHAND]];
|
||||
|
||||
lara->meshPtrs[LM_RHAND] = Objects[ID_MINECART_LARA_ANIMS].meshIndex + LM_RHAND;
|
||||
g_Level.Meshes[Objects[ID_MINECART_LARA_ANIMS].meshIndex + LM_RHAND] = tmp;
|
||||
lara->MeshPtrs[LM_RHAND] = Objects[ID_MINECART_LARA_ANIMS].meshIndex + LM_RHAND;
|
||||
g_Level.Meshes[Objects[ID_MINECART_LARA_ANIMS].meshIndex + LM_RHAND] = temp;
|
||||
|
||||
minecart->Flags |= CART_FLAG_MESH;
|
||||
}
|
||||
|
@ -827,14 +827,12 @@ static void DoUserInput(ITEM_INFO* minecartItem, ITEM_INFO* laraItem, MinecartIn
|
|||
|
||||
if (coll.HitStatic)
|
||||
{
|
||||
int hits;
|
||||
|
||||
laraItem->AnimNumber = Objects[ID_MINECART_LARA_ANIMS].animIndex + 34;
|
||||
laraItem->FrameNumber = g_Level.Anims[laraItem->AnimNumber].frameBase;
|
||||
laraItem->ActiveState = laraItem->TargetState = CART_STATE_HIT;
|
||||
DoLotsOfBlood(laraItem->Position.xPos, laraItem->Position.yPos - CLICK(3), laraItem->Position.zPos, minecartItem->Velocity, minecartItem->Position.yRot, laraItem->RoomNumber, 3);
|
||||
|
||||
hits = CART_NHITS * short(minecart->Velocity / 2048);
|
||||
int hits = CART_NHITS * short(minecart->Velocity / 2048);
|
||||
if (hits < 20)
|
||||
hits = 20;
|
||||
|
||||
|
@ -864,13 +862,13 @@ void MineCartCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
{
|
||||
lara->Vehicle = itemNumber;
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, FALSE);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
lara->Flare.ControlLeft = false;
|
||||
lara->Control.WeaponControl.RequestGunType = WEAPON_NONE;
|
||||
lara->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.RequestGunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
lara->Control.HandStatus = HandStatus::Busy;
|
||||
|
|
|
@ -8,9 +8,9 @@ struct MinecartInfo
|
|||
short TurnLen;
|
||||
|
||||
int Velocity;
|
||||
short VerticalVelocity;
|
||||
short Gradient;
|
||||
char StopDelay;
|
||||
int VerticalVelocity;
|
||||
int Gradient;
|
||||
unsigned int StopDelay;
|
||||
|
||||
int FloorHeightMiddle;
|
||||
int FloorHeightFront;
|
||||
|
|
|
@ -1186,12 +1186,12 @@ void QuadBikeCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
{
|
||||
lara->Vehicle = itemNumber;
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, 0);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
lara->Flare.ControlLeft = false;
|
||||
lara->Control.WeaponControl.RequestGunType = lara->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
lara->Control.HandStatus = HandStatus::Busy;
|
||||
|
@ -1216,7 +1216,7 @@ void QuadBikeCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
laraItem->Position.zPos = quadItem->Position.zPos;
|
||||
laraItem->Position.yRot = quadItem->Position.yRot;
|
||||
ResetLaraFlex(laraItem);
|
||||
lara->hitDirection = -1;
|
||||
lara->HitDirection = -1;
|
||||
quadItem->HitPoints = 1;
|
||||
|
||||
AnimateItem(laraItem);
|
||||
|
|
|
@ -303,7 +303,7 @@ static bool TestUPVDismount(ITEM_INFO* laraItem, ITEM_INFO* UPVItem)
|
|||
{
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
if (lara->ExtraVelocity.x || lara->ExtraVelocity.z)
|
||||
if (lara->WaterCurrentPull.x || lara->WaterCurrentPull.z)
|
||||
return false;
|
||||
|
||||
short moveAngle = UPVItem->Position.yRot + ANGLE(180.0f);
|
||||
|
@ -360,9 +360,9 @@ static void DoCurrent(ITEM_INFO* laraItem, ITEM_INFO* UPVItem)
|
|||
|
||||
PHD_VECTOR target;
|
||||
|
||||
if (!lara->Control.WaterCurrentActive)
|
||||
if (!lara->WaterCurrentActive)
|
||||
{
|
||||
int absVel = abs(lara->ExtraVelocity.x);
|
||||
int absVel = abs(lara->WaterCurrentPull.x);
|
||||
int shift;
|
||||
if (absVel > 16)
|
||||
shift = 4;
|
||||
|
@ -371,12 +371,12 @@ static void DoCurrent(ITEM_INFO* laraItem, ITEM_INFO* UPVItem)
|
|||
else
|
||||
shift = 2;
|
||||
|
||||
lara->ExtraVelocity.x -= lara->ExtraVelocity.x >> shift;
|
||||
lara->WaterCurrentPull.x -= lara->WaterCurrentPull.x >> shift;
|
||||
|
||||
if (abs(lara->ExtraVelocity.x) < 4)
|
||||
lara->ExtraVelocity.x = 0;
|
||||
if (abs(lara->WaterCurrentPull.x) < 4)
|
||||
lara->WaterCurrentPull.x = 0;
|
||||
|
||||
absVel = abs(lara->ExtraVelocity.z);
|
||||
absVel = abs(lara->WaterCurrentPull.z);
|
||||
if (absVel > 16)
|
||||
shift = 4;
|
||||
else if (absVel > 8)
|
||||
|
@ -384,16 +384,16 @@ static void DoCurrent(ITEM_INFO* laraItem, ITEM_INFO* UPVItem)
|
|||
else
|
||||
shift = 2;
|
||||
|
||||
lara->ExtraVelocity.z -= lara->ExtraVelocity.z >> shift;
|
||||
if (abs(lara->ExtraVelocity.z) < 4)
|
||||
lara->ExtraVelocity.z = 0;
|
||||
lara->WaterCurrentPull.z -= lara->WaterCurrentPull.z >> shift;
|
||||
if (abs(lara->WaterCurrentPull.z) < 4)
|
||||
lara->WaterCurrentPull.z = 0;
|
||||
|
||||
if (lara->ExtraVelocity.x == 0 && lara->ExtraVelocity.z == 0)
|
||||
if (lara->WaterCurrentPull.x == 0 && lara->WaterCurrentPull.z == 0)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
int sinkVal = lara->Control.WaterCurrentActive - 1;
|
||||
int sinkVal = lara->WaterCurrentActive - 1;
|
||||
target.x = g_Level.Sinks[sinkVal].x;
|
||||
target.y = g_Level.Sinks[sinkVal].y;
|
||||
target.z = g_Level.Sinks[sinkVal].z;
|
||||
|
@ -407,13 +407,13 @@ static void DoCurrent(ITEM_INFO* laraItem, ITEM_INFO* UPVItem)
|
|||
dx = phd_sin(angle * 16) * velocity * 1024;
|
||||
dz = phd_cos(angle * 16) * velocity * 1024;
|
||||
|
||||
lara->ExtraVelocity.x += ((dx - lara->ExtraVelocity.x) / 16);
|
||||
lara->ExtraVelocity.z += ((dz - lara->ExtraVelocity.z) / 16);
|
||||
lara->WaterCurrentPull.x += ((dx - lara->WaterCurrentPull.x) / 16);
|
||||
lara->WaterCurrentPull.z += ((dz - lara->WaterCurrentPull.z) / 16);
|
||||
}
|
||||
|
||||
lara->Control.WaterCurrentActive = 0;
|
||||
UPVItem->Position.xPos += lara->ExtraVelocity.x / CLICK(1);
|
||||
UPVItem->Position.zPos += lara->ExtraVelocity.z / CLICK(1);
|
||||
lara->WaterCurrentActive = 0;
|
||||
UPVItem->Position.xPos += lara->WaterCurrentPull.x / CLICK(1);
|
||||
UPVItem->Position.zPos += lara->WaterCurrentPull.z / CLICK(1);
|
||||
}
|
||||
|
||||
static void BackgroundCollision(ITEM_INFO* laraItem, ITEM_INFO* UPVItem)
|
||||
|
@ -872,13 +872,13 @@ void UPVCollision(short itemNumber, ITEM_INFO* laraItem, COLL_INFO* coll)
|
|||
lara->Vehicle = itemNumber;
|
||||
lara->Control.WaterStatus = WaterStatus::Dry;
|
||||
|
||||
if (lara->Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (lara->Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, 0);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
|
||||
lara->Flare.ControlLeft = false;
|
||||
lara->Control.WeaponControl.RequestGunType = lara->Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
laraItem->Position.xPos = UPVItem->Position.xPos;
|
||||
|
|
|
@ -305,7 +305,7 @@ void ScorpionControl(short itemNumber)
|
|||
|
||||
if (item->ActiveState == 5)
|
||||
{
|
||||
Lara.Poisoned += 2048;
|
||||
Lara.PoisonPotency += 8;
|
||||
|
||||
CreatureEffect2(
|
||||
item,
|
||||
|
|
|
@ -435,7 +435,7 @@ namespace TEN::Entities::TR4
|
|||
if (AI.bite ||
|
||||
LaraItem->ActiveState >= LS_LADDER_IDLE &&
|
||||
LaraItem->ActiveState <= LS_LADDER_DOWN &&
|
||||
!Lara.location)
|
||||
!Lara.Location)
|
||||
{
|
||||
item->TargetState = STATE_DEMIGOD_HAMMER_AIM;
|
||||
break;
|
||||
|
@ -656,7 +656,7 @@ namespace TEN::Entities::TR4
|
|||
!AI.bite &&
|
||||
(LaraItem->ActiveState < LS_LADDER_IDLE ||
|
||||
LaraItem->ActiveState > LS_LADDER_DOWN ||
|
||||
Lara.location))
|
||||
Lara.Location))
|
||||
{
|
||||
item->TargetState = STATE_DEMIGOD_IDLE;
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ namespace TEN::Entities::TR4
|
|||
|
||||
Camera.bounce = -128;
|
||||
|
||||
if (LaraItem->ActiveState >= 56 && LaraItem->ActiveState <= 61 && !Lara.location)
|
||||
if (LaraItem->ActiveState >= 56 && LaraItem->ActiveState <= 61 && !Lara.Location)
|
||||
{
|
||||
ResetLaraFlex(LaraItem);
|
||||
LaraItem->TargetState = 3;
|
||||
|
|
|
@ -180,7 +180,7 @@ void EnemyJeepControl(short itemNumber)
|
|||
|
||||
if (item->RequiredState)
|
||||
item->TargetState = item->RequiredState;
|
||||
else if (info.distance > SQUARE(1024) || Lara.location >= item->ItemFlags[3])
|
||||
else if (info.distance > SQUARE(1024) || Lara.Location >= item->ItemFlags[3])
|
||||
item->TargetState = 1;
|
||||
|
||||
break;
|
||||
|
@ -266,7 +266,7 @@ void EnemyJeepControl(short itemNumber)
|
|||
{
|
||||
TestTriggers(target->Position.xPos,target->Position.yPos,target->Position.zPos,target->RoomNumber, true);
|
||||
|
||||
if (Lara.location < item->ItemFlags[3] && item->ActiveState != 2 && item->TargetState != 2)
|
||||
if (Lara.Location < item->ItemFlags[3] && item->ActiveState != 2 && item->TargetState != 2)
|
||||
{
|
||||
item->AnimNumber = Objects[item->ObjectNumber].animIndex + 1;
|
||||
item->FrameNumber = g_Level.Anims[item->AnimNumber].frameBase;
|
||||
|
@ -300,7 +300,7 @@ void EnemyJeepControl(short itemNumber)
|
|||
DisableEntityAI(itemNumber);
|
||||
}
|
||||
|
||||
if (Lara.location >= item->ItemFlags[3] || !(target->Flags & 4))
|
||||
if (Lara.Location >= item->ItemFlags[3] || !(target->Flags & 4))
|
||||
{
|
||||
creature->ReachedGoal = false;
|
||||
item->ItemFlags[3]++;
|
||||
|
|
|
@ -241,7 +241,7 @@ void GuideControl(short itemNumber)
|
|||
|
||||
if (item->RequiredState)
|
||||
item->TargetState = item->RequiredState;
|
||||
else if (Lara.location >= item->ItemFlags[3] ||
|
||||
else if (Lara.Location >= item->ItemFlags[3] ||
|
||||
item->ItemFlags[1] != 2)
|
||||
{
|
||||
if (!creature->ReachedGoal || foundEnemy)
|
||||
|
@ -365,7 +365,7 @@ void GuideControl(short itemNumber)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Lara.location >= item->ItemFlags[3])
|
||||
if (Lara.Location >= item->ItemFlags[3])
|
||||
{
|
||||
if (!foundEnemy ||
|
||||
AI.distance >= 0x200000 &&
|
||||
|
@ -381,7 +381,7 @@ void GuideControl(short itemNumber)
|
|||
else
|
||||
item->TargetState = GUIDE_STATE_IDLE;
|
||||
}
|
||||
else if (Lara.location > item->ItemFlags[3] &&
|
||||
else if (Lara.Location > item->ItemFlags[3] &&
|
||||
laraAI.distance > pow(SECTOR(2), 2))
|
||||
{
|
||||
item->TargetState = GUIDE_STATE_RUN;
|
||||
|
@ -404,7 +404,7 @@ void GuideControl(short itemNumber)
|
|||
joint2 = AI.angle;
|
||||
|
||||
if (AI.distance < pow(SECTOR(2), 2) ||
|
||||
Lara.location < item->ItemFlags[3])
|
||||
Lara.Location < item->ItemFlags[3])
|
||||
{
|
||||
item->TargetState = GUIDE_STATE_IDLE;
|
||||
break;
|
||||
|
|
|
@ -557,7 +557,7 @@ void HarpyControl(short itemNumber)
|
|||
DoBloodSplat);
|
||||
|
||||
if (creature->Enemy == LaraItem)
|
||||
Lara.Poisoned += 2048;
|
||||
Lara.PoisonPotency += 8;
|
||||
|
||||
creature->Flags = 1;
|
||||
}
|
||||
|
|
|
@ -269,12 +269,12 @@ namespace TEN::Entities::TR4
|
|||
{
|
||||
if (laraAI.angle > 0 || !(item->MeshBits & 0x400))
|
||||
{
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_SHOTGUN)
|
||||
{
|
||||
item->HitPoints -= 10;
|
||||
item->HitStatus = true;
|
||||
}
|
||||
else if (Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
else if (Lara.Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
{
|
||||
item->HitPoints -= 20;
|
||||
item->HitStatus = true;
|
||||
|
|
|
@ -22,7 +22,7 @@ void JeanYvesControl(short itemNumber)
|
|||
{
|
||||
auto* item = &g_Level.Items[itemNumber];
|
||||
|
||||
if (item->TriggerFlags >= Lara.highestLocation)
|
||||
if (item->TriggerFlags >= Lara.HighestLocation)
|
||||
{
|
||||
short state = 0;
|
||||
|
||||
|
@ -36,17 +36,17 @@ void JeanYvesControl(short itemNumber)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Lara.highestLocation > 3)
|
||||
Lara.highestLocation = 3;
|
||||
if (Lara.HighestLocation > 3)
|
||||
Lara.HighestLocation = 3;
|
||||
|
||||
int state = (GetRandomControl() & 3) + 4 * Lara.highestLocation;
|
||||
int state = (GetRandomControl() & 3) + 4 * Lara.HighestLocation;
|
||||
int animNumber = Objects[item->ObjectNumber].animIndex + state;
|
||||
state++;
|
||||
|
||||
item->TargetState = item->ActiveState = state;
|
||||
item->AnimNumber = animNumber;
|
||||
item->FrameNumber = g_Level.Anims[item->AnimNumber].frameBase;
|
||||
item->TriggerFlags = Lara.highestLocation;
|
||||
item->TriggerFlags = Lara.HighestLocation;
|
||||
|
||||
AnimateItem(item);
|
||||
}
|
||||
|
|
|
@ -107,14 +107,14 @@ void MummyControl(short itemNumber)
|
|||
item->ActiveState != MUMMY_ANIM_STAND_TO_WALK)
|
||||
{
|
||||
if (GetRandomControl() & 3 ||
|
||||
Lara.Control.WeaponControl.GunType != WEAPON_SHOTGUN &&
|
||||
Lara.Control.WeaponControl.GunType != WEAPON_HK &&
|
||||
Lara.Control.WeaponControl.GunType != WEAPON_REVOLVER)
|
||||
Lara.Control.Weapon.GunType != WEAPON_SHOTGUN &&
|
||||
Lara.Control.Weapon.GunType != WEAPON_HK &&
|
||||
Lara.Control.Weapon.GunType != WEAPON_REVOLVER)
|
||||
{
|
||||
if (!(GetRandomControl() & 7) ||
|
||||
Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN ||
|
||||
Lara.Control.WeaponControl.GunType == WEAPON_HK ||
|
||||
Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
Lara.Control.Weapon.GunType == WEAPON_SHOTGUN ||
|
||||
Lara.Control.Weapon.GunType == WEAPON_HK ||
|
||||
Lara.Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
{
|
||||
if (item->ActiveState == MUMMY_STATE_WALK_ARMS_UP ||
|
||||
item->ActiveState == MUMMY_STATE_WALK_HIT)
|
||||
|
|
|
@ -413,7 +413,7 @@ void SethaControl(short itemNumber)
|
|||
|
||||
if (item->HitStatus)
|
||||
{
|
||||
if ((Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN || Lara.Control.WeaponControl.GunType == WEAPON_REVOLVER)
|
||||
if ((Lara.Control.Weapon.GunType == WEAPON_SHOTGUN || Lara.Control.Weapon.GunType == WEAPON_REVOLVER)
|
||||
&& info.distance < SQUARE(2048)
|
||||
&& !(creature->LOT.IsJumping))
|
||||
{
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace TEN::Entities::TR4
|
|||
CreatureAIInfo(item, &info);
|
||||
|
||||
if (item->HitStatus
|
||||
&& Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN
|
||||
&& Lara.Control.Weapon.GunType == WEAPON_SHOTGUN
|
||||
&& info.distance < SQUARE(3584)
|
||||
&& item->ActiveState != 7
|
||||
&& item->ActiveState != 17
|
||||
|
@ -421,7 +421,7 @@ namespace TEN::Entities::TR4
|
|||
&& laraInfo.angle
|
||||
&& laraInfo.distance < SQUARE(2048)
|
||||
&& GetRandomControl() & 1
|
||||
&& (Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN || !(GetRandomControl() & 0xF))
|
||||
&& (Lara.Control.Weapon.GunType == WEAPON_SHOTGUN || !(GetRandomControl() & 0xF))
|
||||
&& item->MeshBits == -1)
|
||||
{
|
||||
item->TargetState = STATE_SKELETON_USE_SHIELD;
|
||||
|
@ -675,7 +675,7 @@ namespace TEN::Entities::TR4
|
|||
case STATE_SKELETON_USE_SHIELD:
|
||||
if (item->HitStatus)
|
||||
{
|
||||
if (item->MeshBits == -1 && laraInfo.angle && Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN)
|
||||
if (item->MeshBits == -1 && laraInfo.angle && Lara.Control.Weapon.GunType == WEAPON_SHOTGUN)
|
||||
{
|
||||
if (GetRandomControl() & 3)
|
||||
{
|
||||
|
@ -691,7 +691,7 @@ namespace TEN::Entities::TR4
|
|||
item->TargetState = 2;
|
||||
}
|
||||
}
|
||||
else if (Lara.TargetEntity != item || item->MeshBits != -1 || Lara.Control.WeaponControl.GunType != WEAPON_SHOTGUN || !(GetRandomControl() & 0x7F))
|
||||
else if (Lara.TargetEntity != item || item->MeshBits != -1 || Lara.Control.Weapon.GunType != WEAPON_SHOTGUN || !(GetRandomControl() & 0x7F))
|
||||
{
|
||||
item->TargetState = 2;
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ void SmallScorpionControl(short itemNumber)
|
|||
if (item->FrameNumber > g_Level.Anims[item->AnimNumber].frameBase + 20 &&
|
||||
item->FrameNumber < g_Level.Anims[item->AnimNumber].frameBase + 32)
|
||||
{
|
||||
Lara.Poisoned += 512;
|
||||
Lara.PoisonPotency += 2;
|
||||
LaraItem->HitPoints -= 20;
|
||||
LaraItem->HitStatus = true;
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ void VonCroyControl(short itemNumber)
|
|||
// Try to find a possible enemy or target
|
||||
ITEM_INFO* foundTarget = NULL;
|
||||
|
||||
if (Lara.location <= creature->LocationAI)
|
||||
if (Lara.Location <= creature->LocationAI)
|
||||
{
|
||||
int minDistance = 0x7FFFFFFF;
|
||||
int distance;
|
||||
|
@ -428,7 +428,7 @@ void VonCroyControl(short itemNumber)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Lara.location >= item->ItemFlags[3])
|
||||
if (Lara.Location >= item->ItemFlags[3])
|
||||
{
|
||||
if (!foundTarget || info.distance >= 0x200000 && (item->SwapMeshFlags & 0x40000 || info.distance >= 9437184))
|
||||
{
|
||||
|
@ -446,7 +446,7 @@ void VonCroyControl(short itemNumber)
|
|||
item->TargetState = STATE_VON_CROY_STOP;
|
||||
}
|
||||
}
|
||||
else if (Lara.location > item->ItemFlags[3] && laraInfo.distance > 0x400000)
|
||||
else if (Lara.Location > item->ItemFlags[3] && laraInfo.distance > 0x400000)
|
||||
{
|
||||
item->TargetState = STATE_VON_CROY_RUN;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ void VonCroyControl(short itemNumber)
|
|||
creature->MaxTurn = ANGLE(11);
|
||||
tilt = abs(angle) / 2;
|
||||
|
||||
if (info.distance < SQUARE(2048) || Lara.location < creature->LocationAI)
|
||||
if (info.distance < SQUARE(2048) || Lara.Location < creature->LocationAI)
|
||||
{
|
||||
item->TargetState = STATE_VON_CROY_STOP;
|
||||
break;
|
||||
|
|
|
@ -317,7 +317,7 @@ void UseClockworkBeetle(short flag)
|
|||
if (itemNum != NO_ITEM)
|
||||
{
|
||||
item = &g_Level.Items[itemNum];
|
||||
Lara.hasBeetleThings &= 0xFE;
|
||||
Lara.HasBeetleThings &= 0xFE;
|
||||
item->Shade = -15856;
|
||||
item->ObjectNumber = ID_CLOCKWORK_BEETLE;
|
||||
item->RoomNumber = LaraItem->RoomNumber;
|
||||
|
|
|
@ -229,7 +229,7 @@ namespace TEN::Entities::TR4
|
|||
}
|
||||
else
|
||||
{
|
||||
if (laraInfo->Control.WeaponControl.GunType != WEAPON_TORCH ||
|
||||
if (laraInfo->Control.Weapon.GunType != WEAPON_TORCH ||
|
||||
laraInfo->Control.HandStatus != HandStatus::WeaponReady ||
|
||||
laraInfo->LeftArm.Locked ||
|
||||
!(TrInput & IN_ACTION) ||
|
||||
|
|
|
@ -1497,13 +1497,13 @@ void JeepCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll)
|
|||
{
|
||||
Lara.Vehicle = itemNumber;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(LaraItem, ID_FLARE_ITEM, 0);
|
||||
UndrawFlareMeshes(l);
|
||||
Lara.Flare.ControlLeft = 0;
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_NONE;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.GunType = WEAPON_NONE;
|
||||
}
|
||||
|
||||
Lara.Control.HandStatus = HandStatus::Busy;
|
||||
|
@ -1549,7 +1549,7 @@ void JeepCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll)
|
|||
LaraItem->Position.yRot = item->Position.yRot;
|
||||
|
||||
ResetLaraFlex(LaraItem);
|
||||
Lara.hitDirection = -1;
|
||||
Lara.HitDirection = -1;
|
||||
|
||||
AnimateItem(l);
|
||||
|
||||
|
|
|
@ -355,13 +355,13 @@ void MotorbikeCollision(short itemNumber, ITEM_INFO* laraitem, COLL_INFO* coll)
|
|||
{
|
||||
Lara.Vehicle = itemNumber;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_FLARE)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_FLARE)
|
||||
{
|
||||
CreateFlare(LaraItem, ID_FLARE_ITEM, FALSE);
|
||||
UndrawFlareMeshes(laraitem);
|
||||
Lara.Flare.ControlLeft = false;
|
||||
Lara.Control.WeaponControl.GunType = WEAPON_NONE;
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.GunType = WEAPON_NONE;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_NONE;
|
||||
Lara.Flare.Life = 0;
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ void MotorbikeCollision(short itemNumber, ITEM_INFO* laraitem, COLL_INFO* coll)
|
|||
laraitem->Position.zPos = item->Position.zPos;
|
||||
laraitem->Position.yRot = item->Position.yRot;
|
||||
ResetLaraFlex(laraitem);
|
||||
Lara.hitDirection = -1;
|
||||
Lara.HitDirection = -1;
|
||||
AnimateItem(laraitem);
|
||||
motorbike->revs = 0;
|
||||
item->Collidable = true;
|
||||
|
@ -1360,7 +1360,7 @@ void SetLaraOnMotorBike(ITEM_INFO* item, ITEM_INFO* lara)//is this function even
|
|||
motorbike = GetMotorbikeInfo(item);
|
||||
|
||||
Lara.Control.HandStatus = HandStatus::Busy;
|
||||
Lara.hitDirection = -1;
|
||||
Lara.HitDirection = -1;
|
||||
lara->ActiveState = BIKE_IDLE;
|
||||
lara->TargetState = BIKE_IDLE;
|
||||
lara->AnimNumber = Objects[ID_MOTORBIKE_LARA_ANIMS].animIndex + BA_IDLE;
|
||||
|
|
|
@ -137,7 +137,7 @@ void UpdateBats()
|
|||
if (!bat->on)
|
||||
continue;
|
||||
|
||||
if ((Lara.burn || LaraItem->HitPoints <= 0)
|
||||
if ((Lara.Burn || LaraItem->HitPoints <= 0)
|
||||
&& bat->counter > 90
|
||||
&& !(GetRandomControl() & 7))
|
||||
bat->counter = 90;
|
||||
|
|
|
@ -530,7 +530,7 @@ void CyborgControl(short itemNumber)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (item->ActiveState == 43 && !Lara.burn)
|
||||
else if (item->ActiveState == 43 && !Lara.Burn)
|
||||
{
|
||||
PHD_VECTOR pos = { 0, 0, 0 };
|
||||
GetLaraJointPosition(&pos, LM_LFOOT);
|
||||
|
@ -556,7 +556,7 @@ void CyborgControl(short itemNumber)
|
|||
{
|
||||
LaraBurn(LaraItem);
|
||||
Lara.BurnCount = 48;
|
||||
Lara.burnBlue = 1;
|
||||
Lara.BurnBlue = 1;
|
||||
LaraItem->HitPoints = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ void ControlGladiator(short itemNumber)
|
|||
unknown &&
|
||||
distance < pow(SECTOR(1.5f), 2) &&
|
||||
GetRandomControl() & 1 &&
|
||||
(Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN ||
|
||||
(Lara.Control.Weapon.GunType == WEAPON_SHOTGUN ||
|
||||
!(GetRandomControl() & 0xF)) &&
|
||||
item->MeshBits == -1)
|
||||
{
|
||||
|
|
|
@ -672,7 +672,7 @@ void GuardControl(short itemNum)
|
|||
break;
|
||||
case 17:
|
||||
joint2 = 0;
|
||||
if (!item->HitStatus && LaraItem->Velocity < 40 && !Lara.Control.WeaponControl.HasFired)
|
||||
if (!item->HitStatus && LaraItem->Velocity < 40 && !Lara.Control.Weapon.HasFired)
|
||||
creature->Alerted = false;
|
||||
if (creature->Alerted)
|
||||
item->TargetState = 18;
|
||||
|
|
|
@ -270,7 +270,7 @@ void HydraControl(short itemNumber)
|
|||
distance = sqrt(AI.distance);
|
||||
damage = 5 - distance / SECTOR(1);
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_SHOTGUN)
|
||||
damage *= 3;
|
||||
|
||||
if (damage > 0)
|
||||
|
@ -295,7 +295,7 @@ void HydraControl(short itemNumber)
|
|||
|
||||
damage = 6 - sqrt(AI.distance) / 1024;
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_SHOTGUN)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_SHOTGUN)
|
||||
damage *= 3;
|
||||
|
||||
if ((GetRandomControl() & 0xF) < damage && AI.distance < SQUARE(10240) && damage > 0)
|
||||
|
|
|
@ -306,7 +306,7 @@ void LaserHeadControl(short itemNumber)
|
|||
if (LOS(&src, &dest)
|
||||
&& distance <= MAX_VISIBILITY_DISTANCE
|
||||
&& LaraItem->HitPoints > 0
|
||||
&& !Lara.burn
|
||||
&& !Lara.Burn
|
||||
&& (LaserHeadData.target.x || LaserHeadData.target.y || LaserHeadData.target.z))
|
||||
{
|
||||
// Lock target for attacking
|
||||
|
@ -438,7 +438,7 @@ void LaserHeadControl(short itemNumber)
|
|||
&& arc
|
||||
&& !arc->life
|
||||
|| LaraItem->HitPoints <= 0
|
||||
|| Lara.burn)
|
||||
|| Lara.Burn)
|
||||
{
|
||||
if (arc)
|
||||
{
|
||||
|
@ -510,7 +510,7 @@ void LaserHeadControl(short itemNumber)
|
|||
}
|
||||
|
||||
// Check if Lara was hit by energy arcs
|
||||
if (!Lara.burn)
|
||||
if (!Lara.Burn)
|
||||
{
|
||||
int someIndex = 0;
|
||||
|
||||
|
@ -571,7 +571,7 @@ void LaserHeadControl(short itemNumber)
|
|||
{
|
||||
LaraBurn(LaraItem);
|
||||
Lara.BurnCount = 48;
|
||||
Lara.burnBlue = 2;
|
||||
Lara.BurnBlue = 2;
|
||||
LaraItem->HitPoints = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ namespace TEN::Renderer
|
|||
|
||||
for (int k = 0; k < laraSkin.ObjectMeshes.size(); k++)
|
||||
{
|
||||
RendererMesh* mesh = GetMesh(Lara.meshPtrs[k]);
|
||||
RendererMesh* mesh = GetMesh(Lara.MeshPtrs[k]);
|
||||
|
||||
for (auto& bucket : mesh->buckets)
|
||||
{
|
||||
|
@ -2112,8 +2112,8 @@ namespace TEN::Renderer
|
|||
PrintDebugMessage("Lara.ActiveState: %d", LaraItem->ActiveState);
|
||||
PrintDebugMessage("Lara.RequiredState: %d", LaraItem->RequiredState);
|
||||
PrintDebugMessage("Lara.TargetState: %d", LaraItem->TargetState);
|
||||
PrintDebugMessage("Lara.Control.WeaponControl.WeaponItem: %d", Lara.Control.WeaponControl.WeaponItem);
|
||||
PrintDebugMessage("Lara.Control.WeaponControl.GunType: %d", Lara.Control.WeaponControl.GunType);
|
||||
PrintDebugMessage("Lara.Control.WeaponControl.WeaponItem: %d", Lara.Control.Weapon.WeaponItem);
|
||||
PrintDebugMessage("Lara.Control.WeaponControl.GunType: %d", Lara.Control.Weapon.GunType);
|
||||
PrintDebugMessage("Lara.Control.HandStatus: %d", Lara.Control.HandStatus);
|
||||
PrintDebugMessage("Lara.Velocity, VerticalVelocity: %d %d", LaraItem->Velocity, LaraItem->VerticalVelocity);
|
||||
PrintDebugMessage("Lara.Airborne: %d", LaraItem->Airborne);
|
||||
|
|
|
@ -556,11 +556,11 @@ namespace TEN::Renderer
|
|||
m_context->OMSetBlendState(m_states->Additive(), NULL, 0xFFFFFFFF);
|
||||
m_context->OMSetDepthStencilState(m_states->DepthRead(), 0);
|
||||
|
||||
if (Lara.Control.WeaponControl.GunType != WEAPON_FLARE &&
|
||||
Lara.Control.WeaponControl.GunType != WEAPON_SHOTGUN &&
|
||||
Lara.Control.WeaponControl.GunType != WEAPON_CROSSBOW)
|
||||
if (Lara.Control.Weapon.GunType != WEAPON_FLARE &&
|
||||
Lara.Control.Weapon.GunType != WEAPON_SHOTGUN &&
|
||||
Lara.Control.Weapon.GunType != WEAPON_CROSSBOW)
|
||||
{
|
||||
switch (Lara.Control.WeaponControl.GunType)
|
||||
switch (Lara.Control.Weapon.GunType)
|
||||
{
|
||||
case WEAPON_REVOLVER:
|
||||
length = 192;
|
||||
|
|
|
@ -85,7 +85,7 @@ void Renderer11::updateLaraAnimations(bool force)
|
|||
UpdateAnimation(item, laraObj, framePtr, frac, rate, mask);
|
||||
|
||||
// Then the arms, based on current weapon status
|
||||
if (Lara.Control.WeaponControl.GunType != WEAPON_FLARE && (Lara.Control.HandStatus == HandStatus::Free || Lara.Control.HandStatus == HandStatus::Busy) || Lara.Control.WeaponControl.GunType == WEAPON_FLARE && !Lara.Flare.ControlLeft)
|
||||
if (Lara.Control.Weapon.GunType != WEAPON_FLARE && (Lara.Control.HandStatus == HandStatus::Free || Lara.Control.HandStatus == HandStatus::Busy) || Lara.Control.Weapon.GunType == WEAPON_FLARE && !Lara.Flare.ControlLeft)
|
||||
{
|
||||
// Both arms
|
||||
mask = MESH_BITS(LM_LINARM) | MESH_BITS(LM_LOUTARM) | MESH_BITS(LM_LHAND) | MESH_BITS(LM_RINARM) | MESH_BITS(LM_ROUTARM) | MESH_BITS(LM_RHAND);
|
||||
|
@ -95,7 +95,7 @@ void Renderer11::updateLaraAnimations(bool force)
|
|||
else
|
||||
{
|
||||
// While handling weapon some extra rotation could be applied to arms
|
||||
if (Lara.Control.WeaponControl.GunType == WEAPON_PISTOLS || Lara.Control.WeaponControl.GunType == WEAPON_UZI)
|
||||
if (Lara.Control.Weapon.GunType == WEAPON_PISTOLS || Lara.Control.Weapon.GunType == WEAPON_UZI)
|
||||
{
|
||||
laraObj.LinearizedBones[LM_LINARM]->ExtraRotation += Vector3(TO_RAD(Lara.LeftArm.Rotation.xRot), TO_RAD(Lara.LeftArm.Rotation.yRot), TO_RAD(Lara.LeftArm.Rotation.zRot));
|
||||
laraObj.LinearizedBones[LM_RINARM]->ExtraRotation += Vector3(TO_RAD(Lara.RightArm.Rotation.xRot), TO_RAD(Lara.RightArm.Rotation.yRot), TO_RAD(Lara.RightArm.Rotation.zRot));
|
||||
|
@ -110,7 +110,7 @@ void Renderer11::updateLaraAnimations(bool force)
|
|||
ArmInfo *rightArm = &Lara.RightArm;
|
||||
|
||||
// HACK: backguns handles differently // TokyoSU: not really a hack since it's the original way to do that.
|
||||
switch (Lara.Control.WeaponControl.GunType)
|
||||
switch (Lara.Control.Weapon.GunType)
|
||||
{
|
||||
case WEAPON_SHOTGUN:
|
||||
case WEAPON_HK:
|
||||
|
@ -124,7 +124,7 @@ void Renderer11::updateLaraAnimations(bool force)
|
|||
// Left arm
|
||||
mask = MESH_BITS(LM_LINARM) | MESH_BITS(LM_LOUTARM) | MESH_BITS(LM_LHAND);
|
||||
|
||||
if(shouldAnimateUpperBody(Lara.Control.WeaponControl.GunType)){
|
||||
if(shouldAnimateUpperBody(Lara.Control.Weapon.GunType)){
|
||||
mask |= MESH_BITS(LM_TORSO) | MESH_BITS(LM_HEAD);
|
||||
}
|
||||
shotgunFramePtr = &g_Level.Frames[Lara.LeftArm.FrameBase + Lara.LeftArm.FrameNumber];
|
||||
|
@ -132,7 +132,7 @@ void Renderer11::updateLaraAnimations(bool force)
|
|||
|
||||
// Right arm
|
||||
mask = MESH_BITS(LM_RINARM) | MESH_BITS(LM_ROUTARM) | MESH_BITS(LM_RHAND);
|
||||
if(shouldAnimateUpperBody(Lara.Control.WeaponControl.GunType)){
|
||||
if(shouldAnimateUpperBody(Lara.Control.Weapon.GunType)){
|
||||
mask |= MESH_BITS(LM_TORSO) | MESH_BITS(LM_HEAD);
|
||||
}
|
||||
shotgunFramePtr = &g_Level.Frames[Lara.RightArm.FrameBase + Lara.RightArm.FrameNumber];
|
||||
|
@ -262,7 +262,7 @@ void TEN::Renderer::Renderer11::DrawLara(bool shadowMap, RenderView& view)
|
|||
|
||||
for (int k = 0; k < laraSkin.ObjectMeshes.size(); k++)
|
||||
{
|
||||
RendererMesh *mesh = GetMesh(Lara.meshPtrs[k]);
|
||||
RendererMesh *mesh = GetMesh(Lara.MeshPtrs[k]);
|
||||
drawMoveableMesh(item, mesh, room, k);
|
||||
}
|
||||
|
||||
|
@ -312,9 +312,9 @@ void Renderer11::DrawLaraHolsters()
|
|||
RendererItem* item = &m_items[Lara.ItemNumber];
|
||||
RendererRoom* room = &m_rooms[LaraItem->RoomNumber];
|
||||
|
||||
HolsterSlot leftHolsterID = Lara.Control.WeaponControl.HolsterInfo.LeftHolster;
|
||||
HolsterSlot rightHolsterID = Lara.Control.WeaponControl.HolsterInfo.RightHolster;
|
||||
HolsterSlot backHolsterID = Lara.Control.WeaponControl.HolsterInfo.BackHolster;
|
||||
HolsterSlot leftHolsterID = Lara.Control.Weapon.HolsterInfo.LeftHolster;
|
||||
HolsterSlot rightHolsterID = Lara.Control.Weapon.HolsterInfo.RightHolster;
|
||||
HolsterSlot backHolsterID = Lara.Control.Weapon.HolsterInfo.BackHolster;
|
||||
|
||||
if(m_moveableObjects[static_cast<int>(leftHolsterID)])
|
||||
{
|
||||
|
|
|
@ -701,9 +701,9 @@ void Sound_UpdateScene()
|
|||
Camera.mikePos.y,
|
||||
Camera.mikePos.z);
|
||||
auto laraVel = BASS_3DVECTOR( // Vel
|
||||
Lara.ExtraVelocity.x,
|
||||
Lara.ExtraVelocity.y,
|
||||
Lara.ExtraVelocity.z);
|
||||
Lara.WaterCurrentPull.x,
|
||||
Lara.WaterCurrentPull.y,
|
||||
Lara.WaterCurrentPull.z);
|
||||
auto atVec = BASS_3DVECTOR(at.x, at.y, at.z); // At
|
||||
auto upVec = BASS_3DVECTOR(0.0f, 1.0f, 0.0f); // Up
|
||||
BASS_Set3DPosition(&mikePos,
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
using TEN::Renderer::g_Renderer;
|
||||
|
||||
const char* g_KeyNames[] = {
|
||||
const char* g_KeyNames[] =
|
||||
{
|
||||
NULL, "ESC", "1", "2", "3", "4", "5", "6",
|
||||
"7", "8", "9", "0", "-", "+", "BKSP", "TAB",
|
||||
"Q", "W", "E", "R", "T", "Y", "U", "I",
|
||||
|
@ -198,7 +199,7 @@ int S_UpdateInput()
|
|||
linput |= IN_DRAW;
|
||||
|
||||
bool flare = false;
|
||||
static bool flare_no = false;
|
||||
static bool flareNo = false;
|
||||
|
||||
/*if (opt_ControlMethod == CM_JOYSTICK)
|
||||
{
|
||||
|
@ -220,7 +221,7 @@ int S_UpdateInput()
|
|||
|
||||
if (Key(KEY_FLARE) || flare)
|
||||
{
|
||||
if (!flare_no)
|
||||
if (!flareNo)
|
||||
{
|
||||
if (LaraItem->ActiveState == LS_CRAWL_IDLE ||
|
||||
LaraItem->ActiveState == LS_CRAWL_FORWARD ||
|
||||
|
@ -230,18 +231,18 @@ int S_UpdateInput()
|
|||
LaraItem->ActiveState == LS_CRAWL_TO_HANG)
|
||||
{
|
||||
SoundEffect(SFX_TR4_LARA_NO, nullptr, 2);
|
||||
flare_no = true;
|
||||
flareNo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flare_no = false;
|
||||
flareNo = false;
|
||||
linput |= IN_FLARE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flare_no = false;
|
||||
flareNo = false;
|
||||
}
|
||||
|
||||
if (Key(KEY_LOOK))
|
||||
|
@ -275,19 +276,19 @@ int S_UpdateInput()
|
|||
|
||||
// Switch debug pages
|
||||
|
||||
static int debug_timeout = 0;
|
||||
static int debugTimeout = 0;
|
||||
if (KeyMap[DIK_F10] || KeyMap[DIK_F11])
|
||||
{
|
||||
if (debug_timeout == 0)
|
||||
if (debugTimeout == 0)
|
||||
{
|
||||
debug_timeout = 1;
|
||||
debugTimeout = 1;
|
||||
g_Renderer.switchDebugPage(KeyMap[DIK_F10]);
|
||||
}
|
||||
}
|
||||
else
|
||||
debug_timeout = 0;
|
||||
debugTimeout = 0;
|
||||
|
||||
static int look_timeout = 0;
|
||||
static int lookTimeout = 0;
|
||||
|
||||
if (Lara.Control.HandStatus == HandStatus::WeaponReady)
|
||||
{
|
||||
|
@ -296,60 +297,58 @@ int S_UpdateInput()
|
|||
|
||||
if (linput & IN_LOOK)
|
||||
{
|
||||
if (look_timeout >= 6)
|
||||
if (lookTimeout >= 6)
|
||||
{
|
||||
look_timeout = 100;
|
||||
lookTimeout = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
linput &= ~IN_LOOK;
|
||||
look_timeout++;
|
||||
lookTimeout++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (look_timeout != 0 && look_timeout != 100)
|
||||
{
|
||||
if (lookTimeout != 0 && lookTimeout != 100)
|
||||
linput |= IN_LOOKSWITCH;
|
||||
}
|
||||
|
||||
look_timeout = 0;
|
||||
lookTimeout = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int medipack_timeout = 0;
|
||||
static int medipackTimeout = 0;
|
||||
|
||||
/***************************WEAPON HOTKEYS***************************/
|
||||
if (KeyMap[DIK_1] && Lara.Weapons[WEAPON_PISTOLS].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_PISTOLS;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_PISTOLS;
|
||||
if (KeyMap[DIK_2] && Lara.Weapons[WEAPON_SHOTGUN].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_SHOTGUN;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_SHOTGUN;
|
||||
if (KeyMap[DIK_3] && Lara.Weapons[WEAPON_REVOLVER].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_REVOLVER;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_REVOLVER;
|
||||
if (KeyMap[DIK_4] && Lara.Weapons[WEAPON_UZI].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_UZI;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_UZI;
|
||||
if (KeyMap[DIK_5] && Lara.Weapons[WEAPON_HARPOON_GUN].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_HARPOON_GUN;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_HARPOON_GUN;
|
||||
if (KeyMap[DIK_6] && Lara.Weapons[WEAPON_HK].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_HK;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_HK;
|
||||
if (KeyMap[DIK_7] && Lara.Weapons[WEAPON_ROCKET_LAUNCHER].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_ROCKET_LAUNCHER;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_ROCKET_LAUNCHER;
|
||||
if (KeyMap[DIK_8] && Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Present == true)
|
||||
Lara.Control.WeaponControl.RequestGunType = WEAPON_GRENADE_LAUNCHER;
|
||||
Lara.Control.Weapon.RequestGunType = WEAPON_GRENADE_LAUNCHER;
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
if (KeyMap[DIK_0])
|
||||
{
|
||||
if (medipack_timeout == 0)
|
||||
if (medipackTimeout == 0)
|
||||
{
|
||||
if (LaraItem->HitPoints > 0 && LaraItem->HitPoints < 1000 || Lara.Poisoned)
|
||||
if (LaraItem->HitPoints > 0 && LaraItem->HitPoints < 1000 || Lara.PoisonPotency)
|
||||
{
|
||||
if (Lara.NumSmallMedipacks != 0)
|
||||
{
|
||||
if (Lara.NumSmallMedipacks != -1)
|
||||
Lara.NumSmallMedipacks--;
|
||||
|
||||
Lara.Poisoned = 0;
|
||||
Lara.PoisonPotency = 0;
|
||||
LaraItem->HitPoints += 500;
|
||||
SoundEffect(SFX_TR4_MENU_MEDI, nullptr, 2);//Fix heal sound not triggering if small medi doesn't top off Lara's health. original tr4/5 issue
|
||||
|
||||
|
@ -361,22 +360,22 @@ int S_UpdateInput()
|
|||
}
|
||||
}
|
||||
|
||||
medipack_timeout = 15;
|
||||
medipackTimeout = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (KeyMap[DIK_9])
|
||||
{
|
||||
if (medipack_timeout == 0)
|
||||
if (medipackTimeout == 0)
|
||||
{
|
||||
if (LaraItem->HitPoints > 0 && LaraItem->HitPoints < 1000 || Lara.Poisoned)
|
||||
if (LaraItem->HitPoints > 0 && LaraItem->HitPoints < 1000 || Lara.PoisonPotency)
|
||||
{
|
||||
if (Lara.NumLargeMedipacks != 0)
|
||||
{
|
||||
if (Lara.NumLargeMedipacks != -1)
|
||||
Lara.NumLargeMedipacks--;
|
||||
|
||||
Lara.Poisoned = 0;
|
||||
Lara.PoisonPotency = 0;
|
||||
LaraItem->HitPoints += 1000;
|
||||
|
||||
if (LaraItem->HitPoints > 1000)
|
||||
|
@ -387,13 +386,13 @@ int S_UpdateInput()
|
|||
}
|
||||
}
|
||||
|
||||
medipack_timeout = 15;
|
||||
medipackTimeout = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (medipack_timeout != 0)
|
||||
else if (medipackTimeout != 0)
|
||||
{
|
||||
medipack_timeout--;
|
||||
medipackTimeout--;
|
||||
}
|
||||
|
||||
if (KeyMap[DIK_F10])
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -85,6 +85,8 @@ table WeaponControlData {
|
|||
weapon_item: int32;
|
||||
has_fired: bool;
|
||||
fired: bool;
|
||||
uzi_left: bool;
|
||||
uzi_right: bool;
|
||||
gun_type: int32;
|
||||
request_gun_type: int32;
|
||||
last_gun_type: int32;
|
||||
|
@ -126,6 +128,11 @@ table SubsuitControlData {
|
|||
hit_count: uint32;
|
||||
}
|
||||
|
||||
table MinecartControlData {
|
||||
left: bool;
|
||||
right: bool;
|
||||
}
|
||||
|
||||
table LaraCountData {
|
||||
run_jump: uint32;
|
||||
position_adjust: uint32;
|
||||
|
@ -142,10 +149,7 @@ table LaraControlData {
|
|||
jump_direction: int32;
|
||||
hand_status: int32;
|
||||
water_status: int32;
|
||||
weapon_control: WeaponControlData;
|
||||
rope_control: RopeControlData;
|
||||
tightrope_control: TightropeControlData;
|
||||
subsuit_control: SubsuitControlData;
|
||||
count: LaraCountData;
|
||||
can_look: bool;
|
||||
is_moving: bool;
|
||||
keep_low: bool;
|
||||
|
@ -154,9 +158,12 @@ table LaraControlData {
|
|||
is_climbing_ladder: bool;
|
||||
can_monkey_swing: bool;
|
||||
run_jump_queued: bool;
|
||||
water_current_active: int32;
|
||||
locked: bool;
|
||||
count: LaraCountData;
|
||||
weapon: WeaponControlData;
|
||||
rope: RopeControlData;
|
||||
tightrope: TightropeControlData;
|
||||
subsuit: SubsuitControlData;
|
||||
minecart: MinecartControlData;
|
||||
}
|
||||
|
||||
table Lara {
|
||||
|
@ -171,25 +178,27 @@ table Lara {
|
|||
extra_head_rot: Vector3;
|
||||
extra_torso_rot: Vector3;
|
||||
extra_velocity: Vector3;
|
||||
water_current_active: int32;
|
||||
water_current_pull: Vector3;
|
||||
hit_frame: int32;
|
||||
hit_direction: int32;
|
||||
air: int32;
|
||||
sprint_energy: int32;
|
||||
spasm_effect_count: int32;
|
||||
spasm_effect_count: uint32;
|
||||
flare: FlareData;
|
||||
burn_type: int32;
|
||||
burn: bool;
|
||||
burn_blue: int32;
|
||||
burn_smoke: bool;
|
||||
burn_count: uint32;
|
||||
poisoned: int32;
|
||||
poison_potency: int32;
|
||||
wet: [bool];
|
||||
lit_torch: bool;
|
||||
water_surface_dist: int32;
|
||||
next_corner_position: Vector3;
|
||||
next_corner_rotation: Vector3;
|
||||
mesh_ptrs: [int32];
|
||||
target_angles: [int32];
|
||||
target_arm_angles: [int32];
|
||||
left_arm: ArmInfo;
|
||||
right_arm: ArmInfo;
|
||||
interacted_item: int32;
|
||||
|
@ -204,8 +213,6 @@ table Lara {
|
|||
big_waterskin: int32;
|
||||
vehicle: int32;
|
||||
extra_anim: int32;
|
||||
mine_l: bool;
|
||||
mine_r: bool;
|
||||
weapons: [CarriedWeaponInfo];
|
||||
puzzles: [int32];
|
||||
keys: [int32];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue