Eliminate burn pyro types (PT_BURNO/T)
parent
ed9701545d
commit
272f80faf9
|
@ -292,8 +292,9 @@ public:
|
||||||
|
|
||||||
class CBurnPyro : public CPyro
|
class CBurnPyro : public CPyro
|
||||||
{
|
{
|
||||||
|
bool m_organicBurn;
|
||||||
public:
|
public:
|
||||||
CBurnPyro(PyroType type, CObject *obj);
|
CBurnPyro(CObject *obj);
|
||||||
void AfterCreate() override;
|
void AfterCreate() override;
|
||||||
void UpdateEffect() override;
|
void UpdateEffect() override;
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,6 @@ enum PyroType
|
||||||
PT_SHOTW = 12, //! < hit under water (TODO: check if unused)
|
PT_SHOTW = 12, //! < hit under water (TODO: check if unused)
|
||||||
|
|
||||||
// Other subclasses
|
// Other subclasses
|
||||||
PT_BURNT = 14, //! < burning of technical object
|
|
||||||
PT_BURNO = 15, //! < burning of organic object
|
|
||||||
PT_WIN = 22, //! < fireworks
|
PT_WIN = 22, //! < fireworks
|
||||||
PT_LOST = 23, //! < black smoke
|
PT_LOST = 23, //! < black smoke
|
||||||
|
|
||||||
|
|
|
@ -32,25 +32,28 @@
|
||||||
|
|
||||||
using namespace Gfx;
|
using namespace Gfx;
|
||||||
|
|
||||||
CBurnPyro::CBurnPyro(PyroType type, CObject *obj)
|
CBurnPyro::CBurnPyro(CObject *obj)
|
||||||
: CPyro(type, obj)
|
: CPyro(PT_OTHER, obj)
|
||||||
|
, m_organicBurn(obj->GetType() == OBJECT_MOTHER ||
|
||||||
|
obj->GetType() == OBJECT_ANT ||
|
||||||
|
obj->GetType() == OBJECT_SPIDER ||
|
||||||
|
obj->GetType() == OBJECT_BEE ||
|
||||||
|
obj->GetType() == OBJECT_WORM ||
|
||||||
|
obj->GetType() == OBJECT_BULLET)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void CBurnPyro::AfterCreate()
|
void CBurnPyro::AfterCreate()
|
||||||
{
|
{
|
||||||
assert( m_type == PT_BURNT || m_type == PT_BURNO );
|
|
||||||
|
|
||||||
m_soundChannel = m_sound->Play(SOUND_BURN, m_pos, 1.0f, 1.0f, true);
|
m_soundChannel = m_sound->Play(SOUND_BURN, m_pos, 1.0f, 1.0f, true);
|
||||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 12.0f, SOPER_CONTINUE);
|
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 12.0f, SOPER_CONTINUE);
|
||||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.0f, 5.0f, SOPER_STOP);
|
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.0f, 5.0f, SOPER_STOP);
|
||||||
|
|
||||||
if ( m_type == PT_BURNO )
|
if (m_organicBurn)
|
||||||
{
|
{
|
||||||
m_sound->Play(SOUND_DEADi, m_pos);
|
m_sound->Play(SOUND_DEADi, m_pos);
|
||||||
m_sound->Play(SOUND_DEADi, m_engine->GetEyePt());
|
m_sound->Play(SOUND_DEADi, m_engine->GetEyePt());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if ( m_type == PT_BURNT )
|
|
||||||
{
|
{
|
||||||
BurnStart();
|
BurnStart();
|
||||||
}
|
}
|
||||||
|
@ -108,7 +111,7 @@ void CBurnPyro::UpdateEffect()
|
||||||
m_particle->CreateParticle(pos, speed, dim, PARTISMOKE3, 4.0f);
|
m_particle->CreateParticle(pos, speed, dim, PARTISMOKE3, 4.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_type == PT_BURNT )
|
if ( !m_organicBurn )
|
||||||
{
|
{
|
||||||
BurnProgress();
|
BurnProgress();
|
||||||
}
|
}
|
||||||
|
@ -699,7 +702,7 @@ void CBurnPyro::AfterEnd()
|
||||||
if (m_object == nullptr)
|
if (m_object == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_type == PT_BURNO) // organic object is burning?
|
if (m_organicBurn) // organic object is burning?
|
||||||
{
|
{
|
||||||
DeleteObject(true, true); // removes the insect
|
DeleteObject(true, true); // removes the insect
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -552,24 +552,13 @@ void COldObject::DestroyObject(DestructionType type, CObject* killer)
|
||||||
}
|
}
|
||||||
else if ( type == DestructionType::Burn ) // burning?
|
else if ( type == DestructionType::Burn ) // burning?
|
||||||
{
|
{
|
||||||
if ( m_type == OBJECT_MOTHER ||
|
if ( m_type == OBJECT_HUMAN )
|
||||||
m_type == OBJECT_ANT ||
|
|
||||||
m_type == OBJECT_SPIDER ||
|
|
||||||
m_type == OBJECT_BEE ||
|
|
||||||
m_type == OBJECT_WORM ||
|
|
||||||
m_type == OBJECT_BULLET )
|
|
||||||
{
|
|
||||||
m_engine->GetPyroManager()->Create(MakeUnique<Gfx::CBurnPyro>(Gfx::PT_BURNO, this));
|
|
||||||
SetDying(DeathType::Burning);
|
|
||||||
m_main->NotifyObjectDestroyed(this);
|
|
||||||
}
|
|
||||||
else if ( m_type == OBJECT_HUMAN )
|
|
||||||
{
|
{
|
||||||
m_engine->GetPyroManager()->Create(MakeUnique<Gfx::CDeadGPyro>(this));
|
m_engine->GetPyroManager()->Create(MakeUnique<Gfx::CDeadGPyro>(this));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_engine->GetPyroManager()->Create(MakeUnique<Gfx::CBurnPyro>(Gfx::PT_BURNT, this));
|
m_engine->GetPyroManager()->Create(MakeUnique<Gfx::CBurnPyro>(this));
|
||||||
SetDying(DeathType::Burning);
|
SetDying(DeathType::Burning);
|
||||||
m_main->NotifyObjectDestroyed(this);
|
m_main->NotifyObjectDestroyed(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue