More Quadravol adjustments.

This commit is contained in:
Mari the Deer 2022-08-17 01:21:38 +02:00
commit 2f22e89fc1
4 changed files with 67 additions and 6 deletions

View file

@ -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();

View file

@ -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;

View file

@ -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()
{