diff --git a/language.def_menu b/language.def_menu index 759d4db49..3c05c4e0c 100644 --- a/language.def_menu +++ b/language.def_menu @@ -249,9 +249,9 @@ TOOLTIP_SWWM_SWAPWEAPONS = "Allow only one weapon per slot (excluding Deep Impac TOOLTIP_SWWM_FORCESTATS = "Shows map statistics in the HUD even when the automap isn't open."; TOOLTIP_SWWM_FUNTRAILS = "Recolors the trails left by slot 5 weapon projectiles."; TOOLTIP_SWWM_PS_FULLRESET = "Clears your entire inventory, excluding collectibles. May include score reset if enabled separately."; -TOOLTIP_SWWM_PS_RESETAMMO = "Resets all your carried ammo, including what is loaded into your weapons."; -TOOLTIP_SWWM_PS_RESETITEMS = "Removes all usable items from your inventory."; -TOOLTIP_SWWM_PS_RESETHEALTH = "Resets your health back to 100%, and removes all equipped armor."; +TOOLTIP_SWWM_PS_RESETAMMO = "Clears all your carried ammo, excluding what is already loaded into your weapons."; +TOOLTIP_SWWM_PS_RESETITEMS = "Clears all your carried items that aren't weapons or ammo. Excludes equipped armor."; +TOOLTIP_SWWM_PS_RESETHEALTH = "Sets your health back to 100%, and removes all equipped armor."; TOOLTIP_SWWM_DRLASKILL = "[DRLA Monsters] Sets the skill level for enemy spawns."; TOOLTIP_SWWM_ITEMSPARKLES = "Nearby items will have particles around them, as a visual aid."; TOOLTIP_SWWM_SINGLEFIRST = "For weapons that have dual-wield variants, enabling this will always select the single weapon first."; diff --git a/language.es_menu b/language.es_menu index 2786c5dcd..47076ec0b 100644 --- a/language.es_menu +++ b/language.es_menu @@ -247,8 +247,8 @@ TOOLTIP_SWWM_SWAPWEAPONS = "Permite solo un arma por puesto (excluyendo Deep Imp TOOLTIP_SWWM_FORCESTATS = "Muestra estadísticas de mapa en el HUD incluso cuando el automapa no está abierto."; TOOLTIP_SWWM_FUNTRAILS = "Recolorea los rastros dejados por proyectiles de armas de ranura 5."; TOOLTIP_SWWM_PS_FULLRESET = "Vacía todo tu inventario, excluyendo coleccionables. Puede incluir el reseteo de puntos si está activado."; -TOOLTIP_SWWM_PS_RESETAMMO = "Resetea toda la munición que llevas, incluyendo la que esté cargada en tus armas."; -TOOLTIP_SWWM_PS_RESETITEMS = "Quita todos los ítems usables del inventario."; +TOOLTIP_SWWM_PS_RESETAMMO = "Vacía toda la munición que llevas, excluyendo la que ya esté cargada en tus armas."; +TOOLTIP_SWWM_PS_RESETITEMS = "Vacía todos los ítems que llevas que no sean armas o munición. Excluye la armadura equipada."; TOOLTIP_SWWM_PS_RESETHEALTH = "Resetea tu salud de vuelta al 100%, y quita toda la armadura equipada."; TOOLTIP_SWWM_DRLASKILL = "[DRLA Monsters] Elige el nivel de dificultad para spawns de enemigos."; TOOLTIP_SWWM_ITEMSPARKLES = "Los ítems cercanos tendrán partículas alrededor, para mejor visibilidad."; diff --git a/language.version b/language.version index 0b223ec1b..b60cc07b0 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r558 \cu(Sat 8 Oct 15:55:42 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r558 \cu(2022-10-08 15:55:42)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r559 \cu(Sat 8 Oct 17:47:35 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r559 \cu(2022-10-08 17:47:35)\c-"; diff --git a/zscript/dlc1/swwm_mister.zsc b/zscript/dlc1/swwm_mister.zsc index 805e8f514..93c28f267 100644 --- a/zscript/dlc1/swwm_mister.zsc +++ b/zscript/dlc1/swwm_mister.zsc @@ -216,8 +216,6 @@ Class MisterRifle : SWWMWeapon override void InitializeWeapon() { - clipcount = default.clipcount; - firemode = 0; // no round in the chamber chambered = false; fired = false; diff --git a/zscript/dlc1/swwm_notashotgun.zsc b/zscript/dlc1/swwm_notashotgun.zsc index 031dabe1d..01f602c44 100644 --- a/zscript/dlc1/swwm_notashotgun.zsc +++ b/zscript/dlc1/swwm_notashotgun.zsc @@ -368,8 +368,6 @@ Class Quadravol : SWWMWeapon { charged = false; chambered = false; - chargelevel = 0; - onehand = false; clipcount = default.AmmoGive1; // match the ammo that the pickup should give } diff --git a/zscript/items/swwm_ammoitems.zsc b/zscript/items/swwm_ammoitems.zsc index 12b4b8f2c..728ea11ed 100644 --- a/zscript/items/swwm_ammoitems.zsc +++ b/zscript/items/swwm_ammoitems.zsc @@ -480,7 +480,6 @@ Class CandyGunSpares : SWWMAmmo let spare = Inventory(Spawn('CandyGun',Owner.Pos,NO_REPLACE)); if ( !spare ) return null; // spare with empty mag - CandyGun(spare).bInitialized = true; CandyGun(spare).AmmoGive1 = 0; CandyGun(spare).clipcount = 0; CandyGun(spare).chambered = false; diff --git a/zscript/utility/swwm_utility.zsc b/zscript/utility/swwm_utility.zsc index 0356bbf89..e01ce565c 100644 --- a/zscript/utility/swwm_utility.zsc +++ b/zscript/utility/swwm_utility.zsc @@ -2005,29 +2005,30 @@ Class SWWMUtility p.health = p.mo.Health = p.mo.SpawnHealth(); } - // resets all carried ammo to its backpack give amount + // sets all carried ammo back to zero // resets hammerspace capacity - // re-initializes any carried weapons static play void ResetAmmo( Actor mo ) { PlayerInfo p = mo.player; if ( !p || !p.mo ) return; for ( Inventory i=p.mo.inv; i; i=i.inv ) { - if ( i is 'Ammo' ) + if ( (i is 'Ammo') || (i is 'MagAmmo') ) { - i.Amount = Ammo(i).BackpackAmount; - i.MaxAmount = i.default.MaxAmount; - } - else if ( i is 'MagAmmo' ) - { - i.Amount = MagAmmo(i).BackpackAmount; - i.MaxAmount = i.default.MaxAmount; - } - else if ( i is 'HammerspaceEmbiggener' ) i.Amount = 0; - else if ( i is 'SWWMWeapon' ) - SWWMWeapon(i).InitializeWeapon(); + i.MaxAmount = i.default.MaxAmount; + } + if ( i is 'HammerspaceEmbiggener' ) + i.Amount = 0; + } + // also gives back any ammo from carried weapons (provided they don't have NOFIRSTGIVE) + for ( Inventory i=p.mo.inv; i; i=i.inv ) + { + if ( !(i is 'Weapon') ) continue; + let w = Weapon(i); + if ( (w is 'SWWMWeapon') && SWWMWeapon(w).bNOFIRSTGIVE ) continue; + if ( w.Ammo1 ) w.Ammo1.Amount = min(w.Ammo1.MaxAmount,w.Ammo1.Amount+w.AmmoGive1); + if ( w.Ammo2 && (w.Ammo2 != w.Ammo1) ) w.Ammo2.Amount = min(w.Ammo2.MaxAmount,w.Ammo2.Amount+w.AmmoGive2); } } diff --git a/zscript/weapons/swwm_cbt.zsc b/zscript/weapons/swwm_cbt.zsc index 4039187d3..df0bf4f50 100644 --- a/zscript/weapons/swwm_cbt.zsc +++ b/zscript/weapons/swwm_cbt.zsc @@ -9,6 +9,24 @@ Class Wallbuster : SWWMWeapon int whichspin; transient bool cancelreload; + override void DoEffect() + { + Super.DoEffect(); + // push back selection order if weapon is unloaded + if ( !bInitialized ) + { + SelectionOrder = default.SelectionOrder; + return; + } + for ( int i=0; i<25; i++ ) + { + if ( !loaded[i] || fired[i] ) continue; + SelectionOrder = default.SelectionOrder; + return; + } + SelectionOrder = 1400; + } + override bool ReportHUDAmmo() { for ( int i=0; i<25; i++ ) if ( loaded[i] && !fired[i] ) return true; @@ -30,8 +48,6 @@ Class Wallbuster : SWWMWeapon loaded[i] = (i<5); for ( int i=0; i<25; i++ ) fired[i] = false; - for ( int i=0; i<6; i++ ) - rotation[i] = 0; } action void A_CBTFlash( StateLabel flashlabel = null, int index = 0 ) { diff --git a/zscript/weapons/swwm_danmaku.zsc b/zscript/weapons/swwm_danmaku.zsc index a2b918748..48a1c72f0 100644 --- a/zscript/weapons/swwm_danmaku.zsc +++ b/zscript/weapons/swwm_danmaku.zsc @@ -225,14 +225,6 @@ Class Eviscerator : SWWMWeapon s.speed *= .1; } - override void InitializeWeapon() - { - extended = false; - chambered = false; - pendingload = false; - loadtics = 0; - } - override void MarkPrecacheSounds() { Super.MarkPrecacheSounds(); diff --git a/zscript/weapons/swwm_deathlydeathcannon.zsc b/zscript/weapons/swwm_deathlydeathcannon.zsc index 39949cff5..e46263f97 100644 --- a/zscript/weapons/swwm_deathlydeathcannon.zsc +++ b/zscript/weapons/swwm_deathlydeathcannon.zsc @@ -175,14 +175,6 @@ Class Ynykron : SWWMWeapon return Super.PickupForAmmoSWWM(ownedWeapon); } - override void InitializeWeapon() - { - clipcount = default.clipcount; - chargestate = CS_IDLE; - chargelevel = 0; - inverted = false; - } - override void MarkPrecacheSounds() { Super.MarkPrecacheSounds(); diff --git a/zscript/weapons/swwm_deepdarkimpact.zsc b/zscript/weapons/swwm_deepdarkimpact.zsc index 61a8a5ff2..cb7dd5b42 100644 --- a/zscript/weapons/swwm_deepdarkimpact.zsc +++ b/zscript/weapons/swwm_deepdarkimpact.zsc @@ -304,11 +304,6 @@ Class DeepImpact : SWWMWeapon A_QuakeEx(1,1,1,2,0,1,"",QF_RELATIVE|QF_SCALEUP,rollIntensity:.05); } - override void InitializeWeapon() - { - clipcount = default.clipcount; - } - override void MarkPrecacheSounds() { Super.MarkPrecacheSounds(); diff --git a/zscript/weapons/swwm_shot.zsc b/zscript/weapons/swwm_shot.zsc index 75dd58bfb..1874327b0 100644 --- a/zscript/weapons/swwm_shot.zsc +++ b/zscript/weapons/swwm_shot.zsc @@ -76,13 +76,9 @@ Class Spreadgun : SWWMWeapon override void DoEffect() { Super.DoEffect(); - // push back selection order if a golden shell is loaded (or golden shells are the only available ammo) - if ( bInitialized && ((chambered && !fired && goldload) || ((Ammo1.Amount <= 0) && (Ammo2.Amount > 0))) ) - { - SelectionOrder = 1500; - return; - } - SelectionOrder = default.SelectionOrder; + // push back selection order if weapon is unloaded (or has a golden shell loaded) + if ( !bInitialized ) SelectionOrder = default.SelectionOrder; + else SelectionOrder = (chambered&&!fired&&!goldload)?default.SelectionOrder:1500; } override bool ReportHUDAmmo() diff --git a/zscript/weapons/swwm_sparkyboi.zsc b/zscript/weapons/swwm_sparkyboi.zsc index e91366ab3..c28939254 100644 --- a/zscript/weapons/swwm_sparkyboi.zsc +++ b/zscript/weapons/swwm_sparkyboi.zsc @@ -149,12 +149,6 @@ Class Sparkster : SWWMWeapon A_StartSound("biospark/fail",CHAN_WEAPON,CHANF_OVERLAP); } - override void InitializeWeapon() - { - clipcount = default.clipcount; - doublestacc = false; - } - override void MarkPrecacheSounds() { Super.MarkPrecacheSounds(); diff --git a/zscript/weapons/swwm_splode.zsc b/zscript/weapons/swwm_splode.zsc index 00703fe58..ea3eabb8d 100644 --- a/zscript/weapons/swwm_splode.zsc +++ b/zscript/weapons/swwm_splode.zsc @@ -316,12 +316,6 @@ Class ExplodiumGun : SWWMWeapon A_ChangeModel("",1,"","",0,"models","DemoTags"..colname..".png",CMDL_USESURFACESKIN,-1); } - override void InitializeWeapon() - { - clipcount = default.clipcount; - chambered = false; - } - Default { Tag "$T_EXPLODIUM"; @@ -769,12 +763,6 @@ Class DualExplodiumGun : SWWMWeapon A_ChangeModel("",3,"","",0,"models","DemoTags"..colname..".png",CMDL_USESURFACESKIN,-1); } - override void InitializeWeapon() - { - clipcount = default.clipcount; - chambered = false; - } - Default { Tag "$T_EXPLODIUM2"; diff --git a/zscript/weapons/swwm_tastytreat.zsc b/zscript/weapons/swwm_tastytreat.zsc index cc44f8f91..1929de58f 100644 --- a/zscript/weapons/swwm_tastytreat.zsc +++ b/zscript/weapons/swwm_tastytreat.zsc @@ -344,7 +344,6 @@ Class CandyGun : SWWMWeapon let spare = Inventory(Spawn('CandyGun',Owner.Pos,NO_REPLACE)); if ( !spare ) return null; // spare with empty mag - CandyGun(spare).bInitialized = true; CandyGun(spare).AmmoGive1 = 0; CandyGun(spare).clipcount = 0; CandyGun(spare).chambered = false; @@ -358,12 +357,6 @@ Class CandyGun : SWWMWeapon return Super.CreateTossable(amt); } - override void InitializeWeapon() - { - clipcount = default.clipcount; - chambered = false; - } - override void MarkPrecacheSounds() { Super.MarkPrecacheSounds(); diff --git a/zscript/weapons/swwm_thiccboolet.zsc b/zscript/weapons/swwm_thiccboolet.zsc index 8cbbeffcc..1215f7af9 100644 --- a/zscript/weapons/swwm_thiccboolet.zsc +++ b/zscript/weapons/swwm_thiccboolet.zsc @@ -711,13 +711,6 @@ Class SilverBullet : SWWMWeapon return good; } - override void InitializeWeapon() - { - clipcount = default.clipcount; - chambered = false; - fired = false; - } - override void MarkPrecacheSounds() { Super.MarkPrecacheSounds();