mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-08 03:28:03 +03:00
latest changes
This commit is contained in:
parent
ab64f466ff
commit
9eafbdc1aa
9 changed files with 36 additions and 51 deletions
|
@ -1592,9 +1592,8 @@ void ProcessEffects(ItemInfo* item)
|
|||
{
|
||||
if (item->Effect.Type == EffectType::Fire ||
|
||||
item->Effect.Type == EffectType::ColoredFire ||
|
||||
item->Effect.Type == EffectType::MagicFire ||
|
||||
item->Effect.Type == EffectType::ElectricDeath ||
|
||||
item->Effect.Type == EffectType::LaserDeath)
|
||||
item->Effect.Type == EffectType::ElectricIgnite ||
|
||||
item->Effect.Type == EffectType::RedIgnite)
|
||||
{
|
||||
item->Effect.Type = EffectType::Smoke;
|
||||
item->Effect.Count = BURN_AFTERMATH_TIMEOUT;
|
||||
|
@ -1620,14 +1619,9 @@ void ProcessEffects(ItemInfo* item)
|
|||
break;
|
||||
|
||||
case EffectType::ColoredFire:
|
||||
if (TestProbability(1 / 8.0f))
|
||||
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Trail : FlameType::Medium, item->Effect.EffectColor1, item->Effect.EffectColor2);
|
||||
break;
|
||||
|
||||
case EffectType::MagicFire:
|
||||
if (TestProbability(1 / 8.0f))
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Trail : FlameType::Medium, item->Effect.EffectColor1, item->Effect.EffectColor2);
|
||||
if (TestProbability(1 / 8.0f))
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Trail : FlameType::Medium,
|
||||
item->Effect.EffectColor1, item->Effect.EffectColor2);
|
||||
break;
|
||||
|
||||
case EffectType::Sparks:
|
||||
|
@ -1638,17 +1632,19 @@ void ProcessEffects(ItemInfo* item)
|
|||
TriggerRocketSmoke(pos.x, pos.y, pos.z, 0);
|
||||
break;
|
||||
|
||||
case EffectType::ElectricDeath:
|
||||
case EffectType::ElectricIgnite:
|
||||
if (TestProbability(1 / 1.0f))
|
||||
TriggerElectricSpark(&GameVector(pos.x, pos.y, pos.z, item->RoomNumber),
|
||||
EulerAngles(0, Random::GenerateAngle(ANGLE(0), ANGLE(359)), 0), 2);
|
||||
if (TestProbability(1 / 1.0f))
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Medium : FlameType::Medium, Vector3(0.2f, 0.5f, 1.0f), Vector3(0.2f, 0.8f, 1.0f));
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Medium : FlameType::Medium,
|
||||
Vector3(0.2f, 0.5f, 1.0f), Vector3(0.2f, 0.8f, 1.0f));
|
||||
break;
|
||||
|
||||
case EffectType::LaserDeath:
|
||||
case EffectType::RedIgnite:
|
||||
if (TestProbability(1 / 1.0f))
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Medium : FlameType::Medium, Vector3(1.0f, 0.5f, 0.2f), Vector3(0.6f, 0.1f, 0.0f));
|
||||
TriggerFireFlame(pos.x, pos.y, pos.z, TestProbability(1 / 10.0f) ? FlameType::Medium : FlameType::Medium,
|
||||
Vector3(1.0f, 0.5f, 0.2f), Vector3(0.6f, 0.1f, 0.0f));
|
||||
break;
|
||||
|
||||
case EffectType::Smoke:
|
||||
|
@ -1676,14 +1672,13 @@ void ProcessEffects(ItemInfo* item)
|
|||
SoundEffect(SOUND_EFFECTS::SFX_TR5_HISS_LOOP_SMALL, &item->Pose);
|
||||
break;
|
||||
|
||||
case EffectType::ElectricDeath:
|
||||
case EffectType::ElectricIgnite:
|
||||
case EffectType::Sparks:
|
||||
SoundEffect(SOUND_EFFECTS::SFX_TR4_LARA_ELECTRIC_CRACKLES, &item->Pose);
|
||||
break;
|
||||
|
||||
case EffectType::Fire:
|
||||
case EffectType::ColoredFire:
|
||||
case EffectType::MagicFire:
|
||||
SoundEffect(SOUND_EFFECTS::SFX_TR4_LOOP_FOR_SMALL_FIRES, &item->Pose);
|
||||
break;
|
||||
}
|
||||
|
@ -1699,9 +1694,12 @@ void ProcessEffects(ItemInfo* item)
|
|||
|
||||
int waterHeight = GetWaterHeight(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, item->RoomNumber);
|
||||
|
||||
if (item->Effect.Type != EffectType::MagicFire && item->Effect.Type != EffectType::Sparks && (waterHeight != NO_HEIGHT && item->Pose.Position.y > waterHeight))
|
||||
if (item->Effect.Type != EffectType::Sparks && (waterHeight != NO_HEIGHT && item->Pose.Position.y > waterHeight))
|
||||
{
|
||||
if (item->Effect.Type == EffectType::Fire || item->Effect.Type == EffectType::ColoredFire || item->Effect.Type == EffectType::MagicFire)
|
||||
if (item->Effect.Type == EffectType::Fire ||
|
||||
item->Effect.Type == EffectType::ColoredFire ||
|
||||
item->Effect.Type == EffectType::ElectricIgnite ||
|
||||
item->Effect.Type == EffectType::RedIgnite)
|
||||
{
|
||||
item->Effect.Type = EffectType::Smoke;
|
||||
item->Effect.Count = 10;
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace TEN::Effects::Items
|
|||
|
||||
void ItemColorBurn(ItemInfo* item, Vector3 color1, Vector3 color2, int timeout)
|
||||
{
|
||||
item->Effect.Type = EffectType::ColoredFire;
|
||||
item->Effect.Count = timeout;
|
||||
item->Effect.LightColor = color1;
|
||||
item->Effect.EffectColor1 = color1;
|
||||
|
@ -42,15 +43,15 @@ namespace TEN::Effects::Items
|
|||
|
||||
void ItemBlueElectricBurn(ItemInfo* item, int timeout)
|
||||
{
|
||||
item->Effect.Type = EffectType::ElectricDeath;
|
||||
item->Effect.Count = 2;
|
||||
item->Effect.Type = EffectType::ElectricIgnite;
|
||||
item->Effect.Count = timeout /FPS;
|
||||
item->Effect.LightColor = Vector3(0.0f, 0.6f, 1.0f);
|
||||
}
|
||||
|
||||
void ItemRedLaserBurn(ItemInfo* item, int timeout)
|
||||
{
|
||||
item->Effect.Type = EffectType::LaserDeath;
|
||||
item->Effect.Count = 2;
|
||||
item->Effect.Type = EffectType::RedIgnite;
|
||||
item->Effect.Count = timeout /FPS;
|
||||
item->Effect.LightColor = Vector3(1.0f, 0.4f, 0.0f);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,10 +62,9 @@ enum class EffectType
|
|||
Fire,
|
||||
Sparks,
|
||||
Smoke,
|
||||
MagicFire,
|
||||
ColoredFire,
|
||||
ElectricDeath,
|
||||
LaserDeath
|
||||
ElectricIgnite,
|
||||
RedIgnite
|
||||
};
|
||||
|
||||
struct EntityAnimationData
|
||||
|
|
|
@ -274,7 +274,6 @@ namespace TEN::Entities::Effects
|
|||
{
|
||||
TriggerShockwave(&fx->pos, 48, 240, 64, 64, 128, 0, 24, 0, 0);
|
||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 2, fx->roomNumber);
|
||||
LaraItem->Effect.Type = EffectType::MagicFire;
|
||||
ItemColorBurn(LaraItem, Vector3(0.0f, 0.8f, 0.1f), Vector3(0.0f, 0.9f, 0.8f), -1);
|
||||
}
|
||||
else if (fx->flag1)
|
||||
|
|
|
@ -226,7 +226,7 @@ void ElectricityWiresControl(short itemNumber)
|
|||
{
|
||||
if (collItem->Effect.Type != EffectType::Smoke)
|
||||
{
|
||||
ItemBlueElectricBurn(collItem, 2);
|
||||
ItemBlueElectricBurn(collItem, 2 *FPS);
|
||||
}
|
||||
else
|
||||
ItemSmoke(collItem, -1);
|
||||
|
|
|
@ -492,8 +492,7 @@ namespace TEN::Entities::TR4
|
|||
if (LaraItem->HitPoints < 0)
|
||||
{
|
||||
SethaKill(item, LaraItem);
|
||||
LaraItem->Effect.Type = EffectType::MagicFire;
|
||||
ItemColorBurn(LaraItem, Vector3(0.0f, 0.8f, 0.1f), Vector3(0.0f, 0.9f, 0.8f), -1);
|
||||
ItemColorBurn(LaraItem, Vector3(0.0f, 0.8f, 0.1f), Vector3(0.0f, 0.9f, 0.8f), 6 *FPS);
|
||||
creature->MaxTurn = 0;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@ static const std::unordered_map<std::string, EffectType> kEffectIDs
|
|||
{"FIRE", EffectType::Fire},
|
||||
{"SPARKS", EffectType::Sparks},
|
||||
{"SMOKE", EffectType::Smoke},
|
||||
{"MAGICFIRE", EffectType::MagicFire},
|
||||
{"COLOREDFIRE", EffectType::ColoredFire},
|
||||
{"ELECTRICDEATH", EffectType::ElectricDeath},
|
||||
{"LASERDEATH", EffectType::LaserDeath}
|
||||
{"ELECTRICIGNITE", EffectType::ElectricIgnite},
|
||||
{"REDIGNITE", EffectType::RedIgnite}
|
||||
};
|
||||
|
|
|
@ -172,11 +172,6 @@ void Moveable::Register(sol::table & parent)
|
|||
// @tparam float timeout time (in seconds) after which effect turns off (optional).
|
||||
ScriptReserved_SetEffect, &Moveable::SetEffect,
|
||||
|
||||
/// Get current moveable effect
|
||||
// @function Moveable:GetEffect
|
||||
// @treturn EffectID effect type currently assigned to moveable.
|
||||
ScriptReserved_GetEffect, &Moveable::GetEffect,
|
||||
|
||||
/// Set extended effect to moveable
|
||||
// @function Moveable:SetCustomEffect
|
||||
// @tparam EffectID effect Type of effect to assign.
|
||||
|
@ -184,6 +179,11 @@ void Moveable::Register(sol::table & parent)
|
|||
// @tparam float timeout time (in seconds) after which effect turns off (optional).
|
||||
ScriptReserved_SetCustomEffect, &Moveable::SetCustomEffect,
|
||||
|
||||
/// Get current moveable effect
|
||||
// @function Moveable:GetEffect
|
||||
// @treturn EffectID effect type currently assigned to moveable.
|
||||
ScriptReserved_GetEffect, & Moveable::GetEffect,
|
||||
|
||||
/// Get the status of object.
|
||||
// possible values:
|
||||
// <br />0 - not active
|
||||
|
@ -690,11 +690,11 @@ void Moveable::SetEffect(EffectType effectType, sol::optional<float> timeout)
|
|||
ItemElectricBurn(m_item, realTimeout);
|
||||
break;
|
||||
|
||||
case EffectType::ElectricDeath:
|
||||
case EffectType::ElectricIgnite:
|
||||
ItemBlueElectricBurn(m_item, realTimeout);
|
||||
break;
|
||||
|
||||
case EffectType::LaserDeath:
|
||||
case EffectType::RedIgnite:
|
||||
ItemRedLaserBurn(m_item, realTimeout);
|
||||
break;
|
||||
}
|
||||
|
@ -706,18 +706,7 @@ void Moveable::SetCustomEffect(EffectType effectType, const ScriptColor& col1, c
|
|||
Vector3 color1 = Vector3(col1.GetR() * (1.f / 255.f), col1.GetG() * (1.f / 255.f), col1.GetB() * (1.f / 255.f));
|
||||
Vector3 color2 = Vector3(col2.GetR() * (1.f / 255.f), col2.GetG() * (1.f / 255.f), col2.GetB() * (1.f / 255.f));
|
||||
|
||||
switch (effectType)
|
||||
{
|
||||
case EffectType::MagicFire:
|
||||
m_item->Effect.Type = EffectType::MagicFire;
|
||||
ItemColorBurn(m_item, color1, color2, realTimeout);
|
||||
break;
|
||||
|
||||
case EffectType::ColoredFire:
|
||||
m_item->Effect.Type = EffectType::ColoredFire;
|
||||
ItemColorBurn(m_item, color1, color2, realTimeout);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EffectType Moveable::GetEffect() const
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
[[nodiscard]] EffectType GetEffect() const;
|
||||
void SetEffect(EffectType effectType, sol::optional<float> timeout);
|
||||
void SetCustomEffect(EffectType effectType, const ScriptColor& col1, const ScriptColor& col2, sol::optional<float> timeout);
|
||||
|
||||
[[nodiscard]] aiBitsType GetAIBits() const;
|
||||
void SetAIBits(aiBitsType const & bits);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue