diff --git a/language.version b/language.version index 07cb1a480..aab5e3cca 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r763 \cu(Sat 18 Feb 11:54:30 CET 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r763 \cu(2023-02-18 11:54:30)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r764 \cu(Sun 19 Feb 20:24:02 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r764 \cu(2023-02-19 20:24:02)\c-"; diff --git a/zscript/handler/swwm_handler_worldthings.zsc b/zscript/handler/swwm_handler_worldthings.zsc index f3427ec1b..aba0d4652 100644 --- a/zscript/handler/swwm_handler_worldthings.zsc +++ b/zscript/handler/swwm_handler_worldthings.zsc @@ -52,7 +52,7 @@ extend Class SWWMHandler return false; } - static bool ShouldSpawnGold() + static int ShouldSpawnGold() { int totalneeded = 0; // check "free space" in player inventories @@ -71,7 +71,7 @@ extend Class SWWMHandler if ( g.Owner ) continue; totalneeded -= g.Amount; } - return (totalneeded > 0); + return max(0,totalneeded); } override void WorldThingDied( WorldEvent e ) @@ -89,12 +89,14 @@ extend Class SWWMHandler let ti = ThinkerIterator.Create(e.Thing.GetClass()); while ( ti.Next() ) dropweight++; int minchance = max(1,6-(e.Thing.GetSpawnHealth()/1000)); - dropweight = max(minchance,dropweight/4); + dropweight = max(minchance,dropweight/2); // make sure the gold shell is "worth spawning", too - if ( !Random[GoldDrop](0,dropweight) && ShouldSpawnGold() ) + // (also, chance should be reduced as you acquire more shells) + int gchance = int(ceil(ShouldSpawnGold()/2.)); + if ( !Random[GoldDrop](0,dropweight) && Random[GoldDrop](0,gchance) ) { - let g = Actor.Spawn("GoldShell",e.Thing.Vec3Offset(0,0,e.Thing.Height/2)); - double ang = FRandom[SpareShells](0,360); + let g = Actor.Spawn("GoldShell",e.Thing.Vec3Offset(0,0,e.Thing.Height/2.)); + double ang = FRandom[SpareShells](0.,360.); g.vel.xy = Actor.AngleToVector(ang,FRandom[SpareShells](.4,.8)); g.vel.z = FRandom[SpareShells](2.,4.); }