swwmgz_m/zscript/dlc1/swwm_notashotgun.zsc

110 lines
3.3 KiB
Text

// Kmonn Shuna Quadravol (from UnSX series, not a Quadshot reskin anymore)
// Slot 6, spawns shared with Hellblazer
Class Quadravol : SWWMWeapon
{
int clipcount;
int chargelevel;
bool chambered, charged;
bool onehand;
Property ClipCount : clipcount;
transient ui Canvas AmmoLed;
ui TextureID AmmoLedBase, AmmoLedRound, AmmoLedCharge;
override void RenderTexture( RenderEvent e )
{
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("QUADRLED");
if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/QuadLEDBase.png",TexMan.Type_Any);
if ( !AmmoLedRound ) AmmoLedRound = TexMan.CheckForTexture("models/QuadLEDRound.png",TexMan.Type_Any);
if ( !AmmoLedCharge ) AmmoLedCharge = TexMan.CheckForTexture("models/QuadLEDCharge.png",TexMan.Type_Any);
AmmoLed.Clear(0,0,64,64,0xFF101033);
AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_LegacyRenderStyle,STYLE_Add,DTA_Color,0xFF00FFFF);
Vector3 lainbow = SWWMUtility.HSVToRGB((.5+(chargelevel-1)/8.,1.,1.));
Color col = Color(255,int(lainbow.x*255),int(lainbow.y*255),int(lainbow.z*255));
AmmoLed.DrawTexture(AmmoLedCharge,false,12,4,DTA_SrcX,(chargelevel%4)*64,DTA_SrcY,(chargelevel/4)*64,DTA_SrcWidth,40,DTA_SrcHeight,40,DTA_DestWidth,40,DTA_DestHeight,40,DTA_LegacyRenderStyle,STYLE_Add,DTA_Color,(chargelevel>0)?col:0xFF00FF00);
for ( int i=0; i<clipcount; i++ ) AmmoLed.DrawTexture(AmmoLedRound,false,36-8*i,52,DTA_LegacyRenderStyle,STYLE_Add,DTA_Color,0xFF0000FF);
if ( chambered ) AmmoLed.DrawTexture(AmmoLedRound,false,52,52,DTA_LegacyRenderStyle,STYLE_Add,DTA_Color,charged?0xFF0000FF:0xFF00FF00);
}
override bool ReportHUDAmmo()
{
return (chargelevel>0)||(chambered&&!charged)||(clipcount>0)||(Ammo1.Amount > 0);
}
override bool CheckAmmo( int firemode, bool autoswitch, bool requireammo, int ammocount )
{
if ( (firemode == PrimaryFire) || (firemode == EitherFire) )
{
if ( (chargelevel > 0) || (chambered && !charged) || (clipcount > 0) || (Ammo1.Amount > 0) ) return true;
if ( autoswitch ) PlayerPawn(Owner).PickNewWeapon(null);
return false;
}
return Super.CheckAmmo(firemode,autoswitch,requireammo,ammocount);
}
override void PlayUpSound( Actor origin )
{
if ( onehand ) origin.A_StartSound("quadshot/selectfast",CHAN_WEAPON,CHANF_OVERLAP);
else origin.A_StartSound(UpSound,CHAN_WEAPON,CHANF_OVERLAP);
}
Default
{
Tag "$T_QUADRAVOL";
Inventory.PickupMessage "$I_QUADRAVOL";
Obituary "$O_QUADRAVOL";
SWWMWeapon.Tooltip "$TT_QUADRAVOL";
SWWMWeapon.GetLine "getquadravol";
Weapon.SlotNumber 6;
Weapon.SlotPriority 2.;
Weapon.SelectionOrder 650;
Weapon.UpSound "quadshot/select";
Weapon.AmmoType1 "QuadravolAmmo";
Weapon.AmmoGive1 1;
SWWMWeapon.DropAmmoType "SWWMRocketAmmoSmall";
Quadravol.ClipCount 5;
Stamina 80000;
+SWWMWEAPON.NOFIRSTGIVE;
+SWWMWEAPON.HASSCRTEX;
+WEAPON.EXPLOSIVE;
Radius 28;
Height 32;
}
States
{
Spawn:
XZW1 A -1;
Stop;
Select:
XZW2 R 1 A_FullRaise();
XZW2 STUVWXYZ 1;
XZW3 ABCDEFGHI 1;
XZW3 JKLMN 2;
Goto Ready;
Ready:
XZW2 A 1 A_WeaponReady();
Wait;
Fire:
XZW2 A 1;
Goto Ready;
AltFire:
XZW2 A 1;
Goto Ready;
Reload:
XZW2 A 1;
Goto Ready;
Zoom:
XZW2 A 1;
Goto Ready;
User1:
XZW2 A 1;
Goto Ready;
Deselect:
XZW2 A 1 A_StartSound("quadshot/deselect",CHAN_WEAPON,CHANF_OVERLAP);
XZW2 BCDEFGHIJKLMNOPQR 1;
XZW2 R -1 A_FullLower();
Stop;
}
}