From 2f22e89fc1992911eacdddb9dfc57ba78c6d135d Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Wed, 17 Aug 2022 01:21:38 +0200 Subject: [PATCH] More Quadravol adjustments. --- language.version | 4 +-- zscript/dlc1/swwm_notashotgun.zsc | 42 +++++++++++++++++++++++++++-- zscript/swwm_player.zsc | 19 +++++++++++++ zscript/weapons/swwm_baseweapon.zsc | 8 ++++-- 4 files changed, 67 insertions(+), 6 deletions(-) diff --git a/language.version b/language.version index d23c14272..73379c250 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r332 \cu(Wed 17 Aug 01:02:07 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r332 \cu(2022-08-17 01:02:07)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r333 \cu(Wed 17 Aug 01:21:38 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r333 \cu(2022-08-17 01:21:38)\c-"; diff --git a/zscript/dlc1/swwm_notashotgun.zsc b/zscript/dlc1/swwm_notashotgun.zsc index 349fa3d50..fd625ba76 100644 --- a/zscript/dlc1/swwm_notashotgun.zsc +++ b/zscript/dlc1/swwm_notashotgun.zsc @@ -7,6 +7,7 @@ Class Quadravol : SWWMWeapon int chargelevel; bool chambered, charged, waschambered, wascharged; bool onehand; + bool initialized; Property ClipCount : clipcount; @@ -91,6 +92,7 @@ Class Quadravol : SWWMWeapon action void A_LoadOverlay() { + A_PlayerReload(true); A_StartSound("demolitionist/handsdown",CHAN_WEAPON,CHANF_OVERLAP,.8); A_ChangeModel("",2,"","",5,"models","QuadCell.png",CMDL_USESURFACESKIN,-1); A_Overlay(PSP_WEAPON+1,"LoadOverlay"); @@ -141,6 +143,42 @@ Class Quadravol : SWWMWeapon invoker.Ammo1.Amount++; } + override bool PickupForAmmoSWWM( SWWMWeapon ownedWeapon ) + { + bool good = Super.PickupForAmmoSWWM(ownedWeapon); + let Owner = ownedWeapon.Owner; + if ( (AmmoGive1 == 0) && ((clipcount > 0) || (chambered && !charged)) ) + { + // let's get this bread + Inventory cur = Owner.FindInventory(AmmoType1); + if ( !cur ) + { + cur = Inventory(Spawn(AmmoType1)); + cur.Amount = 0; + cur.AttachToOwner(Owner); + } + int ingun = clipcount+(chambered&&!charged); + int maxgiveamt = min(cur.MaxAmount-cur.Amount,ingun); + int dropamt = ingun-maxgiveamt; + if ( dropamt > 0 ) cur.CreateTossable(dropamt); + cur.Amount = min(cur.MaxAmount,cur.Amount+ingun); + good = true; + } + return good; + } + override void AttachToOwner( Actor other ) + { + if ( !initialized ) + { + initialized = true; + charged = false; + chambered = false; + clipcount = default.AmmoGive1; // match the ammo that the pickup should give + } + Super.AttachToOwner(other); + } + + Default { Tag "$T_QUADRAVOL"; @@ -153,7 +191,7 @@ Class Quadravol : SWWMWeapon Weapon.SelectionOrder 650; Weapon.UpSound "quadshot/select"; Weapon.AmmoType1 "QuadravolAmmo"; - Weapon.AmmoGive1 1; + Weapon.AmmoGive1 3; SWWMWeapon.DropAmmoType "SWWMRocketAmmoSmall"; Quadravol.ClipCount 5; Stamina 80000; @@ -197,7 +235,7 @@ Class Quadravol : SWWMWeapon } Goto Ready; AltFire: - XZW2 A 2; + XZW2 A 2 A_PlayerCheckGun(); XZW5 C 2; XZW5 D 2 A_StartSound("quadshot/leverforward",CHAN_WEAPON,CHANF_OVERLAP); XZW5 E 2 A_Eject(); diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index 3e647fe7a..778cc2ad2 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -2924,6 +2924,14 @@ Class Demolitionist : PlayerPawn if ( player && (player.crouchdir == -1) ) SetStateLabel("CrouchReload"); else SetStateLabel("Reload"); } + void PlayFastReload() + { + if ( InStateSequence(CurState,FindState("Dash")) + || InStateSequence(CurState,FindState("Boost")) ) + return; // don't cancel dash/boost + if ( player && (player.crouchdir == -1) ) SetStateLabel("CrouchFastReload"); + else SetStateLabel("FastReload"); + } void PlayCheckGun() { if ( InStateSequence(CurState,FindState("Dash")) @@ -3807,6 +3815,12 @@ Class Demolitionist : PlayerPawn XZW9 GHIJKLMNOPQRSTUVWXYZ 2; XZWA ABCDE 2; Goto Spawn+1; + FastReload: + // reload (fast) + #### # 2; + XZW9 GHIJKLMNOPQRSTUVWXYZ 1; + XZWA ABCDE 1; + Goto Spawn+1; CheckGun: // speen #### # 2; @@ -3893,6 +3907,11 @@ Class Demolitionist : PlayerPawn XZWB MNOPQRSTUVWXYZ 2; XZWC ABCDEFGHIJ 2; Goto Crouch+1; + CrouchFastReload: + XZW7 M 2; + XZWB MNOPQRSTUVWXYZ 1; + XZWC ABCDEFGHIJ 1; + Goto Crouch+1; CrouchCheckGun: XZW7 M 2; XZWC LMNOPQRSTUVWXYZ 2; diff --git a/zscript/weapons/swwm_baseweapon.zsc b/zscript/weapons/swwm_baseweapon.zsc index e519a237d..c0e06c414 100644 --- a/zscript/weapons/swwm_baseweapon.zsc +++ b/zscript/weapons/swwm_baseweapon.zsc @@ -397,10 +397,14 @@ Class SWWMWeapon : Weapon abstract else demo.PlayMelee(); } } - action void A_PlayerReload() + action void A_PlayerReload( bool bFast = false ) { let demo = Demolitionist(player.mo); - if ( demo && (demo.Health > 0) ) demo.PlayReload(); + if ( demo && (demo.Health > 0) ) + { + if ( bFast ) demo.PlayFastReload(); + else demo.PlayReload(); + } } action void A_PlayerCheckGun() {