swwmgz_m/zscript/items/swwm_ammoitems.zsc
Marisa the Magician 80db58b0d0 Bump zscript ver to 4.14.1, plus a whole lot of stuff.
- Try to get rid of all implicit casts from string to name, color or class.
 - Use FindClass where needed.
 - Used a map in a case where a dictionary was unneeded.
 - Use new bounce flags where needed.
 - Replace Legacy of Rust weapons/ammo.
2025-03-13 14:50:58 +01:00

454 lines
8 KiB
Text

// ============================================================================
// Spreadgun / Wallbuster ammo
// ============================================================================
Class RedShell : SWWMAmmo
{
Default
{
Tag "$T_REDSHELL";
SWWMAmmo.PickupTag "REDSHELL";
Stamina 500;
Inventory.Amount 1;
Inventory.MaxAmount 40;
Ammo.BackpackAmount 4;
Ammo.BackpackMaxAmount 160;
Ammo.DropAmount 2;
Accuracy 50;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class RedShell2 : RedShell
{
Default
{
Inventory.Amount 2;
}
}
Class RedShell4 : RedShell
{
Default
{
Inventory.Amount 4;
}
}
Class RedShell6 : RedShell
{
Default
{
Inventory.Amount 6;
}
}
Class GoldShellSparkle : SWWMNonInteractiveActor
{
override void PostBeginPlay()
{
Scale *= FRandom[Goldy](.5,1.5);
vel.z = FRandom[Goldy](.5,1.5);
}
override void Tick()
{
if ( freezetics > 0 )
{
freezetics--;
return;
}
if ( isFrozen() ) return;
SetOrigin(Vec3Offset(0,0,vel.z),true);
alpha -= .02;
if ( alpha <= 0 ) Destroy();
}
Default
{
RenderStyle 'Add';
Scale 0.05;
+FORCEXYBILLBOARD;
}
States
{
Spawn:
BLPF A -1 Bright;
Stop;
}
}
Class GoldShell : SWWMAmmo
{
action void A_GoldShellTrail()
{
if ( Random[Goldy](0,2) ) return;
Spawn('GoldShellSparkle',Vec3Offset(FRandom[Goldy](-radius,radius)/2.,FRandom[Goldy](-radius,radius)/2.,FRandom[Goldy](10,18)));
}
Default
{
Tag "$T_GOLDSHELL";
SWWMAmmo.PickupTag "GOLDSHELL";
Inventory.PickupSound "misc/ammo_pkup_vip";
Stamina -1000000;
Inventory.Amount 1;
Inventory.MaxAmount 7;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 7;
Ammo.DropAmount 1;
}
States
{
Spawn:
XZW1 A 1 A_GoldShellTrail();
Wait;
}
}
// ============================================================================
// Eviscerator ammo
// ============================================================================
Class EvisceratorShell : SWWMAmmo
{
Default
{
Tag "$T_EVISHELL";
SWWMAmmo.PickupTag "EVISHELL";
Inventory.PickupMessage "$T_EVISHELL";
Stamina 3000;
Inventory.Amount 1;
Inventory.MaxAmount 40;
Ammo.BackpackAmount 3;
Ammo.BackpackMaxAmount 80;
Ammo.DropAmount 1;
+SWWMAMMO.USEPICKUPMSG;
Accuracy 60;
}
override void ModifyDropAmount( int dropamount )
{
Ammo.ModifyDropAmount(dropamount);
Amount = min(Amount,3);
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class EvisceratorShell2 : EvisceratorShell
{
Default
{
Inventory.PickupMessage "$I_EVISHELLCLIP2";
Inventory.Amount 2;
}
}
Class EvisceratorShell3 : EvisceratorShell
{
Default
{
Inventory.PickupMessage "$I_EVISHELLCLIP3";
Inventory.Amount 3;
}
}
Class EvisceratorSixPack : EvisceratorShell
{
Default
{
Inventory.PickupMessage "$I_EVISHELLPAK";
Inventory.Amount 6;
}
}
// ============================================================================
// Hellblazer ammo
// ============================================================================
Class HellblazerMissiles : SWWMAmmo
{
Default
{
Tag "$T_HELLMISSILE";
SWWMAmmo.PickupTag "HELLMISSILE";
Stamina 8000;
Inventory.Amount 1;
Inventory.MaxAmount 24;
Ammo.BackpackAmount 3;
Ammo.BackpackMaxAmount 72;
Ammo.DropAmount 1;
Accuracy 70;
}
override void ModifyDropAmount( int dropamount )
{
Ammo.ModifyDropAmount(dropamount);
Amount = min(Amount,3);
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class HellblazerMissiles2 : HellblazerMissiles
{
Default
{
Inventory.Amount 2;
}
}
Class HellblazerMissiles3 : HellblazerMissiles
{
Default
{
Inventory.Amount 3;
}
}
Class HellblazerMissileMag : HellblazerMissiles
{
Default
{
Inventory.PickupMessage "$T_HELLMISSILEMAG";
Inventory.Amount 6;
+SWWMAMMO.USEPICKUPMSG;
}
}
// ============================================================================
// Sparkster ammo
// ============================================================================
Class SparkUnit : SWWMAmmo
{
Default
{
Tag "$T_SPARKUNIT";
SWWMAmmo.PickupTag "SPARKUNIT";
Stamina 50000;
Inventory.Amount 1;
Inventory.MaxAmount 8;
Ammo.BackpackAmount 1;
Ammo.BackpackMaxAmount 24;
Ammo.DropAmount 1;
Accuracy 70;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class SparkUnit2 : SparkUnit
{
Default
{
Inventory.Amount 2;
}
}
// ============================================================================
// Silver Bullet ammo
// ============================================================================
Class SilverBulletAmmo : SWWMAmmo
{
Default
{
Tag "$T_XSBMAG";
SWWMAmmo.PickupTag "XSBMAG";
Stamina 70000;
Inventory.Amount 1;
Inventory.MaxAmount 4;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 9;
Ammo.DropAmount 1;
SWWMAmmo.MagAmmoType 'SilverBullets';
Accuracy 75;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class SilverBullets : MagAmmo
{
Default
{
Tag "$T_XSBBULLET";
MagAmmo.PickupTag "XSBBULLET";
Stamina -12000;
MagAmmo.ParentAmmo 'SilverBulletAmmo';
MagAmmo.ClipSize 5;
MagAmmo.BackpackAmount 2;
Inventory.MaxAmount 5;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class SilverBullets2 : SilverBullets
{
Default
{
Inventory.Amount 2;
}
}
Class SilverBullets3 : SilverBullets
{
Default
{
Inventory.Amount 3;
}
}
// ============================================================================
// Candygun ammo
// ============================================================================
Class CandyGunAmmo : SWWMAmmo
{
Default
{
Tag "$T_CANDYMAG";
SWWMAmmo.PickupTag "CANDYMAG";
Stamina 100000;
Inventory.Amount 1;
Inventory.MaxAmount 1;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 3;
Ammo.DropAmount 1;
SWWMAmmo.MagAmmoType 'CandyGunBullets';
Accuracy 90;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class CandyGunBullets : MagAmmo
{
Default
{
Tag "$T_CANDYBULLET";
MagAmmo.PickupTag "CANDYBULLET";
Stamina -14000;
MagAmmo.ParentAmmo 'CandyGunAmmo';
MagAmmo.ClipSize 7;
MagAmmo.BackpackAmount 1;
Inventory.MaxAmount 7;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class CandyGunBullets2 : CandyGunBullets
{
Default
{
Inventory.Amount 2;
}
}
Class CandyGunBullets3 : CandyGunBullets
{
Default
{
Inventory.Amount 3;
}
}
Class CandyGunSpares : SWWMAmmo
{
Default
{
Tag "$T_CANDYSPARE";
SWWMAmmo.PickupTag "CANDYSPARE";
Stamina 600000;
Inventory.Amount 1;
Inventory.MaxAmount 3;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 3;
}
override Inventory CreateTossable( int amt )
{
if ( Amount > 0 )
{
// drop an empty spare
let spare = Inventory(Spawn('CandyGun',Owner.Pos,NO_REPLACE));
if ( !spare ) return null;
// spare with empty mag
CandyGun(spare).AmmoGive1 = 0;
CandyGun(spare).clipcount = 0;
CandyGun(spare).chambered = false;
spare.SetState(spare.SpawnState+1);
spare.DropTime = 30;
spare.bSpecial = spare.bSolid = false;
Amount--;
return spare;
}
return null;
}
override void DoEffect()
{
Super.DoEffect();
if ( !Owner ) return;
// auto-give an empty gun if the player does not own one
if ( Owner.FindInventory('CandyGun') || (Amount <= 0) ) return;
// don't do this if the player owns a Mortal Rifle and swapweapons are enabled
if ( Owner.FindInventory('MisterRifle') && swwm_swapweapons ) return;
Amount--;
let g = CandyGun(Spawn('CandyGun'));
g.bInitialized = true;
g.ammogive1 = 0;
g.ammogive2 = 0;
g.clipcount = 0;
g.chambered = false;
g.AttachToOwner(Owner);
// make sure it doesn't autoswitch if empty
if ( !g.ReportHUDAmmo() && (Owner.player.PendingWeapon == g) )
Owner.player.PendingWeapon = WP_NOCHANGE;
}
}
// ============================================================================
// Ynykron ammo
// ============================================================================
Class YnykronAmmo : SWWMAmmo
{
Default
{
Tag "$T_YNYKRONAMMO";
SWWMAmmo.PickupTag "YNYKRONAMMO";
Inventory.PickupSound "misc/ammo_pkup_vip";
Stamina -3000000;
Inventory.Amount 1;
Inventory.MaxAmount 1;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 3;
Ammo.DropAmount 1;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}