forked from Mirrors/openclonk
Remove unused engine internal Explosion function
parent
e418476954
commit
c14ca10f89
|
@ -853,51 +853,3 @@ void Smoke(int32_t tx, int32_t ty, int32_t level, DWORD dwClr)
|
|||
if ((pObj = Game.CreateObjectConstruction(C4Id2Def(C4ID("FXS1")),NULL,NO_OWNER,tx,ty,FullCon*level/32)))
|
||||
pObj->Call(PSF_Activate);
|
||||
}
|
||||
|
||||
void Explosion(int32_t tx, int32_t ty, int32_t level, C4Object *inobj, int32_t iCausedBy, C4Object *pByObj, C4ID idEffect, const char *szEffect)
|
||||
{
|
||||
int32_t grade=BoundBy((level/10)-1,1,3);
|
||||
// Sound
|
||||
StdStrBuf sound = FormatString("Blast%c", '0'+grade);
|
||||
StartSoundEffect(sound.getData(),false,100,pByObj);
|
||||
// Check blast containment
|
||||
C4Object *container=inobj;
|
||||
while (container && !container->Def->ContainBlast) container=container->Contained;
|
||||
// Uncontained blast effects
|
||||
if (!container)
|
||||
{
|
||||
// Incinerate landscape
|
||||
if (!::Landscape.Incinerate(tx,ty))
|
||||
if (!::Landscape.Incinerate(tx,ty-10))
|
||||
if (!::Landscape.Incinerate(tx-5,ty-5))
|
||||
::Landscape.Incinerate(tx+5,ty-5);
|
||||
// Create blast object or particle
|
||||
C4Object *pBlast;
|
||||
C4ParticleDef *pPrtDef = ::Particles.pBlast;
|
||||
// particle override
|
||||
if (szEffect)
|
||||
{
|
||||
C4ParticleDef *pPrtDef2 = ::Particles.GetDef(szEffect);
|
||||
if (pPrtDef2) pPrtDef = pPrtDef2;
|
||||
}
|
||||
else if (idEffect) pPrtDef = NULL;
|
||||
// create particle
|
||||
if (pPrtDef)
|
||||
{
|
||||
::Particles.Create(pPrtDef, (float) tx, (float) ty, 0.0f, 0.0f, (float) level, 0);
|
||||
if (SEqual2(pPrtDef->Name.getData(), "Blast"))
|
||||
::Particles.Cast(::Particles.pFSpark, level/5+1, (float) tx, (float) ty, level, level/2+1.0f, 0x00ef0000, level+1.0f, 0xffff1010);
|
||||
}
|
||||
else if ((pBlast = Game.CreateObjectConstruction(C4Id2Def(idEffect ? idEffect : C4ID("FXB1")),pByObj,iCausedBy,tx,ty+level,FullCon*level/20)))
|
||||
pBlast->Call(PSF_Activate);
|
||||
}
|
||||
// Blast objects
|
||||
Game.BlastObjects(tx,ty,level,inobj,iCausedBy,pByObj);
|
||||
if (container!=inobj) Game.BlastObjects(tx,ty,level,container,iCausedBy,pByObj);
|
||||
if (!container)
|
||||
{
|
||||
// Blast free landscape. After blasting objects so newly mined materials don't get flinged
|
||||
::Landscape.BlastFree(tx,ty,level,grade, iCausedBy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,6 @@ class C4Value &FxFireVarCausedBy(C4Effect *pEffect);
|
|||
|
||||
// some other hardcoded engine effects
|
||||
void Splash(int32_t tx, int32_t ty, int32_t amt, C4Object *pByObj);
|
||||
void Explosion(int32_t tx, int32_t ty, int32_t level, C4Object *inobj, int32_t iCausedBy, C4Object *pByObj, C4ID idEffect, const char *szEffect);
|
||||
void Smoke(int32_t tx, int32_t ty, int32_t level, DWORD dwClr=0);
|
||||
void BubbleOut(int32_t tx, int32_t ty);
|
||||
|
||||
|
|
Loading…
Reference in New Issue