Guess there's a new DLC weapon to be added, oops.
This commit is contained in:
parent
5c2ad558c4
commit
daea2d2afa
103 changed files with 247 additions and 14 deletions
53
zscript/dlc1/swwm_blastin.zsc
Normal file
53
zscript/dlc1/swwm_blastin.zsc
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// Nuutek Plasma Blaster (from SWWM series)
|
||||
// Slot 2, spawns shared with Explodium Gun
|
||||
|
||||
Class PlasmaBlast : SWWMWeapon
|
||||
{
|
||||
int clipcount, chargelevel;
|
||||
|
||||
Property ClipCount : clipcount;
|
||||
|
||||
Default
|
||||
{
|
||||
Tag "$T_PLASMABLAST";
|
||||
Inventory.PickupMessage "$T_PLASMABLAST";
|
||||
Obituary "$O_PLASMABLAST";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PlasmaBlast.png";
|
||||
Weapon.SlotNumber 2;
|
||||
Weapon.SlotPriority 3.;
|
||||
Weapon.SelectionOrder 1100;
|
||||
Inventory.MaxAmount 2;
|
||||
Weapon.SisterWeapon "DualPlasmaBlast";
|
||||
Stamina 7000;
|
||||
PlasmaBlast.ClipCount 15;
|
||||
+WEAPON.EXPLOSIVE;
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
XZW1 A -1;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class DualPlasmaBlast : SWWMWeapon
|
||||
{
|
||||
int clipcount;
|
||||
|
||||
Property ClipCount : clipcount;
|
||||
|
||||
Default
|
||||
{
|
||||
Tag "$T_PLASMABLAST2";
|
||||
Obituary "$O_PLASMABLAST";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PlasmaBlast2.png";
|
||||
Weapon.SlotNumber 2;
|
||||
Weapon.SlotPriority 4.;
|
||||
Weapon.SelectionOrder 1050;
|
||||
Weapon.SisterWeapon "PlasmaBlast";
|
||||
DualPlasmaBlast.ClipCount 15;
|
||||
+WEAPON.EXPLOSIVE;
|
||||
+SWWMWEAPON.HIDEINMENU;
|
||||
+SWWMWEAPON.NOSWAPWEAPON;
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ Class HOLYCOWIMTOTALLYGOINGSOFASTOHFUCK : Inventory
|
|||
override void DoEffect()
|
||||
{
|
||||
Super.DoEffect();
|
||||
if ( !Owner ) return;
|
||||
if ( !Owner || (Owner.Health <= 0) ) return;
|
||||
if ( (Owner.tics > 1) && (Owner.tics > max(1,Owner.CurState.tics/2)) )
|
||||
Owner.tics = max(1,Owner.CurState.tics/2);
|
||||
}
|
||||
|
|
@ -1686,7 +1686,7 @@ Class SWWMHandler : EventHandler
|
|||
override void WorldThingSpawned( WorldEvent e )
|
||||
{
|
||||
// I WANT DIE
|
||||
if ( G_SkillPropertyInt(SKILLP_ACSReturn) >= 4 )
|
||||
if ( G_SkillName() == StringTable.Localize("$SWWM_SKLUNATIC") )
|
||||
{
|
||||
if ( e.Thing.bMISSILE && !e.Thing.FindInventory("DontDuplicate") && !e.Thing.IsZeroDamage() && (e.Thing.target && e.Thing.target.bISMONSTER && !e.Thing.target.player) )
|
||||
{
|
||||
|
|
@ -2528,10 +2528,20 @@ Class SWWMHandler : EventHandler
|
|||
// drop the swapweapon if we own it first
|
||||
if ( swwm_swapweapons && (item is 'SWWMWeapon') && (sw = SWWMWeapon(def).HasSwapWeapon(players[e.Args[0]].mo)) )
|
||||
{
|
||||
bool swapto = (sw == players[e.Args[0]].ReadyWeapon);
|
||||
let drop = players[e.Args[0]].mo.DropInventory(sw);
|
||||
// add some random velocity so multiple drops don't get bunched together
|
||||
if ( drop ) drop.vel += (Actor.RotateVector((FRandom[Junk](-1.5,.5),FRandom[Junk](-2.5,2.5)),players[e.Args[0]].mo.angle),FRandom[Junk](2.,5.));
|
||||
bool swapto = (sw == players[e.Args[0]].ReadyWeapon) || (sw.SisterWeapon && (sw.Sisterweapon == players[e.Args[0]].ReadyWeapon));
|
||||
int ngun = sw.Amount;
|
||||
double ang = -15*(ngun-1);
|
||||
for ( int i=0; i<ngun; i++ )
|
||||
{
|
||||
let d = players[e.Args[0]].mo.DropInventory(sw);
|
||||
if ( !d || (ngun <= 1) ) continue;
|
||||
// adjust angle for multi-drops
|
||||
d.angle = players[e.Args[0]].mo.angle+ang;
|
||||
d.vel.xy = Actor.RotateVector((5,0),d.angle);
|
||||
d.vel.z = 1;
|
||||
d.vel += players[e.Args[0]].mo.vel;
|
||||
ang += 30;
|
||||
}
|
||||
// don't autoswitch just yet (hacky)
|
||||
if ( swapto )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,12 @@ Class SWWMWeapon : Weapon abstract
|
|||
if ( swwm_swapweapons && (sw = HasSwapWeapon(toucher)) )
|
||||
{
|
||||
if ( toucher.CheckLocalView() )
|
||||
Console.MidPrint(SmallFont,String.Format(StringTable.Localize("$SWWM_SWAPWEAPON"),sw.GetTag(),GetTag()));
|
||||
{
|
||||
// use sisterweapon tag for dual wield (slot 2 weapons)
|
||||
if ( sw.SisterWeapon && (sw.Amount > 1) )
|
||||
Console.MidPrint(SmallFont,String.Format(StringTable.Localize("$SWWM_SWAPWEAPON"),sw.SisterWeapon.GetTag(),GetTag()));
|
||||
else Console.MidPrint(SmallFont,String.Format(StringTable.Localize("$SWWM_SWAPWEAPON"),sw.GetTag(),GetTag()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
Super.Touch(toucher);
|
||||
|
|
@ -1045,8 +1050,21 @@ Class SWWMWeapon : Weapon abstract
|
|||
SWWMWeapon sw;
|
||||
if ( swwm_swapweapons && (sw = HasSwapWeapon(user)) )
|
||||
{
|
||||
if ( sw == user.player.ReadyWeapon ) swapto = true;
|
||||
user.DropInventory(sw);
|
||||
if ( (sw == user.player.ReadyWeapon) || (sw.SisterWeapon && (sw.SisterWeapon == user.player.ReadyWeapon)) )
|
||||
swapto = true;
|
||||
int ngun = sw.Amount;
|
||||
double ang = -15*(ngun-1);
|
||||
for ( int i=0; i<ngun; i++ )
|
||||
{
|
||||
let d = user.DropInventory(sw);
|
||||
if ( !d || (ngun <= 1) ) continue;
|
||||
// adjust angle for multi-drops
|
||||
d.angle = user.angle+ang;
|
||||
d.vel.xy = RotateVector((5,0),d.angle);
|
||||
d.vel.z = 1;
|
||||
d.vel += user.vel;
|
||||
ang += 30;
|
||||
}
|
||||
// don't autoswitch just yet (hacky)
|
||||
if ( swapto )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -337,6 +337,9 @@ Class ExplodiumGun : SWWMWeapon
|
|||
|
||||
override bool HandlePickup( Inventory item )
|
||||
{
|
||||
// can't hold both weapons at once
|
||||
if ( swwm_swapweapons && IsSwapWeapon(item) )
|
||||
return true;
|
||||
if ( (item.GetClass() == 'ExplodiumGun') && !item.ShouldStay() )
|
||||
{
|
||||
if ( (Amount+item.Amount > MaxAmount) && (Stamina > 0) )
|
||||
|
|
@ -515,13 +518,14 @@ Class ExplodiumGun : SWWMWeapon
|
|||
return Super.Use(pickup);
|
||||
}
|
||||
|
||||
override Inventory CreateTossable (int amt)
|
||||
override Inventory CreateTossable( int amt )
|
||||
{
|
||||
let copy = ExplodiumGun(Inventory.CreateTossable(1));
|
||||
if ( !copy ) return null;
|
||||
// destroy sister weapon if we're removing ourselves
|
||||
if ( copy == self )
|
||||
{
|
||||
copy.preinit = true; // need this in case we get picked up again out of order
|
||||
if ( SisterWeapon )
|
||||
{
|
||||
SisterWeapon.SisterWeapon = null;
|
||||
|
|
@ -559,7 +563,6 @@ Class ExplodiumGun : SWWMWeapon
|
|||
Stamina 8000;
|
||||
ExplodiumGun.ClipCount 7;
|
||||
+WEAPON.EXPLOSIVE;
|
||||
+SWWMWEAPON.NOSWAPWEAPON;
|
||||
Radius 12;
|
||||
Height 24;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue