mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 00:37:58 +03:00
Fix formatting
This commit is contained in:
parent
49477d2954
commit
dd6eaceff8
10 changed files with 94 additions and 88 deletions
|
@ -81,6 +81,11 @@ void ObjectInfo::SetBoneRotationFlags(int boneID, int flags)
|
||||||
g_Level.Bones[boneIndex + (boneID * 4)] |= flags;
|
g_Level.Bones[boneIndex + (boneID * 4)] |= flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectInfo::SetHitEffect(HitEffect hitEffect)
|
||||||
|
{
|
||||||
|
this->hitEffect = hitEffect;
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: Use if object is alive, but not intelligent, to set up blood effects.
|
// NOTE: Use if object is alive, but not intelligent, to set up blood effects.
|
||||||
void ObjectInfo::SetHitEffect(bool isSolid, bool isAlive)
|
void ObjectInfo::SetHitEffect(bool isSolid, bool isAlive)
|
||||||
{
|
{
|
||||||
|
@ -116,11 +121,6 @@ void ObjectInfo::SetHitEffect(bool isSolid, bool isAlive)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectInfo::SetExactHitEffect(HitEffect value)
|
|
||||||
{
|
|
||||||
hitEffect = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitializeGameFlags()
|
void InitializeGameFlags()
|
||||||
{
|
{
|
||||||
ZeroMemory(FlipMap, MAX_FLIPMAP * sizeof(int));
|
ZeroMemory(FlipMap, MAX_FLIPMAP * sizeof(int));
|
||||||
|
|
|
@ -106,8 +106,8 @@ struct ObjectInfo
|
||||||
std::function<void(ItemInfo* item)> drawRoutine = nullptr;
|
std::function<void(ItemInfo* item)> drawRoutine = nullptr;
|
||||||
|
|
||||||
void SetBoneRotationFlags(int boneID, int flags);
|
void SetBoneRotationFlags(int boneID, int flags);
|
||||||
|
void SetHitEffect(HitEffect hitEffect);
|
||||||
void SetHitEffect(bool isSolid = false, bool isAlive = false);
|
void SetHitEffect(bool isSolid = false, bool isAlive = false);
|
||||||
void SetExactHitEffect(HitEffect value);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ObjectHandler
|
class ObjectHandler
|
||||||
|
|
|
@ -813,7 +813,6 @@ void CreatureDie(int itemNumber, bool doExplosion)
|
||||||
|
|
||||||
case HitEffect::NonExplosive:
|
case HitEffect::NonExplosive:
|
||||||
return;
|
return;
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
flags |= BODY_DO_EXPLOSION;
|
flags |= BODY_DO_EXPLOSION;
|
||||||
|
|
|
@ -628,21 +628,21 @@ void InitializeItemArray(int totalItem)
|
||||||
NextItemFree = g_Level.NumItems;
|
NextItemFree = g_Level.NumItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
short SpawnItem(const ItemInfo& item, GAME_OBJECT_ID objectNumber)
|
short SpawnItem(const ItemInfo& item, GAME_OBJECT_ID objectID)
|
||||||
{
|
{
|
||||||
short itemNumber = CreateItem();
|
int itemNumber = CreateItem();
|
||||||
if (itemNumber != NO_ITEM)
|
if (itemNumber != NO_ITEM)
|
||||||
{
|
{
|
||||||
auto* spawn = &g_Level.Items[itemNumber];
|
auto& newItem = g_Level.Items[itemNumber];
|
||||||
|
|
||||||
spawn->ObjectNumber = objectNumber;
|
newItem.ObjectNumber = objectID;
|
||||||
spawn->RoomNumber = item.RoomNumber;
|
newItem.RoomNumber = item.RoomNumber;
|
||||||
memcpy(&spawn->Pose, &item.Pose, sizeof(Pose));
|
newItem.Pose = item.Pose;
|
||||||
spawn->Model.Color = Vector4::One;
|
newItem.Model.Color = Vector4::One;
|
||||||
|
|
||||||
InitializeItem(itemNumber);
|
InitializeItem(itemNumber);
|
||||||
|
|
||||||
spawn->Status = ITEM_NOT_ACTIVE;
|
newItem.Status = ITEM_NOT_ACTIVE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -197,6 +197,6 @@ int FindItem(ItemInfo* item);
|
||||||
void DoDamage(ItemInfo* item, int damage);
|
void DoDamage(ItemInfo* item, int damage);
|
||||||
void DoItemHit(ItemInfo* target, int damage, bool isExplosive, bool allowBurn = true);
|
void DoItemHit(ItemInfo* target, int damage, bool isExplosive, bool allowBurn = true);
|
||||||
void DefaultItemHit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex);
|
void DefaultItemHit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex);
|
||||||
short SpawnItem(const ItemInfo& item, GAME_OBJECT_ID objectNumber);
|
short SpawnItem(const ItemInfo& item, GAME_OBJECT_ID objectID);
|
||||||
|
|
||||||
Vector3i GetNearestSectorCenter(const Vector3i& pos);
|
Vector3i GetNearestSectorCenter(const Vector3i& pos);
|
||||||
|
|
|
@ -27,24 +27,27 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
|
|
||||||
InitializeCreature(itemNumber);
|
InitializeCreature(itemNumber);
|
||||||
|
|
||||||
if (item.ItemFlags[1] == 0) item.ItemFlags[1] = TRANSFORM_EFFECT_1_TIME;
|
if (item.ItemFlags[1] == 0)
|
||||||
if (item.ItemFlags[2] == 0) item.ItemFlags[2] = TRANSFORM_EFFECT_2_TIME;
|
item.ItemFlags[1] = TRANSFORM_EFFECT_1_TIME;
|
||||||
if (item.ItemFlags[3] == 0) item.ItemFlags[3] = TRANSFORM_EFFECT_3_TIME;
|
|
||||||
|
|
||||||
|
if (item.ItemFlags[2] == 0)
|
||||||
|
item.ItemFlags[2] = TRANSFORM_EFFECT_2_TIME;
|
||||||
|
|
||||||
|
if (item.ItemFlags[3] == 0)
|
||||||
|
item.ItemFlags[3] = TRANSFORM_EFFECT_3_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpawnBartoliTransformEffect(const ItemInfo& item, GAME_OBJECT_ID objectID)
|
static void SpawnBartoliTransformEffect(const ItemInfo& item, GAME_OBJECT_ID objectID)
|
||||||
{
|
{
|
||||||
int explosionItemNumber = SpawnItem(item, objectID);
|
int explosionItemNumber = SpawnItem(item, objectID);
|
||||||
|
|
||||||
//Activates the new item
|
// Activates item.
|
||||||
AddActiveItem(explosionItemNumber);
|
AddActiveItem(explosionItemNumber);
|
||||||
auto& explosionItem = g_Level.Items[explosionItemNumber];
|
auto& explosionItem = g_Level.Items[explosionItemNumber];
|
||||||
explosionItem.Status = ITEM_ACTIVE;
|
explosionItem.Status = ITEM_ACTIVE;
|
||||||
|
|
||||||
// Time before fading away.
|
// Set fade timer.
|
||||||
explosionItem.Timer = EXPLOSION_LIVE_TIME;
|
explosionItem.Timer = EXPLOSION_LIVE_TIME;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlBartoli(short itemNumber)
|
void ControlBartoli(short itemNumber)
|
||||||
|
@ -81,12 +84,14 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
SpawnBartoliTransformEffect(item, ID_SPHERE_OF_DOOM);
|
SpawnBartoliTransformEffect(item, ID_SPHERE_OF_DOOM);
|
||||||
SoundEffect(SFX_TR2_MARCO_BARTOLLI_TRANSFORM, &item.Pose);
|
SoundEffect(SFX_TR2_MARCO_BARTOLLI_TRANSFORM, &item.Pose);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effectTimer == timeExplosion2)
|
if (effectTimer == timeExplosion2)
|
||||||
{
|
{
|
||||||
TriggerDynamicLight(lightPos, lightColor, transformationLightFalloff);
|
TriggerDynamicLight(lightPos, lightColor, transformationLightFalloff);
|
||||||
SpawnBartoliTransformEffect(item, ID_SPHERE_OF_DOOM2);
|
SpawnBartoliTransformEffect(item, ID_SPHERE_OF_DOOM2);
|
||||||
SoundEffect(SFX_TR2_MARCO_BARTOLLI_TRANSFORM, &item.Pose);
|
SoundEffect(SFX_TR2_MARCO_BARTOLLI_TRANSFORM, &item.Pose);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effectTimer == timeExplosion3)
|
if (effectTimer == timeExplosion3)
|
||||||
{
|
{
|
||||||
TriggerDynamicLight(lightPos, lightColor, transformationLightFalloff);
|
TriggerDynamicLight(lightPos, lightColor, transformationLightFalloff);
|
||||||
|
@ -95,11 +100,10 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
KillItem(itemNumber);
|
KillItem(itemNumber);
|
||||||
|
|
||||||
TestTriggers(&item, true);
|
TestTriggers(&item, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlBartoliTransformEffect(int itemNumber)
|
void ControlBartoliTransformEffect(short itemNumber)
|
||||||
{
|
{
|
||||||
constexpr auto SCALE_RATE = Vector3(0.7f);
|
constexpr auto SCALE_RATE = Vector3(0.7f);
|
||||||
constexpr auto OPACITY_CHANGE_RATE = 1.0f;
|
constexpr auto OPACITY_CHANGE_RATE = 1.0f;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
enum GAME_OBJECT_ID : short;
|
|
||||||
struct CollisionInfo;
|
struct CollisionInfo;
|
||||||
struct ItemInfo;
|
struct ItemInfo;
|
||||||
|
|
||||||
|
@ -8,6 +7,5 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
{
|
{
|
||||||
void InitializeBartoli(short itemNumber);
|
void InitializeBartoli(short itemNumber);
|
||||||
void ControlBartoli(short itemNumber);
|
void ControlBartoli(short itemNumber);
|
||||||
|
void ControlBartoliTransformEffect(short itemNumber);
|
||||||
void ControlBartoliTransformEffect(int itemNumber);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,6 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
const auto DragonSwipeAttackJointsLeft = std::vector<unsigned int>{ 24, 25, 26, 27, 28, 29, 30 };
|
const auto DragonSwipeAttackJointsLeft = std::vector<unsigned int>{ 24, 25, 26, 27, 28, 29, 30 };
|
||||||
const auto DragonSwipeAttackJointsRight = std::vector<unsigned int>{ 1, 2, 3, 4, 5, 6, 7 };
|
const auto DragonSwipeAttackJointsRight = std::vector<unsigned int>{ 1, 2, 3, 4, 5, 6, 7 };
|
||||||
|
|
||||||
const auto SPRITE_ANIMATION = Random::GenerateInt(0, 10);
|
|
||||||
|
|
||||||
enum class DragonLightEffectType
|
enum class DragonLightEffectType
|
||||||
{
|
{
|
||||||
Yellow,
|
Yellow,
|
||||||
|
@ -213,10 +211,9 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Demagic.
|
|
||||||
// TODO: Smoke and sparks.
|
// TODO: Smoke and sparks.
|
||||||
// TODO: Animate flame sprite sequence.
|
// TODO: Animate flame sprite sequence.
|
||||||
static void SpawnDragonFireBreath(const ItemInfo& item, const CreatureBiteInfo& bite, const ItemInfo& targetItem, float vel)
|
static void SpawnDragonFireBreathEffect(const ItemInfo& item, const CreatureBiteInfo& bite)
|
||||||
{
|
{
|
||||||
constexpr auto FIRE_COUNT = 3;
|
constexpr auto FIRE_COUNT = 3;
|
||||||
constexpr auto SPHERE_RADIUS = BLOCK(0.2f);
|
constexpr auto SPHERE_RADIUS = BLOCK(0.2f);
|
||||||
|
@ -233,7 +230,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
|
|
||||||
auto dir = target - origin;
|
auto dir = target - origin;
|
||||||
dir.Normalize();
|
dir.Normalize();
|
||||||
dir *= vel;
|
dir *= 300.0f;
|
||||||
|
|
||||||
fire.spriteIndex = Objects[ID_FIRE_SPRITES].meshIndex;
|
fire.spriteIndex = Objects[ID_FIRE_SPRITES].meshIndex;
|
||||||
|
|
||||||
|
@ -272,53 +269,60 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpawnDragonInhale(const ItemInfo& item, const CreatureBiteInfo& bite, const ItemInfo& targetItem, float vel)
|
static void SpawnDragonSmokeBreathEffect(const ItemInfo& item, const CreatureBiteInfo& bite)
|
||||||
{
|
{
|
||||||
constexpr auto SMOKE_COUNT = 2;
|
constexpr auto SMOKE_COUNT = 2;
|
||||||
constexpr auto SPHERE_RADIUS = BLOCK(0.5f);
|
constexpr auto SPHERE_RADIUS = BLOCK(0.25f);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < SMOKE_COUNT; i++)
|
for (int i = 0; i < SMOKE_COUNT; i++)
|
||||||
{
|
{
|
||||||
auto& inhale = *GetFreeParticle();
|
|
||||||
|
|
||||||
auto origin = GetJointPosition(item, bite.BoneID, bite.Position).ToVector3();
|
auto origin = GetJointPosition(item, bite.BoneID, bite.Position).ToVector3();
|
||||||
auto target = GetJointPosition(LaraItem, LM_HIPS).ToVector3();
|
auto target = GetJointPosition(LaraItem, LM_HIPS).ToVector3();
|
||||||
|
|
||||||
auto sphere = BoundingSphere(origin, SPHERE_RADIUS);
|
auto sphere = BoundingSphere(origin, SPHERE_RADIUS);
|
||||||
auto pos = Random::GeneratePointInSphere(sphere);
|
auto pos = Random::GeneratePointInSphere(sphere);
|
||||||
int v = Random::GenerateFloat(0.75f, 1.0f) * UCHAR_MAX;
|
auto vel = Random::GenerateDirection() * Random::GenerateFloat(0.0f, 1.0f);
|
||||||
|
|
||||||
auto dir = target - origin;
|
auto dir = target - origin;
|
||||||
dir.Normalize();
|
dir.Normalize();
|
||||||
|
|
||||||
inhale.spriteIndex = Objects[ID_SMOKE_SPRITES].meshIndex + SPRITE_ANIMATION;
|
int spriteID = Random::GenerateInt(0, 10);
|
||||||
inhale.x = pos.x;
|
|
||||||
inhale.y = pos.y;
|
|
||||||
inhale.z = pos.z;
|
|
||||||
inhale.on = true;
|
|
||||||
inhale.sR = 128, inhale.sG = 128, inhale.sB = 128;
|
|
||||||
inhale.dR = 128, inhale.dG = 64, inhale.dB = 0;
|
|
||||||
inhale.colFadeSpeed = 128;
|
|
||||||
inhale.fadeToBlack = 64;
|
|
||||||
inhale.blendMode = BlendMode::Lighten;
|
|
||||||
inhale.life = inhale.sLife = Random::GenerateInt(10,60);
|
|
||||||
inhale.yVel = Random::GenerateFloat(-1.0f, 0.5f);
|
|
||||||
inhale.xVel = Random::GenerateFloat(-1.0f, 0.5f);
|
|
||||||
inhale.zVel = Random::GenerateFloat(-1.0f, 0.5f);
|
|
||||||
|
|
||||||
inhale.friction = 0;
|
auto& smoke = *GetFreeParticle();
|
||||||
inhale.gravity = -30;
|
|
||||||
inhale.maxYvel = 5;
|
|
||||||
inhale.flags = SP_DEF | SP_ROTATE | SP_FIRE;
|
|
||||||
|
|
||||||
inhale.scalar = 0.1f;
|
smoke.spriteIndex = Objects[ID_SMOKE_SPRITES].meshIndex + spriteID;
|
||||||
inhale.dSize = BLOCK(0.1f);
|
smoke.on = true;
|
||||||
inhale.sSize = BLOCK(0.5f);
|
smoke.x = pos.x;
|
||||||
inhale.size = inhale.dSize/8;
|
smoke.y = pos.y;
|
||||||
inhale.flags = SP_WIND | SP_SCALE | SP_DEF | SP_ROTATE | SP_EXPDEF;
|
smoke.z = pos.z;
|
||||||
|
smoke.yVel = vel.x;
|
||||||
|
smoke.xVel = vel.y;
|
||||||
|
smoke.zVel = vel.z;
|
||||||
|
smoke.sR = 0.5f * UCHAR_MAX;
|
||||||
|
smoke.sG = 0.5f * UCHAR_MAX;
|
||||||
|
smoke.sB = 0.5f * UCHAR_MAX;
|
||||||
|
smoke.dR = 0.5f * UCHAR_MAX;
|
||||||
|
smoke.dG = 0.25f * UCHAR_MAX;
|
||||||
|
smoke.dB = 0;
|
||||||
|
smoke.colFadeSpeed = 128;
|
||||||
|
smoke.fadeToBlack = 64;
|
||||||
|
smoke.blendMode = BlendMode::Lighten;
|
||||||
|
smoke.life = smoke.sLife = Random::GenerateInt(10, 60);
|
||||||
|
|
||||||
|
smoke.friction = 0;
|
||||||
|
smoke.gravity = -30;
|
||||||
|
smoke.maxYvel = 5;
|
||||||
|
smoke.flags = SP_DEF | SP_ROTATE | SP_FIRE;
|
||||||
|
|
||||||
|
smoke.scalar = 0.1f;
|
||||||
|
smoke.dSize = BLOCK(0.1f);
|
||||||
|
smoke.sSize = BLOCK(0.5f);
|
||||||
|
smoke.size = smoke.dSize/8;
|
||||||
|
smoke.flags = SP_WIND | SP_SCALE | SP_DEF | SP_ROTATE | SP_EXPDEF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpawnDragonShockwave(const ItemInfo& item, int jointIndex)
|
static void SpawnDragonShockwaveEffect(const ItemInfo& item, int jointIndex)
|
||||||
{
|
{
|
||||||
auto pos = GetJointPosition(item, jointIndex, Vector3i(0, -8, 0));
|
auto pos = GetJointPosition(item, jointIndex, Vector3i(0, -8, 0));
|
||||||
|
|
||||||
|
@ -356,7 +360,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
auto& timer = item.ItemFlags[1];
|
auto& timer = item.ItemFlags[1];
|
||||||
|
|
||||||
short headingAngle = 0;
|
short headingAngle = 0;
|
||||||
short headYRot = 0;
|
short headOrient = 0;
|
||||||
|
|
||||||
bool isTargetAhead = false;
|
bool isTargetAhead = false;
|
||||||
|
|
||||||
|
@ -477,7 +481,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
creature.Flags = 0;
|
creature.Flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnDragonShockwave(item, DragonSwipeAttackJointsLeft[3]);
|
SpawnDragonShockwaveEffect(item, DragonSwipeAttackJointsLeft[3]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -488,7 +492,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
creature.Flags = 0;
|
creature.Flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnDragonShockwave(item, DragonSwipeAttackJointsRight[3]);
|
SpawnDragonShockwaveEffect(item, DragonSwipeAttackJointsRight[3]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -550,8 +554,8 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
item.Pose.Orientation.y -= headingAngle;
|
item.Pose.Orientation.y -= headingAngle;
|
||||||
|
|
||||||
if (ai.ahead)
|
if (ai.ahead)
|
||||||
headYRot = -ai.angle;
|
headOrient = -ai.angle;
|
||||||
SpawnDragonInhale(item, DragonMouthBite, *creature.Enemy, 100.0f);
|
SpawnDragonSmokeBreathEffect(item, DragonMouthBite);
|
||||||
|
|
||||||
if (isTargetAhead)
|
if (isTargetAhead)
|
||||||
{
|
{
|
||||||
|
@ -571,14 +575,16 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
SoundEffect(SFX_TR2_DRAGON_FIRE, &item.Pose);
|
SoundEffect(SFX_TR2_DRAGON_FIRE, &item.Pose);
|
||||||
|
|
||||||
if (ai.ahead)
|
if (ai.ahead)
|
||||||
headYRot = -ai.angle;
|
headOrient = -ai.angle;
|
||||||
SpawnDragonInhale(item, DragonMouthBite, *creature.Enemy, 20.0f);
|
SpawnDragonSmokeBreathEffect(item, DragonMouthBite);
|
||||||
|
|
||||||
if (creature.Flags)
|
if (creature.Flags)
|
||||||
{
|
{
|
||||||
if (ai.ahead)
|
if (ai.ahead)
|
||||||
SpawnDragonFireBreath(item, DragonMouthBite, *creature.Enemy, 300.0f);
|
{
|
||||||
SpawnDragonInhale(item, DragonMouthBite, *creature.Enemy, 1000.0f);
|
SpawnDragonFireBreathEffect(item, DragonMouthBite);
|
||||||
|
SpawnDragonSmokeBreathEffect(item, DragonMouthBite);
|
||||||
|
}
|
||||||
|
|
||||||
creature.Flags--;
|
creature.Flags--;
|
||||||
}
|
}
|
||||||
|
@ -593,7 +599,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
|
|
||||||
if (timer >= 0)
|
if (timer >= 0)
|
||||||
{
|
{
|
||||||
CreatureJoint(&item, 0, headYRot);
|
CreatureJoint(&item, 0, headOrient);
|
||||||
CreatureAnimation(itemNumber, headingAngle, 0);
|
CreatureAnimation(itemNumber, headingAngle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -636,7 +642,7 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
//SetAnimation(*playerItem, ID_LARA_EXTRA_ANIMS, LEA_PULL_DAGGER_FROM_DRAGON);
|
//SetAnimation(*playerItem, ID_LARA_EXTRA_ANIMS, LEA_PULL_DAGGER_FROM_DRAGON);
|
||||||
//playerItem.Pose = item.Pose;
|
//playerItem.Pose = item.Pose;
|
||||||
|
|
||||||
// Temporarily use small button push animation.
|
// HACK: Temporarily use small button push animation.
|
||||||
SetAnimation(playerItem, LA_BUTTON_SMALL_PUSH);
|
SetAnimation(playerItem, LA_BUTTON_SMALL_PUSH);
|
||||||
|
|
||||||
ResetPlayerFlex(&playerItem);
|
ResetPlayerFlex(&playerItem);
|
||||||
|
@ -668,21 +674,23 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
void CollideDragonFront(short itemNumber, ItemInfo* playerItem, CollisionInfo* coll)
|
void CollideDragonFront(short itemNumber, ItemInfo* playerItem, CollisionInfo* coll)
|
||||||
{
|
{
|
||||||
auto& item = g_Level.Items[itemNumber];
|
auto& item = g_Level.Items[itemNumber];
|
||||||
|
const auto& player = *GetLaraInfo(playerItem);
|
||||||
|
|
||||||
if (item.Animation.ActiveState == DRAGON_STATE_DEFEAT &&
|
if (item.Animation.ActiveState == DRAGON_STATE_DEFEAT &&
|
||||||
item.TriggerFlags == DRAGON_OCB_NORMAL)
|
item.TriggerFlags == DRAGON_OCB_NORMAL)
|
||||||
{
|
{
|
||||||
HandleDaggerPickup(item, *playerItem);
|
HandleDaggerPickup(item, *playerItem);
|
||||||
|
|
||||||
auto& player = *GetLaraInfo(playerItem);
|
|
||||||
|
|
||||||
if (player.Control.IsMoving &&
|
if (player.Control.IsMoving &&
|
||||||
player.Context.InteractedItem == item.Index ||
|
player.Context.InteractedItem == item.Index ||
|
||||||
playerItem->Animation.AnimNumber == GetAnimIndex(item, LA_BUTTON_SMALL_PUSH))
|
playerItem->Animation.AnimNumber == GetAnimIndex(item, LA_BUTTON_SMALL_PUSH))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
CreatureCollision(itemNumber, playerItem, coll);
|
CreatureCollision(itemNumber, playerItem, coll);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -698,5 +706,4 @@ namespace TEN::Entities::Creatures::TR2
|
||||||
if (item.HitPoints > 0)
|
if (item.HitPoints > 0)
|
||||||
CreatureCollision(itemNumber, playerItem, coll);
|
CreatureCollision(itemNumber, playerItem, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class GameVector;
|
|
||||||
struct CollisionInfo;
|
struct CollisionInfo;
|
||||||
struct CreatureBiteInfo;
|
|
||||||
struct ItemInfo;
|
struct ItemInfo;
|
||||||
|
|
||||||
namespace TEN::Entities::Creatures::TR2
|
namespace TEN::Entities::Creatures::TR2
|
||||||
|
|
|
@ -442,7 +442,7 @@ static void StartEntity(ObjectInfo* obj)
|
||||||
obj->intelligent = true;
|
obj->intelligent = true;
|
||||||
obj->LotType = LotType::Blockable;
|
obj->LotType = LotType::Blockable;
|
||||||
obj->SetBoneRotationFlags(10, ROT_Z);
|
obj->SetBoneRotationFlags(10, ROT_Z);
|
||||||
obj->SetExactHitEffect(HitEffect::NonExplosive);
|
obj->SetHitEffect(HitEffect::NonExplosive);
|
||||||
}
|
}
|
||||||
|
|
||||||
obj = &Objects[ID_DRAGON_BACK];
|
obj = &Objects[ID_DRAGON_BACK];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue