From 7d6562c3266cfdf53b368c2bdf3f51e19f90fa10 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Fri, 12 Aug 2022 11:15:09 +0200 Subject: [PATCH] Demoslayer mode now has "ammo orbs" as well. --- language.def_menu | 2 +- language.es_menu | 2 +- language.version | 4 +- zscript/handler/swwm_handler_damage.zsc | 26 ++++++++++++- zscript/items/swwm_ammoextra.zsc | 49 +++++-------------------- zscript/swwm_player_fx.zsc | 38 ++++++++++++++++++- 6 files changed, 75 insertions(+), 46 deletions(-) diff --git a/language.def_menu b/language.def_menu index 810d21837..d566e9eba 100644 --- a/language.def_menu +++ b/language.def_menu @@ -273,7 +273,7 @@ TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resets weapon tooltips so you can see them al TOOLTIP_EVENT_SWWMRESETCVARS = "Resets all the mod's settings to their original values."; TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Erases all your archievement progress."; TOOLTIP_SWWM_NOINTERTIPS = "Hides intermission tips, in case you don't want to see them."; -TOOLTIP_SWWM_DEMOSLAYER = "Killed enemies may drop health and armor orbs."; +TOOLTIP_SWWM_DEMOSLAYER = "Killed enemies may drop health, armor and ammo orbs."; TOOLTIP_SWWM_BEEPBOOP = "The Demolitionist will make cute noises whenever pressing any usable line. This might get annoying, so it's optional."; TOOLTIP_SWWM_VOICEAMP = "At their default volume, the Demolitionist's voice lines might be drowned out by in-game audio. This sets an additional amplification level so they're louder than other sounds."; TOOLTIP_NETEVENT_SWWMCLEAREFFECTS = "Fades out any active blood, gore, debris and casings."; diff --git a/language.es_menu b/language.es_menu index ab8eb7113..82e4ee50a 100644 --- a/language.es_menu +++ b/language.es_menu @@ -271,7 +271,7 @@ TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resetea la ayuda de armas para que puedas vol TOOLTIP_EVENT_SWWMRESETCVARS = "Resetea todas las opciones del mod a sus valores originales."; TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Borra todo tu progreso de logros."; TOOLTIP_SWWM_NOINTERTIPS = "Oculta los consejos de intermisión, por si no quieres verlos."; -TOOLTIP_SWWM_DEMOSLAYER = "Los enemigos que mates soltarán orbes de salud y armadura."; +TOOLTIP_SWWM_DEMOSLAYER = "Los enemigos que mates soltarán orbes de salud, armadura y munición."; TOOLTIP_SWWM_BEEPBOOP = "La Demolicionista hará ruiditos adorables cuando pulse cualquier línea utilizable. Esto puede que resulte cansino, así que es opcional."; TOOLTIP_SWWM_VOICEAMP = "A su volumen normal, las voces de la Demolicionista pueden ser ahogadas por el audio del juego. Con esto se le dá un nivel de amplificación extra para que sean más estridentes que otros sonidos."; TOOLTIP_NETEVENT_SWWMCLEAREFFECTS = "Desvanece cualquier sangre, vísceras, escombros y casquillos activos."; diff --git a/language.version b/language.version index cf00d4339..11a2c06c2 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r306 \cu(Fri 12 Aug 09:31:45 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r306 \cu(2022-08-12 09:31:45)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r307 \cu(Fri 12 Aug 11:15:09 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r307 \cu(2022-08-12 11:15:09)\c-"; diff --git a/zscript/handler/swwm_handler_damage.zsc b/zscript/handler/swwm_handler_damage.zsc index 62bf43758..186047a38 100644 --- a/zscript/handler/swwm_handler_damage.zsc +++ b/zscript/handler/swwm_handler_damage.zsc @@ -218,6 +218,7 @@ extend Class SWWMHandler if ( src.Health < 100 ) { int amt = clamp(e.Thing.SpawnHealth()/20,1,10); + if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2; if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3; else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2; for ( int i=0; i 50000) || (i.Amount >= i.MaxAmount) ) continue; + needsammo = true; + break; + } + if ( needsammo ) + { + int amt = clamp(e.Thing.SpawnHealth()/40,1,10); + if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2; + if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3; + else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2; + for ( int i=0; i > validweapons; - for ( int i=0; i)(AllActorClasses[i]); - if ( !type2 ) continue; - let rep = GetReplacement(type2); - if ( (rep != type2) && !(rep is "DehackedPickup") ) continue; - readonly weap = GetDefaultByType(type2); - if ( !Owner.player || !Owner.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon || !weap.CanPickup(Owner) ) continue; - let ready = weap.FindState("Ready"); - if ( !ready || !ready.ValidateSpriteFrame() ) continue; - validweapons.Push(type2); - } Array > available; // populate ammo production list for ( int i=0; i maxunitprice) ) continue; - // only ammo for weapons that are valid (can be used) - bool isvalid = false; - for ( int j=0; j weap = GetDefaultByType(validweapons[j]); - if ( (validweapons[j] is 'SWWMWeapon') && SWWMWeapon(weap).UsesAmmo(a) ) - { - isvalid = true; - break; - } - if ( (weap.AmmoType1 == a) || (weap.AmmoType2 == a) ) - { - isvalid = true; - break; - } - } - if ( !isvalid ) continue; let f = Owner.FindInventory(a); // don't include maxed out ammo if ( f && (f.Amount >= f.MaxAmount) ) continue; @@ -228,7 +197,7 @@ Class AmmoFabricator : Inventory abstract { if ( FabricateAmmo() ) { - if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA); + if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) && !bQUIET ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA); return true; } return false; @@ -270,8 +239,8 @@ Class FabricatorTier1 : AmmoFabricator Inventory.PickupMessage "$T_FABRICATOR1"; AmmoFabricator.Budget 3000; AmmoFabricator.PerType 1; - AmmoFabricator.MaxUnits 1; - AmmoFabricator.MaxTypes 1; + AmmoFabricator.MaxUnits 2; + AmmoFabricator.MaxTypes 2; AmmoFabricator.MaxUnitPrice 2500; AmmoFabricator.ChanceFactor 1; AmmoFabricator.TextColor Font.CR_BLUE; @@ -286,9 +255,9 @@ Class FabricatorTier2 : AmmoFabricator Tag "$T_FABRICATOR2"; Inventory.PickupMessage "$T_FABRICATOR2"; AmmoFabricator.Budget 20000; - AmmoFabricator.PerType 1; - AmmoFabricator.MaxUnits 2; - AmmoFabricator.MaxTypes 2; + AmmoFabricator.PerType 2; + AmmoFabricator.MaxUnits 5; + AmmoFabricator.MaxTypes 3; AmmoFabricator.MaxUnitPrice 18000; AmmoFabricator.ChanceFactor 2; AmmoFabricator.TextColor Font.CR_GREEN; @@ -303,9 +272,9 @@ Class FabricatorTier3 : AmmoFabricator Tag "$T_FABRICATOR3"; Inventory.PickupMessage "$T_FABRICATOR3"; AmmoFabricator.Budget 60000; - AmmoFabricator.PerType 2; - AmmoFabricator.MaxUnits 4; - AmmoFabricator.MaxTypes 3; + AmmoFabricator.PerType -25; + AmmoFabricator.MaxUnits 10; + AmmoFabricator.MaxTypes 4; AmmoFabricator.MaxUnitPrice 50000; AmmoFabricator.ChanceFactor 4; AmmoFabricator.TextColor Font.CR_RED; diff --git a/zscript/swwm_player_fx.zsc b/zscript/swwm_player_fx.zsc index 1f682afe3..da2bcfaf8 100644 --- a/zscript/swwm_player_fx.zsc +++ b/zscript/swwm_player_fx.zsc @@ -1,7 +1,6 @@ // player effects // drop from monsters when using "Demoslayer" fun option -// heals up to 100 HP when touched Class SlayerOrb : Actor abstract { Class tclass; @@ -138,6 +137,34 @@ Class ArmorOrb : SlayerOrb } } +Class AmmoOrb : SlayerOrb +{ + Default + { + SlayerOrb.TrailClass "AmmoOrbTrail"; + } + override void PickedUp( int np, PlayerPawn mo ) + { + int flg = CHANF_OVERLAP|CHANF_MAYBE_LOCAL; + if ( mo.CheckLocalView() ) flg |= CHANF_NOPAUSE; + mo.A_StartSound("misc/ammo_pkup",CHAN_ITEM,flg); + int tier = int(ceil(abs(scale.x*10))); + Class cls = "FabricatorTier1"; + if ( tier >= 4 ) cls = "FabricatorTier3"; + else if ( tier >= 2 ) cls = "FabricatorTier2"; + let f = Inventory(Spawn(cls)); + f.bQUIET = true; + if ( !f.CallTryPickup(mo) ) f.Destroy(); + mo.player.bonuscount = Inventory.BONUSADD; + } + States + { + Spawn: + BLPF A -1 Bright; + Stop; + + } +} Class SlayerOrbTrail : Actor abstract { @@ -186,6 +213,15 @@ Class ArmorOrbTrail : SlayerOrbTrail Stop; } } +Class AmmoOrbTrail : SlayerOrbTrail +{ + States + { + Spawn: + BLPS A -1 Bright; + Stop; + } +} Class DashTrail : Actor {