mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Revert "Merge branch 'develop' into sezz_x64"
This reverts commitf695769189
, reversing changes made to54c5e0c70d
.
This commit is contained in:
parent
f695769189
commit
e1128c41f8
141 changed files with 856 additions and 1249 deletions
|
@ -14,11 +14,6 @@ Version 1.0.9
|
||||||
* Add TR1 cowboy.
|
* Add TR1 cowboy.
|
||||||
* Add TR3 wall mounted blade.
|
* Add TR3 wall mounted blade.
|
||||||
* Add TR3 claw mutant.
|
* Add TR3 claw mutant.
|
||||||
* Add TR5 lasers
|
|
||||||
- Choose colour for the lasers via tint menu.
|
|
||||||
- Laser OCB means width of the laser in sectors.
|
|
||||||
- Negative OCB laser will trigger heavy trigger.
|
|
||||||
- Positive OCB kills Lara.
|
|
||||||
* Add removable puzzles from puzzle holes and puzzle dones.
|
* Add removable puzzles from puzzle holes and puzzle dones.
|
||||||
- Employed by setting the trigger type as "Switch" for either puzzle hole or puzzle done.
|
- Employed by setting the trigger type as "Switch" for either puzzle hole or puzzle done.
|
||||||
- Can be mixed with puzzle done and puzzle holes of the same or different type.
|
- Can be mixed with puzzle done and puzzle holes of the same or different type.
|
||||||
|
@ -33,8 +28,8 @@ Version 1.0.9
|
||||||
* Add "Reset to defaults" entry to controls menu and automatically bind XBOX gamepad profile if connected.
|
* Add "Reset to defaults" entry to controls menu and automatically bind XBOX gamepad profile if connected.
|
||||||
|
|
||||||
Lua API changes:
|
Lua API changes:
|
||||||
* Add Vec2 class.
|
* Add class Vec2
|
||||||
* Add function String::SetTranslated()
|
* Add function String::SetTranslated()
|
||||||
* Add function Misc::IsStringDisplaying()
|
* Add function Misc::IsStringDisplaying()
|
||||||
* Add the following for use in AddCallback and RemoveCallback:
|
* Add the following for use in AddCallback and RemoveCallback:
|
||||||
- PRESTART, POSTSTART
|
- PRESTART, POSTSTART
|
||||||
|
|
|
@ -179,7 +179,11 @@ std::function<LaraRoutineFunction> lara_control_routines[NUM_LARA_STATES + 1] =
|
||||||
lara_as_tightrope_fall,//122
|
lara_as_tightrope_fall,//122
|
||||||
lara_as_tightrope_fall,//123
|
lara_as_tightrope_fall,//123
|
||||||
lara_as_null,//124
|
lara_as_null,//124
|
||||||
|
#ifdef NEW_TIGHTROPE
|
||||||
lara_as_tightrope_dismount,//125
|
lara_as_tightrope_dismount,//125
|
||||||
|
#else // !NEW_TIGHTROPE
|
||||||
|
lara_as_null,//125
|
||||||
|
#endif
|
||||||
lara_as_switch_on,//126
|
lara_as_switch_on,//126
|
||||||
lara_as_null,//127
|
lara_as_null,//127
|
||||||
lara_as_horizontal_bar_swing,//128
|
lara_as_horizontal_bar_swing,//128
|
||||||
|
|
|
@ -34,6 +34,11 @@ using namespace TEN::Entities::Generic;
|
||||||
using namespace TEN::Input;
|
using namespace TEN::Input;
|
||||||
using namespace TEN::Math;
|
using namespace TEN::Math;
|
||||||
|
|
||||||
|
constexpr auto TARGET_COUNT_MAX = 8;
|
||||||
|
|
||||||
|
std::array<ItemInfo*, TARGET_COUNT_MAX> LastTargets = {};
|
||||||
|
std::array<ItemInfo*, TARGET_COUNT_MAX> TargetList = {};
|
||||||
|
|
||||||
int FlashGrenadeAftershockTimer = 0;
|
int FlashGrenadeAftershockTimer = 0;
|
||||||
|
|
||||||
// States in which Lara will hold an active flare out in front.
|
// States in which Lara will hold an active flare out in front.
|
||||||
|
@ -332,8 +337,8 @@ void InitializeNewWeapon(ItemInfo& laraItem)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
player.RightArm.FrameBase = GetAnimData(laraItem).FramePtr;
|
player.RightArm.FrameBase = g_Level.Anims[laraItem.Animation.AnimNumber].FramePtr;
|
||||||
player.LeftArm.FrameBase = GetAnimData(laraItem).FramePtr;
|
player.LeftArm.FrameBase = g_Level.Anims[laraItem.Animation.AnimNumber].FramePtr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -905,7 +910,7 @@ void FindNewTarget(ItemInfo& laraItem, const WeaponInfo& weaponInfo)
|
||||||
orient.x <= weaponInfo.LockOrientConstraint.second.x &&
|
orient.x <= weaponInfo.LockOrientConstraint.second.x &&
|
||||||
orient.y <= weaponInfo.LockOrientConstraint.second.y)
|
orient.y <= weaponInfo.LockOrientConstraint.second.y)
|
||||||
{
|
{
|
||||||
player.TargetList[targetCount] = &item;
|
TargetList[targetCount] = &item;
|
||||||
++targetCount;
|
++targetCount;
|
||||||
|
|
||||||
if (distance < closestDistance &&
|
if (distance < closestDistance &&
|
||||||
|
@ -918,14 +923,14 @@ void FindNewTarget(ItemInfo& laraItem, const WeaponInfo& weaponInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.TargetList[targetCount] = nullptr;
|
TargetList[targetCount] = nullptr;
|
||||||
if (player.TargetList[0] == nullptr)
|
if (TargetList[0] == nullptr)
|
||||||
{
|
{
|
||||||
player.TargetEntity = nullptr;
|
player.TargetEntity = nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (const auto* targetPtr : player.TargetList)
|
for (const auto* targetPtr : TargetList)
|
||||||
{
|
{
|
||||||
if (targetPtr == nullptr)
|
if (targetPtr == nullptr)
|
||||||
player.TargetEntity = nullptr;
|
player.TargetEntity = nullptr;
|
||||||
|
@ -939,17 +944,17 @@ void FindNewTarget(ItemInfo& laraItem, const WeaponInfo& weaponInfo)
|
||||||
if (player.TargetEntity == nullptr)
|
if (player.TargetEntity == nullptr)
|
||||||
{
|
{
|
||||||
player.TargetEntity = closestEntityPtr;
|
player.TargetEntity = closestEntityPtr;
|
||||||
player.LastTargets[0] = nullptr;
|
LastTargets[0] = nullptr;
|
||||||
}
|
}
|
||||||
else if (IsClicked(In::SwitchTarget))
|
else if (IsClicked(In::SwitchTarget))
|
||||||
{
|
{
|
||||||
player.TargetEntity = nullptr;
|
player.TargetEntity = nullptr;
|
||||||
bool flag = true;
|
bool flag = true;
|
||||||
|
|
||||||
for (const auto& targetPtr : player.TargetList)
|
for (const auto& targetPtr : TargetList)
|
||||||
{
|
{
|
||||||
bool doLoop = false;
|
bool doLoop = false;
|
||||||
for (const auto* lastTargetPtr : player.LastTargets)
|
for (const auto* lastTargetPtr : LastTargets)
|
||||||
{
|
{
|
||||||
if (lastTargetPtr == targetPtr)
|
if (lastTargetPtr == targetPtr)
|
||||||
{
|
{
|
||||||
|
@ -971,18 +976,18 @@ void FindNewTarget(ItemInfo& laraItem, const WeaponInfo& weaponInfo)
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
player.TargetEntity = closestEntityPtr;
|
player.TargetEntity = closestEntityPtr;
|
||||||
player.LastTargets[0] = nullptr;
|
LastTargets[0] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.TargetEntity != player.LastTargets[0])
|
if (player.TargetEntity != LastTargets[0])
|
||||||
{
|
{
|
||||||
for (int slot = LaraInfo::TARGET_COUNT_MAX - 1; slot > 0; --slot)
|
for (int slot = TARGET_COUNT_MAX - 1; slot > 0; --slot)
|
||||||
player.LastTargets[slot] = player.LastTargets[slot - 1];
|
LastTargets[slot] = LastTargets[slot - 1];
|
||||||
|
|
||||||
player.LastTargets[0] = player.TargetEntity;
|
LastTargets[0] = player.TargetEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
LaraTargetInfo(laraItem, weaponInfo);
|
LaraTargetInfo(laraItem, weaponInfo);
|
||||||
|
|
|
@ -126,7 +126,7 @@ void UndrawFlare(ItemInfo& laraItem)
|
||||||
if (laraItem.Animation.AnimNumber == LA_STAND_IDLE)
|
if (laraItem.Animation.AnimNumber == LA_STAND_IDLE)
|
||||||
{
|
{
|
||||||
laraItem.Animation.AnimNumber = LA_DISCARD_FLARE;
|
laraItem.Animation.AnimNumber = LA_DISCARD_FLARE;
|
||||||
flareFrame = armFrame + GetAnimData(laraItem).frameBase;
|
flareFrame = armFrame + g_Level.Anims[laraItem.Animation.AnimNumber].frameBase;
|
||||||
laraItem.Animation.FrameNumber = flareFrame;
|
laraItem.Animation.FrameNumber = flareFrame;
|
||||||
player.Flare.Frame = flareFrame;
|
player.Flare.Frame = flareFrame;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ void UndrawFlare(ItemInfo& laraItem)
|
||||||
{
|
{
|
||||||
player.Flare.ControlLeft = false;
|
player.Flare.ControlLeft = false;
|
||||||
|
|
||||||
if (flareFrame >= (GetAnimData(laraItem).frameBase + 31)) // 31 = Last frame.
|
if (flareFrame >= (g_Level.Anims[laraItem.Animation.AnimNumber].frameBase + 31)) // 31 = Last frame.
|
||||||
{
|
{
|
||||||
player.Control.Weapon.RequestGunType = player.Control.Weapon.LastGunType;
|
player.Control.Weapon.RequestGunType = player.Control.Weapon.LastGunType;
|
||||||
player.Control.Weapon.GunType = player.Control.Weapon.LastGunType;
|
player.Control.Weapon.GunType = player.Control.Weapon.LastGunType;
|
||||||
|
@ -146,8 +146,8 @@ void UndrawFlare(ItemInfo& laraItem)
|
||||||
player.TargetEntity = nullptr;
|
player.TargetEntity = nullptr;
|
||||||
player.LeftArm.Locked =
|
player.LeftArm.Locked =
|
||||||
player.RightArm.Locked = false;
|
player.RightArm.Locked = false;
|
||||||
SetAnimation(laraItem, LA_STAND_IDLE);
|
SetAnimation(&laraItem, LA_STAND_IDLE);
|
||||||
player.Flare.Frame = GetAnimData(laraItem).frameBase;
|
player.Flare.Frame = g_Level.Anims[laraItem.Animation.AnimNumber].frameBase;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,27 +281,27 @@ void DrawFlare(ItemInfo& laraItem)
|
||||||
void SetFlareArm(ItemInfo& laraItem, int armFrame)
|
void SetFlareArm(ItemInfo& laraItem, int armFrame)
|
||||||
{
|
{
|
||||||
auto& player = *GetLaraInfo(&laraItem);
|
auto& player = *GetLaraInfo(&laraItem);
|
||||||
int flareAnimNumber = Objects[ID_FLARE_ANIM].animIndex;
|
int flareAnimNum = Objects[ID_FLARE_ANIM].animIndex;
|
||||||
|
|
||||||
if (armFrame >= 95)
|
if (armFrame >= 95)
|
||||||
{
|
{
|
||||||
flareAnimNumber += 4;
|
flareAnimNum += 4;
|
||||||
}
|
}
|
||||||
else if (armFrame >= 72)
|
else if (armFrame >= 72)
|
||||||
{
|
{
|
||||||
flareAnimNumber += 3;
|
flareAnimNum += 3;
|
||||||
}
|
}
|
||||||
else if (armFrame >= 33)
|
else if (armFrame >= 33)
|
||||||
{
|
{
|
||||||
flareAnimNumber += 2;
|
flareAnimNum += 2;
|
||||||
}
|
}
|
||||||
else if (armFrame >= 1)
|
else if (armFrame >= 1)
|
||||||
{
|
{
|
||||||
flareAnimNumber += 1;
|
flareAnimNum += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.LeftArm.AnimNumber = flareAnimNumber;
|
player.LeftArm.AnimNumber = flareAnimNum;
|
||||||
player.LeftArm.FrameBase = GetAnimData(flareAnimNumber).FramePtr;
|
player.LeftArm.FrameBase = g_Level.Anims[flareAnimNum].FramePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateFlare(ItemInfo& laraItem, GAME_OBJECT_ID objectID, bool isThrown)
|
void CreateFlare(ItemInfo& laraItem, GAME_OBJECT_ID objectID, bool isThrown)
|
||||||
|
|
|
@ -312,6 +312,7 @@ void lara_as_horizontal_bar_leap(ItemInfo* item, CollisionInfo* coll)
|
||||||
// TIGHTROPE
|
// TIGHTROPE
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
|
#ifdef NEW_TIGHTROPE
|
||||||
// State: LS_TIGHTROPE_IDLE (119)
|
// State: LS_TIGHTROPE_IDLE (119)
|
||||||
// Collision: lara_default_col()
|
// Collision: lara_default_col()
|
||||||
void lara_as_tightrope_idle(ItemInfo* item, CollisionInfo* coll)
|
void lara_as_tightrope_idle(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
@ -413,6 +414,140 @@ void lara_as_tightrope_fall(ItemInfo* item, CollisionInfo* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
// State: LS_TIGHTROPE_IDLE (119)
|
||||||
|
// Collision: lara_default_col()
|
||||||
|
void lara_as_tightrope_idle(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
{
|
||||||
|
GetTightropeFallOff(item, 127);
|
||||||
|
|
||||||
|
if (TrInput & IN_LOOK)
|
||||||
|
LookUpDown(item);
|
||||||
|
|
||||||
|
if (item->Animation.ActiveState != LS_TIGHTROPE_UNBALANCE_LEFT)
|
||||||
|
{
|
||||||
|
if (lara->Control.TightropeControl.Fall)
|
||||||
|
{
|
||||||
|
if (GetRandomControl() & 1)
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_UNBALANCE_RIGHT;
|
||||||
|
else
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_UNBALANCE_LEFT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (TrInput & IN_FORWARD)
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_WALK;
|
||||||
|
else if (TrInput & (IN_ROLL | IN_BACK))
|
||||||
|
{
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_TURN_180;
|
||||||
|
GetTightropeFallOff(item, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// State: LS_TIGHTROPE_WALK (121)
|
||||||
|
// Collision: lara_default_col()
|
||||||
|
void lara_as_tightrope_walk(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
{
|
||||||
|
if (lara->Control.TightropeControl.OnCount)
|
||||||
|
lara->Control.TightropeControl.OnCount--;
|
||||||
|
else if (lara->Control.TightropeControl.Off)
|
||||||
|
{
|
||||||
|
short roomNumber = item->RoomNumber;
|
||||||
|
|
||||||
|
if (GetFloorHeight(GetFloor(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, &roomNumber),
|
||||||
|
item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z) == item->Pose.Position.y)
|
||||||
|
{
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_DISMOUNT;
|
||||||
|
lara->Control.TightropeControl.Off = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GetTightropeFallOff(item, 127);
|
||||||
|
|
||||||
|
if (item->Animation.ActiveState != LS_TIGHTROPE_UNBALANCE_LEFT)
|
||||||
|
{
|
||||||
|
if (TrInput & IN_LOOK)
|
||||||
|
LookUpDown(item);
|
||||||
|
|
||||||
|
if (((TrInput & (IN_BACK | IN_ROLL) || !(TrInput & IN_FORWARD) || lara->Control.TightropeControl.Fall) &&
|
||||||
|
!lara->Control.TightropeControl.OnCount &&
|
||||||
|
!lara->Control.TightropeControl.Off) &&
|
||||||
|
item->Animation.TargetState != LS_TIGHTROPE_DISMOUNT)
|
||||||
|
{
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_IDLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// State: TIGHTROPE_UNBALANCE_LEFT (122), TIGHTROPE_UNBALANCE_RIGHT (123)
|
||||||
|
// Collision: lara_default_col()
|
||||||
|
void lara_as_tightrope_fall(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
{
|
||||||
|
if (item->Animation.AnimNumber == LA_TIGHTROPE_FALL_LEFT || item->Animation.AnimNumber == LA_TIGHTROPE_FALL_RIGHT)
|
||||||
|
{
|
||||||
|
if (TestLastFrame(item, item->Animation.AnimNumber))
|
||||||
|
{
|
||||||
|
auto pos = GetJointPosition(item, LM_RFOOT);
|
||||||
|
item->Pose.Position.x = pos.x;
|
||||||
|
item->Pose.Position.y = pos.y + 75;
|
||||||
|
item->Pose.Position.z = pos.z;
|
||||||
|
|
||||||
|
item->Animation.TargetState = LS_FREEFALL;
|
||||||
|
item->Animation.ActiveState = LS_FREEFALL;
|
||||||
|
item->Animation.AnimNumber = LA_FREEFALL;
|
||||||
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
|
item->Animation.Velocity.y = 81;
|
||||||
|
Camera.targetspeed = 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int undoInput, wrongInput;
|
||||||
|
int undoAnim, undoFrame;
|
||||||
|
|
||||||
|
if (lara->Control.TightropeControl.OnCount > 0)
|
||||||
|
lara->Control.TightropeControl.OnCount--;
|
||||||
|
|
||||||
|
if (item->Animation.AnimNumber == LA_TIGHTROPE_UNBALANCE_LEFT)
|
||||||
|
{
|
||||||
|
undoInput = IN_RIGHT;
|
||||||
|
wrongInput = IN_LEFT;
|
||||||
|
undoAnim = LA_TIGHTROPE_RECOVER_LEFT;
|
||||||
|
}
|
||||||
|
else if (item->Animation.AnimNumber == LA_TIGHTROPE_UNBALANCE_RIGHT)
|
||||||
|
{
|
||||||
|
undoInput = IN_LEFT;
|
||||||
|
wrongInput = IN_RIGHT;
|
||||||
|
undoAnim = LA_TIGHTROPE_RECOVER_RIGHT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
undoFrame = g_Level.Anims[item->Animation.AnimNumber].frameEnd + g_Level.Anims[undoAnim].frameBase - item->Animation.FrameNumber;
|
||||||
|
|
||||||
|
if (TrInput & undoInput && lara->Control.TightropeControl.OnCount == 0)
|
||||||
|
{
|
||||||
|
item->Animation.ActiveState = LS_TIGHTROPE_RECOVER_BALANCE;
|
||||||
|
item->Animation.TargetState = LS_TIGHTROPE_IDLE;
|
||||||
|
item->Animation.AnimNumber = undoAnim;
|
||||||
|
item->Animation.FrameNumber = undoFrame;
|
||||||
|
lara->Control.TightropeControl.Fall--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (TrInput & wrongInput)
|
||||||
|
{
|
||||||
|
if (lara->Control.TightropeControl.OnCount < 10)
|
||||||
|
lara->Control.TightropeControl.OnCount += (GetRandomControl() & 3) + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----
|
// ----
|
||||||
// ROPE
|
// ROPE
|
||||||
// ----
|
// ----
|
||||||
|
@ -547,7 +682,7 @@ void lara_col_rope_swing(ItemInfo* item, CollisionInfo* coll)
|
||||||
item->Animation.TargetState = LS_ROPE_IDLE;
|
item->Animation.TargetState = LS_ROPE_IDLE;
|
||||||
item->Animation.ActiveState = LS_ROPE_IDLE;
|
item->Animation.ActiveState = LS_ROPE_IDLE;
|
||||||
item->Animation.AnimNumber = LA_JUMP_UP_TO_ROPE_END;
|
item->Animation.AnimNumber = LA_JUMP_UP_TO_ROPE_END;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TrInput & IN_JUMP)
|
if (TrInput & IN_JUMP)
|
||||||
|
|
|
@ -55,7 +55,9 @@ void lara_as_horizontal_bar_leap(ItemInfo* item, CollisionInfo* coll);
|
||||||
// TIGHTROPE
|
// TIGHTROPE
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
|
#ifdef NEW_TIGHTROPE
|
||||||
void lara_as_tightrope_dismount(ItemInfo* item, CollisionInfo* coll);
|
void lara_as_tightrope_dismount(ItemInfo* item, CollisionInfo* coll);
|
||||||
|
#endif
|
||||||
void lara_as_tightrope_idle(ItemInfo* item, CollisionInfo* coll);
|
void lara_as_tightrope_idle(ItemInfo* item, CollisionInfo* coll);
|
||||||
void lara_as_tightrope_walk(ItemInfo* item, CollisionInfo* coll);
|
void lara_as_tightrope_walk(ItemInfo* item, CollisionInfo* coll);
|
||||||
void lara_as_tightrope_fall(ItemInfo* item, CollisionInfo* coll);
|
void lara_as_tightrope_fall(ItemInfo* item, CollisionInfo* coll);
|
||||||
|
|
|
@ -475,7 +475,7 @@ void DrawShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
||||||
if (weaponItemPtr->Animation.ActiveState != WEAPON_STATE_AIM &&
|
if (weaponItemPtr->Animation.ActiveState != WEAPON_STATE_AIM &&
|
||||||
weaponItemPtr->Animation.ActiveState != WEAPON_STATE_UNDERWATER_AIM)
|
weaponItemPtr->Animation.ActiveState != WEAPON_STATE_UNDERWATER_AIM)
|
||||||
{
|
{
|
||||||
if ((weaponItemPtr->Animation.FrameNumber - GetAnimData(weaponItemPtr).frameBase) == Weapons[(int)weaponType].DrawFrame)
|
if ((weaponItemPtr->Animation.FrameNumber - g_Level.Anims[weaponItemPtr->Animation.AnimNumber].frameBase) == Weapons[(int)weaponType].DrawFrame)
|
||||||
{
|
{
|
||||||
DrawShotgunMeshes(laraItem, weaponType);
|
DrawShotgunMeshes(laraItem, weaponType);
|
||||||
}
|
}
|
||||||
|
@ -489,8 +489,8 @@ void DrawShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
||||||
ReadyShotgun(laraItem, weaponType);
|
ReadyShotgun(laraItem, weaponType);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.LeftArm.FrameBase = player.RightArm.FrameBase = GetAnimData(weaponItemPtr).FramePtr;
|
player.LeftArm.FrameBase = player.RightArm.FrameBase = g_Level.Anims[weaponItemPtr->Animation.AnimNumber].FramePtr;
|
||||||
player.LeftArm.FrameNumber = player.RightArm.FrameNumber = weaponItemPtr->Animation.FrameNumber - GetAnimData(weaponItemPtr).frameBase;
|
player.LeftArm.FrameNumber = player.RightArm.FrameNumber = weaponItemPtr->Animation.FrameNumber - g_Level.Anims[weaponItemPtr->Animation.AnimNumber].frameBase;
|
||||||
player.LeftArm.AnimNumber = player.RightArm.AnimNumber = weaponItemPtr->Animation.AnimNumber;
|
player.LeftArm.AnimNumber = player.RightArm.AnimNumber = weaponItemPtr->Animation.AnimNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,19 +517,19 @@ void UndrawShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
||||||
}
|
}
|
||||||
else if (item.Animation.ActiveState == WEAPON_STATE_UNDRAW)
|
else if (item.Animation.ActiveState == WEAPON_STATE_UNDRAW)
|
||||||
{
|
{
|
||||||
if (item.Animation.FrameNumber - GetAnimData(item).frameBase == 21 ||
|
if ((item.Animation.FrameNumber - g_Level.Anims[item.Animation.AnimNumber].frameBase) == 21 ||
|
||||||
(weaponType == LaraWeaponType::GrenadeLauncher && item.Animation.FrameNumber - GetAnimData(item).frameBase == 15))
|
(weaponType == LaraWeaponType::GrenadeLauncher && (item.Animation.FrameNumber - g_Level.Anims[item.Animation.AnimNumber].frameBase) == 15))
|
||||||
{
|
{
|
||||||
UndrawShotgunMeshes(laraItem, weaponType);
|
UndrawShotgunMeshes(laraItem, weaponType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.RightArm.FrameBase =
|
player.LeftArm.FrameBase =
|
||||||
player.LeftArm.FrameBase = GetAnimData(item).FramePtr;
|
player.RightArm.FrameBase = g_Level.Anims[item.Animation.AnimNumber].FramePtr;
|
||||||
player.RightArm.FrameNumber =
|
player.LeftArm.FrameNumber =
|
||||||
player.LeftArm.FrameNumber = item.Animation.FrameNumber - GetAnimData(item).frameBase;
|
player.RightArm.FrameNumber = item.Animation.FrameNumber - g_Level.Anims[item.Animation.AnimNumber].frameBase;
|
||||||
player.RightArm.AnimNumber =
|
player.LeftArm.AnimNumber =
|
||||||
player.LeftArm.AnimNumber = player.RightArm.AnimNumber;
|
player.RightArm.AnimNumber = item.Animation.AnimNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawShotgunMeshes(ItemInfo& laraItem, LaraWeaponType weaponType)
|
void DrawShotgunMeshes(ItemInfo& laraItem, LaraWeaponType weaponType)
|
||||||
|
|
|
@ -699,7 +699,7 @@ void lara_as_sclimbstart(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
|
||||||
int distance = TestLaraWall(item, 0, SECTOR(1.5f), 0) ? SECTOR(1) : CLICK(6.5f);
|
int distance = TestLaraWall(item, 0, SECTOR(1.5f), 0) ? SECTOR(1) : CLICK(6.5f);
|
||||||
|
|
||||||
if (item->Animation.FrameNumber < GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
Camera.targetDistance = distance;
|
Camera.targetDistance = distance;
|
||||||
Camera.targetElevation = int(SECTOR(3) * frac);
|
Camera.targetElevation = int(SECTOR(3) * frac);
|
||||||
|
@ -753,7 +753,7 @@ void lara_as_sclimbstop(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
|
||||||
Camera.flags = CF_FOLLOW_CENTER;
|
Camera.flags = CF_FOLLOW_CENTER;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber < GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
|
|
||||||
Camera.targetAngle = (short)(-ANGLE(90.0f) * frac);
|
Camera.targetAngle = (short)(-ANGLE(90.0f) * frac);
|
||||||
|
|
|
@ -1220,12 +1220,19 @@ struct RopeControlData
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Give tightrope a property for difficulty?
|
// TODO: Give tightrope a property for difficulty?
|
||||||
|
// TODO: Remove old tightrope functionality.
|
||||||
struct TightropeControlData
|
struct TightropeControlData
|
||||||
{
|
{
|
||||||
|
#if NEW_TIGHTROPE
|
||||||
short TightropeItem = 0;
|
short TightropeItem = 0;
|
||||||
bool CanDismount = false;
|
bool CanDismount = false;
|
||||||
float Balance = 0.0f;
|
float Balance = 0.0f;
|
||||||
unsigned int TimeOnTightrope = 0;
|
unsigned int TimeOnTightrope = 0;
|
||||||
|
#else // !NEW_TIGHTROPE
|
||||||
|
unsigned int OnCount;
|
||||||
|
byte Off;
|
||||||
|
byte Fall;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SubsuitControlData
|
struct SubsuitControlData
|
||||||
|
@ -1300,8 +1307,6 @@ struct PlayerEffectData
|
||||||
|
|
||||||
struct LaraInfo
|
struct LaraInfo
|
||||||
{
|
{
|
||||||
static constexpr auto TARGET_COUNT_MAX = 8;
|
|
||||||
|
|
||||||
int ItemNumber = 0; // TODO: Remove. No longer necessary since ItemInfo already has it. -- Sezz 2023.04.09
|
int ItemNumber = 0; // TODO: Remove. No longer necessary since ItemInfo already has it. -- Sezz 2023.04.09
|
||||||
|
|
||||||
LaraControlData Control = {};
|
LaraControlData Control = {};
|
||||||
|
@ -1314,15 +1319,12 @@ struct LaraInfo
|
||||||
TorchData Torch = {};
|
TorchData Torch = {};
|
||||||
CarriedWeaponInfo Weapons[(int)LaraWeaponType::NumWeapons] = {};
|
CarriedWeaponInfo Weapons[(int)LaraWeaponType::NumWeapons] = {};
|
||||||
|
|
||||||
EulerAngles ExtraHeadRot = EulerAngles::Zero;
|
EulerAngles ExtraHeadRot = {};
|
||||||
EulerAngles ExtraTorsoRot = EulerAngles::Zero;
|
EulerAngles ExtraTorsoRot = {};
|
||||||
EulerAngles TargetArmOrient = EulerAngles::Zero;
|
|
||||||
ArmInfo LeftArm = {};
|
ArmInfo LeftArm = {};
|
||||||
ArmInfo RightArm = {};
|
ArmInfo RightArm = {};
|
||||||
|
EulerAngles TargetArmOrient = EulerAngles::Zero;
|
||||||
ItemInfo* TargetEntity = nullptr; // TargetEntityPtr. Should use item number instead?
|
ItemInfo* TargetEntity = nullptr; // TargetEntityPtr. Should use item number instead?
|
||||||
std::array<ItemInfo*, TARGET_COUNT_MAX> TargetList = {};
|
|
||||||
std::array<ItemInfo*, TARGET_COUNT_MAX> LastTargets = {};
|
|
||||||
|
|
||||||
// TODO: Rewrite and restore spasm effect. Also move to PlayerEffectData?
|
// TODO: Rewrite and restore spasm effect. Also move to PlayerEffectData?
|
||||||
int HitFrame = 0; // Frame index.
|
int HitFrame = 0; // Frame index.
|
||||||
|
|
|
@ -1099,6 +1099,19 @@ void TestLaraWaterDepth(ItemInfo* item, CollisionInfo* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NEW_TIGHTROPE
|
||||||
|
void GetTightropeFallOff(ItemInfo* item, int regularity)
|
||||||
|
{
|
||||||
|
auto* lara = GetLaraInfo(item);
|
||||||
|
|
||||||
|
if (item->HitPoints <= 0 || item->HitStatus)
|
||||||
|
SetAnimation(item, LA_TIGHTROPE_FALL_LEFT);
|
||||||
|
|
||||||
|
if (!lara->Control.Tightrope.Fall && !(GetRandomControl() & regularity))
|
||||||
|
lara->Control.Tightrope.Fall = 2 - ((GetRandomControl() & 0xF) != 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool TestLaraWeaponType(LaraWeaponType refWeaponType, const vector<LaraWeaponType>& weaponTypeList)
|
bool TestLaraWeaponType(LaraWeaponType refWeaponType, const vector<LaraWeaponType>& weaponTypeList)
|
||||||
{
|
{
|
||||||
for (const auto& weaponType : weaponTypeList)
|
for (const auto& weaponType : weaponTypeList)
|
||||||
|
|
|
@ -42,6 +42,10 @@ bool TestLaraWaterClimbOut(ItemInfo* item, CollisionInfo* coll);
|
||||||
bool TestLaraLadderClimbOut(ItemInfo* item, CollisionInfo* coll);
|
bool TestLaraLadderClimbOut(ItemInfo* item, CollisionInfo* coll);
|
||||||
void TestLaraWaterDepth(ItemInfo* item, CollisionInfo* coll);
|
void TestLaraWaterDepth(ItemInfo* item, CollisionInfo* coll);
|
||||||
|
|
||||||
|
#ifndef NEW_TIGHTROPE
|
||||||
|
void GetTightropeFallOff(ItemInfo* item, int regularity);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool TestLaraWeaponType(LaraWeaponType refWeaponType, const std::vector<LaraWeaponType>& weaponTypeList);
|
bool TestLaraWeaponType(LaraWeaponType refWeaponType, const std::vector<LaraWeaponType>& weaponTypeList);
|
||||||
bool IsStandingWeapon(ItemInfo* item, LaraWeaponType weaponType);
|
bool IsStandingWeapon(ItemInfo* item, LaraWeaponType weaponType);
|
||||||
bool IsVaultState(int state);
|
bool IsVaultState(int state);
|
||||||
|
|
|
@ -89,7 +89,7 @@ static void SetArmInfo(const ItemInfo& laraItem, ArmInfo& arm, int frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
arm.FrameNumber = frame;
|
arm.FrameNumber = frame;
|
||||||
arm.FrameBase = GetAnimData(arm.AnimNumber).FramePtr;
|
arm.FrameBase = g_Level.Anims[arm.AnimNumber].FramePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ReadyPistols(ItemInfo& laraItem, LaraWeaponType weaponType)
|
static void ReadyPistols(ItemInfo& laraItem, LaraWeaponType weaponType)
|
||||||
|
|
|
@ -406,9 +406,9 @@ void SetAnimation(ItemInfo& item, GAME_OBJECT_ID animObjectID, int animNumber, i
|
||||||
if (animIndex < 0 || animIndex >= g_Level.Anims.size())
|
if (animIndex < 0 || animIndex >= g_Level.Anims.size())
|
||||||
{
|
{
|
||||||
TENLog(
|
TENLog(
|
||||||
"Attempted to set missing animation " + std::to_string(animNumber) +
|
std::string("Attempted to set missing animation ") + std::to_string(animNumber) +
|
||||||
((animObjectID == item.ObjectNumber) ? "" : (" from object " + GetObjectName(animObjectID))) +
|
(animObjectID == item.ObjectNumber ? std::string() : std::string(" from object ") + GetObjectName(animObjectID)) +
|
||||||
" for object " + GetObjectName(item.ObjectNumber),
|
std::string(" for object ") + GetObjectName(item.ObjectNumber),
|
||||||
LogLevel::Warning);
|
LogLevel::Warning);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -442,23 +442,23 @@ void SetAnimation(ItemInfo* item, int animNumber, int frameNumber)
|
||||||
SetAnimation(*item, item->ObjectNumber, animNumber, frameNumber);
|
SetAnimation(*item, item->ObjectNumber, animNumber, frameNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimData& GetAnimData(int animIndex)
|
AnimData& GetAnimData(int animIndex)
|
||||||
{
|
{
|
||||||
return g_Level.Anims[animIndex];
|
return g_Level.Anims[animIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimData& GetAnimData(GAME_OBJECT_ID objectID, int animNumber)
|
AnimData& GetAnimData(GAME_OBJECT_ID objectID, int animNumber)
|
||||||
{
|
{
|
||||||
const auto& object = Objects[objectID];
|
const auto& object = Objects[objectID];
|
||||||
return GetAnimData(object, animNumber);
|
return GetAnimData(object, animNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimData& GetAnimData(const ObjectInfo& object, int animNumber)
|
AnimData& GetAnimData(const ObjectInfo& object, int animNumber)
|
||||||
{
|
{
|
||||||
return g_Level.Anims[object.animIndex + animNumber];
|
return g_Level.Anims[object.animIndex + animNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimData& GetAnimData(const ItemInfo& item, int animNumber)
|
AnimData& GetAnimData(const ItemInfo& item, int animNumber)
|
||||||
{
|
{
|
||||||
if (animNumber == NO_ANIM)
|
if (animNumber == NO_ANIM)
|
||||||
return GetAnimData(item.Animation.AnimNumber);
|
return GetAnimData(item.Animation.AnimNumber);
|
||||||
|
@ -467,11 +467,6 @@ const AnimData& GetAnimData(const ItemInfo& item, int animNumber)
|
||||||
return GetAnimData(object, animNumber);
|
return GetAnimData(object, animNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimData& GetAnimData(const ItemInfo* item, int animNumber)
|
|
||||||
{
|
|
||||||
return (GetAnimData(*item, animNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimFrameInterpData GetFrameInterpData(const ItemInfo& item)
|
AnimFrameInterpData GetFrameInterpData(const ItemInfo& item)
|
||||||
{
|
{
|
||||||
const auto& anim = GetAnimData(item);
|
const auto& anim = GetAnimData(item);
|
||||||
|
@ -483,8 +478,8 @@ AnimFrameInterpData GetFrameInterpData(const ItemInfo& item)
|
||||||
// Calculate keyframe numbers defining interpolated frame and get pointers to them.
|
// Calculate keyframe numbers defining interpolated frame and get pointers to them.
|
||||||
int frame0 = (int)floor(frameNumberNorm);
|
int frame0 = (int)floor(frameNumberNorm);
|
||||||
int frame1 = (int)ceil(frameNumberNorm);
|
int frame1 = (int)ceil(frameNumberNorm);
|
||||||
const auto* framePtr0 = &g_Level.Frames[anim.FramePtr + frame0];
|
auto* framePtr0 = &g_Level.Frames[anim.FramePtr + frame0];
|
||||||
const auto* framePtr1 = &g_Level.Frames[anim.FramePtr + frame1];
|
auto* framePtr1 = &g_Level.Frames[anim.FramePtr + frame1];
|
||||||
|
|
||||||
// Calculate interpolation alpha between keyframes.
|
// Calculate interpolation alpha between keyframes.
|
||||||
float alpha = (1.0f / anim.Interpolation) * (frameNumber % anim.Interpolation);
|
float alpha = (1.0f / anim.Interpolation) * (frameNumber % anim.Interpolation);
|
||||||
|
@ -493,12 +488,12 @@ AnimFrameInterpData GetFrameInterpData(const ItemInfo& item)
|
||||||
return AnimFrameInterpData{ framePtr0, framePtr1, alpha };
|
return AnimFrameInterpData{ framePtr0, framePtr1, alpha };
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimFrame& GetAnimFrame(const ItemInfo& item, int animNumber, int frameNumber)
|
AnimFrame& GetAnimFrame(const ItemInfo& item, int animNumber, int frameNumber)
|
||||||
{
|
{
|
||||||
return *GetFrame(item.ObjectNumber, animNumber, frameNumber);
|
return *GetFrame(item.ObjectNumber, animNumber, frameNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimFrame* GetFrame(GAME_OBJECT_ID objectID, int animNumber, int frameNumber)
|
AnimFrame* GetFrame(GAME_OBJECT_ID objectID, int animNumber, int frameNumber)
|
||||||
{
|
{
|
||||||
const auto& object = Objects[objectID];
|
const auto& object = Objects[objectID];
|
||||||
|
|
||||||
|
@ -513,25 +508,39 @@ const AnimFrame* GetFrame(GAME_OBJECT_ID objectID, int animNumber, int frameNumb
|
||||||
frameNumber = frameCount;
|
frameNumber = frameCount;
|
||||||
|
|
||||||
// Interpolate and return frame pointer.
|
// Interpolate and return frame pointer.
|
||||||
const auto* framePtr = &g_Level.Frames[anim.FramePtr];
|
auto* framePtr = &g_Level.Frames[anim.FramePtr];
|
||||||
framePtr += frameNumber / anim.Interpolation;
|
framePtr += frameNumber / anim.Interpolation;
|
||||||
return framePtr;
|
return framePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimFrame* GetFirstFrame(GAME_OBJECT_ID objectID, int animNumber)
|
AnimFrame* GetFirstFrame(GAME_OBJECT_ID objectID, int animNumber)
|
||||||
{
|
{
|
||||||
return GetFrame(objectID, animNumber, 0);
|
return GetFrame(objectID, animNumber, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimFrame* GetLastFrame(GAME_OBJECT_ID objectID, int animNumber)
|
AnimFrame* GetLastFrame(GAME_OBJECT_ID objectID, int animNumber)
|
||||||
{
|
{
|
||||||
return GetFrame(objectID, animNumber, INT_MAX);
|
return GetFrame(objectID, animNumber, INT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimFrame& GetBestFrame(const ItemInfo& item)
|
AnimFrame& GetBestFrame(const ItemInfo& item)
|
||||||
{
|
{
|
||||||
auto frameData = GetFrameInterpData(item);
|
auto frameData = GetFrameInterpData(item);
|
||||||
return ((frameData.Alpha <= 0.5f) ? *frameData.FramePtr0 : *frameData.FramePtr1);
|
if (frameData.Alpha <= 0.5f)
|
||||||
|
return *frameData.FramePtr0;
|
||||||
|
else
|
||||||
|
return *frameData.FramePtr1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetFrameNumber(const ItemInfo& item)
|
||||||
|
{
|
||||||
|
const auto& anim = GetAnimData(item);
|
||||||
|
return (item.Animation.FrameNumber - anim.frameBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetFrameNumber(ItemInfo* item)
|
||||||
|
{
|
||||||
|
return GetFrameNumber(*item);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetAnimNumber(const ItemInfo& item)
|
int GetAnimNumber(const ItemInfo& item)
|
||||||
|
@ -546,17 +555,6 @@ int GetAnimIndex(const ItemInfo& item, int animNumber)
|
||||||
return (object.animIndex + animNumber);
|
return (object.animIndex + animNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetFrameNumber(const ItemInfo& item)
|
|
||||||
{
|
|
||||||
const auto& anim = GetAnimData(item);
|
|
||||||
return (item.Animation.FrameNumber - anim.frameBase);
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetFrameNumber(ItemInfo* item)
|
|
||||||
{
|
|
||||||
return GetFrameNumber(*item);
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetFrameIndex(ItemInfo* item, int frameNumber)
|
int GetFrameIndex(ItemInfo* item, int frameNumber)
|
||||||
{
|
{
|
||||||
int animNumber = item->Animation.AnimNumber - Objects[item->Animation.AnimObjectID].animIndex;
|
int animNumber = item->Animation.AnimNumber - Objects[item->Animation.AnimObjectID].animIndex;
|
||||||
|
@ -577,7 +575,10 @@ int GetFrameCount(int animIndex)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const auto& anim = GetAnimData(animIndex);
|
const auto& anim = GetAnimData(animIndex);
|
||||||
return (anim.frameEnd - anim.frameBase);
|
|
||||||
|
int end = anim.frameEnd;
|
||||||
|
int base = anim.frameBase;
|
||||||
|
return (end - base);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetNextAnimState(ItemInfo* item)
|
int GetNextAnimState(ItemInfo* item)
|
||||||
|
|
|
@ -75,9 +75,9 @@ struct AnimData
|
||||||
|
|
||||||
struct AnimFrameInterpData
|
struct AnimFrameInterpData
|
||||||
{
|
{
|
||||||
const AnimFrame* FramePtr0 = nullptr;
|
AnimFrame* FramePtr0 = nullptr;
|
||||||
const AnimFrame* FramePtr1 = nullptr;
|
AnimFrame* FramePtr1 = nullptr;
|
||||||
float Alpha = 0.0f;
|
float Alpha = 0.0f;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BoneMutator
|
struct BoneMutator
|
||||||
|
@ -115,18 +115,10 @@ void SetAnimation(ItemInfo& item, int animNumber, int frameNumber = 0);
|
||||||
void SetAnimation(ItemInfo* item, int animNumber, int frameNumber = 0); // Deprecated.
|
void SetAnimation(ItemInfo* item, int animNumber, int frameNumber = 0); // Deprecated.
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
const AnimData& GetAnimData(int animIndex); // Deprecated.
|
AnimData& GetAnimData(int animIndex); // Deprecated.
|
||||||
const AnimData& GetAnimData(GAME_OBJECT_ID objectID, int animNumber);
|
AnimData& GetAnimData(GAME_OBJECT_ID objectID, int animNumber);
|
||||||
const AnimData& GetAnimData(const ObjectInfo& object, int animNumber);
|
AnimData& GetAnimData(const ObjectInfo& object, int animNumber);
|
||||||
const AnimData& GetAnimData(const ItemInfo& item, int animNumber = NO_ANIM);
|
AnimData& GetAnimData(const ItemInfo& item, int animNumber = NO_ANIM);
|
||||||
const AnimData& GetAnimData(const ItemInfo* item, int animNumber = NO_ANIM); // Deprecated.
|
|
||||||
|
|
||||||
AnimFrameInterpData GetFrameInterpData(const ItemInfo& item);
|
|
||||||
const AnimFrame& GetAnimFrame(const ItemInfo& item, int animNumber, int frameNumber);
|
|
||||||
const AnimFrame* GetFrame(GAME_OBJECT_ID objectID, int animNumber, int frameNumber);
|
|
||||||
const AnimFrame* GetFirstFrame(GAME_OBJECT_ID objectID, int animNumber);
|
|
||||||
const AnimFrame* GetLastFrame(GAME_OBJECT_ID objectID, int animNumber);
|
|
||||||
const AnimFrame& GetBestFrame(const ItemInfo& item);
|
|
||||||
|
|
||||||
int GetAnimNumber(const ItemInfo& item);
|
int GetAnimNumber(const ItemInfo& item);
|
||||||
int GetAnimIndex(const ItemInfo& item, int animNumber);
|
int GetAnimIndex(const ItemInfo& item, int animNumber);
|
||||||
|
@ -142,6 +134,13 @@ int GetNextAnimState(ItemInfo* item);
|
||||||
int GetNextAnimState(int objectID, int animNumber);
|
int GetNextAnimState(int objectID, int animNumber);
|
||||||
bool GetStateDispatch(ItemInfo* item, const AnimData& anim);
|
bool GetStateDispatch(ItemInfo* item, const AnimData& anim);
|
||||||
|
|
||||||
|
AnimFrameInterpData GetFrameInterpData(const ItemInfo& item);
|
||||||
|
AnimFrame& GetAnimFrame(const ItemInfo& item, int animNumber, int frameNumber);
|
||||||
|
AnimFrame* GetFrame(GAME_OBJECT_ID objectID, int animNumber, int frameNumber);
|
||||||
|
AnimFrame* GetFirstFrame(GAME_OBJECT_ID objectID, int animNumber);
|
||||||
|
AnimFrame* GetLastFrame(GAME_OBJECT_ID objectID, int animNumber);
|
||||||
|
AnimFrame& GetBestFrame(const ItemInfo& item);
|
||||||
|
|
||||||
void ClampRotation(Pose& outPose, short angle, short rotation);
|
void ClampRotation(Pose& outPose, short angle, short rotation);
|
||||||
void DrawAnimatingItem(ItemInfo* item);
|
void DrawAnimatingItem(ItemInfo* item);
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ bool GetCollidedObjects(ItemInfo* collidingItem, int radius, bool onlyVisible, I
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This is awful and we need a better system.
|
/*this is awful*/
|
||||||
if (item->ObjectNumber == ID_UPV && item->HitPoints == 1)
|
if (item->ObjectNumber == ID_UPV && item->HitPoints == 1)
|
||||||
{
|
{
|
||||||
itemNumber = item->NextItem;
|
itemNumber = item->NextItem;
|
||||||
|
@ -182,12 +182,14 @@ bool GetCollidedObjects(ItemInfo* collidingItem, int radius, bool onlyVisible, I
|
||||||
itemNumber = item->NextItem;
|
itemNumber = item->NextItem;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/*we need a better system*/
|
||||||
|
|
||||||
int dx = collidingItem->Pose.Position.x - item->Pose.Position.x;
|
int dx = collidingItem->Pose.Position.x - item->Pose.Position.x;
|
||||||
int dy = collidingItem->Pose.Position.y - item->Pose.Position.y;
|
int dy = collidingItem->Pose.Position.y - item->Pose.Position.y;
|
||||||
int dz = collidingItem->Pose.Position.z - item->Pose.Position.z;
|
int dz = collidingItem->Pose.Position.z - item->Pose.Position.z;
|
||||||
|
|
||||||
auto bounds = GetBestFrame(*item).BoundingBox;
|
// TODO: Don't modify object animation data!!!
|
||||||
|
auto& bounds = GetBestFrame(*item).BoundingBox;
|
||||||
|
|
||||||
if (dx >= -BLOCK(2) && dx <= BLOCK(2) &&
|
if (dx >= -BLOCK(2) && dx <= BLOCK(2) &&
|
||||||
dy >= -BLOCK(2) && dy <= BLOCK(2) &&
|
dy >= -BLOCK(2) && dy <= BLOCK(2) &&
|
||||||
|
@ -201,7 +203,6 @@ bool GetCollidedObjects(ItemInfo* collidingItem, int radius, bool onlyVisible, I
|
||||||
int rx = (dx * cosY) - (dz * sinY);
|
int rx = (dx * cosY) - (dz * sinY);
|
||||||
int rz = (dz * cosY) + (dx * sinY);
|
int rz = (dz * cosY) + (dx * sinY);
|
||||||
|
|
||||||
// TODO: Modify asset to avoid hardcoded bounds change. -- Sezz 2023.04.30
|
|
||||||
if (item->ObjectNumber == ID_TURN_SWITCH)
|
if (item->ObjectNumber == ID_TURN_SWITCH)
|
||||||
{
|
{
|
||||||
bounds.X1 = -CLICK(1);
|
bounds.X1 = -CLICK(1);
|
||||||
|
@ -230,7 +231,6 @@ bool GetCollidedObjects(ItemInfo* collidingItem, int radius, bool onlyVisible, I
|
||||||
int rx = (dx * cosY) - (dz * sinY);
|
int rx = (dx * cosY) - (dz * sinY);
|
||||||
int rz = (dz * cosY) + (dx * sinY);
|
int rz = (dz * cosY) + (dx * sinY);
|
||||||
|
|
||||||
// TODO: Modify asset to avoid hardcoded bounds change. -- Sezz 2023.04.30
|
|
||||||
if (item->ObjectNumber == ID_TURN_SWITCH)
|
if (item->ObjectNumber == ID_TURN_SWITCH)
|
||||||
{
|
{
|
||||||
bounds.X1 = -CLICK(1);
|
bounds.X1 = -CLICK(1);
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
#include "Objects/TR5/Emitter/tr5_bats_emitter.h"
|
#include "Objects/TR5/Emitter/tr5_bats_emitter.h"
|
||||||
#include "Objects/TR5/Emitter/tr5_rats_emitter.h"
|
#include "Objects/TR5/Emitter/tr5_rats_emitter.h"
|
||||||
#include "Objects/TR5/Emitter/tr5_spider_emitter.h"
|
#include "Objects/TR5/Emitter/tr5_spider_emitter.h"
|
||||||
#include "Objects/TR5/Trap/LaserBarrier.h"
|
|
||||||
#include "Scripting/Include/Flow/ScriptInterfaceFlowHandler.h"
|
#include "Scripting/Include/Flow/ScriptInterfaceFlowHandler.h"
|
||||||
#include "Scripting/Include/Objects/ScriptInterfaceObjectsHandler.h"
|
#include "Scripting/Include/Objects/ScriptInterfaceObjectsHandler.h"
|
||||||
#include "Scripting/Include/ScriptInterfaceGame.h"
|
#include "Scripting/Include/ScriptInterfaceGame.h"
|
||||||
|
@ -80,7 +79,6 @@ using namespace TEN::Hud;
|
||||||
using namespace TEN::Input;
|
using namespace TEN::Input;
|
||||||
using namespace TEN::Math;
|
using namespace TEN::Math;
|
||||||
using namespace TEN::Renderer;
|
using namespace TEN::Renderer;
|
||||||
using namespace TEN::Traps::TR5;
|
|
||||||
|
|
||||||
int GameTimer = 0;
|
int GameTimer = 0;
|
||||||
int GlobalCounter = 0;
|
int GlobalCounter = 0;
|
||||||
|
@ -419,7 +417,6 @@ void CleanUp()
|
||||||
ClearFootprints();
|
ClearFootprints();
|
||||||
ClearDrips();
|
ClearDrips();
|
||||||
ClearRipples();
|
ClearRipples();
|
||||||
ClearLaserBarrierEffects();
|
|
||||||
DisableSmokeParticles();
|
DisableSmokeParticles();
|
||||||
DisableSparkParticles();
|
DisableSparkParticles();
|
||||||
DisableDebris();
|
DisableDebris();
|
||||||
|
|
|
@ -182,8 +182,8 @@ int SwitchTrigger(short itemNumber, short timer)
|
||||||
// Handle switches.
|
// Handle switches.
|
||||||
if (item.Status == ITEM_DEACTIVATED)
|
if (item.Status == ITEM_DEACTIVATED)
|
||||||
{
|
{
|
||||||
if (((item.Animation.ActiveState == SWITCH_OFF && item.ObjectNumber != ID_JUMP_SWITCH) ||
|
if (((item.Animation.ActiveState == 0 && item.ObjectNumber != ID_JUMP_SWITCH) ||
|
||||||
(item.Animation.ActiveState == SWITCH_ON && item.ObjectNumber == ID_JUMP_SWITCH)) &&
|
(item.Animation.ActiveState == 1 && item.ObjectNumber == ID_JUMP_SWITCH)) &&
|
||||||
timer > 0)
|
timer > 0)
|
||||||
{
|
{
|
||||||
item.Timer = timer;
|
item.Timer = timer;
|
||||||
|
@ -195,7 +195,7 @@ int SwitchTrigger(short itemNumber, short timer)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.TriggerFlags >= 0 || item.Animation.ActiveState != SWITCH_OFF)
|
if (item.TriggerFlags >= 0 || item.Animation.ActiveState != 0)
|
||||||
{
|
{
|
||||||
RemoveActiveItem(itemNumber);
|
RemoveActiveItem(itemNumber);
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ int SwitchTrigger(short itemNumber, short timer)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (item.Status != ITEM_NOT_ACTIVE)
|
else if (item.Status != 0)
|
||||||
{
|
{
|
||||||
if (item.ObjectNumber == ID_AIRLOCK_SWITCH &&
|
if (item.ObjectNumber == ID_AIRLOCK_SWITCH &&
|
||||||
item.Animation.AnimNumber == GetAnimIndex(item, 2) &&
|
item.Animation.AnimNumber == GetAnimIndex(item, 2) &&
|
||||||
|
|
|
@ -449,7 +449,7 @@ void PickupCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Animation.TargetState = LS_UNDERWATER_IDLE;
|
laraItem->Animation.TargetState = LS_UNDERWATER_IDLE;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
lara->Control.IsMoving = false;
|
lara->Control.IsMoving = false;
|
||||||
lara->Control.HandStatus = HandStatus::Busy;
|
lara->Control.HandStatus = HandStatus::Busy;
|
||||||
}
|
}
|
||||||
|
@ -507,11 +507,10 @@ void PickupCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item->Pose.Orientation.x = 0;
|
|
||||||
const GameBoundingBox* plinthBounds = nullptr;
|
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
|
GameBoundingBox* plinth = nullptr;
|
||||||
|
item->Pose.Orientation.x = 0;
|
||||||
switch (triggerFlags)
|
switch (triggerFlags)
|
||||||
{
|
{
|
||||||
// Pick up from hole in wall.
|
// Pick up from hole in wall.
|
||||||
|
@ -599,19 +598,19 @@ void PickupCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
case 4:
|
case 4:
|
||||||
case 7:
|
case 7:
|
||||||
case 8:
|
case 8:
|
||||||
plinthBounds = FindPlinth(item);
|
plinth = FindPlinth(item);
|
||||||
|
|
||||||
if (plinthBounds == nullptr)
|
if (!plinth)
|
||||||
{
|
{
|
||||||
item->Pose.Orientation = prevOrient;
|
item->Pose.Orientation = prevOrient;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlinthPickUpBounds.BoundingBox.X1 = plinthBounds->X1;
|
PlinthPickUpBounds.BoundingBox.X1 = plinth->X1;
|
||||||
PlinthPickUpBounds.BoundingBox.X2 = plinthBounds->X2;
|
PlinthPickUpBounds.BoundingBox.X2 = plinth->X2;
|
||||||
PlinthPickUpBounds.BoundingBox.Y2 = laraItem->Pose.Position.y - item->Pose.Position.y + 100;
|
PlinthPickUpBounds.BoundingBox.Y2 = laraItem->Pose.Position.y - item->Pose.Position.y + 100;
|
||||||
PlinthPickUpBounds.BoundingBox.Z2 = plinthBounds->Z2 + 320;
|
PlinthPickUpBounds.BoundingBox.Z2 = plinth->Z2 + 320;
|
||||||
PlinthPickUpPosition.z = -200 - plinthBounds->Z2;
|
PlinthPickUpPosition.z = -200 - plinth->Z2;
|
||||||
|
|
||||||
// HACK: Until we refactor a way plinth collision is detected, this must be here
|
// HACK: Until we refactor a way plinth collision is detected, this must be here
|
||||||
// to prevent false positives with two stacked plinths -- Lwmte, 16.06.22
|
// to prevent false positives with two stacked plinths -- Lwmte, 16.06.22
|
||||||
|
@ -776,7 +775,7 @@ void PickupCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
lara->Control.IsMoving = false;
|
lara->Control.IsMoving = false;
|
||||||
lara->Control.HandStatus = HandStatus::Busy;
|
lara->Control.HandStatus = HandStatus::Busy;
|
||||||
|
@ -1022,7 +1021,7 @@ void PickupControl(short itemNumber)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const GameBoundingBox* FindPlinth(ItemInfo* item)
|
GameBoundingBox* FindPlinth(ItemInfo* item)
|
||||||
{
|
{
|
||||||
auto* room = &g_Level.Rooms[item->RoomNumber];
|
auto* room = &g_Level.Rooms[item->RoomNumber];
|
||||||
|
|
||||||
|
@ -1067,13 +1066,9 @@ const GameBoundingBox* FindPlinth(ItemInfo* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemNumber == NO_ITEM)
|
if (itemNumber == NO_ITEM)
|
||||||
{
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return &GetBestFrame(g_Level.Items[itemNumber]).BoundingBox;
|
return &GetBestFrame(g_Level.Items[itemNumber]).BoundingBox;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializePickup(short itemNumber)
|
void InitializePickup(short itemNumber)
|
||||||
|
@ -1212,7 +1207,7 @@ void SearchObjectCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo*
|
||||||
{
|
{
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.AnimNumber = SearchAnims[objectNumber];
|
laraItem->Animation.AnimNumber = SearchAnims[objectNumber];
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
lara->Control.IsMoving = false;
|
lara->Control.IsMoving = false;
|
||||||
lara->Control.HandStatus = HandStatus::Busy;
|
lara->Control.HandStatus = HandStatus::Busy;
|
||||||
|
@ -1226,7 +1221,7 @@ void SearchObjectCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo*
|
||||||
}
|
}
|
||||||
|
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 1;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 1;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1251,7 +1246,7 @@ void SearchObjectControl(short itemNumber)
|
||||||
if (item->ObjectNumber != ID_SEARCH_OBJECT4 || item->ItemFlags[0] == 1)
|
if (item->ObjectNumber != ID_SEARCH_OBJECT4 || item->ItemFlags[0] == 1)
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
|
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
if (item->ObjectNumber == ID_SEARCH_OBJECT1)
|
if (item->ObjectNumber == ID_SEARCH_OBJECT1)
|
||||||
{
|
{
|
||||||
if (frameNumber > 0)
|
if (frameNumber > 0)
|
||||||
|
|
|
@ -20,7 +20,7 @@ void PickupCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll);
|
||||||
void RegeneratePickups();
|
void RegeneratePickups();
|
||||||
void DropPickups(ItemInfo* item);
|
void DropPickups(ItemInfo* item);
|
||||||
void CollectMultiplePickups(int itemNumber);
|
void CollectMultiplePickups(int itemNumber);
|
||||||
const GameBoundingBox* FindPlinth(ItemInfo* item);
|
GameBoundingBox* FindPlinth(ItemInfo* item);
|
||||||
|
|
||||||
void PickupControl(short itemNumber);
|
void PickupControl(short itemNumber);
|
||||||
|
|
||||||
|
|
|
@ -576,7 +576,7 @@ namespace TEN::Entities::Effects
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
Lara.Flare.ControlLeft = false;
|
Lara.Flare.ControlLeft = false;
|
||||||
Lara.LeftArm.Locked = true;
|
Lara.LeftArm.Locked = true;
|
||||||
Lara.Context.InteractedItem = itemNumber;
|
Lara.Context.InteractedItem = itemNumber;
|
||||||
|
@ -591,7 +591,7 @@ namespace TEN::Entities::Effects
|
||||||
{
|
{
|
||||||
if (laraItem->Animation.AnimNumber >= LA_TORCH_LIGHT_1 && laraItem->Animation.AnimNumber <= LA_TORCH_LIGHT_5)
|
if (laraItem->Animation.AnimNumber >= LA_TORCH_LIGHT_1 && laraItem->Animation.AnimNumber <= LA_TORCH_LIGHT_5)
|
||||||
{
|
{
|
||||||
if (laraItem->Animation.FrameNumber - GetAnimData(laraItem).frameBase == 40)
|
if (laraItem->Animation.FrameNumber - g_Level.Anims[laraItem->Animation.AnimNumber].frameBase == 40)
|
||||||
{
|
{
|
||||||
TestTriggers(item, true, item->Flags & IFLAG_ACTIVATION_MASK);
|
TestTriggers(item, true, item->Flags & IFLAG_ACTIVATION_MASK);
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ namespace TEN::Entities::Generic
|
||||||
if (lara->Flare.ControlLeft)
|
if (lara->Flare.ControlLeft)
|
||||||
lara->Control.HandStatus = HandStatus::WeaponReady;
|
lara->Control.HandStatus = HandStatus::WeaponReady;
|
||||||
|
|
||||||
lara->LeftArm.FrameBase = GetAnimData(lara->LeftArm.AnimNumber).FramePtr;
|
lara->LeftArm.FrameBase = g_Level.Anims[lara->LeftArm.AnimNumber].FramePtr;
|
||||||
|
|
||||||
if (lara->Torch.IsLit)
|
if (lara->Torch.IsLit)
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ namespace TEN::Entities::Generic
|
||||||
lara->LeftArm.AnimNumber = Objects[ID_LARA_TORCH_ANIM].animIndex;
|
lara->LeftArm.AnimNumber = Objects[ID_LARA_TORCH_ANIM].animIndex;
|
||||||
lara->LeftArm.Locked = false;
|
lara->LeftArm.Locked = false;
|
||||||
lara->LeftArm.FrameNumber = 0;
|
lara->LeftArm.FrameNumber = 0;
|
||||||
lara->LeftArm.FrameBase = GetAnimData(lara->LeftArm.AnimNumber).FramePtr;
|
lara->LeftArm.FrameBase = g_Level.Anims[lara->LeftArm.AnimNumber].FramePtr;
|
||||||
|
|
||||||
laraItem->Model.MeshIndex[LM_LHAND] = Objects[ID_LARA_TORCH_ANIM].meshIndex + LM_LHAND;
|
laraItem->Model.MeshIndex[LM_LHAND] = Objects[ID_LARA_TORCH_ANIM].meshIndex + LM_LHAND;
|
||||||
}
|
}
|
||||||
|
@ -357,7 +357,7 @@ namespace TEN::Entities::Generic
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
lara->Flare.ControlLeft = false;
|
lara->Flare.ControlLeft = false;
|
||||||
lara->LeftArm.Locked = true;
|
lara->LeftArm.Locked = true;
|
||||||
lara->Context.InteractedItem = itemNumber;
|
lara->Context.InteractedItem = itemNumber;
|
||||||
|
@ -372,7 +372,7 @@ namespace TEN::Entities::Generic
|
||||||
if (laraItem->Animation.AnimNumber >= LA_TORCH_LIGHT_1 &&
|
if (laraItem->Animation.AnimNumber >= LA_TORCH_LIGHT_1 &&
|
||||||
laraItem->Animation.AnimNumber <= LA_TORCH_LIGHT_5)
|
laraItem->Animation.AnimNumber <= LA_TORCH_LIGHT_5)
|
||||||
{
|
{
|
||||||
if ((laraItem->Animation.FrameNumber - GetAnimData(laraItem).frameBase) == 40)
|
if ((laraItem->Animation.FrameNumber - g_Level.Anims[laraItem->Animation.AnimNumber].frameBase) == 40)
|
||||||
{
|
{
|
||||||
TestTriggers(torchItem, true, torchItem->Flags & IFLAG_ACTIVATION_MASK);
|
TestTriggers(torchItem, true, torchItem->Flags & IFLAG_ACTIVATION_MASK);
|
||||||
torchItem->Flags |= CODE_BITS;
|
torchItem->Flags |= CODE_BITS;
|
||||||
|
|
|
@ -56,7 +56,7 @@ void TrapDoorCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll
|
||||||
auto* trapDoorItem = &g_Level.Items[itemNumber];
|
auto* trapDoorItem = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
if (trapDoorItem->Animation.ActiveState == 1 &&
|
if (trapDoorItem->Animation.ActiveState == 1 &&
|
||||||
trapDoorItem->Animation.FrameNumber == GetAnimData(trapDoorItem).frameEnd)
|
trapDoorItem->Animation.FrameNumber == g_Level.Anims[trapDoorItem->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
ObjectCollision(itemNumber, laraItem, coll);
|
ObjectCollision(itemNumber, laraItem, coll);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void CeilingTrapDoorCollision(short itemNumber, ItemInfo* laraItem, CollisionInf
|
||||||
laraItem->Animation.Velocity.y = 0;
|
laraItem->Animation.Velocity.y = 0;
|
||||||
laraItem->Animation.IsAirborne = false;
|
laraItem->Animation.IsAirborne = false;
|
||||||
laraItem->Animation.AnimNumber = LA_TRAPDOOR_CEILING_OPEN;
|
laraItem->Animation.AnimNumber = LA_TRAPDOOR_CEILING_OPEN;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.ActiveState = LS_FREEFALL_BIS;
|
laraItem->Animation.ActiveState = LS_FREEFALL_BIS;
|
||||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
|
@ -110,7 +110,7 @@ void CeilingTrapDoorCollision(short itemNumber, ItemInfo* laraItem, CollisionInf
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trapDoorItem->Animation.ActiveState == 1 &&
|
if (trapDoorItem->Animation.ActiveState == 1 &&
|
||||||
trapDoorItem->Animation.FrameNumber == GetAnimData(trapDoorItem).frameEnd)
|
trapDoorItem->Animation.FrameNumber == g_Level.Anims[trapDoorItem->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
ObjectCollision(itemNumber, laraItem, coll);
|
ObjectCollision(itemNumber, laraItem, coll);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ void FloorTrapDoorCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo*
|
||||||
{
|
{
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.AnimNumber = LA_TRAPDOOR_FLOOR_OPEN;
|
laraItem->Animation.AnimNumber = LA_TRAPDOOR_FLOOR_OPEN;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.ActiveState = LS_TRAPDOOR_FLOOR_OPEN;
|
laraItem->Animation.ActiveState = LS_TRAPDOOR_FLOOR_OPEN;
|
||||||
laraInfo->Control.IsMoving = false;
|
laraInfo->Control.IsMoving = false;
|
||||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||||
|
@ -153,9 +153,7 @@ void FloorTrapDoorCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo*
|
||||||
ForcedFixedCamera.RoomNumber = trapDoorItem->RoomNumber;
|
ForcedFixedCamera.RoomNumber = trapDoorItem->RoomNumber;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
laraInfo->Context.InteractedItem =itemNumber;
|
||||||
laraInfo->Context.InteractedItem = itemNumber;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -164,7 +162,7 @@ void FloorTrapDoorCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo*
|
||||||
UseForcedFixedCamera = 0;
|
UseForcedFixedCamera = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trapDoorItem->Animation.ActiveState == 1 && trapDoorItem->Animation.FrameNumber == GetAnimData(trapDoorItem).frameEnd)
|
if (trapDoorItem->Animation.ActiveState == 1 && trapDoorItem->Animation.FrameNumber == g_Level.Anims[trapDoorItem->Animation.AnimNumber].frameEnd)
|
||||||
ObjectCollision(itemNumber, laraItem, coll);
|
ObjectCollision(itemNumber, laraItem, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,13 +173,9 @@ void TrapDoorControl(short itemNumber)
|
||||||
if (TriggerActive(trapDoorItem))
|
if (TriggerActive(trapDoorItem))
|
||||||
{
|
{
|
||||||
if (!trapDoorItem->Animation.ActiveState && trapDoorItem->TriggerFlags >= 0)
|
if (!trapDoorItem->Animation.ActiveState && trapDoorItem->TriggerFlags >= 0)
|
||||||
{
|
|
||||||
trapDoorItem->Animation.TargetState = 1;
|
trapDoorItem->Animation.TargetState = 1;
|
||||||
}
|
else if (trapDoorItem->Animation.FrameNumber == g_Level.Anims[trapDoorItem->Animation.AnimNumber].frameEnd && CurrentLevel == 14 && trapDoorItem->ObjectNumber == ID_TRAPDOOR1)
|
||||||
else if (trapDoorItem->Animation.FrameNumber == GetAnimData(trapDoorItem).frameEnd && CurrentLevel == 14 && trapDoorItem->ObjectNumber == ID_TRAPDOOR1)
|
|
||||||
{
|
|
||||||
trapDoorItem->Status = ITEM_INVISIBLE;
|
trapDoorItem->Status = ITEM_INVISIBLE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -194,13 +188,9 @@ void TrapDoorControl(short itemNumber)
|
||||||
AnimateItem(trapDoorItem);
|
AnimateItem(trapDoorItem);
|
||||||
|
|
||||||
if (trapDoorItem->Animation.ActiveState == 1 && (trapDoorItem->ItemFlags[2] || JustLoaded))
|
if (trapDoorItem->Animation.ActiveState == 1 && (trapDoorItem->ItemFlags[2] || JustLoaded))
|
||||||
{
|
|
||||||
OpenTrapDoor(itemNumber);
|
OpenTrapDoor(itemNumber);
|
||||||
}
|
|
||||||
else if (!trapDoorItem->Animation.ActiveState && !trapDoorItem->ItemFlags[2])
|
else if (!trapDoorItem->Animation.ActiveState && !trapDoorItem->ItemFlags[2])
|
||||||
{
|
|
||||||
CloseTrapDoor(itemNumber);
|
CloseTrapDoor(itemNumber);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloseTrapDoor(short itemNumber)
|
void CloseTrapDoor(short itemNumber)
|
||||||
|
|
|
@ -78,6 +78,7 @@ void TightropeCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* col
|
||||||
laraInfo->Control.HandStatus != HandStatus::Free) &&
|
laraInfo->Control.HandStatus != HandStatus::Free) &&
|
||||||
(!laraInfo->Control.IsMoving || laraInfo->Context.InteractedItem !=itemNumber))
|
(!laraInfo->Control.IsMoving || laraInfo->Context.InteractedItem !=itemNumber))
|
||||||
{
|
{
|
||||||
|
#ifdef NEW_TIGHTROPE
|
||||||
if (laraItem->Animation.ActiveState == LS_TIGHTROPE_WALK &&
|
if (laraItem->Animation.ActiveState == LS_TIGHTROPE_WALK &&
|
||||||
laraItem->Animation.TargetState != LS_TIGHTROPE_DISMOUNT &&
|
laraItem->Animation.TargetState != LS_TIGHTROPE_DISMOUNT &&
|
||||||
!laraInfo->Control.Tightrope.CanDismount)
|
!laraInfo->Control.Tightrope.CanDismount)
|
||||||
|
@ -88,6 +89,19 @@ void TightropeCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* col
|
||||||
laraInfo->Control.Tightrope.CanDismount = true;
|
laraInfo->Control.Tightrope.CanDismount = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // !NEW_TIGHTROPE
|
||||||
|
if (laraItem->Animation.ActiveState == LS_TIGHTROPE_WALK &&
|
||||||
|
laraItem->Animation.TargetState != LS_TIGHTROPE_DISMOUNT &&
|
||||||
|
!laraInfo->Control.Tightrope.Off)
|
||||||
|
{
|
||||||
|
if (item->Pose.Orientation.y == laraItem->Pose.Orientation.y)
|
||||||
|
{
|
||||||
|
if (abs(item->Pose.Position.x - laraItem->Pose.Position.x) + abs(item->Pose.Position.z - laraItem->Pose.Position.z) < 640)
|
||||||
|
laraInfo->tightRopeOff = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -99,18 +113,22 @@ void TightropeCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* col
|
||||||
{
|
{
|
||||||
laraItem->Animation.ActiveState = LS_TIGHTROPE_ENTER;
|
laraItem->Animation.ActiveState = LS_TIGHTROPE_ENTER;
|
||||||
laraItem->Animation.AnimNumber = LA_TIGHTROPE_START;
|
laraItem->Animation.AnimNumber = LA_TIGHTROPE_START;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraInfo->Control.IsMoving = false;
|
laraInfo->Control.IsMoving = false;
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
|
#ifdef NEW_TIGHTROPE
|
||||||
laraInfo->Control.Tightrope.Balance = 0;
|
laraInfo->Control.Tightrope.Balance = 0;
|
||||||
laraInfo->Control.Tightrope.CanDismount = false;
|
laraInfo->Control.Tightrope.CanDismount = false;
|
||||||
laraInfo->Control.Tightrope.TightropeItem = itemNumber;
|
laraInfo->Control.Tightrope.TightropeItem = itemNumber;
|
||||||
laraInfo->Control.Tightrope.TimeOnTightrope = 0;
|
laraInfo->Control.Tightrope.TimeOnTightrope = 0;
|
||||||
|
#else // !NEW_TIGHTROPE
|
||||||
|
laraInfo->Control.Tightrope.OnCount = 60;
|
||||||
|
laraInfo->Control.Tightrope.Off = 0;
|
||||||
|
laraInfo->Control.Tightrope.Fall = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
laraInfo->Context.InteractedItem = itemNumber;
|
laraInfo->Context.InteractedItem = itemNumber;
|
||||||
}
|
|
||||||
|
|
||||||
tightropeItem->Pose.Orientation.y += -ANGLE(180.0f);
|
tightropeItem->Pose.Orientation.y += -ANGLE(180.0f);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +165,7 @@ void HorizontalBarCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo*
|
||||||
{
|
{
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
laraItem->Animation.AnimNumber = LA_SWINGBAR_GRAB;
|
laraItem->Animation.AnimNumber = LA_SWINGBAR_GRAB;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.Velocity.y = false;
|
laraItem->Animation.Velocity.y = false;
|
||||||
laraItem->Animation.IsAirborne = false;
|
laraItem->Animation.IsAirborne = false;
|
||||||
|
|
||||||
|
@ -244,7 +262,7 @@ void AnimatingControl(short itemNumber)
|
||||||
item->Status = ITEM_ACTIVE;
|
item->Status = ITEM_ACTIVE;
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
|
|
||||||
// TODO: ID_SHOOT_SWITCH2 is probably the bell in Trajan Markets, use Lua for that.
|
// TODO: ID_SHOOT_SWITCH2 probably the bell in Trajan Markets, use LUA for that
|
||||||
/*if (item->frameNumber >= g_Level.Anims[item->animNumber].frameEnd)
|
/*if (item->frameNumber >= g_Level.Anims[item->animNumber].frameEnd)
|
||||||
{
|
{
|
||||||
item->frameNumber = g_Level.Anims[item->animNumber].frameBase;
|
item->frameNumber = g_Level.Anims[item->animNumber].frameBase;
|
||||||
|
|
|
@ -189,8 +189,8 @@ namespace TEN::Entities::Generic
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_REACH_TO_ROPE_SWING;
|
laraItem->Animation.AnimNumber = LA_REACH_TO_ROPE_SWING;
|
||||||
laraItem->Animation.ActiveState = LS_ROPE_SWING;
|
laraItem->Animation.ActiveState = LS_ROPE_SWING;
|
||||||
laraInfo->Control.Rope.Frame = GetAnimData(*laraItem, LA_ROPE_SWING).frameBase + 32 << 8;
|
laraInfo->Control.Rope.Frame = g_Level.Anims[LA_ROPE_SWING].frameBase + 32 << 8;
|
||||||
laraInfo->Control.Rope.DFrame = GetAnimData(*laraItem, LA_ROPE_SWING).frameBase + 60 << 8;
|
laraInfo->Control.Rope.DFrame = g_Level.Anims[LA_ROPE_SWING].frameBase + 60 << 8;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -198,7 +198,7 @@ namespace TEN::Entities::Generic
|
||||||
laraItem->Animation.ActiveState = LS_ROPE_IDLE;
|
laraItem->Animation.ActiveState = LS_ROPE_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.Velocity.y = 0;
|
laraItem->Animation.Velocity.y = 0;
|
||||||
laraItem->Animation.IsAirborne = false;
|
laraItem->Animation.IsAirborne = false;
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ namespace TEN::Entities::Generic
|
||||||
Lara.Control.Rope.ArcFront = Lara.Control.Rope.LastX;
|
Lara.Control.Rope.ArcFront = Lara.Control.Rope.LastX;
|
||||||
Lara.Control.Rope.Direction = 0;
|
Lara.Control.Rope.Direction = 0;
|
||||||
Lara.Control.Rope.MaxXBackward = 0;
|
Lara.Control.Rope.MaxXBackward = 0;
|
||||||
int frame = 15 * Lara.Control.Rope.MaxXForward / 18000 + GetAnimData(*item, LA_ROPE_SWING).frameBase + 47 << 8;
|
int frame = 15 * Lara.Control.Rope.MaxXForward / 18000 + g_Level.Anims[LA_ROPE_SWING].frameBase + 47 << 8;
|
||||||
|
|
||||||
if (frame > Lara.Control.Rope.DFrame)
|
if (frame > Lara.Control.Rope.DFrame)
|
||||||
{
|
{
|
||||||
|
@ -541,7 +541,7 @@ namespace TEN::Entities::Generic
|
||||||
else if (Lara.Control.Rope.LastX < 0 && Lara.Control.Rope.Frame == Lara.Control.Rope.DFrame)
|
else if (Lara.Control.Rope.LastX < 0 && Lara.Control.Rope.Frame == Lara.Control.Rope.DFrame)
|
||||||
{
|
{
|
||||||
RopeSwing = 0;
|
RopeSwing = 0;
|
||||||
Lara.Control.Rope.DFrame = 15 * Lara.Control.Rope.MaxXBackward / 18000 + GetAnimData(*item, LA_ROPE_SWING).frameBase + 47 << 8;
|
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;
|
Lara.Control.Rope.FrameRate = 15 * Lara.Control.Rope.MaxXBackward / 9000 + 1;
|
||||||
}
|
}
|
||||||
else if (Lara.Control.Rope.FrameRate < 512)
|
else if (Lara.Control.Rope.FrameRate < 512)
|
||||||
|
@ -558,7 +558,7 @@ namespace TEN::Entities::Generic
|
||||||
Lara.Control.Rope.Direction = 1;
|
Lara.Control.Rope.Direction = 1;
|
||||||
Lara.Control.Rope.MaxXForward = 0;
|
Lara.Control.Rope.MaxXForward = 0;
|
||||||
|
|
||||||
int frame = GetAnimData(*item, LA_ROPE_SWING).frameBase - 15 * Lara.Control.Rope.MaxXBackward / 18000 + 17 << 8;
|
int frame = g_Level.Anims[LA_ROPE_SWING].frameBase - 15 * Lara.Control.Rope.MaxXBackward / 18000 + 17 << 8;
|
||||||
if (frame < Lara.Control.Rope.DFrame)
|
if (frame < Lara.Control.Rope.DFrame)
|
||||||
{
|
{
|
||||||
Lara.Control.Rope.DFrame = frame;
|
Lara.Control.Rope.DFrame = frame;
|
||||||
|
@ -572,7 +572,7 @@ namespace TEN::Entities::Generic
|
||||||
else if (Lara.Control.Rope.LastX > 0 && Lara.Control.Rope.Frame == Lara.Control.Rope.DFrame)
|
else if (Lara.Control.Rope.LastX > 0 && Lara.Control.Rope.Frame == Lara.Control.Rope.DFrame)
|
||||||
{
|
{
|
||||||
RopeSwing = 0;
|
RopeSwing = 0;
|
||||||
Lara.Control.Rope.DFrame = GetAnimData(*item, LA_ROPE_SWING).frameBase - 15 * Lara.Control.Rope.MaxXForward / 18000 + 17 << 8;
|
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;
|
Lara.Control.Rope.FrameRate = 15 * Lara.Control.Rope.MaxXForward / 9000 + 1;
|
||||||
}
|
}
|
||||||
else if (Lara.Control.Rope.FrameRate < 512)
|
else if (Lara.Control.Rope.FrameRate < 512)
|
||||||
|
@ -641,14 +641,14 @@ namespace TEN::Entities::Generic
|
||||||
|
|
||||||
Lara.Control.HandStatus = HandStatus::Free;
|
Lara.Control.HandStatus = HandStatus::Free;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber - GetAnimData(*item, LA_ROPE_SWING).frameBase > 42)
|
if (item->Animation.FrameNumber - g_Level.Anims[LA_ROPE_SWING].frameBase > 42)
|
||||||
item->Animation.AnimNumber = LA_ROPE_SWING_TO_REACH_1;
|
item->Animation.AnimNumber = LA_ROPE_SWING_TO_REACH_1;
|
||||||
else if (item->Animation.FrameNumber - GetAnimData(*item, LA_ROPE_SWING).frameBase > 21)
|
else if (item->Animation.FrameNumber - g_Level.Anims[LA_ROPE_SWING].frameBase > 21)
|
||||||
item->Animation.AnimNumber = LA_ROPE_SWING_TO_REACH_2;
|
item->Animation.AnimNumber = LA_ROPE_SWING_TO_REACH_2;
|
||||||
else
|
else
|
||||||
item->Animation.AnimNumber = LA_ROPE_SWING_TO_REACH_3;
|
item->Animation.AnimNumber = LA_ROPE_SWING_TO_REACH_3;
|
||||||
|
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = LS_REACH;
|
item->Animation.ActiveState = LS_REACH;
|
||||||
item->Animation.TargetState = LS_REACH;
|
item->Animation.TargetState = LS_REACH;
|
||||||
Lara.Control.Rope.Ptr = -1;
|
Lara.Control.Rope.Ptr = -1;
|
||||||
|
@ -712,10 +712,10 @@ namespace TEN::Entities::Generic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.AnimNumber == LA_ROPE_DOWN && item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.AnimNumber == LA_ROPE_DOWN && item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR4_LARA_POLE_SLIDE_LOOP, &LaraItem->Pose);
|
SoundEffect(SFX_TR4_LARA_POLE_SLIDE_LOOP, &LaraItem->Pose);
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
Lara.Control.Rope.Flag = 0;
|
Lara.Control.Rope.Flag = 0;
|
||||||
++Lara.Control.Rope.Segment;
|
++Lara.Control.Rope.Segment;
|
||||||
Lara.Control.Rope.Offset = 0;
|
Lara.Control.Rope.Offset = 0;
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace TEN::Entities::Switches
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
player.Control.IsMoving = false;
|
player.Control.IsMoving = false;
|
||||||
player.Control.HandStatus = HandStatus::Busy;
|
player.Control.HandStatus = HandStatus::Busy;
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace TEN::Entities::Switches
|
||||||
laraItem->Animation.AnimNumber = LA_COGWHEEL_GRAB;
|
laraItem->Animation.AnimNumber = LA_COGWHEEL_GRAB;
|
||||||
laraItem->Animation.TargetState = LS_COGWHEEL;
|
laraItem->Animation.TargetState = LS_COGWHEEL;
|
||||||
laraItem->Animation.ActiveState = LS_COGWHEEL;
|
laraItem->Animation.ActiveState = LS_COGWHEEL;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
lara->Control.IsMoving = false;
|
lara->Control.IsMoving = false;
|
||||||
lara->Control.HandStatus = HandStatus::Busy;
|
lara->Control.HandStatus = HandStatus::Busy;
|
||||||
lara->Context.InteractedItem = targetItemNum;
|
lara->Context.InteractedItem = targetItemNum;
|
||||||
|
@ -137,7 +137,7 @@ namespace TEN::Entities::Switches
|
||||||
|
|
||||||
if (LaraItem->Animation.AnimNumber == LA_COGWHEEL_PULL)
|
if (LaraItem->Animation.AnimNumber == LA_COGWHEEL_PULL)
|
||||||
{
|
{
|
||||||
if (LaraItem->Animation.FrameNumber == GetAnimData(LaraItem).frameBase + 10)
|
if (LaraItem->Animation.FrameNumber == g_Level.Anims[LaraItem->Animation.AnimNumber].frameBase + 10)
|
||||||
{
|
{
|
||||||
if (!switchItem->TriggerFlags)
|
if (!switchItem->TriggerFlags)
|
||||||
{
|
{
|
||||||
|
@ -149,7 +149,7 @@ namespace TEN::Entities::Switches
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((switchItem->Animation.FrameNumber == GetAnimData(switchItem).frameEnd)
|
if ((switchItem->Animation.FrameNumber == g_Level.Anims[switchItem->Animation.AnimNumber].frameEnd)
|
||||||
&& (LaraItem->Animation.AnimNumber == LA_COGWHEEL_RELEASE))
|
&& (LaraItem->Animation.AnimNumber == LA_COGWHEEL_RELEASE))
|
||||||
{
|
{
|
||||||
switchItem->Animation.ActiveState = SWITCH_OFF;
|
switchItem->Animation.ActiveState = SWITCH_OFF;
|
||||||
|
|
|
@ -45,33 +45,33 @@ namespace TEN::Entities::Switches
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
void CrowbarSwitchCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
void CrowbarSwitchCollision(short itemNumber, ItemInfo* laraitem, CollisionInfo* coll)
|
||||||
{
|
{
|
||||||
auto* laraInfo = GetLaraInfo(laraItem);
|
auto* laraInfo = GetLaraInfo(laraitem);
|
||||||
ItemInfo* switchItem = &g_Level.Items[itemNumber];
|
ItemInfo* switchItem = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
int doSwitch = 0;
|
int doSwitch = 0;
|
||||||
|
|
||||||
if (((TrInput & IN_ACTION || g_Gui.GetInventoryItemChosen() == ID_CROWBAR_ITEM) &&
|
if (((TrInput & IN_ACTION || g_Gui.GetInventoryItemChosen() == ID_CROWBAR_ITEM) &&
|
||||||
laraItem->Animation.ActiveState == LS_IDLE &&
|
laraitem->Animation.ActiveState == LS_IDLE &&
|
||||||
laraItem->Animation.AnimNumber == LA_STAND_IDLE &&
|
laraitem->Animation.AnimNumber == LA_STAND_IDLE &&
|
||||||
laraInfo->Control.HandStatus == HandStatus::Free &&
|
laraInfo->Control.HandStatus == HandStatus::Free &&
|
||||||
switchItem->ItemFlags[0] == 0) ||
|
switchItem->ItemFlags[0] == 0) ||
|
||||||
(laraInfo->Control.IsMoving && laraInfo->Context.InteractedItem == itemNumber))
|
(laraInfo->Control.IsMoving && laraInfo->Context.InteractedItem == itemNumber))
|
||||||
{
|
{
|
||||||
if (switchItem->Animation.ActiveState == SWITCH_ON)
|
if (switchItem->Animation.ActiveState == SWITCH_ON)
|
||||||
{
|
{
|
||||||
laraItem->Pose.Orientation.y ^= (short)ANGLE(180.0f);
|
laraitem->Pose.Orientation.y ^= (short)ANGLE(180.0f);
|
||||||
|
|
||||||
if (TestLaraPosition(CrowbarBounds2, switchItem, laraItem))
|
if (TestLaraPosition(CrowbarBounds2, switchItem, laraitem))
|
||||||
{
|
{
|
||||||
if (laraInfo->Control.IsMoving || g_Gui.GetInventoryItemChosen() == ID_CROWBAR_ITEM)
|
if (laraInfo->Control.IsMoving || g_Gui.GetInventoryItemChosen() == ID_CROWBAR_ITEM)
|
||||||
{
|
{
|
||||||
if (MoveLaraPosition(CrowbarPos2, switchItem, laraItem))
|
if (MoveLaraPosition(CrowbarPos2, switchItem, laraitem))
|
||||||
{
|
{
|
||||||
doSwitch = 1;
|
doSwitch = 1;
|
||||||
laraItem->Animation.AnimNumber = LA_CROWBAR_USE_ON_FLOOR;
|
laraitem->Animation.AnimNumber = LA_CROWBAR_USE_ON_FLOOR;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraitem->Animation.FrameNumber = g_Level.Anims[laraitem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->Animation.TargetState = SWITCH_OFF;
|
switchItem->Animation.TargetState = SWITCH_OFF;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -88,19 +88,19 @@ namespace TEN::Entities::Switches
|
||||||
laraInfo->Control.HandStatus = HandStatus::Free;
|
laraInfo->Control.HandStatus = HandStatus::Free;
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Pose.Orientation.y ^= (short)ANGLE(180.0f);
|
laraitem->Pose.Orientation.y ^= (short)ANGLE(180.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (TestLaraPosition(CrowbarBounds, switchItem, laraItem))
|
if (TestLaraPosition(CrowbarBounds, switchItem, laraitem))
|
||||||
{
|
{
|
||||||
if (laraInfo->Control.IsMoving || g_Gui.GetInventoryItemChosen() == ID_CROWBAR_ITEM)
|
if (laraInfo->Control.IsMoving || g_Gui.GetInventoryItemChosen() == ID_CROWBAR_ITEM)
|
||||||
{
|
{
|
||||||
if (MoveLaraPosition(CrowbarPos, switchItem, laraItem))
|
if (MoveLaraPosition(CrowbarPos, switchItem, laraitem))
|
||||||
{
|
{
|
||||||
doSwitch = 1;
|
doSwitch = 1;
|
||||||
laraItem->Animation.AnimNumber = LA_CROWBAR_USE_ON_FLOOR;
|
laraitem->Animation.AnimNumber = LA_CROWBAR_USE_ON_FLOOR;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraitem->Animation.FrameNumber = g_Level.Anims[laraitem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->Animation.TargetState = SWITCH_ON;
|
switchItem->Animation.TargetState = SWITCH_ON;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -127,20 +127,20 @@ namespace TEN::Entities::Switches
|
||||||
g_Gui.SetEnterInventory(ID_CROWBAR_ITEM);
|
g_Gui.SetEnterInventory(ID_CROWBAR_ITEM);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (OldPickupPos.x != laraItem->Pose.Position.x || OldPickupPos.y != laraItem->Pose.Position.y || OldPickupPos.z != laraItem->Pose.Position.z)
|
if (OldPickupPos.x != laraitem->Pose.Position.x || OldPickupPos.y != laraitem->Pose.Position.y || OldPickupPos.z != laraitem->Pose.Position.z)
|
||||||
{
|
{
|
||||||
OldPickupPos.x = laraItem->Pose.Position.x;
|
OldPickupPos.x = laraitem->Pose.Position.x;
|
||||||
OldPickupPos.y = laraItem->Pose.Position.y;
|
OldPickupPos.y = laraitem->Pose.Position.y;
|
||||||
OldPickupPos.z = laraItem->Pose.Position.z;
|
OldPickupPos.z = laraitem->Pose.Position.z;
|
||||||
SayNo();
|
SayNo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraitem);
|
||||||
laraItem->Animation.TargetState = LS_SWITCH_DOWN;
|
laraitem->Animation.TargetState = LS_SWITCH_DOWN;
|
||||||
laraItem->Animation.ActiveState = LS_SWITCH_DOWN;
|
laraitem->Animation.ActiveState = LS_SWITCH_DOWN;
|
||||||
laraInfo->Control.IsMoving = false;
|
laraInfo->Control.IsMoving = false;
|
||||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||||
switchItem->Status = ITEM_ACTIVE;
|
switchItem->Status = ITEM_ACTIVE;
|
||||||
|
@ -150,6 +150,6 @@ namespace TEN::Entities::Switches
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ObjectCollision(itemNumber, laraItem, coll);
|
ObjectCollision(itemNumber, laraitem, coll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace TEN::Entities::Switches
|
||||||
laraItem->Animation.AnimNumber != LA_STAND_IDLE ||
|
laraItem->Animation.AnimNumber != LA_STAND_IDLE ||
|
||||||
laraInfo->Control.HandStatus != HandStatus::Free ||
|
laraInfo->Control.HandStatus != HandStatus::Free ||
|
||||||
switchItem->Status ||
|
switchItem->Status ||
|
||||||
switchItem->Flags & ONESHOT ||
|
switchItem->Flags & 0x100 ||
|
||||||
CurrentSequence >= 3) &&
|
CurrentSequence >= 3) &&
|
||||||
(!laraInfo->Control.IsMoving || laraInfo->Context.InteractedItem !=itemNumber))
|
(!laraInfo->Control.IsMoving || laraInfo->Context.InteractedItem !=itemNumber))
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ namespace TEN::Entities::Switches
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Animation.TargetState = LS_IDLE;
|
laraItem->Animation.TargetState = LS_IDLE;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->Status = ITEM_ACTIVE;
|
switchItem->Status = ITEM_ACTIVE;
|
||||||
|
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace TEN::Entities::Switches
|
||||||
laraItem->Animation.AnimNumber == LA_STAND_IDLE &&
|
laraItem->Animation.AnimNumber == LA_STAND_IDLE &&
|
||||||
laraInfo->Control.HandStatus == HandStatus::Free &&
|
laraInfo->Control.HandStatus == HandStatus::Free &&
|
||||||
switchItem->Status == ITEM_NOT_ACTIVE &&
|
switchItem->Status == ITEM_NOT_ACTIVE &&
|
||||||
!(switchItem->Flags & ONESHOT) &&
|
!(switchItem->Flags & 0x100) &&
|
||||||
switchItem->TriggerFlags >= 0 ||
|
switchItem->TriggerFlags >= 0 ||
|
||||||
laraInfo->Control.IsMoving && laraInfo->Context.InteractedItem == itemNumber)
|
laraInfo->Control.IsMoving && laraInfo->Context.InteractedItem == itemNumber)
|
||||||
{
|
{
|
||||||
|
@ -79,62 +79,62 @@ namespace TEN::Entities::Switches
|
||||||
if ((switchItem->TriggerFlags == 3 || switchItem->TriggerFlags == 4) && switchItem->Animation.ActiveState == SWITCH_OFF)
|
if ((switchItem->TriggerFlags == 3 || switchItem->TriggerFlags == 4) && switchItem->Animation.ActiveState == SWITCH_OFF)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SwitchBounds.BoundingBox.X1 = bounds.X1 - BLOCK(0.25f);
|
SwitchBounds.BoundingBox.X1 = bounds.X1 - BLOCK(0.25);
|
||||||
SwitchBounds.BoundingBox.X2 = bounds.X2 + BLOCK(0.25f);
|
SwitchBounds.BoundingBox.X2 = bounds.X2 + BLOCK(0.25);
|
||||||
|
|
||||||
switch (switchItem->TriggerFlags)
|
switch (switchItem->TriggerFlags)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
SwitchPos.z = bounds.Z1 - 128;
|
SwitchPos.z = bounds.Z1 - 128;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_BIG_LEVER:
|
case SWT_BIG_LEVER:
|
||||||
SwitchPos.z = bounds.Z1 - 64;
|
SwitchPos.z = bounds.Z1 - 64;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_SMALL_LEVER:
|
case SWT_SMALL_LEVER:
|
||||||
SwitchPos.z = bounds.Z1 - 112;
|
SwitchPos.z = bounds.Z1 - 112;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.25f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.25);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_SMALL_BUTTON:
|
case SWT_SMALL_BUTTON:
|
||||||
SwitchPos.z = bounds.Z1 - 156;
|
SwitchPos.z = bounds.Z1 - 156;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_BIG_BUTTON:
|
case SWT_BIG_BUTTON:
|
||||||
SwitchPos.z = bounds.Z1 - 256;
|
SwitchPos.z = bounds.Z1 - 256;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.5f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.5);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_GIANT_BUTTON:
|
case SWT_GIANT_BUTTON:
|
||||||
SwitchPos.z = bounds.Z1 - 384;
|
SwitchPos.z = bounds.Z1 - 384;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.5f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.5);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_VALVE:
|
case SWT_VALVE:
|
||||||
SwitchPos.z = bounds.Z1 - 112;
|
SwitchPos.z = bounds.Z1 - 112;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.25f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.25);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_WALL_HOLE:
|
case SWT_WALL_HOLE:
|
||||||
SwitchPos.z = bounds.Z1 - 196;
|
SwitchPos.z = bounds.Z1 - 196;
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.2);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SWT_CUSTOM:
|
case SWT_CUSTOM:
|
||||||
SwitchPos.z = bounds.Z1 - switchItem->ItemFlags[6];
|
SwitchPos.z = bounds.Z1 - switchItem->ItemFlags[6];
|
||||||
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.5f);
|
SwitchBounds.BoundingBox.Z1 = bounds.Z1 - BLOCK(0.5);
|
||||||
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
SwitchBounds.BoundingBox.Z2 = bounds.Z2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ namespace TEN::Entities::Switches
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraInfo->Control.IsMoving = false;
|
laraInfo->Control.IsMoving = false;
|
||||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace TEN::Entities::Switches
|
||||||
(laraItem->Status || laraItem->Animation.IsAirborne) &&
|
(laraItem->Status || laraItem->Animation.IsAirborne) &&
|
||||||
laraItem->Animation.Velocity.y > 0 &&
|
laraItem->Animation.Velocity.y > 0 &&
|
||||||
laraInfo->Control.HandStatus == HandStatus::Free &&
|
laraInfo->Control.HandStatus == HandStatus::Free &&
|
||||||
switchItem->Animation.ActiveState == SWITCH_OFF)
|
!switchItem->Animation.ActiveState)
|
||||||
{
|
{
|
||||||
if (TestLaraPosition(JumpSwitchBounds, switchItem, laraItem))
|
if (TestLaraPosition(JumpSwitchBounds, switchItem, laraItem))
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ namespace TEN::Entities::Switches
|
||||||
laraItem->Animation.ActiveState = LS_SWITCH_DOWN;
|
laraItem->Animation.ActiveState = LS_SWITCH_DOWN;
|
||||||
laraItem->Animation.AnimNumber = LA_JUMPSWITCH_PULL;
|
laraItem->Animation.AnimNumber = LA_JUMPSWITCH_PULL;
|
||||||
laraItem->Animation.Velocity.y = 0;
|
laraItem->Animation.Velocity.y = 0;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.IsAirborne = false;
|
laraItem->Animation.IsAirborne = false;
|
||||||
laraInfo->Control.HandStatus = HandStatus::Busy;
|
laraInfo->Control.HandStatus = HandStatus::Busy;
|
||||||
switchItem->Animation.TargetState = SWITCH_ON;
|
switchItem->Animation.TargetState = SWITCH_ON;
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_PULLEY_GRAB;
|
laraItem->Animation.AnimNumber = LA_PULLEY_GRAB;
|
||||||
laraItem->Animation.ActiveState = LS_PULLEY;
|
laraItem->Animation.ActiveState = LS_PULLEY;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.AnimNumber = LA_LEVER_PUSH;
|
laraItem->Animation.AnimNumber = LA_LEVER_PUSH;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.TargetState = LS_LEVERSWITCH_PUSH;
|
laraItem->Animation.TargetState = LS_LEVERSWITCH_PUSH;
|
||||||
laraItem->Animation.ActiveState = LS_LEVERSWITCH_PUSH;
|
laraItem->Animation.ActiveState = LS_LEVERSWITCH_PUSH;
|
||||||
lara->Control.IsMoving = false;
|
lara->Control.IsMoving = false;
|
||||||
|
@ -108,7 +108,7 @@ namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.AnimNumber = LA_LEVER_PUSH;
|
laraItem->Animation.AnimNumber = LA_LEVER_PUSH;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.TargetState = LS_LEVERSWITCH_PUSH;
|
laraItem->Animation.TargetState = LS_LEVERSWITCH_PUSH;
|
||||||
laraItem->Animation.ActiveState = LS_LEVERSWITCH_PUSH;
|
laraItem->Animation.ActiveState = LS_LEVERSWITCH_PUSH;
|
||||||
lara->Control.IsMoving = false;
|
lara->Control.IsMoving = false;
|
||||||
|
|
|
@ -71,19 +71,18 @@ namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
if (MoveLaraPosition(TurnSwitchPosA, switchItem, laraItem))
|
if (MoveLaraPosition(TurnSwitchPosA, switchItem, laraItem))
|
||||||
{
|
{
|
||||||
SetAnimation(*laraItem, LA_TURNSWITCH_GRAB_COUNTER_CLOCKWISE);
|
laraItem->Animation.AnimNumber = LA_TURNSWITCH_GRAB_COUNTER_CLOCKWISE;
|
||||||
SetAnimation(*switchItem, 4);
|
laraItem->Animation.FrameNumber = g_Level.Anims[LA_TURNSWITCH_GRAB_COUNTER_CLOCKWISE].frameBase;
|
||||||
|
switchItem->Animation.AnimNumber = Objects[switchItem->ObjectNumber].animIndex + 4;
|
||||||
|
switchItem->Animation.FrameNumber = g_Level.Anims[switchItem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->ItemFlags[0] = TURN_SWITCH_ANTICLOCKWISE;
|
switchItem->ItemFlags[0] = TURN_SWITCH_ANTICLOCKWISE;
|
||||||
|
ForcedFixedCamera.x = switchItem->Pose.Position.x - 1024 * phd_sin(switchItem->Pose.Orientation.y);
|
||||||
ForcedFixedCamera.x = switchItem->Pose.Position.x - BLOCK(1) * phd_sin(switchItem->Pose.Orientation.y);
|
ForcedFixedCamera.z = switchItem->Pose.Position.z - 1024 * phd_cos(switchItem->Pose.Orientation.y);
|
||||||
ForcedFixedCamera.z = switchItem->Pose.Position.z - BLOCK(1) * phd_cos(switchItem->Pose.Orientation.y);
|
|
||||||
|
|
||||||
doSwitch = -1;
|
doSwitch = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
laraInfo->Context.InteractedItem = itemNumber;
|
laraInfo->Context.InteractedItem = itemNumber;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -92,19 +91,15 @@ namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
if (MoveLaraPosition(TurnSwitchPos, switchItem, laraItem))
|
if (MoveLaraPosition(TurnSwitchPos, switchItem, laraItem))
|
||||||
{
|
{
|
||||||
SetAnimation(*laraItem, LA_TURNSWITCH_GRAB_CLOCKWISE);
|
laraItem->Animation.AnimNumber = LA_TURNSWITCH_GRAB_CLOCKWISE;
|
||||||
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->ItemFlags[0] = TURN_SWITCH_CLOCKWISE;
|
switchItem->ItemFlags[0] = TURN_SWITCH_CLOCKWISE;
|
||||||
|
|
||||||
ForcedFixedCamera.x = switchItem->Pose.Position.x + 1024 * phd_sin(switchItem->Pose.Orientation.y);
|
ForcedFixedCamera.x = switchItem->Pose.Position.x + 1024 * phd_sin(switchItem->Pose.Orientation.y);
|
||||||
ForcedFixedCamera.z = switchItem->Pose.Position.z + 1024 * phd_cos(switchItem->Pose.Orientation.y);
|
ForcedFixedCamera.z = switchItem->Pose.Position.z + 1024 * phd_cos(switchItem->Pose.Orientation.y);
|
||||||
|
|
||||||
doSwitch = 1;
|
doSwitch = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
laraInfo->Context.InteractedItem = itemNumber;
|
laraInfo->Context.InteractedItem = itemNumber;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (laraInfo->Control.IsMoving && laraInfo->Context.InteractedItem == itemNumber)
|
else if (laraInfo->Control.IsMoving && laraInfo->Context.InteractedItem == itemNumber)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +134,7 @@ namespace TEN::Entities::Switches
|
||||||
if (!TriggerActive(&g_Level.Items[ItemNos[0]]))
|
if (!TriggerActive(&g_Level.Items[ItemNos[0]]))
|
||||||
{
|
{
|
||||||
g_Level.Items[ItemNos[0]].Animation.AnimNumber = Objects[g_Level.Items[ItemNos[0]].ObjectNumber].animIndex;
|
g_Level.Items[ItemNos[0]].Animation.AnimNumber = Objects[g_Level.Items[ItemNos[0]].ObjectNumber].animIndex;
|
||||||
g_Level.Items[ItemNos[0]].Animation.FrameNumber = GetAnimData(g_Level.Items[ItemNos[0]].Animation.AnimNumber).frameBase;
|
g_Level.Items[ItemNos[0]].Animation.FrameNumber = g_Level.Anims[g_Level.Items[ItemNos[0]].Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,22 +174,22 @@ namespace TEN::Entities::Switches
|
||||||
if (TrInput & IN_ACTION)
|
if (TrInput & IN_ACTION)
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_TURNSWITCH_PUSH_CLOCKWISE_START;
|
laraItem->Animation.AnimNumber = LA_TURNSWITCH_PUSH_CLOCKWISE_START;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
switchItem->Animation.AnimNumber = Objects[switchItem->ObjectNumber].animIndex + 1;
|
switchItem->Animation.AnimNumber = Objects[switchItem->ObjectNumber].animIndex + 1;
|
||||||
switchItem->Animation.FrameNumber = GetAnimData(switchItem).frameBase;
|
switchItem->Animation.FrameNumber = g_Level.Anims[switchItem->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (laraItem->Animation.AnimNumber == LA_TURNSWITCH_PUSH_CLOCKWISE_END &&
|
if (laraItem->Animation.AnimNumber == LA_TURNSWITCH_PUSH_CLOCKWISE_END &&
|
||||||
laraItem->Animation.FrameNumber == GetAnimData(laraItem).frameEnd &&
|
laraItem->Animation.FrameNumber == g_Level.Anims[laraItem->Animation.AnimNumber].frameEnd &&
|
||||||
!switchItem->ItemFlags[1])
|
!switchItem->ItemFlags[1])
|
||||||
switchItem->ItemFlags[1] = 1;
|
switchItem->ItemFlags[1] = 1;
|
||||||
|
|
||||||
if ((laraItem->Animation.FrameNumber >= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_CLOCKWISE_START).frameBase &&
|
if (laraItem->Animation.FrameNumber >= g_Level.Anims[LA_TURNSWITCH_PUSH_CLOCKWISE_START].frameBase &&
|
||||||
laraItem->Animation.FrameNumber <= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_CLOCKWISE_START).frameBase + 43) ||
|
laraItem->Animation.FrameNumber <= g_Level.Anims[LA_TURNSWITCH_PUSH_CLOCKWISE_START].frameBase + 43 ||
|
||||||
(laraItem->Animation.FrameNumber >= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_CLOCKWISE_START).frameBase + 58 &&
|
laraItem->Animation.FrameNumber >= g_Level.Anims[LA_TURNSWITCH_PUSH_CLOCKWISE_START].frameBase + 58 &&
|
||||||
laraItem->Animation.FrameNumber <= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_CLOCKWISE_START).frameBase + 115))
|
laraItem->Animation.FrameNumber <= g_Level.Anims[LA_TURNSWITCH_PUSH_CLOCKWISE_START].frameBase + 115)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR4_PUSHABLE_SOUND, &switchItem->Pose, SoundEnvironment::Always);
|
SoundEffect(SFX_TR4_PUSHABLE_SOUND, &switchItem->Pose, SoundEnvironment::Always);
|
||||||
}
|
}
|
||||||
|
@ -206,22 +201,21 @@ namespace TEN::Entities::Switches
|
||||||
switchItem->Pose.Orientation.y -= ANGLE(90.0f);
|
switchItem->Pose.Orientation.y -= ANGLE(90.0f);
|
||||||
if (TrInput & IN_ACTION)
|
if (TrInput & IN_ACTION)
|
||||||
{
|
{
|
||||||
SetAnimation(*laraItem, LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START);
|
laraItem->Animation.AnimNumber = LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START;
|
||||||
SetAnimation(*switchItem, 5);
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
|
switchItem->Animation.AnimNumber = Objects[switchItem->ObjectNumber].animIndex + 5;
|
||||||
|
switchItem->Animation.FrameNumber = g_Level.Anims[switchItem->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (laraItem->Animation.AnimNumber == LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_END &&
|
if (laraItem->Animation.AnimNumber == LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_END && laraItem->Animation.FrameNumber == g_Level.Anims[LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_END].frameEnd &&
|
||||||
laraItem->Animation.FrameNumber == GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_END).frameEnd &&
|
|
||||||
!switchItem->ItemFlags[1])
|
!switchItem->ItemFlags[1])
|
||||||
{
|
|
||||||
switchItem->ItemFlags[1] = 1;
|
switchItem->ItemFlags[1] = 1;
|
||||||
}
|
|
||||||
|
|
||||||
if ((laraItem->Animation.FrameNumber >= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START).frameBase &&
|
if (laraItem->Animation.FrameNumber >= g_Level.Anims[LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START].frameBase &&
|
||||||
laraItem->Animation.FrameNumber <= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START).frameBase + 43) ||
|
laraItem->Animation.FrameNumber <= g_Level.Anims[LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START].frameBase + 43 ||
|
||||||
(laraItem->Animation.FrameNumber >= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START).frameBase + 58 &&
|
laraItem->Animation.FrameNumber >= g_Level.Anims[LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START].frameBase + 58 &&
|
||||||
laraItem->Animation.FrameNumber <= GetAnimData(*laraItem, LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START).frameBase + 115))
|
laraItem->Animation.FrameNumber <= g_Level.Anims[LA_TURNSWITCH_PUSH_COUNTER_CLOCKWISE_START].frameBase + 115)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR4_PUSHABLE_SOUND, &switchItem->Pose, SoundEnvironment::Always);
|
SoundEffect(SFX_TR4_PUSHABLE_SOUND, &switchItem->Pose, SoundEnvironment::Always);
|
||||||
}
|
}
|
||||||
|
@ -233,9 +227,9 @@ namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_STAND_IDLE;
|
laraItem->Animation.AnimNumber = LA_STAND_IDLE;
|
||||||
laraItem->Animation.ActiveState = LS_IDLE;
|
laraItem->Animation.ActiveState = LS_IDLE;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->Animation.AnimNumber = Objects[switchItem->ObjectNumber].animIndex;
|
switchItem->Animation.AnimNumber = Objects[switchItem->ObjectNumber].animIndex;
|
||||||
switchItem->Animation.FrameNumber = GetAnimData(switchItem).frameBase;
|
switchItem->Animation.FrameNumber = g_Level.Anims[switchItem->Animation.AnimNumber].frameBase;
|
||||||
switchItem->Status = ITEM_NOT_ACTIVE;
|
switchItem->Status = ITEM_NOT_ACTIVE;
|
||||||
|
|
||||||
RemoveActiveItem(itemNumber);
|
RemoveActiveItem(itemNumber);
|
||||||
|
|
|
@ -65,10 +65,9 @@ void InitializePuzzleHole(short itemNumber)
|
||||||
void InitializePuzzleDone(short itemNumber)
|
void InitializePuzzleDone(short itemNumber)
|
||||||
{
|
{
|
||||||
auto& receptacleItem = g_Level.Items[itemNumber];
|
auto& receptacleItem = g_Level.Items[itemNumber];
|
||||||
const auto& anim = GetAnimData(receptacleItem);
|
|
||||||
|
|
||||||
receptacleItem.Animation.RequiredState = NO_STATE;
|
receptacleItem.Animation.RequiredState = NO_STATE;
|
||||||
receptacleItem.Animation.FrameNumber = anim.frameBase + anim.frameEnd;
|
receptacleItem.Animation.FrameNumber = g_Level.Anims[receptacleItem.Animation.AnimNumber].frameBase + g_Level.Anims[receptacleItem.Animation.AnimNumber].frameEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuzzleHoleCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
void PuzzleHoleCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
|
@ -175,7 +174,7 @@ void PuzzleHoleCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* co
|
||||||
|
|
||||||
g_Gui.SetInventoryItemChosen(NO_ITEM);
|
g_Gui.SetInventoryItemChosen(NO_ITEM);
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = GetAnimData(*laraItem, laraItem->Animation.AnimNumber).frameBase;
|
||||||
player.Control.IsMoving = false;
|
player.Control.IsMoving = false;
|
||||||
player.Control.HandStatus = HandStatus::Busy;
|
player.Control.HandStatus = HandStatus::Busy;
|
||||||
player.Context.InteractedItem = itemNumber;
|
player.Context.InteractedItem = itemNumber;
|
||||||
|
@ -350,9 +349,9 @@ void PuzzleDone(ItemInfo* item, short itemNumber)
|
||||||
{
|
{
|
||||||
item->ObjectNumber += GAME_OBJECT_ID{ ID_PUZZLE_DONE1 - ID_PUZZLE_HOLE1 };
|
item->ObjectNumber += GAME_OBJECT_ID{ ID_PUZZLE_DONE1 - ID_PUZZLE_HOLE1 };
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = GetAnimData(item).ActiveState;
|
item->Animation.ActiveState = g_Level.Anims[item->Animation.AnimNumber].ActiveState;
|
||||||
item->Animation.TargetState = GetAnimData(item).ActiveState;
|
item->Animation.TargetState = g_Level.Anims[item->Animation.AnimNumber].ActiveState;
|
||||||
item->Animation.RequiredState = NO_STATE;
|
item->Animation.RequiredState = NO_STATE;
|
||||||
item->ResetModelToDefault();
|
item->ResetModelToDefault();
|
||||||
|
|
||||||
|
@ -507,7 +506,7 @@ void KeyHoleCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
}
|
}
|
||||||
|
|
||||||
laraItem->Animation.ActiveState = LS_INSERT_KEY;
|
laraItem->Animation.ActiveState = LS_INSERT_KEY;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
player->Control.IsMoving = false;
|
player->Control.IsMoving = false;
|
||||||
ResetPlayerFlex(laraItem);
|
ResetPlayerFlex(laraItem);
|
||||||
player->Control.HandStatus = HandStatus::Busy;
|
player->Control.HandStatus = HandStatus::Busy;
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace TEN::Entities::Creatures::TR1
|
||||||
COWBOY_ANIM_IDLE
|
COWBOY_ANIM_IDLE
|
||||||
};
|
};
|
||||||
|
|
||||||
void InitializeCowboy(short itemNumber)
|
void InitialiseCowboy(short itemNumber)
|
||||||
{
|
{
|
||||||
auto& item = g_Level.Items[itemNumber];
|
auto& item = g_Level.Items[itemNumber];
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
namespace TEN::Entities::Creatures::TR1
|
namespace TEN::Entities::Creatures::TR1
|
||||||
{
|
{
|
||||||
void InitializeCowboy(short itemNumber);
|
void InitialiseCowboy(short itemNumber);
|
||||||
void CowboyControl(short itemNumber);
|
void CowboyControl(short itemNumber);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace TEN::Entities::Creatures::TR1
|
||||||
if (item->Animation.ActiveState != WOLF_STATE_DEATH)
|
if (item->Animation.ActiveState != WOLF_STATE_DEATH)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_WOLF].animIndex + WOLF_ANIM_DEATH + (short)(GetRandomControl() / 11000);
|
item->Animation.AnimNumber = Objects[ID_WOLF].animIndex + WOLF_ANIM_DEATH + (short)(GetRandomControl() / 11000);
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = WOLF_STATE_DEATH;
|
item->Animation.ActiveState = WOLF_STATE_DEATH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,7 @@ static void StartEntity(ObjectInfo* obj)
|
||||||
obj = &Objects[ID_COWBOY];
|
obj = &Objects[ID_COWBOY];
|
||||||
if (obj->loaded)
|
if (obj->loaded)
|
||||||
{
|
{
|
||||||
obj->Initialize = InitializeCowboy;
|
obj->Initialize = InitialiseCowboy;
|
||||||
obj->control = CowboyControl;
|
obj->control = CowboyControl;
|
||||||
obj->collision = CreatureCollision;
|
obj->collision = CreatureCollision;
|
||||||
obj->shadowType = ShadowMode::All;
|
obj->shadowType = ShadowMode::All;
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item->Animation.ActiveState != BARRACUDA_STATE_DEATH)
|
if (item->Animation.ActiveState != BARRACUDA_STATE_DEATH)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_BARRACUDA].animIndex + BARRACUDA_ANIM_DEATH_START;
|
item->Animation.AnimNumber = Objects[ID_BARRACUDA].animIndex + BARRACUDA_ANIM_DEATH_START;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = BARRACUDA_STATE_DEATH;
|
item->Animation.ActiveState = BARRACUDA_STATE_DEATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
int angle = laraItem->Pose.Orientation.y - item->Pose.Orientation.y;
|
int angle = laraItem->Pose.Orientation.y - item->Pose.Orientation.y;
|
||||||
|
|
||||||
int anim = item->Animation.AnimNumber - Objects[ID_DRAGON_BACK].animIndex;
|
int anim = item->Animation.AnimNumber - Objects[ID_DRAGON_BACK].animIndex;
|
||||||
int frame = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frame = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if ((anim == DRAGON_ANIM_DEAD || (anim == DRAGON_ANIM_DEAD + 1 && frame <= DRAGON_ALMOST_LIVE)) &&
|
if ((anim == DRAGON_ANIM_DEAD || (anim == DRAGON_ANIM_DEAD + 1 && frame <= DRAGON_ALMOST_LIVE)) &&
|
||||||
TrInput & IN_ACTION &&
|
TrInput & IN_ACTION &&
|
||||||
|
@ -438,7 +438,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
|
|
||||||
back->Animation.ActiveState = item->Animation.ActiveState;
|
back->Animation.ActiveState = item->Animation.ActiveState;
|
||||||
back->Animation.AnimNumber = Objects[ID_DRAGON_BACK].animIndex + (item->Animation.AnimNumber - Objects[ID_DRAGON_FRONT].animIndex);
|
back->Animation.AnimNumber = Objects[ID_DRAGON_BACK].animIndex + (item->Animation.AnimNumber - Objects[ID_DRAGON_FRONT].animIndex);
|
||||||
back->Animation.FrameNumber = GetAnimData(back).frameBase + (item->Animation.FrameNumber - GetAnimData(item).frameBase);
|
back->Animation.FrameNumber = g_Level.Anims[back->Animation.AnimNumber].frameBase + (item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase);
|
||||||
back->Pose = item->Pose;
|
back->Pose = item->Pose;
|
||||||
|
|
||||||
if (back->RoomNumber != item->RoomNumber)
|
if (back->RoomNumber != item->RoomNumber)
|
||||||
|
|
|
@ -41,13 +41,13 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item->ObjectNumber == ID_CROW)
|
if (item->ObjectNumber == ID_CROW)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_CROW].animIndex + 14;
|
item->Animation.AnimNumber = Objects[ID_CROW].animIndex + 14;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = item->Animation.TargetState = 7;
|
item->Animation.ActiveState = item->Animation.TargetState = 7;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_EAGLE].animIndex + 5;
|
item->Animation.AnimNumber = Objects[ID_EAGLE].animIndex + 5;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = item->Animation.TargetState = 2;
|
item->Animation.ActiveState = item->Animation.TargetState = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
else
|
else
|
||||||
item->Animation.AnimNumber = Objects[ID_EAGLE].animIndex + 8;
|
item->Animation.AnimNumber = Objects[ID_EAGLE].animIndex + 8;
|
||||||
|
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 4;
|
item->Animation.ActiveState = 4;
|
||||||
item->Animation.Velocity.z = 0;
|
item->Animation.Velocity.z = 0;
|
||||||
item->Animation.IsAirborne = true;
|
item->Animation.IsAirborne = true;
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item->Animation.ActiveState != 13)
|
if (item->Animation.ActiveState != 13)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 14;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 14;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 13;
|
item->Animation.ActiveState = 13;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item->Animation.ActiveState != 9)
|
if (item->Animation.ActiveState != 9)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 20 + (GetRandomControl() / 0x4000);
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 20 + (GetRandomControl() / 0x4000);
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 9;
|
item->Animation.ActiveState = 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,7 +307,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
ItemNewRoom(riderItemNumber, skidooItem->RoomNumber);
|
ItemNewRoom(riderItemNumber, skidooItem->RoomNumber);
|
||||||
|
|
||||||
riderItem.Animation.AnimNumber = skidooItem->Animation.AnimNumber + (Objects[ID_SNOWMOBILE_DRIVER].animIndex - Objects[ID_SNOWMOBILE_GUN].animIndex);
|
riderItem.Animation.AnimNumber = skidooItem->Animation.AnimNumber + (Objects[ID_SNOWMOBILE_DRIVER].animIndex - Objects[ID_SNOWMOBILE_GUN].animIndex);
|
||||||
riderItem.Animation.FrameNumber = skidooItem->Animation.FrameNumber + (GetAnimData(riderItem).frameBase - GetAnimData(skidooItem).frameBase);
|
riderItem.Animation.FrameNumber = skidooItem->Animation.FrameNumber + (g_Level.Anims[riderItem.Animation.AnimNumber].frameBase - g_Level.Anims[skidooItem->Animation.AnimNumber].frameBase);
|
||||||
}
|
}
|
||||||
else if (riderItem.Status == ITEM_DEACTIVATED &&
|
else if (riderItem.Status == ITEM_DEACTIVATED &&
|
||||||
skidooItem->Animation.Velocity.z == 0 &&
|
skidooItem->Animation.Velocity.z == 0 &&
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item->Animation.ActiveState != 7)
|
if (item->Animation.ActiveState != 7)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 2;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 2;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 7;
|
item->Animation.ActiveState = 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item->Animation.ActiveState != 8)
|
if (item->Animation.ActiveState != 8)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 31;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 31;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 8;
|
item->Animation.ActiveState = 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,25 +290,25 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 34;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 34;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 10;
|
item->Animation.ActiveState = 10;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 33;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 33;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 11;
|
item->Animation.ActiveState = 11;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 32;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 32;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 12;
|
item->Animation.ActiveState = 12;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -4:
|
case -4:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 35;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 35;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 13;
|
item->Animation.ActiveState = 13;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ void InitializeKillerStatue(short itemNumber)
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 3;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 3;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 1;
|
item->Animation.ActiveState = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ namespace TEN::Entities::Vehicles
|
||||||
SetAnimation(*laraItem, ID_SPEEDBOAT_LARA_ANIMS, SPEEDBOAT_ANIM_MOUNT_JUMP);
|
SetAnimation(*laraItem, ID_SPEEDBOAT_LARA_ANIMS, SPEEDBOAT_ANIM_MOUNT_JUMP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (laraItem->RoomNumber != speedboatItem->RoomNumber)
|
if (laraItem->RoomNumber != speedboatItem->RoomNumber)
|
||||||
ItemNewRoom(lara->ItemNumber, speedboatItem->RoomNumber);
|
ItemNewRoom(lara->ItemNumber, speedboatItem->RoomNumber);
|
||||||
|
|
|
@ -326,7 +326,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
creature.MaxTurn = 0;
|
creature.MaxTurn = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int frameEnd = GetAnimData(object, PUNA_ANIM_DEATH).frameEnd;
|
int frameEnd = g_Level.Anims[object.animIndex + PUNA_ANIM_DEATH].frameEnd;
|
||||||
if (item.Animation.FrameNumber >= frameEnd)
|
if (item.Animation.FrameNumber >= frameEnd)
|
||||||
{
|
{
|
||||||
// Avoid having the object stop working.
|
// Avoid having the object stop working.
|
||||||
|
|
|
@ -290,7 +290,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
item->ItemFlags[3] = 1;
|
item->ItemFlags[3] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int frameEnd = GetAnimData(object, SHIVA_ANIM_DEATH).frameEnd - 1;
|
int frameEnd = g_Level.Anims[object.animIndex + SHIVA_ANIM_DEATH].frameEnd - 1;
|
||||||
if (item->Animation.FrameNumber >= frameEnd)
|
if (item->Animation.FrameNumber >= frameEnd)
|
||||||
{
|
{
|
||||||
// Block frame until mesh is swapped.
|
// Block frame until mesh is swapped.
|
||||||
|
|
|
@ -721,7 +721,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
if (item.Animation.ActiveState != SOPHIALEIGH_STATE_DEATH)
|
if (item.Animation.ActiveState != SOPHIALEIGH_STATE_DEATH)
|
||||||
SetAnimation(&item, SOPHIALEIGH_ANIM_DEATH);
|
SetAnimation(&item, SOPHIALEIGH_ANIM_DEATH);
|
||||||
|
|
||||||
int frameEnd = GetAnimData(object, SOPHIALEIGH_ANIM_DEATH).frameEnd;
|
int frameEnd = g_Level.Anims[object.animIndex + SOPHIALEIGH_ANIM_DEATH].frameEnd;
|
||||||
if (item.Animation.FrameNumber >= frameEnd)
|
if (item.Animation.FrameNumber >= frameEnd)
|
||||||
{
|
{
|
||||||
// Avoid having the object stop working.
|
// Avoid having the object stop working.
|
||||||
|
|
|
@ -347,7 +347,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
break;
|
break;
|
||||||
else if ((creature->Enemy->ObjectNumber == ID_SMALLMEDI_ITEM ||
|
else if ((creature->Enemy->ObjectNumber == ID_SMALLMEDI_ITEM ||
|
||||||
creature->Enemy->ObjectNumber == ID_KEY_ITEM4) &&
|
creature->Enemy->ObjectNumber == ID_KEY_ITEM4) &&
|
||||||
item->Animation.FrameNumber == (GetAnimData(item).frameBase + 12))
|
item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 12))
|
||||||
{
|
{
|
||||||
if (creature->Enemy->RoomNumber == NO_ROOM ||
|
if (creature->Enemy->RoomNumber == NO_ROOM ||
|
||||||
creature->Enemy->Status == ITEM_INVISIBLE ||
|
creature->Enemy->Status == ITEM_INVISIBLE ||
|
||||||
|
@ -382,7 +382,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (creature->Enemy->ObjectNumber == ID_AI_AMBUSH &&
|
else if (creature->Enemy->ObjectNumber == ID_AI_AMBUSH &&
|
||||||
item->Animation.FrameNumber == (GetAnimData(item).frameBase + 12))
|
item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 12))
|
||||||
{
|
{
|
||||||
item->AIBits = 0;
|
item->AIBits = 0;
|
||||||
|
|
||||||
|
|
|
@ -84,10 +84,10 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
if (item->Animation.ActiveState != 13)
|
if (item->Animation.ActiveState != 13)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_MP_WITH_GUN].animIndex + 14;
|
item->Animation.AnimNumber = Objects[ID_MP_WITH_GUN].animIndex + 14;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 13;
|
item->Animation.ActiveState = 13;
|
||||||
}
|
}
|
||||||
else if (Random::TestProbability(0.25f) && item->Animation.FrameNumber == GetAnimData(item).frameBase + 1)
|
else if (Random::TestProbability(0.25f) && item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 1)
|
||||||
{
|
{
|
||||||
CreatureAIInfo(item, &AI);
|
CreatureAIInfo(item, &AI);
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
|
|
||||||
if (item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 12 ||
|
if (item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 12 ||
|
||||||
(item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 1 &&
|
(item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 1 &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase + 10))
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 10))
|
||||||
{
|
{
|
||||||
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
||||||
item->Animation.RequiredState = MPGUN_STATE_WAIT;
|
item->Animation.RequiredState = MPGUN_STATE_WAIT;
|
||||||
|
@ -386,7 +386,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
extraTorsoRot.y = AI.angle;
|
extraTorsoRot.y = AI.angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
||||||
item->Animation.TargetState = MPGUN_STATE_WAIT;
|
item->Animation.TargetState = MPGUN_STATE_WAIT;
|
||||||
|
@ -410,8 +410,8 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
extraTorsoRot.y = AI.angle;
|
extraTorsoRot.y = AI.angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase ||
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase ||
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase + 11)
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 11)
|
||||||
{
|
{
|
||||||
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
||||||
item->Animation.TargetState = MPGUN_STATE_WAIT;
|
item->Animation.TargetState = MPGUN_STATE_WAIT;
|
||||||
|
@ -435,9 +435,9 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 18 &&
|
if ((item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 18 &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase + 17) ||
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 17) ||
|
||||||
(item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 19 &&
|
(item->Animation.AnimNumber == Objects[ID_MP_WITH_GUN].animIndex + 19 &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase + 6))
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 6))
|
||||||
{
|
{
|
||||||
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
||||||
item->Animation.RequiredState = MPGUN_STATE_WALK;
|
item->Animation.RequiredState = MPGUN_STATE_WALK;
|
||||||
|
@ -467,7 +467,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
if (item->Animation.RequiredState == MPGUN_STATE_WALK)
|
if (item->Animation.RequiredState == MPGUN_STATE_WALK)
|
||||||
item->Animation.TargetState = MPGUN_STATE_WALK;
|
item->Animation.TargetState = MPGUN_STATE_WALK;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + 16)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 16)
|
||||||
{
|
{
|
||||||
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32))
|
||||||
item->Animation.TargetState = MPGUN_STATE_WALK;
|
item->Animation.TargetState = MPGUN_STATE_WALK;
|
||||||
|
@ -523,7 +523,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
if (AI.ahead)
|
if (AI.ahead)
|
||||||
extraTorsoRot.y = AI.angle;
|
extraTorsoRot.y = AI.angle;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32) || Random::TestProbability(1 / 8.0f))
|
if (!ShotLara(item, &AI, MPGunBite, extraTorsoRot.y, 32) || Random::TestProbability(1 / 8.0f))
|
||||||
item->Animation.TargetState = MPGUN_STATE_CROUCHED;
|
item->Animation.TargetState = MPGUN_STATE_CROUCHED;
|
||||||
|
|
|
@ -449,7 +449,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
if (creature->Enemy->IsLara())
|
if (creature->Enemy->IsLara())
|
||||||
{
|
{
|
||||||
if (creature->Flags != 1 && item->TouchBits.Test(MPStickKickAttackJoints) &&
|
if (creature->Flags != 1 && item->TouchBits.Test(MPStickKickAttackJoints) &&
|
||||||
item->Animation.FrameNumber > GetAnimData(item).frameBase + 8)
|
item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 8)
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, 150);
|
DoDamage(creature->Enemy, 150);
|
||||||
CreatureEffect(item, MPStickBite2, DoBloodSplat);
|
CreatureEffect(item, MPStickBite2, DoBloodSplat);
|
||||||
|
@ -460,7 +460,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!creature->Flags != 1 && creature->Enemy &&
|
if (!creature->Flags != 1 && creature->Enemy &&
|
||||||
item->Animation.FrameNumber > GetAnimData(item).frameBase + 8)
|
item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 8)
|
||||||
{
|
{
|
||||||
if (Vector3i::Distance(item->Pose.Position, creature->Enemy->Pose.Position) <= SECTOR(0.25f))
|
if (Vector3i::Distance(item->Pose.Position, creature->Enemy->Pose.Position) <= SECTOR(0.25f))
|
||||||
{
|
{
|
||||||
|
|
|
@ -502,7 +502,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
if (item->Animation.ActiveState != TONY_STATE_DEATH)
|
if (item->Animation.ActiveState != TONY_STATE_DEATH)
|
||||||
SetAnimation(item, TONY_ANIM_DEATH);
|
SetAnimation(item, TONY_ANIM_DEATH);
|
||||||
|
|
||||||
int frameEnd = GetAnimData(*object, TONY_ANIM_DEATH).frameEnd;
|
int frameEnd = g_Level.Anims[object->animIndex + TONY_ANIM_DEATH].frameEnd;
|
||||||
if (item->Animation.FrameNumber >= frameEnd)
|
if (item->Animation.FrameNumber >= frameEnd)
|
||||||
{
|
{
|
||||||
// Avoid having the object stop working.
|
// Avoid having the object stop working.
|
||||||
|
|
|
@ -319,7 +319,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
case TRIBESMAN_STATE_RUN_AXE_ATTACK_HIGH:
|
case TRIBESMAN_STATE_RUN_AXE_ATTACK_HIGH:
|
||||||
item->ItemFlags[0] = 1;
|
item->ItemFlags[0] = 1;
|
||||||
creature->MaxTurn = ANGLE(4.0f);
|
creature->MaxTurn = ANGLE(4.0f);
|
||||||
creature->Flags = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
creature->Flags = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (creature->Enemy->IsLara())
|
if (creature->Enemy->IsLara())
|
||||||
{
|
{
|
||||||
|
@ -655,7 +655,7 @@ namespace TEN::Entities::Creatures::TR3
|
||||||
item->Pose.Orientation.y += ANGLE(2.0f);
|
item->Pose.Orientation.y += ANGLE(2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + 15)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 15)
|
||||||
{
|
{
|
||||||
item->Animation.TargetState = TRIBESMAN_STATE_CROUCH_IDLE;
|
item->Animation.TargetState = TRIBESMAN_STATE_CROUCH_IDLE;
|
||||||
TribesmanShotDart(item);
|
TribesmanShotDart(item);
|
||||||
|
|
|
@ -618,7 +618,7 @@ namespace TEN::Entities::Vehicles
|
||||||
SetAnimation(*laraItem, ID_KAYAK_LARA_ANIMS, KAYAK_ANIM_IDLE_DEATH);
|
SetAnimation(*laraItem, ID_KAYAK_LARA_ANIMS, KAYAK_ANIM_IDLE_DEATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
int frame = laraItem->Animation.FrameNumber - GetAnimData(laraItem).frameBase;
|
int frame = laraItem->Animation.FrameNumber - g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
switch (laraItem->Animation.ActiveState)
|
switch (laraItem->Animation.ActiveState)
|
||||||
{
|
{
|
||||||
|
|
|
@ -310,11 +310,11 @@ namespace TEN::Entities::Vehicles
|
||||||
{
|
{
|
||||||
if (item->ObjectNumber == ID_MINECART_SWITCH)
|
if (item->ObjectNumber == ID_MINECART_SWITCH)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase &&
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase &&
|
||||||
(laraItem->Animation.ActiveState == MINECART_STATE_SWIPE &&
|
(laraItem->Animation.ActiveState == MINECART_STATE_SWIPE &&
|
||||||
TestAnimNumber(*laraItem, MINECART_ANIM_SWIPE_WRENCH)))
|
TestAnimNumber(*laraItem, MINECART_ANIM_SWIPE_WRENCH)))
|
||||||
{
|
{
|
||||||
int frame = laraItem->Animation.FrameNumber - GetAnimData(laraItem).frameBase;
|
int frame = laraItem->Animation.FrameNumber - g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
if (frame >= 12 && frame <= 22)
|
if (frame >= 12 && frame <= 22)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR3_VEHICLE_MINECART_WRENCH, &item->Pose, SoundEnvironment::Always);
|
SoundEffect(SFX_TR3_VEHICLE_MINECART_WRENCH, &item->Pose, SoundEnvironment::Always);
|
||||||
|
|
|
@ -527,7 +527,7 @@ namespace TEN::Entities::Vehicles
|
||||||
|
|
||||||
TestUPVDismount(UPVItem, laraItem);
|
TestUPVDismount(UPVItem, laraItem);
|
||||||
|
|
||||||
int frame = laraItem->Animation.FrameNumber - GetAnimData(laraItem).frameBase;
|
int frame = laraItem->Animation.FrameNumber - g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
switch (laraItem->Animation.ActiveState)
|
switch (laraItem->Animation.ActiveState)
|
||||||
{
|
{
|
||||||
|
|
|
@ -503,7 +503,7 @@ namespace TEN::Entities::TR4
|
||||||
SpawnWraithExplosion(item, Vector3(48.0f), 48.0f);
|
SpawnWraithExplosion(item, Vector3(48.0f), 48.0f);
|
||||||
|
|
||||||
if (target->TriggerFlags > 0)
|
if (target->TriggerFlags > 0)
|
||||||
target->Animation.FrameNumber = GetAnimData(target).frameBase;
|
target->Animation.FrameNumber = g_Level.Anims[target->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
target->ItemFlags[6] = 0;
|
target->ItemFlags[6] = 0;
|
||||||
DoDamage(target, INT_MAX);
|
DoDamage(target, INT_MAX);
|
||||||
|
|
|
@ -137,9 +137,9 @@ namespace TEN::Entities::TR4
|
||||||
if (item->Animation.ActiveState == AHMET_STATE_DEATH)
|
if (item->Animation.ActiveState == AHMET_STATE_DEATH)
|
||||||
{
|
{
|
||||||
// Don't clear.
|
// Don't clear.
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
item->Animation.FrameNumber = (GetAnimData(item).frameEnd - 1);
|
item->Animation.FrameNumber = (g_Level.Anims[item->Animation.AnimNumber].frameEnd - 1);
|
||||||
item->Collidable = false;
|
item->Collidable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Pose.Orientation.y += AI.angle;
|
item->Pose.Orientation.y += AI.angle;
|
||||||
|
|
||||||
if (!(creature->Flags & 1) &&
|
if (!(creature->Flags & 1) &&
|
||||||
item->Animation.FrameNumber > (GetAnimData(item).frameBase + 7) &&
|
item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 7) &&
|
||||||
item->TouchBits.Test(AhmetSwipeAttackLeftJoints))
|
item->TouchBits.Test(AhmetSwipeAttackLeftJoints))
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
||||||
|
@ -292,7 +292,7 @@ namespace TEN::Entities::TR4
|
||||||
creature->Flags |= 1;
|
creature->Flags |= 1;
|
||||||
}
|
}
|
||||||
else if (!(creature->Flags & 2) &&
|
else if (!(creature->Flags & 2) &&
|
||||||
item->Animation.FrameNumber > (GetAnimData(item).frameBase + 32) &&
|
item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 32) &&
|
||||||
item->TouchBits.Test(AhmetSwipeAttackRightJoints))
|
item->TouchBits.Test(AhmetSwipeAttackRightJoints))
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
||||||
|
@ -322,7 +322,7 @@ namespace TEN::Entities::TR4
|
||||||
if (!(creature->Flags & 1) &&
|
if (!(creature->Flags & 1) &&
|
||||||
item->Animation.AnimNumber == (Objects[item->ObjectNumber].animIndex + AHMET_ANIM_JUMP_BITE_ATTACK_CONTINUE))
|
item->Animation.AnimNumber == (Objects[item->ObjectNumber].animIndex + AHMET_ANIM_JUMP_BITE_ATTACK_CONTINUE))
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > (GetAnimData(item).frameBase + 11) &&
|
if (item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 11) &&
|
||||||
item->TouchBits.Test(AhmetSwipeAttackLeftJoints))
|
item->TouchBits.Test(AhmetSwipeAttackLeftJoints))
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, AHMET_BITE_ATTACK_DAMAGE);
|
DoDamage(creature->Enemy, AHMET_BITE_ATTACK_DAMAGE);
|
||||||
|
@ -352,7 +352,7 @@ namespace TEN::Entities::TR4
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(creature->Flags & 1) &&
|
if (!(creature->Flags & 1) &&
|
||||||
item->Animation.FrameNumber > (GetAnimData(item).frameBase + 14) &&
|
item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 14) &&
|
||||||
item->TouchBits.Test(AhmetSwipeAttackLeftJoints))
|
item->TouchBits.Test(AhmetSwipeAttackLeftJoints))
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
||||||
|
@ -360,7 +360,7 @@ namespace TEN::Entities::TR4
|
||||||
creature->Flags |= 1;
|
creature->Flags |= 1;
|
||||||
}
|
}
|
||||||
else if (!(creature->Flags & 2) &&
|
else if (!(creature->Flags & 2) &&
|
||||||
item->Animation.FrameNumber > (GetAnimData(item).frameBase + 22) &&
|
item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 22) &&
|
||||||
item->TouchBits.Test(AhmetSwipeAttackRightJoints))
|
item->TouchBits.Test(AhmetSwipeAttackRightJoints))
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
DoDamage(creature->Enemy, AHMET_SWIPE_ATTACK_DAMAGE);
|
||||||
|
@ -384,7 +384,7 @@ namespace TEN::Entities::TR4
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
if (item->Animation.ActiveState != AHMET_STATE_DEATH ||
|
if (item->Animation.ActiveState != AHMET_STATE_DEATH ||
|
||||||
item->Animation.FrameNumber != GetAnimData(item).frameEnd)
|
item->Animation.FrameNumber != g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,7 +263,7 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
if (item->Animation.ActiveState == BABOON_STATE_WALK)
|
if (item->Animation.ActiveState == BABOON_STATE_WALK)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
BaboonRespawnFunction(itemNumber);
|
BaboonRespawnFunction(itemNumber);
|
||||||
}
|
}
|
||||||
else if (item->Animation.ActiveState != BABOON_ACTIVATE_SWITCH)
|
else if (item->Animation.ActiveState != BABOON_ACTIVATE_SWITCH)
|
||||||
|
@ -486,7 +486,7 @@ namespace TEN::Entities::TR4
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
item->HitPoints = NOT_TARGETABLE;
|
item->HitPoints = NOT_TARGETABLE;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + 212)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 212)
|
||||||
{
|
{
|
||||||
auto pos = Vector3i::Zero;
|
auto pos = Vector3i::Zero;
|
||||||
if (item->Pose.Orientation.y == ANGLE(270.0f))
|
if (item->Pose.Orientation.y == ANGLE(270.0f))
|
||||||
|
|
|
@ -242,7 +242,7 @@ namespace TEN::Entities::TR4
|
||||||
if (!ocb || ocb > 4 && ocb < 7)
|
if (!ocb || ocb > 4 && ocb < 7)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_IDLE;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_IDLE;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = BADDY_STATE_IDLE;
|
item->Animation.TargetState = BADDY_STATE_IDLE;
|
||||||
item->Animation.ActiveState = BADDY_STATE_IDLE;
|
item->Animation.ActiveState = BADDY_STATE_IDLE;
|
||||||
return;
|
return;
|
||||||
|
@ -252,7 +252,7 @@ namespace TEN::Entities::TR4
|
||||||
if (ocb == 1)
|
if (ocb == 1)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_TO_JUMP_RIGHT;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_TO_JUMP_RIGHT;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = BADDY_STATE_JUMP_RIGHT;
|
item->Animation.TargetState = BADDY_STATE_JUMP_RIGHT;
|
||||||
item->Animation.ActiveState = BADDY_STATE_JUMP_RIGHT;
|
item->Animation.ActiveState = BADDY_STATE_JUMP_RIGHT;
|
||||||
return;
|
return;
|
||||||
|
@ -262,7 +262,7 @@ namespace TEN::Entities::TR4
|
||||||
if (ocb == 2)
|
if (ocb == 2)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_TO_ROLL_LEFT;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_TO_ROLL_LEFT;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = BADDY_STATE_ROLL_LEFT;
|
item->Animation.TargetState = BADDY_STATE_ROLL_LEFT;
|
||||||
item->Animation.ActiveState = BADDY_STATE_ROLL_LEFT;
|
item->Animation.ActiveState = BADDY_STATE_ROLL_LEFT;
|
||||||
return;
|
return;
|
||||||
|
@ -272,7 +272,7 @@ namespace TEN::Entities::TR4
|
||||||
if (ocb == 3)
|
if (ocb == 3)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_CROUCH;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_CROUCH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = BADDY_STATE_CROUCH;
|
item->Animation.TargetState = BADDY_STATE_CROUCH;
|
||||||
item->Animation.ActiveState = BADDY_STATE_CROUCH;
|
item->Animation.ActiveState = BADDY_STATE_CROUCH;
|
||||||
return;
|
return;
|
||||||
|
@ -282,7 +282,7 @@ namespace TEN::Entities::TR4
|
||||||
if (ocb == 4)
|
if (ocb == 4)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_CLIMB_4_STEPS;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_CLIMB_4_STEPS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = BADDY_STATE_CLIMB_4_STEPS;
|
item->Animation.TargetState = BADDY_STATE_CLIMB_4_STEPS;
|
||||||
item->Animation.ActiveState = BADDY_STATE_CLIMB_4_STEPS;
|
item->Animation.ActiveState = BADDY_STATE_CLIMB_4_STEPS;
|
||||||
item->Pose.Position.x += phd_sin(item->Pose.Orientation.y) * CLICK(4);
|
item->Pose.Position.x += phd_sin(item->Pose.Orientation.y) * CLICK(4);
|
||||||
|
@ -294,7 +294,7 @@ namespace TEN::Entities::TR4
|
||||||
if (ocb > 100)
|
if (ocb > 100)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_CROUCH;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_CROUCH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = BADDY_STATE_CROUCH;
|
item->Animation.TargetState = BADDY_STATE_CROUCH;
|
||||||
item->Animation.ActiveState = BADDY_STATE_CROUCH;
|
item->Animation.ActiveState = BADDY_STATE_CROUCH;
|
||||||
item->Pose.Position.x += phd_sin(item->Pose.Orientation.y) * CLICK(4);
|
item->Pose.Position.x += phd_sin(item->Pose.Orientation.y) * CLICK(4);
|
||||||
|
@ -303,7 +303,7 @@ namespace TEN::Entities::TR4
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaddyControl(short itemNumber)
|
void BaddyControl(short itemNumber)
|
||||||
|
@ -470,14 +470,14 @@ namespace TEN::Entities::TR4
|
||||||
case BADDY_STATE_MONKEY_IDLE:
|
case BADDY_STATE_MONKEY_IDLE:
|
||||||
case BADDY_STATE_MONKEY_FORWARD:
|
case BADDY_STATE_MONKEY_FORWARD:
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_MONKEY_TO_FREEFALL;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_MONKEY_TO_FREEFALL;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = BADDY_STATE_MONKEY_TO_FREEFALL;
|
item->Animation.ActiveState = BADDY_STATE_MONKEY_TO_FREEFALL;
|
||||||
item->Animation.Velocity.z = 0;
|
item->Animation.Velocity.z = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_DEATH;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_DEATH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = BADDY_STATE_DEATH;
|
item->Animation.ActiveState = BADDY_STATE_DEATH;
|
||||||
currentCreature->LOT.IsJumping = true;
|
currentCreature->LOT.IsJumping = true;
|
||||||
|
|
||||||
|
@ -685,7 +685,7 @@ namespace TEN::Entities::TR4
|
||||||
currentCreature->LOT.IsJumping = true;
|
currentCreature->LOT.IsJumping = true;
|
||||||
|
|
||||||
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_TO_JUMP_FORWARD;
|
item->Animation.AnimNumber = Objects[objectNumber].animIndex + BADDY_ANIM_STAND_TO_JUMP_FORWARD;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = BADDY_STATE_JUMP_FORWARD_1_BLOCK;
|
item->Animation.ActiveState = BADDY_STATE_JUMP_FORWARD_1_BLOCK;
|
||||||
|
|
||||||
if (!canJump2Sectors)
|
if (!canJump2Sectors)
|
||||||
|
@ -863,7 +863,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (Random::GenerateInt(0, 30) > 20 &&
|
if (Random::GenerateInt(0, 30) > 20 &&
|
||||||
objectNumber == ID_BADDY2 &&
|
objectNumber == ID_BADDY2 &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase + FRAME_BADDY_RUN_TO_SOMERSAULT &&
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_RUN_TO_SOMERSAULT &&
|
||||||
height3 == height1 &&
|
height3 == height1 &&
|
||||||
abs(height1 - item->Pose.Position.y) < CLICK(1.5f) &&
|
abs(height1 - item->Pose.Position.y) < CLICK(1.5f) &&
|
||||||
(AI.angle > -ANGLE(22.5f) && AI.angle < ANGLE(22.5f) && AI.distance < pow(SECTOR(3), 2) || height2 >= (height1 + CLICK(2))))
|
(AI.angle > -ANGLE(22.5f) && AI.angle < ANGLE(22.5f) && AI.distance < pow(SECTOR(3), 2) || height2 >= (height1 + CLICK(2))))
|
||||||
|
@ -913,7 +913,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.ActiveState != BADDY_STATE_SWORD_HIT_FRONT ||
|
if (item->Animation.ActiveState != BADDY_STATE_SWORD_HIT_FRONT ||
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + FRAME_BADDY_SWORD_HIT_NO_DAMAGE_MAX)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_SWORD_HIT_NO_DAMAGE_MAX)
|
||||||
{
|
{
|
||||||
if (abs(AI.angle) >= ANGLE(7.0f))
|
if (abs(AI.angle) >= ANGLE(7.0f))
|
||||||
{
|
{
|
||||||
|
@ -930,8 +930,8 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
if (item->TouchBits.Test(BaddySwordAttackJoints))
|
if (item->TouchBits.Test(BaddySwordAttackJoints))
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase + FRAME_BADDY_SWORD_HIT_DAMAGE_MIN &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_SWORD_HIT_DAMAGE_MIN &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + FRAME_BADDY_SWORD_HIT_DAMAGE_MAX)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_SWORD_HIT_DAMAGE_MAX)
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, 120);
|
DoDamage(creature->Enemy, 120);
|
||||||
CreatureEffect2(item, BaddySwordBite, 10, item->Pose.Orientation.y, DoBloodSplat);
|
CreatureEffect2(item, BaddySwordBite, 10, item->Pose.Orientation.y, DoBloodSplat);
|
||||||
|
@ -940,7 +940,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd - 1)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd - 1)
|
||||||
currentCreature->Flags = 0;
|
currentCreature->Flags = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1073,7 +1073,7 @@ namespace TEN::Entities::TR4
|
||||||
case BADDY_STATE_CROUCH_PICKUP:
|
case BADDY_STATE_CROUCH_PICKUP:
|
||||||
ClampRotation(item->Pose, AI.angle, ANGLE(11.0f));
|
ClampRotation(item->Pose, AI.angle, ANGLE(11.0f));
|
||||||
|
|
||||||
if (item->Animation.FrameNumber != GetAnimData(item).frameBase + FRAME_BADDY_CROUCH_PICKUP)
|
if (item->Animation.FrameNumber != g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_CROUCH_PICKUP)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!currentCreature->Enemy)
|
if (!currentCreature->Enemy)
|
||||||
|
@ -1147,8 +1147,8 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
ClampRotation(item->Pose, AI.angle, ANGLE(7.0f));
|
ClampRotation(item->Pose, AI.angle, ANGLE(7.0f));
|
||||||
|
|
||||||
if (item->Animation.FrameNumber >= GetAnimData(item).frameBase + FRAME_BADDY_FIRE_MAX ||
|
if (item->Animation.FrameNumber >= g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_FIRE_MAX ||
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase + FRAME_BADDY_FIRE_MIN)
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_FIRE_MIN)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1167,25 +1167,25 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BADDY_STATE_HOLSTER_GUN:
|
case BADDY_STATE_HOLSTER_GUN:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + FRAME_BADDY_HOLSTER_GUN)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_HOLSTER_GUN)
|
||||||
item->SetMeshSwapFlags(MESHSWAPFLAGS_BADDY_EMPTY);
|
item->SetMeshSwapFlags(MESHSWAPFLAGS_BADDY_EMPTY);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BADDY_STATE_DRAW_GUN:
|
case BADDY_STATE_DRAW_GUN:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + FRAME_BADDY_DRAW_GUN)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_DRAW_GUN)
|
||||||
item->SetMeshSwapFlags(MESHSWAPFLAGS_BADDY_GUN);
|
item->SetMeshSwapFlags(MESHSWAPFLAGS_BADDY_GUN);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BADDY_STATE_HOLSTER_SWORD:
|
case BADDY_STATE_HOLSTER_SWORD:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + FRAME_BADDY_HOLSTER_SWORD)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_HOLSTER_SWORD)
|
||||||
item->SetMeshSwapFlags(MESHSWAPFLAGS_BADDY_EMPTY);
|
item->SetMeshSwapFlags(MESHSWAPFLAGS_BADDY_EMPTY);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BADDY_STATE_DRAW_SWORD:
|
case BADDY_STATE_DRAW_SWORD:
|
||||||
if (item->Animation.FrameNumber != GetAnimData(item).frameBase + FRAME_BADDY_DRAW_SWORD)
|
if (item->Animation.FrameNumber != g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_DRAW_SWORD)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (item->ObjectNumber == ID_BADDY1)
|
if (item->ObjectNumber == ID_BADDY1)
|
||||||
|
@ -1224,7 +1224,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber != (GetAnimData(item).frameBase + FRAME_BADDY_SOMERSAULT_START_TAKE_OFF))
|
if (item->Animation.FrameNumber != (g_Level.Anims[item->Animation.AnimNumber].frameBase + FRAME_BADDY_SOMERSAULT_START_TAKE_OFF))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
currentCreature->LOT.IsJumping = true;
|
currentCreature->LOT.IsJumping = true;
|
||||||
|
|
|
@ -262,7 +262,7 @@ namespace TEN::Entities::TR4
|
||||||
case BSCORPION_STATE_KILL_TROOP:
|
case BSCORPION_STATE_KILL_TROOP:
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
item->TriggerFlags++;
|
item->TriggerFlags++;
|
||||||
|
|
||||||
if ((creature->Enemy != nullptr && creature->Enemy->HitPoints <= 0) ||
|
if ((creature->Enemy != nullptr && creature->Enemy->HitPoints <= 0) ||
|
||||||
|
|
|
@ -240,7 +240,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CROC_STATE_BITE_ATTACK:
|
case CROC_STATE_BITE_ATTACK:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
item->Animation.RequiredState = NO_STATE;
|
item->Animation.RequiredState = NO_STATE;
|
||||||
|
|
||||||
if (AI.bite &&
|
if (AI.bite &&
|
||||||
|
@ -279,7 +279,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CROC_STATE_WATER_BITE_ATTACK:
|
case CROC_STATE_WATER_BITE_ATTACK:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
item->Animation.RequiredState = NO_STATE;
|
item->Animation.RequiredState = NO_STATE;
|
||||||
|
|
||||||
if (AI.bite && item->TouchBits.Test(CrocodileBiteAttackJoints))
|
if (AI.bite && item->TouchBits.Test(CrocodileBiteAttackJoints))
|
||||||
|
|
|
@ -217,7 +217,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (animIndex == DEMIGOD2_ANIM_SINGLE_PROJECTILE_ATTACK)
|
if (animIndex == DEMIGOD2_ANIM_SINGLE_PROJECTILE_ATTACK)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
auto origin = GetJointPosition(item, 16, Vector3i(-544, 96, 0));
|
auto origin = GetJointPosition(item, 16, Vector3i(-544, 96, 0));
|
||||||
auto target = GetJointPosition(item, 16, Vector3i(-900, 96, 0));
|
auto target = GetJointPosition(item, 16, Vector3i(-900, 96, 0));
|
||||||
|
@ -232,7 +232,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
else if (animIndex == DEMIGOD3_ANIM_SINGLE_PROJECTILE_ATTACK)
|
else if (animIndex == DEMIGOD3_ANIM_SINGLE_PROJECTILE_ATTACK)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
auto pos1 = GetJointPosition(item, 16, Vector3i(-544, 96, 0));
|
auto pos1 = GetJointPosition(item, 16, Vector3i(-544, 96, 0));
|
||||||
auto pos2 = GetJointPosition(item, 16, Vector3i(-900, 96, 0));
|
auto pos2 = GetJointPosition(item, 16, Vector3i(-900, 96, 0));
|
||||||
|
@ -247,7 +247,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
else if (animIndex == DEMIGOD3_ANIM_RADIAL_PROJECTILE_ATTACK)
|
else if (animIndex == DEMIGOD3_ANIM_RADIAL_PROJECTILE_ATTACK)
|
||||||
{
|
{
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (frameNumber >= 8 && frameNumber <= 64)
|
if (frameNumber >= 8 && frameNumber <= 64)
|
||||||
{
|
{
|
||||||
|
@ -360,13 +360,13 @@ namespace TEN::Entities::TR4
|
||||||
item->Animation.ActiveState == DEMIGOD_STATE_RUN_FORWARD)
|
item->Animation.ActiveState == DEMIGOD_STATE_RUN_FORWARD)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + DEMIGOD_ANIM_RUN_OVER_DEATH;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + DEMIGOD_ANIM_RUN_OVER_DEATH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = DEMIGOD_STATE_RUN_OVER_DEATH;
|
item->Animation.ActiveState = DEMIGOD_STATE_RUN_OVER_DEATH;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + DEMIGOD_ANIM_DEATH;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + DEMIGOD_ANIM_DEATH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = DEMIGOD_STATE_DEATH;
|
item->Animation.ActiveState = DEMIGOD_STATE_DEATH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -694,7 +694,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEMIGOD1_STATE_HAMMER_ATTACK:
|
case DEMIGOD1_STATE_HAMMER_ATTACK:
|
||||||
if ((item->Animation.FrameNumber - GetAnimData(item).frameBase) == DEMIGOD_ANIM_RUN_TO_IDLE)
|
if ((item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase) == DEMIGOD_ANIM_RUN_TO_IDLE)
|
||||||
{
|
{
|
||||||
auto pos = GetJointPosition(item, 17, Vector3i(80, -8, -40));
|
auto pos = GetJointPosition(item, 17, Vector3i(80, -8, -40));
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ namespace TEN::Entities::TR4
|
||||||
item->AIBits &= ~MODIFY;
|
item->AIBits &= ~MODIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
int frame = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frame = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
switch (item->Animation.ActiveState)
|
switch (item->Animation.ActiveState)
|
||||||
{
|
{
|
||||||
|
|
|
@ -212,7 +212,7 @@ namespace TEN::Entities::TR4
|
||||||
if (height4 > (item->Floor + CLICK(2)) && item->Animation.ActiveState != 5)
|
if (height4 > (item->Floor + CLICK(2)) && item->Animation.ActiveState != 5)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 8;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 8;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 5;
|
item->Animation.ActiveState = 5;
|
||||||
item->Animation.TargetState = 1;
|
item->Animation.TargetState = 1;
|
||||||
item->ItemFlags[1] = 0;
|
item->ItemFlags[1] = 0;
|
||||||
|
@ -253,7 +253,7 @@ namespace TEN::Entities::TR4
|
||||||
if (Lara.Location < item->ItemFlags[3] && item->Animation.ActiveState != 2 && item->Animation.TargetState != 2)
|
if (Lara.Location < item->ItemFlags[3] && item->Animation.ActiveState != 2 && item->Animation.TargetState != 2)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 1;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 1;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.TargetState = 2;
|
item->Animation.TargetState = 2;
|
||||||
item->Animation.ActiveState = 2;
|
item->Animation.ActiveState = 2;
|
||||||
|
|
||||||
|
|
|
@ -133,8 +133,8 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (item->Animation.AnimNumber == (object->animIndex + GUIDE_ANIM_LIGHTING_TORCH))
|
if (item->Animation.AnimNumber == (object->animIndex + GUIDE_ANIM_LIGHTING_TORCH))
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase + 32 &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 32 &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + 42)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + 42)
|
||||||
{
|
{
|
||||||
TriggerFireFlame(
|
TriggerFireFlame(
|
||||||
(random & 0x3F) + pos.x - 32,
|
(random & 0x3F) + pos.x - 32,
|
||||||
|
@ -480,7 +480,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
case GUIDE_STATE_IGNITE_TORCH:
|
case GUIDE_STATE_IGNITE_TORCH:
|
||||||
pos1 = GetJointPosition(item, GuideBite2);
|
pos1 = GetJointPosition(item, GuideBite2);
|
||||||
frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
random = GetRandomControl();
|
random = GetRandomControl();
|
||||||
|
|
||||||
if (frameNumber == 32)
|
if (frameNumber == 32)
|
||||||
|
@ -588,8 +588,8 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
if (enemy)
|
if (enemy)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase + 15 &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 15 &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + 26)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + 26)
|
||||||
{
|
{
|
||||||
float distance = Vector3i::Distance(item->Pose.Position, enemy->Pose.Position);
|
float distance = Vector3i::Distance(item->Pose.Position, enemy->Pose.Position);
|
||||||
if (distance <= CLICK(2))
|
if (distance <= CLICK(2))
|
||||||
|
@ -631,7 +631,7 @@ namespace TEN::Entities::TR4
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (item->Animation.AnimNumber != (object->animIndex + GUIDE_ANIM_IDLE_CROUCH) &&
|
if (item->Animation.AnimNumber != (object->animIndex + GUIDE_ANIM_IDLE_CROUCH) &&
|
||||||
item->Animation.FrameNumber == (GetAnimData(item).frameEnd - 20))
|
item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameEnd - 20))
|
||||||
{
|
{
|
||||||
TestTriggers(item, true);
|
TestTriggers(item, true);
|
||||||
|
|
||||||
|
@ -647,12 +647,12 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUIDE_STATE_PICK_UP_TORCH:
|
case GUIDE_STATE_PICK_UP_TORCH:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
someFlag = true;
|
someFlag = true;
|
||||||
item->Pose = enemy->Pose;
|
item->Pose = enemy->Pose;
|
||||||
}
|
}
|
||||||
else if (item->Animation.FrameNumber == (GetAnimData(item).frameBase + 35))
|
else if (item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 35))
|
||||||
{
|
{
|
||||||
item->SetMeshSwapFlags(GuideRightHandSwapJoints, true);
|
item->SetMeshSwapFlags(GuideRightHandSwapJoints, true);
|
||||||
|
|
||||||
|
@ -692,11 +692,11 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUIDE_STATE_LIGHT_TORCHES:
|
case GUIDE_STATE_LIGHT_TORCHES:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
item->Pose.Position = enemy->Pose.Position;
|
item->Pose.Position = enemy->Pose.Position;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber == (GetAnimData(item).frameBase + 42))
|
if (item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 42))
|
||||||
{
|
{
|
||||||
TestTriggers(item, true);
|
TestTriggers(item, true);
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ namespace TEN::Entities::TR4
|
||||||
creature->Enemy = nullptr;
|
creature->Enemy = nullptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (item->Animation.FrameNumber < (GetAnimData(item).frameBase + 42))
|
else if (item->Animation.FrameNumber < (g_Level.Anims[item->Animation.AnimNumber].frameBase + 42))
|
||||||
{
|
{
|
||||||
if ((enemy->Pose.Orientation.y - item->Pose.Orientation.y) <= ANGLE(2.0f))
|
if ((enemy->Pose.Orientation.y - item->Pose.Orientation.y) <= ANGLE(2.0f))
|
||||||
{
|
{
|
||||||
|
@ -722,9 +722,9 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUIDE_STATE_READ_INSCRIPTION:
|
case GUIDE_STATE_READ_INSCRIPTION:
|
||||||
if (item->Animation.FrameNumber >= GetAnimData(item).frameBase + 20)
|
if (item->Animation.FrameNumber >= g_Level.Anims[item->Animation.AnimNumber].frameBase + 20)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber == (GetAnimData(item).frameBase + 20))
|
if (item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 20))
|
||||||
{
|
{
|
||||||
item->Animation.TargetState = GUIDE_STATE_IDLE;
|
item->Animation.TargetState = GUIDE_STATE_IDLE;
|
||||||
|
|
||||||
|
@ -737,14 +737,14 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == (GetAnimData(item).frameBase + 70) &&
|
if (item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 70) &&
|
||||||
flagScaryInscription)
|
flagScaryInscription)
|
||||||
{
|
{
|
||||||
item->Animation.RequiredState = GUIDE_STATE_RUN_FORWARD;
|
item->Animation.RequiredState = GUIDE_STATE_RUN_FORWARD;
|
||||||
item->SetMeshSwapFlags(GuideHeadSwapJoints);
|
item->SetMeshSwapFlags(GuideHeadSwapJoints);
|
||||||
SoundEffect(SFX_TR4_GUIDE_SCARE, &item->Pose);
|
SoundEffect(SFX_TR4_GUIDE_SCARE, &item->Pose);
|
||||||
}
|
}
|
||||||
if (item->Animation.FrameNumber == (GetAnimData(item).frameBase + 185) &&
|
if (item->Animation.FrameNumber == (g_Level.Anims[item->Animation.AnimNumber].frameBase + 185) &&
|
||||||
flagScaryInscription)
|
flagScaryInscription)
|
||||||
{
|
{
|
||||||
item->ItemFlags[2] &= ~(1 << 4); // Turn off 4th bit for flagScaryInscription.
|
item->ItemFlags[2] &= ~(1 << 4); // Turn off 4th bit for flagScaryInscription.
|
||||||
|
|
|
@ -273,7 +273,7 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_DEATH;
|
item->Animation.AnimNumber = Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_DEATH;
|
||||||
item->Animation.ActiveState = HORSEMAN_STATE_DEATH;
|
item->Animation.ActiveState = HORSEMAN_STATE_DEATH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (item->ItemFlags[0])
|
if (item->ItemFlags[0])
|
||||||
{
|
{
|
||||||
|
@ -288,7 +288,7 @@ namespace TEN::Entities::TR4
|
||||||
item->AIBits = 0;
|
item->AIBits = 0;
|
||||||
item->ItemFlags[1] = 0;
|
item->ItemFlags[1] = 0;
|
||||||
item->Animation.AnimNumber = Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_FALL_OFF_HORSE_START;
|
item->Animation.AnimNumber = Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_FALL_OFF_HORSE_START;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = HORSEMAN_STATE_FALL_OFF_HORSE;
|
item->Animation.ActiveState = HORSEMAN_STATE_FALL_OFF_HORSE;
|
||||||
creature->Enemy = nullptr;
|
creature->Enemy = nullptr;
|
||||||
|
|
||||||
|
@ -522,10 +522,10 @@ namespace TEN::Entities::TR4
|
||||||
case HORSEMAN_STATE_MOUNTED_REAR:
|
case HORSEMAN_STATE_MOUNTED_REAR:
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
horseItem->Animation.AnimNumber = Objects[ID_HORSE].animIndex + HORSE_ANIM_REAR;
|
horseItem->Animation.AnimNumber = Objects[ID_HORSE].animIndex + HORSE_ANIM_REAR;
|
||||||
horseItem->Animation.FrameNumber = GetAnimData(horseItem).frameBase;
|
horseItem->Animation.FrameNumber = g_Level.Anims[horseItem->Animation.AnimNumber].frameBase;
|
||||||
horseItem->Animation.ActiveState = HORSE_STATE_REAR;
|
horseItem->Animation.ActiveState = HORSE_STATE_REAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,7 +608,7 @@ namespace TEN::Entities::TR4
|
||||||
creature->Enemy = nullptr;
|
creature->Enemy = nullptr;
|
||||||
|
|
||||||
item->Animation.AnimNumber = Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_MOUNT_HORSE;
|
item->Animation.AnimNumber = Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_MOUNT_HORSE;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = HORSEMAN_STATE_MOUNT_HORSE;
|
item->Animation.ActiveState = HORSEMAN_STATE_MOUNT_HORSE;
|
||||||
|
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
@ -715,10 +715,10 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.AnimNumber == Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_MOUNTED_SPRINT &&
|
if (item->Animation.AnimNumber == Objects[ID_HORSEMAN].animIndex + HORSEMAN_ANIM_MOUNTED_SPRINT &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
horseItem->Animation.AnimNumber = Objects[ID_HORSE].animIndex + HORSE_ANIM_SPRINT;
|
horseItem->Animation.AnimNumber = Objects[ID_HORSE].animIndex + HORSE_ANIM_SPRINT;
|
||||||
horseItem->Animation.FrameNumber = GetAnimData(horseItem).frameBase;
|
horseItem->Animation.FrameNumber = g_Level.Anims[horseItem->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (laraAI.distance > pow(SECTOR(4), 2) || creature->ReachedGoal)
|
if (laraAI.distance > pow(SECTOR(4), 2) || creature->ReachedGoal)
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Animation.TargetState = JEAN_YVES_STATE_HANDS_BEHIND_HEAD;
|
item->Animation.TargetState = JEAN_YVES_STATE_HANDS_BEHIND_HEAD;
|
||||||
item->Animation.ActiveState = JEAN_YVES_STATE_HANDS_BEHIND_HEAD;
|
item->Animation.ActiveState = JEAN_YVES_STATE_HANDS_BEHIND_HEAD;
|
||||||
item->Animation.AnimNumber = objectInfo->animIndex;
|
item->Animation.AnimNumber = objectInfo->animIndex;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JeanYvesControl(short itemNumber)
|
void JeanYvesControl(short itemNumber)
|
||||||
|
@ -68,7 +68,7 @@ namespace TEN::Entities::TR4
|
||||||
state++;
|
state++;
|
||||||
|
|
||||||
item->Animation.AnimNumber = animNumber;
|
item->Animation.AnimNumber = animNumber;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = state;
|
item->Animation.ActiveState = state;
|
||||||
item->Animation.TargetState = state;
|
item->Animation.TargetState = state;
|
||||||
item->TriggerFlags = Lara.HighestLocation;
|
item->TriggerFlags = Lara.HighestLocation;
|
||||||
|
|
|
@ -179,7 +179,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
|
|
||||||
frameNumber = item->Animation.FrameNumber;
|
frameNumber = item->Animation.FrameNumber;
|
||||||
frameBase = GetAnimData(item).frameBase;
|
frameBase = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
if (frameNumber > (frameBase + 42) &&
|
if (frameNumber > (frameBase + 42) &&
|
||||||
frameNumber < (frameBase + 51))
|
frameNumber < (frameBase + 51))
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + MUMMY_ANIM_RECOIL;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + MUMMY_ANIM_RECOIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Pose.Orientation.y += AI.angle;
|
item->Pose.Orientation.y += AI.angle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
item->TriggerFlags = 0;
|
item->TriggerFlags = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -282,8 +282,8 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
if (item->TouchBits.Test(MummySwipeAttackJoints))
|
if (item->TouchBits.Test(MummySwipeAttackJoints))
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameEnd)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
DoDamage(creature->Enemy, MUMMY_SWIPE_ATTACK_DAMAGE);
|
DoDamage(creature->Enemy, MUMMY_SWIPE_ATTACK_DAMAGE);
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
bool ShootFrame(ItemInfo* item)
|
bool ShootFrame(ItemInfo* item)
|
||||||
{
|
{
|
||||||
int frameNumber = (item->Animation.FrameNumber - GetAnimData(item).frameBase);
|
int frameNumber = (item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase);
|
||||||
if (frameNumber == 45 ||
|
if (frameNumber == 45 ||
|
||||||
/*frameNumber == 50 ||
|
/*frameNumber == 50 ||
|
||||||
frameNumber == 55 ||*/
|
frameNumber == 55 ||*/
|
||||||
|
@ -258,7 +258,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + MUTANT_ANIM_APPEAR;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + MUTANT_ANIM_APPEAR;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = MUTANT_STATE_APPEAR;
|
item->Animation.ActiveState = MUTANT_STATE_APPEAR;
|
||||||
item->Animation.TargetState = MUTANT_STATE_APPEAR;
|
item->Animation.TargetState = MUTANT_STATE_APPEAR;
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MUTANT_STATE_PROJECTILE_ATTACK:
|
case MUTANT_STATE_PROJECTILE_ATTACK:
|
||||||
frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
if (frameNumber >= 94 && frameNumber <= 96)
|
if (frameNumber >= 94 && frameNumber <= 96)
|
||||||
{
|
{
|
||||||
Pose src;
|
Pose src;
|
||||||
|
@ -332,7 +332,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MUTANT_STATE_LOCUST_ATTACK_1:
|
case MUTANT_STATE_LOCUST_ATTACK_1:
|
||||||
frameNumber = (item->Animation.FrameNumber - GetAnimData(item).frameBase);
|
frameNumber = (item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase);
|
||||||
if (frameNumber >= 60 && frameNumber <= 120)
|
if (frameNumber >= 60 && frameNumber <= 120)
|
||||||
SpawnLocust(item);
|
SpawnLocust(item);
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace TEN::Entities::TR4
|
||||||
item.Animation.TargetState = item.Animation.ActiveState = 4;
|
item.Animation.TargetState = item.Animation.ActiveState = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.Animation.FrameNumber = GetAnimData(item).frameBase;
|
item.Animation.FrameNumber = g_Level.Anims[item.Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SasControl(short itemNumber)
|
void SasControl(short itemNumber)
|
||||||
|
@ -474,7 +474,7 @@ namespace TEN::Entities::TR4
|
||||||
angle2 = 0;
|
angle2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.Animation.FrameNumber == (GetAnimData(item).frameBase + 20))
|
if (item.Animation.FrameNumber == (g_Level.Anims[item.Animation.AnimNumber].frameBase + 20))
|
||||||
{
|
{
|
||||||
if (!creature.Enemy->Animation.Velocity.z)
|
if (!creature.Enemy->Animation.Velocity.z)
|
||||||
{
|
{
|
||||||
|
|
|
@ -300,7 +300,7 @@ namespace TEN::Entities::TR4
|
||||||
if (canJump)
|
if (canJump)
|
||||||
{
|
{
|
||||||
if (item->Animation.AnimNumber == (Objects[item->ObjectNumber].animIndex + SETH_ANIM_POUNCE_ATTACK_START) &&
|
if (item->Animation.AnimNumber == (Objects[item->ObjectNumber].animIndex + SETH_ANIM_POUNCE_ATTACK_START) &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
creature.MaxTurn = 0;
|
creature.MaxTurn = 0;
|
||||||
creature.ReachedGoal = true;
|
creature.ReachedGoal = true;
|
||||||
|
@ -340,7 +340,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
case SETH_STATE_HARD_RECOIL:
|
case SETH_STATE_HARD_RECOIL:
|
||||||
if (item->Animation.AnimNumber == (Objects[item->Animation.AnimNumber].animIndex + SETH_ANIM_HARD_RECOIL_START) &&
|
if (item->Animation.AnimNumber == (Objects[item->Animation.AnimNumber].animIndex + SETH_ANIM_HARD_RECOIL_START) &&
|
||||||
item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
if (Random::TestProbability(SETH_HARD_RECOIL_RECOVER_CHANCE))
|
if (Random::TestProbability(SETH_HARD_RECOIL_RECOVER_CHANCE))
|
||||||
item->Animation.RequiredState = SETH_STATE_HARD_RECOIL_RECOVER;
|
item->Animation.RequiredState = SETH_STATE_HARD_RECOIL_RECOVER;
|
||||||
|
@ -367,8 +367,8 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
if (item->TouchBits.TestAny())
|
if (item->TouchBits.TestAny())
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > (GetAnimData(item).frameBase + SETH_ANIM_POUNCE_ATTACK_START) &&
|
if (item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + SETH_ANIM_POUNCE_ATTACK_START) &&
|
||||||
item->Animation.FrameNumber < (GetAnimData(item).frameBase + SETH_ANIM_IDLE_TO_HOVER))
|
item->Animation.FrameNumber < (g_Level.Anims[item->Animation.AnimNumber].frameBase + SETH_ANIM_IDLE_TO_HOVER))
|
||||||
{
|
{
|
||||||
DoDamage(creature.Enemy, SETH_KILL_ATTACK_DAMAGE);
|
DoDamage(creature.Enemy, SETH_KILL_ATTACK_DAMAGE);
|
||||||
CreatureEffect2(item, SethBite1, 25, -1, DoBloodSplat);
|
CreatureEffect2(item, SethBite1, 25, -1, DoBloodSplat);
|
||||||
|
|
|
@ -284,7 +284,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Pose.Orientation.y += AI.angle;
|
item->Pose.Orientation.y += AI.angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
creature->LOT.IsJumping = true;
|
creature->LOT.IsJumping = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -413,7 +413,7 @@ namespace TEN::Entities::TR4
|
||||||
else if (canJump1Block || canJump2Blocks)
|
else if (canJump1Block || canJump2Blocks)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_SKELETON].animIndex + 40;
|
item->Animation.AnimNumber = Objects[ID_SKELETON].animIndex + 40;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = SKELETON_STATE_JUMP_LEFT;
|
item->Animation.ActiveState = SKELETON_STATE_JUMP_LEFT;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ namespace TEN::Entities::TR4
|
||||||
if (GetCollision(item).Position.Floor > item->Pose.Position.y + BLOCK(1))
|
if (GetCollision(item).Position.Floor > item->Pose.Position.y + BLOCK(1))
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[ID_SKELETON].animIndex + 44;
|
item->Animation.AnimNumber = Objects[ID_SKELETON].animIndex + 44;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 23;
|
item->Animation.ActiveState = 23;
|
||||||
item->Animation.IsAirborne = true;
|
item->Animation.IsAirborne = true;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
@ -635,7 +635,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Pose.Orientation.y += AI.angle;
|
item->Pose.Orientation.y += AI.angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->Animation.FrameNumber > (GetAnimData(item).frameBase + 15))
|
if (item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 15))
|
||||||
{
|
{
|
||||||
auto* room = &g_Level.Rooms[item->RoomNumber];
|
auto* room = &g_Level.Rooms[item->RoomNumber];
|
||||||
|
|
||||||
|
@ -705,7 +705,7 @@ namespace TEN::Entities::TR4
|
||||||
if (GetCollision(item).Position.Floor > (item->Pose.Position.y + CLICK(5)))
|
if (GetCollision(item).Position.Floor > (item->Pose.Position.y + CLICK(5)))
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 44;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 44;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 23;
|
item->Animation.ActiveState = 23;
|
||||||
item->Animation.IsAirborne = true;
|
item->Animation.IsAirborne = true;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
@ -736,7 +736,7 @@ namespace TEN::Entities::TR4
|
||||||
case SKELETON_STATE_RECOIL_BACK:
|
case SKELETON_STATE_RECOIL_BACK:
|
||||||
if ((item->Animation.ActiveState == SKELETON_STATE_RECOIL_FRONT ||
|
if ((item->Animation.ActiveState == SKELETON_STATE_RECOIL_FRONT ||
|
||||||
item->Animation.ActiveState == SKELETON_STATE_RECOIL_BACK) &&
|
item->Animation.ActiveState == SKELETON_STATE_RECOIL_BACK) &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + 20)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + 20)
|
||||||
{
|
{
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -758,7 +758,7 @@ namespace TEN::Entities::TR4
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 47;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 47;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = 24;
|
item->Animation.ActiveState = 24;
|
||||||
item->Animation.IsAirborne = true;
|
item->Animation.IsAirborne = true;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
|
@ -775,7 +775,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SKELETON_STATE_SUBTERRANEAN:
|
case SKELETON_STATE_SUBTERRANEAN:
|
||||||
if (item->Animation.FrameNumber - GetAnimData(item).frameBase < 32)
|
if (item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase < 32)
|
||||||
TriggerRiseEffect(item);
|
TriggerRiseEffect(item);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -159,8 +159,8 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
if (item->TouchBits.Test(SmallScorpionAttackJoints))
|
if (item->TouchBits.Test(SmallScorpionAttackJoints))
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase + 20 &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 20 &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + 32)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + 32)
|
||||||
{
|
{
|
||||||
short rotation;
|
short rotation;
|
||||||
CreatureBiteInfo biteInfo;
|
CreatureBiteInfo biteInfo;
|
||||||
|
|
|
@ -220,7 +220,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPHINX_STATE_COLLIDE:
|
case SPHINX_STATE_COLLIDE:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
TestTriggers(item, true);
|
TestTriggers(item, true);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 12;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TroopsControl(short itemNumber)
|
void TroopsControl(short itemNumber)
|
||||||
|
@ -104,9 +104,9 @@ namespace TEN::Entities::TR4
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 23;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 23;
|
||||||
|
|
||||||
if (item->Animation.ActiveState == TROOP_STATE_ATTACKED_BY_SCORPION)
|
if (item->Animation.ActiveState == TROOP_STATE_ATTACKED_BY_SCORPION)
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase + 37;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase + 37;
|
||||||
else
|
else
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
item->Animation.ActiveState = TROOP_STATE_KILLED_BY_SCORPION;
|
item->Animation.ActiveState = TROOP_STATE_KILLED_BY_SCORPION;
|
||||||
item->Animation.TargetState = TROOP_STATE_KILLED_BY_SCORPION;
|
item->Animation.TargetState = TROOP_STATE_KILLED_BY_SCORPION;
|
||||||
|
@ -128,7 +128,7 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 19;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 19;
|
||||||
item->Animation.ActiveState = TROOP_STATE_DEATH;
|
item->Animation.ActiveState = TROOP_STATE_DEATH;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,7 +460,7 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 28;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 28;
|
||||||
item->Animation.ActiveState = TROOP_STATE_FLASHED;
|
item->Animation.ActiveState = TROOP_STATE_FLASHED;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase + (GetRandomControl() & 7);
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase + (GetRandomControl() & 7);
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
GetFloor(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, &item->RoomNumber);
|
GetFloor(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, &item->RoomNumber);
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase + VON_CROY_ANIM_RUN_FORWARD)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + VON_CROY_ANIM_RUN_FORWARD)
|
||||||
CreateZone(item);
|
CreateZone(item);
|
||||||
|
|
||||||
CreatureAIInfo(item, &AI);
|
CreatureAIInfo(item, &AI);
|
||||||
|
@ -405,7 +405,7 @@ namespace TEN::Entities::TR4
|
||||||
else if (canJump1block || canJump2blocks)
|
else if (canJump1block || canJump2blocks)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_IDLE_TO_JUMP;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_IDLE_TO_JUMP;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_JUMP;
|
item->Animation.ActiveState = VON_CROY_STATE_JUMP;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
creature->LOT.IsJumping = true;
|
creature->LOT.IsJumping = true;
|
||||||
|
@ -621,7 +621,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VON_CROY_STATE_TOGGLE_KNIFE:
|
case VON_CROY_STATE_TOGGLE_KNIFE:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
item->SetMeshSwapFlags(VonCroyKnifeSwapJoints, item->TestMeshSwapFlags(VonCroyKnifeSwapJoints));
|
item->SetMeshSwapFlags(VonCroyKnifeSwapJoints, item->TestMeshSwapFlags(VonCroyKnifeSwapJoints));
|
||||||
}
|
}
|
||||||
|
@ -629,7 +629,7 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VON_CROY_STATE_LOOK_BEFORE_JUMP:
|
case VON_CROY_STATE_LOOK_BEFORE_JUMP:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
item->Pose = enemy->Pose;
|
item->Pose = enemy->Pose;
|
||||||
|
|
||||||
|
@ -639,7 +639,7 @@ namespace TEN::Entities::TR4
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_JUMP;
|
item->Animation.ActiveState = VON_CROY_STATE_JUMP;
|
||||||
item->Animation.TargetState = VON_CROY_STATE_JUMP_2_BLOCKS;
|
item->Animation.TargetState = VON_CROY_STATE_JUMP_2_BLOCKS;
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_IDLE_TO_JUMP;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_IDLE_TO_JUMP;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
creature->LOT.IsJumping = true;
|
creature->LOT.IsJumping = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
case VON_CROY_STATE_JUMP_2_BLOCKS:
|
case VON_CROY_STATE_JUMP_2_BLOCKS:
|
||||||
if (item->Animation.AnimNumber == Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_JUMP_2_BLOCKS ||
|
if (item->Animation.AnimNumber == Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_JUMP_2_BLOCKS ||
|
||||||
item->Animation.FrameNumber > (GetAnimData(item).frameBase + 5))
|
item->Animation.FrameNumber > (g_Level.Anims[item->Animation.AnimNumber].frameBase + 5))
|
||||||
{
|
{
|
||||||
creature->LOT.IsJumping = true;
|
creature->LOT.IsJumping = true;
|
||||||
//if (canJump3blocks)
|
//if (canJump3blocks)
|
||||||
|
@ -668,9 +668,9 @@ namespace TEN::Entities::TR4
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VON_CROY_STATE_ENABLE_TRAP:
|
case VON_CROY_STATE_ENABLE_TRAP:
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
item->Pose = enemy->Pose;
|
item->Pose = enemy->Pose;
|
||||||
else if (item->Animation.FrameNumber == GetAnimData(item).frameBase + 120)
|
else if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameBase + 120)
|
||||||
{
|
{
|
||||||
TestTriggers(creature->AITarget, true);
|
TestTriggers(creature->AITarget, true);
|
||||||
|
|
||||||
|
@ -695,8 +695,8 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (!creature->Flags && enemy != nullptr)
|
if (!creature->Flags && enemy != nullptr)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase + 20 &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 20 &&
|
||||||
item->Animation.FrameNumber > GetAnimData(item).frameBase + 45)
|
item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 45)
|
||||||
{
|
{
|
||||||
if (abs(item->Pose.Position.x - enemy->Pose.Position.x) < CLICK(2) &&
|
if (abs(item->Pose.Position.x - enemy->Pose.Position.x) < CLICK(2) &&
|
||||||
abs(item->Pose.Position.y - enemy->Pose.Position.y) < CLICK(2) &&
|
abs(item->Pose.Position.y - enemy->Pose.Position.y) < CLICK(2) &&
|
||||||
|
@ -759,12 +759,12 @@ namespace TEN::Entities::TR4
|
||||||
ClampRotation(item->Pose, AI.angle, ANGLE(6.0f));
|
ClampRotation(item->Pose, AI.angle, ANGLE(6.0f));
|
||||||
|
|
||||||
if ((enemy == nullptr || enemy->Flags != 0) ||
|
if ((enemy == nullptr || enemy->Flags != 0) ||
|
||||||
item->Animation.FrameNumber <= GetAnimData(item).frameBase + 21)
|
item->Animation.FrameNumber <= g_Level.Anims[item->Animation.AnimNumber].frameBase + 21)
|
||||||
{
|
{
|
||||||
if (creature->Flags == 0 && enemy != nullptr)
|
if (creature->Flags == 0 && enemy != nullptr)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber > GetAnimData(item).frameBase + 15 &&
|
if (item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 15 &&
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + 26)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + 26)
|
||||||
{
|
{
|
||||||
if (abs(item->Pose.Position.x - enemy->Pose.Position.x) < CLICK(2) &&
|
if (abs(item->Pose.Position.x - enemy->Pose.Position.x) < CLICK(2) &&
|
||||||
abs(item->Pose.Position.y - enemy->Pose.Position.y) < CLICK(2) &&
|
abs(item->Pose.Position.y - enemy->Pose.Position.y) < CLICK(2) &&
|
||||||
|
@ -805,7 +805,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (item->Animation.AnimNumber == Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_START_POINT)
|
if (item->Animation.AnimNumber == Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_START_POINT)
|
||||||
{
|
{
|
||||||
if (item->Animation.FrameNumber != GetAnimData(item).frameBase)
|
if (item->Animation.FrameNumber != g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -825,7 +825,7 @@ namespace TEN::Entities::TR4
|
||||||
case VON_CROY_STATE_STANDING_JUMP_GRAB:
|
case VON_CROY_STATE_STANDING_JUMP_GRAB:
|
||||||
flags = true;
|
flags = true;
|
||||||
if (item->Animation.AnimNumber != Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_UP_AFTER_JUMP ||
|
if (item->Animation.AnimNumber != Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_UP_AFTER_JUMP ||
|
||||||
item->Animation.FrameNumber != GetAnimData(item).frameBase)
|
item->Animation.FrameNumber != g_Level.Anims[item->Animation.AnimNumber].frameBase)
|
||||||
{
|
{
|
||||||
flags = false;
|
flags = false;
|
||||||
}
|
}
|
||||||
|
@ -868,55 +868,55 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_2_BLOCKS;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_2_BLOCKS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_CLIMB_2_BLOCKS;
|
item->Animation.ActiveState = VON_CROY_STATE_CLIMB_2_BLOCKS;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_3_BLOCKS;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_3_BLOCKS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_CLIMB_3_BLOCKS;
|
item->Animation.ActiveState = VON_CROY_STATE_CLIMB_3_BLOCKS;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_4_BLOCKS;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_4_BLOCKS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_CLIMB_4_BLOCKS;
|
item->Animation.ActiveState = VON_CROY_STATE_CLIMB_4_BLOCKS;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_JUMP_TO_HANG;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_JUMP_TO_HANG;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_GRAB_LADDER;
|
item->Animation.ActiveState = VON_CROY_STATE_GRAB_LADDER;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
case -7:
|
case -7:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_DOWN_2_SECTORS;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_DOWN_2_SECTORS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_STEP_DOWN_HIGH;
|
item->Animation.ActiveState = VON_CROY_STATE_STEP_DOWN_HIGH;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -4:
|
case -4:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_DOWN_1_SECTOR;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_DOWN_1_SECTOR;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_JUMP_DOWN_4_CLICKS;
|
item->Animation.ActiveState = VON_CROY_STATE_JUMP_DOWN_4_CLICKS;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -3:
|
case -3:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_OFF_3_CLICKS;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_OFF_3_CLICKS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_JUMP_DOWN_3_CLICKS;
|
item->Animation.ActiveState = VON_CROY_STATE_JUMP_DOWN_3_CLICKS;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -2:
|
case -2:
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_OFF_2_CLICKS;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + VON_CROY_ANIM_CLIMB_OFF_2_CLICKS;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = VON_CROY_STATE_JUMP_DOWN_2_CLICKS;
|
item->Animation.ActiveState = VON_CROY_STATE_JUMP_DOWN_2_CLICKS;
|
||||||
creature->MaxTurn = 0;
|
creature->MaxTurn = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -22,7 +22,8 @@ namespace TEN::Entities::TR4
|
||||||
{
|
{
|
||||||
auto& item = g_Level.Items[itemNumber];
|
auto& item = g_Level.Items[itemNumber];
|
||||||
|
|
||||||
SetAnimation(item, 0);
|
item.Animation.AnimNumber = Objects[item.ObjectNumber].animIndex;
|
||||||
|
item.Animation.FrameNumber = g_Level.Anims[item.Animation.AnimNumber].frameBase;
|
||||||
item.ItemFlags[6] = 0;
|
item.ItemFlags[6] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ void ClockworkBeetleControl(short itemNumber)
|
||||||
|
|
||||||
if (LaraItem->Animation.AnimNumber == LA_MECHANICAL_BEETLE_USE)
|
if (LaraItem->Animation.AnimNumber == LA_MECHANICAL_BEETLE_USE)
|
||||||
{
|
{
|
||||||
short fb = GetAnimData(ID_LARA, LA_MECHANICAL_BEETLE_USE).frameBase;
|
short fb = g_Level.Anims[LA_MECHANICAL_BEETLE_USE].frameBase;
|
||||||
|
|
||||||
if (LaraItem->Animation.FrameNumber < fb + 14)
|
if (LaraItem->Animation.FrameNumber < fb + 14)
|
||||||
{
|
{
|
||||||
|
|
|
@ -198,10 +198,10 @@ namespace TEN::Entities::TR4
|
||||||
if (laraItem->Animation.AnimNumber == LA_WATERSKIN_POUR_LOW && LaraItem->ItemFlags[2] == flags)
|
if (laraItem->Animation.AnimNumber == LA_WATERSKIN_POUR_LOW && LaraItem->ItemFlags[2] == flags)
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_WATERSKIN_POUR_HIGH;
|
laraItem->Animation.AnimNumber = LA_WATERSKIN_POUR_HIGH;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (laraItem->Animation.FrameNumber == GetAnimData(*laraItem, LA_WATERSKIN_POUR_HIGH).frameBase + 74 &&
|
if (laraItem->Animation.FrameNumber == g_Level.Anims[LA_WATERSKIN_POUR_HIGH].frameBase + 74 &&
|
||||||
LaraItem->ItemFlags[2] == flags)
|
LaraItem->ItemFlags[2] == flags)
|
||||||
{
|
{
|
||||||
if (!puzzleItem->TriggerFlags)
|
if (!puzzleItem->TriggerFlags)
|
||||||
|
@ -245,7 +245,7 @@ namespace TEN::Entities::TR4
|
||||||
laraItem->Animation.IsAirborne)
|
laraItem->Animation.IsAirborne)
|
||||||
{
|
{
|
||||||
if (laraItem->Animation.AnimNumber != LA_TORCH_LIGHT_3 ||
|
if (laraItem->Animation.AnimNumber != LA_TORCH_LIGHT_3 ||
|
||||||
GetAnimData(*laraItem, LA_TORCH_LIGHT_3).frameBase + 16 ||
|
g_Level.Anims[LA_TORCH_LIGHT_3].frameBase + 16 ||
|
||||||
puzzleItem->ItemFlags[0] != 2)
|
puzzleItem->ItemFlags[0] != 2)
|
||||||
{
|
{
|
||||||
ElementPuzzleDoCollision(itemNumber, laraItem, coll);
|
ElementPuzzleDoCollision(itemNumber, laraItem, coll);
|
||||||
|
@ -274,7 +274,7 @@ namespace TEN::Entities::TR4
|
||||||
if (TestLaraPosition(ElementPuzzleBounds, puzzleItem, laraItem))
|
if (TestLaraPosition(ElementPuzzleBounds, puzzleItem, laraItem))
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = (abs(puzzleItem->Pose.Position.y- laraItem->Pose.Position.y) >> 8) + LA_TORCH_LIGHT_3;
|
laraItem->Animation.AnimNumber = (abs(puzzleItem->Pose.Position.y- laraItem->Pose.Position.y) >> 8) + LA_TORCH_LIGHT_3;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(puzzleItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[puzzleItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
laraInfo->Flare.ControlLeft = false;
|
laraInfo->Flare.ControlLeft = false;
|
||||||
laraInfo->LeftArm.Locked = true;
|
laraInfo->LeftArm.Locked = true;
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace TEN::Entities::TR4
|
||||||
if (!TriggerActive(item))
|
if (!TriggerActive(item))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber - GetAnimData(item).frameBase >= 200)
|
if (item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase >= 200)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR4_MAPPER_LASER, &item->Pose);
|
SoundEffect(SFX_TR4_MAPPER_LASER, &item->Pose);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ void InitializeObelisk(short itemNumber)
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 3;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + 3;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
item->Status = ITEM_ACTIVE;
|
item->Status = ITEM_ACTIVE;
|
||||||
|
@ -162,7 +162,7 @@ void ObeliskControl(short itemNumber)
|
||||||
if (TrInput & IN_ACTION)
|
if (TrInput & IN_ACTION)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = obj->animIndex + 1;
|
item->Animation.AnimNumber = obj->animIndex + 1;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
flag = true;
|
flag = true;
|
||||||
|
@ -175,20 +175,20 @@ void ObeliskControl(short itemNumber)
|
||||||
if (!(TrInput & IN_ACTION))
|
if (!(TrInput & IN_ACTION))
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = obj->animIndex + 3;
|
item->Animation.AnimNumber = obj->animIndex + 3;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = obj->animIndex + 5;
|
item->Animation.AnimNumber = obj->animIndex + 5;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = obj->animIndex + 3;
|
item->Animation.AnimNumber = obj->animIndex + 3;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->TriggerFlags == 2)
|
if (item->TriggerFlags == 2)
|
||||||
|
|
|
@ -44,7 +44,7 @@ void SarcophagusCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* c
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_PICKUP_SARCOPHAGUS;
|
laraItem->Animation.AnimNumber = LA_PICKUP_SARCOPHAGUS;
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(laraItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||||
sarcItem->Flags |= IFLAG_ACTIVATION_MASK;
|
sarcItem->Flags |= IFLAG_ACTIVATION_MASK;
|
||||||
|
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
|
@ -67,7 +67,7 @@ void SarcophagusCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (laraItem->Animation.AnimNumber != LA_PICKUP_SARCOPHAGUS ||
|
else if (laraItem->Animation.AnimNumber != LA_PICKUP_SARCOPHAGUS ||
|
||||||
laraItem->Animation.FrameNumber != GetAnimData(*laraItem, LA_PICKUP_SARCOPHAGUS).frameBase + 113)
|
laraItem->Animation.FrameNumber != g_Level.Anims[LA_PICKUP_SARCOPHAGUS].frameBase + 113)
|
||||||
{
|
{
|
||||||
ObjectCollision(itemNumber, laraItem, coll);
|
ObjectCollision(itemNumber, laraItem, coll);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ void ScalesControl(short itemNumber)
|
||||||
{
|
{
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
if (item->Animation.FrameNumber != GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber != g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
{
|
{
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
return;
|
return;
|
||||||
|
@ -131,15 +131,15 @@ void ScalesCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
if (TestLaraPosition(ScalesBounds, item, laraItem))
|
if (TestLaraPosition(ScalesBounds, item, laraItem))
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_WATERSKIN_POUR_HIGH;
|
laraItem->Animation.AnimNumber = LA_WATERSKIN_POUR_HIGH;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(item).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Pose.Orientation.y = rotY;
|
item->Pose.Orientation.y = rotY;
|
||||||
}
|
}
|
||||||
else if (laraItem->Animation.FrameNumber == GetAnimData(*laraItem, LA_WATERSKIN_POUR_HIGH).frameBase + 51)
|
else if (laraItem->Animation.FrameNumber == g_Level.Anims[LA_WATERSKIN_POUR_HIGH].frameBase + 51)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR4_POUR_WATER, &laraItem->Pose);
|
SoundEffect(SFX_TR4_POUR_WATER, &laraItem->Pose);
|
||||||
item->Pose.Orientation.y = rotY;
|
item->Pose.Orientation.y = rotY;
|
||||||
}
|
}
|
||||||
else if (laraItem->Animation.FrameNumber == GetAnimData(*laraItem, LA_WATERSKIN_POUR_HIGH).frameBase + 74)
|
else if (laraItem->Animation.FrameNumber == g_Level.Anims[LA_WATERSKIN_POUR_HIGH].frameBase + 74)
|
||||||
{
|
{
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
item->Status = ITEM_ACTIVE;
|
item->Status = ITEM_ACTIVE;
|
||||||
|
@ -162,10 +162,10 @@ void ScalesCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((laraItem->Animation.FrameNumber >= GetAnimData(*laraItem, LA_WATERSKIN_POUR_LOW).frameBase + 44 &&
|
if (laraItem->Animation.FrameNumber >= g_Level.Anims[LA_WATERSKIN_POUR_LOW].frameBase + 44 &&
|
||||||
laraItem->Animation.FrameNumber <= GetAnimData(*laraItem, LA_WATERSKIN_POUR_LOW).frameBase + 72) ||
|
laraItem->Animation.FrameNumber <= g_Level.Anims[LA_WATERSKIN_POUR_LOW].frameBase + 72 ||
|
||||||
(laraItem->Animation.FrameNumber >= GetAnimData(*laraItem, LA_WATERSKIN_POUR_HIGH).frameBase + 51 &&
|
laraItem->Animation.FrameNumber >= g_Level.Anims[LA_WATERSKIN_POUR_HIGH].frameBase + 51 &&
|
||||||
laraItem->Animation.FrameNumber <= GetAnimData(*laraItem, LA_WATERSKIN_POUR_HIGH).frameBase + 74))
|
laraItem->Animation.FrameNumber <= g_Level.Anims[LA_WATERSKIN_POUR_HIGH].frameBase + 74)
|
||||||
{
|
{
|
||||||
auto pos = GetJointPosition(laraItem, LM_LHAND).ToVector3();
|
auto pos = GetJointPosition(laraItem, LM_LHAND).ToVector3();
|
||||||
auto velocity = Vector3(0.0f, Random::GenerateFloat(32.0f, 64.0f), 0.0f);
|
auto velocity = Vector3(0.0f, Random::GenerateFloat(32.0f, 64.0f), 0.0f);
|
||||||
|
|
|
@ -443,7 +443,7 @@ void GameSticksCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* co
|
||||||
if (MoveLaraPosition(GameStixPosition, item, laraItem))
|
if (MoveLaraPosition(GameStixPosition, item, laraItem))
|
||||||
{
|
{
|
||||||
laraItem->Animation.AnimNumber = LA_SENET_ROLL;
|
laraItem->Animation.AnimNumber = LA_SENET_ROLL;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(*laraItem, LA_SENET_ROLL).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[LA_SENET_ROLL].frameBase;
|
||||||
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
laraItem->Animation.ActiveState = LS_MISC_CONTROL;
|
||||||
Lara.Control.IsMoving = false;
|
Lara.Control.IsMoving = false;
|
||||||
Lara.ExtraTorsoRot = { 0, 0, 0 };
|
Lara.ExtraTorsoRot = { 0, 0, 0 };
|
||||||
|
|
|
@ -15,12 +15,12 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (!TriggerActive(item))
|
if (!TriggerActive(item))
|
||||||
{
|
{
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
*((int*)&item->ItemFlags[0]) = 0;
|
*((int*)&item->ItemFlags[0]) = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (frameNumber <= 14 || frameNumber >= 31)
|
if (frameNumber <= 14 || frameNumber >= 31)
|
||||||
*((int*)&item->ItemFlags[0]) = 0;
|
*((int*)&item->ItemFlags[0]) = 0;
|
||||||
|
|
|
@ -12,12 +12,12 @@ namespace TEN::Entities::TR4
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
if (!TriggerActive(item))
|
if (!TriggerActive(item))
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd || frameNumber < 38)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd || frameNumber < 38)
|
||||||
item->ItemFlags[3] = 0;
|
item->ItemFlags[3] = 0;
|
||||||
else
|
else
|
||||||
item->ItemFlags[3] = 100;
|
item->ItemFlags[3] = 100;
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
//Shouldnt this be TR4_LIBRARY_COG_LOOP? Changed. Rollback if incorrect. Stranger1992 06/06/22
|
//Shouldnt this be TR4_LIBRARY_COG_LOOP? Changed. Rollback if incorrect. Stranger1992 06/06/22
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
item->Flags &= 0xC1;
|
item->Flags &= 0xC1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,12 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (!TriggerActive(item))
|
if (!TriggerActive(item))
|
||||||
{
|
{
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
*((int*)&item->ItemFlags[0]) = 0;
|
*((int*)&item->ItemFlags[0]) = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
if (frameNumber <= 5 ||
|
if (frameNumber <= 5 ||
|
||||||
frameNumber >= 58 ||
|
frameNumber >= 58 ||
|
||||||
frameNumber >= 8 && frameNumber <= 54)
|
frameNumber >= 8 && frameNumber <= 54)
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace TEN::Entities::TR4
|
||||||
void HammerControl(short itemNumber)
|
void HammerControl(short itemNumber)
|
||||||
{
|
{
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->ItemFlags[3] = HAMMER_HIT_DAMAGE;
|
item->ItemFlags[3] = HAMMER_HIT_DAMAGE;
|
||||||
|
|
||||||
if (!TriggerActive(item))
|
if (!TriggerActive(item))
|
||||||
|
@ -79,7 +79,7 @@ namespace TEN::Entities::TR4
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + HAMMER_ANIM_ACTIVATED;
|
item->Animation.AnimNumber = Objects[item->ObjectNumber].animIndex + HAMMER_ANIM_ACTIVATED;
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
item->Animation.ActiveState = HAMMER_STATE_ACTIVE;
|
item->Animation.ActiveState = HAMMER_STATE_ACTIVE;
|
||||||
item->Animation.TargetState = HAMMER_STATE_ACTIVE;
|
item->Animation.TargetState = HAMMER_STATE_ACTIVE;
|
||||||
item->ItemFlags[2] = HAMMER_OCB4_INTERVAL;
|
item->ItemFlags[2] = HAMMER_OCB4_INTERVAL;
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace TEN::Entities::TR4
|
||||||
if (mineItem->TriggerFlags && !mineItem->ItemFlags[3])
|
if (mineItem->TriggerFlags && !mineItem->ItemFlags[3])
|
||||||
{
|
{
|
||||||
if (laraItem->Animation.AnimNumber != LA_DETONATOR_USE ||
|
if (laraItem->Animation.AnimNumber != LA_DETONATOR_USE ||
|
||||||
laraItem->Animation.FrameNumber < GetAnimData(laraItem).frameBase + 57)
|
laraItem->Animation.FrameNumber < g_Level.Anims[laraItem->Animation.AnimNumber].frameBase + 57)
|
||||||
{
|
{
|
||||||
if (TestBoundsCollide(mineItem, laraItem, 512))
|
if (TestBoundsCollide(mineItem, laraItem, 512))
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,7 @@ namespace TEN::Entities::TR4
|
||||||
KillItem(itemNumber);
|
KillItem(itemNumber);
|
||||||
|
|
||||||
laraItem->Animation.AnimNumber = LA_MINE_DEATH;
|
laraItem->Animation.AnimNumber = LA_MINE_DEATH;
|
||||||
laraItem->Animation.FrameNumber = GetAnimData(*mineItem).frameBase;
|
laraItem->Animation.FrameNumber = g_Level.Anims[mineItem->Animation.AnimNumber].frameBase;
|
||||||
laraItem->Animation.ActiveState = LS_DEATH;
|
laraItem->Animation.ActiveState = LS_DEATH;
|
||||||
laraItem->Animation.Velocity.z = 0;
|
laraItem->Animation.Velocity.z = 0;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,6 @@ namespace TEN::Entities::TR4
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,12 @@ namespace TEN::Entities::TR4
|
||||||
auto* item = &g_Level.Items[itemNumber];
|
auto* item = &g_Level.Items[itemNumber];
|
||||||
|
|
||||||
if (!TriggerActive(item))
|
if (!TriggerActive(item))
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (item->Animation.FrameNumber == GetAnimData(item).frameEnd)
|
if (item->Animation.FrameNumber == g_Level.Anims[item->Animation.AnimNumber].frameEnd)
|
||||||
item->ItemFlags[3] = 0;
|
item->ItemFlags[3] = 0;
|
||||||
else
|
else
|
||||||
item->ItemFlags[3] = 200;
|
item->ItemFlags[3] = 200;
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
else if (item.Animation.ActiveState == SETHBLADE_STATE_ACTIVE)
|
else if (item.Animation.ActiveState == SETHBLADE_STATE_ACTIVE)
|
||||||
{
|
{
|
||||||
int frame = item.Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frame = item.Animation.FrameNumber - g_Level.Anims[item.Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if (frame >= 0 && frame <= 6)
|
if (frame >= 0 && frame <= 6)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
if (TriggerActive(item))
|
if (TriggerActive(item))
|
||||||
{
|
{
|
||||||
int frameNumber = item->Animation.FrameNumber - GetAnimData(item).frameBase;
|
int frameNumber = item->Animation.FrameNumber - g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
|
|
||||||
if ((frameNumber <= 14 || frameNumber >= 24) &&
|
if ((frameNumber <= 14 || frameNumber >= 24) &&
|
||||||
(frameNumber < 138 || frameNumber > 140))
|
(frameNumber < 138 || frameNumber > 140))
|
||||||
|
@ -36,7 +36,7 @@ namespace TEN::Entities::TR4
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->Animation.FrameNumber = GetAnimData(item).frameBase;
|
item->Animation.FrameNumber = g_Level.Anims[item->Animation.AnimNumber].frameBase;
|
||||||
*((int*)&item->ItemFlags[0]) = 0;
|
*((int*)&item->ItemFlags[0]) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,8 +65,8 @@ namespace TEN::Entities::Traps
|
||||||
|
|
||||||
if (TestCollision(item, laraItem) &&
|
if (TestCollision(item, laraItem) &&
|
||||||
TriggerActive(item) &&
|
TriggerActive(item) &&
|
||||||
item->Animation.FrameNumber > GetAnimData(item).frameBase + 20 && // Hardcoded frame range.
|
item->Animation.FrameNumber > g_Level.Anims[item->Animation.AnimNumber].frameBase + 20 && // Hardcoded frame range.
|
||||||
item->Animation.FrameNumber < GetAnimData(item).frameBase + 60)
|
item->Animation.FrameNumber < g_Level.Anims[item->Animation.AnimNumber].frameBase + 60)
|
||||||
{
|
{
|
||||||
// Blades deal damage cumulatively.
|
// Blades deal damage cumulatively.
|
||||||
for (int i = 0; i < StargateHarmJoints.size(); i++)
|
for (int i = 0; i < StargateHarmJoints.size(); i++)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue