Code: Select all
Class SuperShotgunReplacement : Actor replaces SuperShotgun
{
Default
{
+WEAPONSPAWN
}
States
{
Spawn:
TNT1 A 0 NoDelay A_JumpIf(GetCVar("New_SSG") == 0, "Random");
TNT1 A 0 A_JumpIf(GetCVar("New_SSG") == 1, "SuperShotgun"); // SuperShotgun only
TNT1 A 0 A_JumpIf(GetCVar("New_SSG") == 2, "AutoShotgun"); // AutoShotgun only
Stop;
Random:
TNT1 A 0 A_Jump(256, "SuperShotgun", "AutoShotgun");
Stop;
SuperShotgun:
TNT1 A 0 A_SpawnItem("NewSuperShotgun");
Stop;
AutoShotgun:
TNT1 A 0 A_SpawnItem("NewShotgun");
Stop;
}
}
// Exemple of the weapon
Class NewSuperShotgun : Weapon
{
Default
{
Weapon.SelectionOrder 400;
Weapon.AmmoUse 2;
Weapon.AmmoGive2 8;
Weapon.AmmoType "SuperShotgunAmmo";
Weapon.AmmoType2 "Shell";
+WEAPON.NOALERT
Inventory.PickupMessage "$GOTSHOTGUN2";
Obituary "$OB_MPSSHOTGUN";
Tag "$TAG_SUPERSHOTGUN";
}
}
In the case where we enter ' Summon NewSuperShotgun ' in the console, it will give the 8 shells of the weapon when we pick up this item.
Code: Select all
override bool TryPickup (in out Actor toucher)
{
if(toucher. (" ")).
{
A_Log("You unloaded the New Super Shotgun ");
return false;
}
else
return Super.TryPickup(toucher);
}