diff --git a/language.version b/language.version index 5a880800b..e8f40b6fd 100644 --- a/language.version +++ b/language.version @@ -1,2 +1,2 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r581 \cu(Sun 25 Oct 17:55:43 CET 2020)"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r582 \cu(Sun 25 Oct 18:43:32 CET 2020)"; diff --git a/zscript/swwm_funstuff.zsc b/zscript/swwm_funstuff.zsc index 3e5307d52..82d22551a 100644 --- a/zscript/swwm_funstuff.zsc +++ b/zscript/swwm_funstuff.zsc @@ -593,6 +593,7 @@ Class Chancebox : Actor Vector3 testpos = (origin.x+j*cos(k),origin.y+j*sin(k),0); testpos.z = s.floorplane.ZAtPoint(testpos.xy); if ( (level.PointInSector(testpos.xy) != s) || !level.IsPointInLevel(testpos) ) continue; + double ceil = s.ceilingplane.ZAtPoint(testpos.xy); bool blocked = false; BlockLinesIterator bl = BlockLinesIterator.CreateFromPos(testpos,32,32,s); double tbox[4]; @@ -614,6 +615,44 @@ Class Chancebox : Actor break; } if ( blocked ) continue; + // check for 3D floors first + int nffloor = s.Get3DFloorCount(); + double bceil = ceil; + for ( int l=0; l 32+bt.Thing.Radius ) continue; + if ( abs(bt.Thing.pos.y-testpos.y) > 32+bt.Thing.Radius ) continue; + blockedff = true; + break; + } + if ( blockedff ) continue; + let sp = new("BoxSpawnSpot"); + sp.pos = (testpos.x,testpos.y,fz); + sp.angle = k+180; + spots.Push(sp); + } + // spawn at the real floor + if ( bceil-testpos.z < 32 ) continue; // too short + // don't spawn on sky or hurtfloors if there are 3D floors + if ( (nffloor > 0) && ((s.GetTexture(0) == skyflatnum) || (s.damageamount > 0)) ) continue; BlockThingsIterator bt = BlockThingsIterator.CreateFromPos(testpos.x,testpos.y,testpos.z,32,256,false); while ( bt.Next() ) { @@ -850,10 +889,16 @@ Class Chancebox : Actor } } } - if ( bCountSecret ) + if ( bCOUNTITEM ) + { + user.player.itemcount++; + level.found_items++; + bCOUNTITEM = false; + } + if ( bCOUNTSECRET ) { user.GiveSecret(); - bCountSecret = false; + bCOUNTSECRET = false; } if ( special ) { @@ -894,6 +939,7 @@ Class Chancebox : Actor +ROLLSPRITE; +SOLID; +INTERPOLATEANGLES; + +COUNTITEM; Species "Chancebox"; } States