Some wallbusting fixing.
This commit is contained in:
parent
5afc381e42
commit
cb3c253bb8
4 changed files with 21 additions and 15 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r352 \cu(Fri 12 Mar 21:36:08 CET 2021)\c-";
|
||||
SWWM_SHORTVER="\cw0.9.11b-pre r352 \cu(2021-03-12 21:36:08)\c-";
|
||||
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r353 \cu(Fri 12 Mar 21:54:57 CET 2021)\c-";
|
||||
SWWM_SHORTVER="\cw0.9.11b-pre r353 \cu(2021-03-12 21:54:57)\c-";
|
||||
|
|
|
|||
|
|
@ -1144,7 +1144,7 @@ Class Demolitionist : PlayerPawn
|
|||
else if ( pos.z <= florz )
|
||||
tempme.Results.Tier = TIER_LOWER;
|
||||
}
|
||||
if ( BusterWall.Bust(tempme.Results,dmg,self,dir,pos.z+Height/2) )
|
||||
if ( BusterWall.Bust(tempme.Results,dmg,self,dir,pos.z+Height) )
|
||||
{
|
||||
// busted through
|
||||
if ( raging )
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ Class SWWMDamageAccumulator : Thinker
|
|||
}
|
||||
|
||||
// prevents floors/ceilings from ever moving again, as they're "broken crushers"
|
||||
// optional "instant" parameter is used by wall busting, no crusher malfunction animation will play
|
||||
Class SWWMCrusherBroken : Thinker
|
||||
{
|
||||
Sector fsec, csec;
|
||||
|
|
@ -159,7 +160,7 @@ Class SWWMCrusherBroken : Thinker
|
|||
int fphase, cphase;
|
||||
int ftics, ctics;
|
||||
|
||||
static void Create( Sector f, Sector c, double diffh )
|
||||
static void Create( Sector f, Sector c, double diffh, bool instant = false )
|
||||
{
|
||||
if ( !f && !c ) return;
|
||||
let ti = ThinkerIterator.Create("SWWMCrusherBroken",STAT_USER);
|
||||
|
|
@ -167,7 +168,15 @@ Class SWWMCrusherBroken : Thinker
|
|||
while ( cb = SWWMCrusherBroken(ti.Next()) )
|
||||
{
|
||||
if ( (cb.fsec == f) && (cb.csec == c) )
|
||||
{
|
||||
if ( instant )
|
||||
{
|
||||
// force it to be instant
|
||||
if ( f ) cb.fphase = 3;
|
||||
if ( c ) cb.cphase = 3;
|
||||
}
|
||||
return; // we already have this
|
||||
}
|
||||
if ( cb.fsec && (cb.fsec == f) )
|
||||
{
|
||||
cb.Destroy(); // we override this one
|
||||
|
|
@ -186,6 +195,11 @@ Class SWWMCrusherBroken : Thinker
|
|||
cb.diffh = diffh;
|
||||
if ( f && f.floordata ) f.floordata.Destroy();
|
||||
if ( c && c.ceilingdata ) c.ceilingdata.Destroy();
|
||||
if ( instant )
|
||||
{
|
||||
if ( f ) cb.fphase = 3;
|
||||
if ( c ) cb.cphase = 3;
|
||||
}
|
||||
}
|
||||
|
||||
override void Tick()
|
||||
|
|
|
|||
|
|
@ -379,17 +379,8 @@ Class BusterWall : Thinker
|
|||
if ( l.Activation&(SPAC_Use|SPAC_Impact) )
|
||||
l.Activation &= ~(SPAC_Use|SPAC_Impact);
|
||||
}
|
||||
// stop all movers
|
||||
let ti2 = ThinkerIterator.Create("SectorEffect",STAT_SECTOREFFECT);
|
||||
SectorEffect se;
|
||||
while ( se = SectorEffect(ti2.Next()) )
|
||||
{
|
||||
if ( se.GetSector() != hs ) continue;
|
||||
se.Destroy();
|
||||
}
|
||||
bust.step = (clamp((b.x-a.x)/4.,2.,32.),clamp((b.y-a.y)/4.,2.,32.),clamp(partheight/4.,2.,32.));
|
||||
// stop all sound sequences
|
||||
for ( int i=1; i<=4; i++ ) hs.StopSoundSequence(i);
|
||||
// stop movement permanently
|
||||
SWWMCrusherBroken.Create(hp?null:hs,hp?hs:null,0.,true);
|
||||
// quakin'
|
||||
let q = Actor.Spawn("BustedQuake",(hs.centerspot.x,hs.centerspot.y,thisheight));
|
||||
q.special1 = clamp(int(girthitude**.15),1,9);
|
||||
|
|
@ -407,6 +398,7 @@ Class BusterWall : Thinker
|
|||
bust.boundsmin = (a.x,a.y,bust.cutheight)+(1,1,1);
|
||||
bust.boundsmax = (b.x,b.y,thisheight)-(1,1,1);
|
||||
}
|
||||
bust.step = (clamp((b.x-a.x)/4.,2.,32.),clamp((b.y-a.y)/4.,2.,32.),clamp(partheight/4.,2.,32.));
|
||||
bust.SpawnDebris(true);
|
||||
hs.SetTexture(hp,rubble);
|
||||
hs.SetXScale(hp,1.);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue