- Added all armor and health items. - Added Grilled Cheese Sandwich and Ghost Artifact. - Started work on Chanceboxes, just need to finish adding the drop lists. - Fixed Ammo division. - Reduced backpack amounts of some ammo types. - Added inventory box/bar to HUD, plus armor and powerup display. - Fix jumps still alerting monsters even if not boosting. - Added "future plans" document.
236 lines
5 KiB
Text
236 lines
5 KiB
Text
// Powerups go here
|
|
Class GrilledCheeseSandwich : Inventory
|
|
{
|
|
override Inventory CreateCopy( Actor other )
|
|
{
|
|
// additional lore
|
|
SWWMLoreLibrary.Add(other.player,"GCSandwich");
|
|
return Super.CreateCopy(other);
|
|
}
|
|
private void DoTheThing()
|
|
{
|
|
SWWMHandler.DoFlash(Owner,Color(64,255,255,64),10);
|
|
Owner.A_QuakeEx(9,9,9,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:1.);
|
|
Owner.A_StartSound(UseSound,CHAN_ITEM);
|
|
Owner.GiveBody(1000,1000);
|
|
let n = Owner.FindInventory("ArmorNugget");
|
|
if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount);
|
|
else n.Amount = n.MaxAmount;
|
|
let b = Owner.FindInventory("BlastSuit");
|
|
if ( !b ) Owner.GiveInventory("BlastSuit",GetDefaultByType("BlastSuit").MaxAmount);
|
|
else b.Amount = b.MaxAmount;
|
|
let w = Owner.FindInventory("WarArmor");
|
|
if ( !w ) Owner.GiveInventory("WarArmor",GetDefaultByType("WarArmor").MaxAmount);
|
|
else w.Amount = w.MaxAmount;
|
|
SWWMLoreLibrary.Add(Owner.player,"Nugget");
|
|
SWWMLoreLibrary.Add(Owner.player,"BlastSuit");
|
|
SWWMLoreLibrary.Add(Owner.player,"WarArmor");
|
|
}
|
|
override bool Use( bool pickup )
|
|
{
|
|
if ( pickup && !deathmatch ) return false;
|
|
if ( Owner.Health >= 1000 ) return false;
|
|
DoTheThing();
|
|
return true;
|
|
}
|
|
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
|
|
{
|
|
if ( passive && (Owner.Health-damage <= 0) )
|
|
{
|
|
newdamage = 0;
|
|
DoTheThing();
|
|
if ( Amount <= 0 ) DepleteOrDestroy();
|
|
}
|
|
}
|
|
|
|
Default
|
|
{
|
|
Tag "$T_SANDWICH";
|
|
Inventory.Icon "graphics/HUD/Icons/I_Sandwich.png";
|
|
Inventory.PickupSound "misc/p_pkup";
|
|
Inventory.UseSound "powerup/sandwich";
|
|
Inventory.PickupMessage "$T_SANDWICH";
|
|
Inventory.MaxAmount 5;
|
|
Inventory.InterHubAmount 5;
|
|
+INVENTORY.ALWAYSPICKUP;
|
|
+INVENTORY.AUTOACTIVATE;
|
|
+INVENTORY.INVBAR;
|
|
+COUNTITEM;
|
|
+INVENTORY.BIGPOWERUP;
|
|
+FLOATBOB;
|
|
FloatBobStrength 0.25;
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A -1;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class GhostSnd : Actor
|
|
{
|
|
Default
|
|
{
|
|
+NOBLOCKMAP;
|
|
+NOGRAVITY;
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( !target || !master )
|
|
{
|
|
Destroy();
|
|
return;
|
|
}
|
|
SetOrigin(target.pos,true);
|
|
if ( players[consoleplayer].Camera == target )
|
|
{
|
|
A_SoundVolume(CHAN_VOICE,0.);
|
|
A_SoundVolume(CHAN_7,.4);
|
|
}
|
|
else
|
|
{
|
|
A_SoundVolume(CHAN_VOICE,.1);
|
|
A_SoundVolume(CHAN_7,0.);
|
|
}
|
|
}
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
A_StartSound("powerup/ghostact",CHAN_VOICE,CHANF_LOOPING,.1,1.5);
|
|
A_StartSound("powerup/ghostact",CHAN_7,CHANF_LOOPING,.4,ATTN_NONE);
|
|
}
|
|
override void OnDestroy()
|
|
{
|
|
Super.OnDestroy();
|
|
A_StopSound(CHAN_VOICE);
|
|
A_StopSound(CHAN_7);
|
|
}
|
|
}
|
|
|
|
Class GhostPower : PowerInvisibility
|
|
{
|
|
Actor snd;
|
|
|
|
Default
|
|
{
|
|
Inventory.Icon "graphics/HUD/Icons/I_Ghost.png";
|
|
Powerup.Duration -60;
|
|
Powerup.Strength 100;
|
|
Powerup.Mode "Translucent";
|
|
Powerup.Color "F0E0FF", 0.1;
|
|
}
|
|
|
|
override void InitEffect()
|
|
{
|
|
Super.InitEffect();
|
|
if ( !Owner ) return;
|
|
Owner.bNOTARGET = true;
|
|
}
|
|
override void EndEffect()
|
|
{
|
|
Super.EndEffect();
|
|
if ( !Owner ) return;
|
|
Owner.bNOTARGET = false;
|
|
Owner.A_StartSound("powerup/ghostend",CHAN_ITEM);
|
|
if ( (EffectTics <= 0) && Owner && Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_GHOSTARTI"));
|
|
}
|
|
|
|
override void DoEffect()
|
|
{
|
|
Super.DoEffect();
|
|
if ( !Owner ) return;
|
|
if ( !snd ) snd = Spawn("GhostSnd",Owner.pos);
|
|
snd.target = Owner;
|
|
snd.master = self;
|
|
}
|
|
|
|
override void AlterWeaponSprite( VisStyle vis, in out int changed )
|
|
{
|
|
// leave weapons alone
|
|
vis.RenderStyle = STYLE_Normal;
|
|
vis.Alpha = 1.f;
|
|
changed = 1;
|
|
}
|
|
}
|
|
|
|
Class GhostArtifactX : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Add";
|
|
+NOGRAVITY;
|
|
+NOCLIP;
|
|
+DONTSPLASH;
|
|
Radius 0.1;
|
|
Height 0;
|
|
+FLOATBOB;
|
|
FloatBobStrength 0.25;
|
|
}
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
if ( !target )
|
|
{
|
|
Destroy();
|
|
return;
|
|
}
|
|
Warp(target,flags:WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION);
|
|
bInvisible = target.bInvisible||!target.InStateSequence(target.CurState,target.FindState("Spawn"));
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A -1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class GhostArtifact : Inventory
|
|
{
|
|
Default
|
|
{
|
|
Tag "$T_GHOSTARTI";
|
|
Inventory.Icon "graphics/HUD/Icons/I_Ghost.png";
|
|
Inventory.PickupSound "misc/p_pkup";
|
|
Inventory.UseSound "powerup/ghost";
|
|
Inventory.PickupMessage "$T_GHOSTARTI";
|
|
Inventory.MaxAmount 5;
|
|
Inventory.InterHubAmount 5;
|
|
+INVENTORY.ALWAYSPICKUP;
|
|
+INVENTORY.AUTOACTIVATE;
|
|
+INVENTORY.INVBAR;
|
|
+COUNTITEM;
|
|
+INVENTORY.BIGPOWERUP;
|
|
+FLOATBOB;
|
|
FloatBobStrength 0.25;
|
|
}
|
|
|
|
override bool Use( bool pickup )
|
|
{
|
|
if ( pickup && !deathmatch ) return false;
|
|
A_StartSound(UseSound,CHAN_ITEM);
|
|
let g = GhostPower(Owner.FindInventory("GhostPower"));
|
|
if ( g ) g.EffectTics = g.default.EffectTics;
|
|
else Owner.GiveInventory("GhostPower",1);
|
|
return true;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
Super.PostBeginPlay();
|
|
tracer = Spawn("GhostArtifactX",pos);
|
|
tracer.angle = angle;
|
|
tracer.target = self;
|
|
tracer.FloatBobPhase = FloatBobPhase;
|
|
}
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 A -1;
|
|
Stop;
|
|
}
|
|
}
|