swwmgz_m/zscript/swwm_health.zsc

198 lines
3.8 KiB
Text

// all the healing items go here
Class HealthNugget : Health
{
Default
{
Inventory.Amount 1;
Inventory.MaxAmount 200;
}
}
Class TetraHealth : Health
{
Default
{
Inventory.Amount 10;
Inventory.MaxAmount 100;
}
}
Class CubeHealth : Health
{
Default
{
Inventory.Amount 20;
Inventory.MaxAmount 100;
}
}
Class RefresherHealth : Health
{
Default
{
Inventory.Amount 100;
Inventory.MaxAmount 500;
}
}
Class RefresherRegen : Powerup
{
Default
{
Inventory.Icon "graphics/HUD/Icons/I_Refresher.png";
Powerup.Duration -50;
Powerup.Strength 10;
+INVENTORY.ADDITIVETIME;
}
override void EndEffect()
{
Super.EndEffect();
if ( (EffectTics <= 0) && Owner && Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_REFRESHER"));
}
override void DoEffect()
{
Super.DoEffect();
if ( Owner && (Owner.health > 0) && !((EffectTics-5)%175) )
{
if ( Owner.GiveBody(int(Strength),500) )
{
SWWMScoreObj.Spawn(int(Strength),Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMHandler.DoFlash(Owner,Color(32,224,128,255),10);
Owner.A_StartSound("powerup/refresher",CHAN_ITEM,CHANF_LOCAL,.4);
}
}
}
}
Class HealthNuggetItem : SWWMHealth
{
override Inventory CreateCopy( Actor other )
{
// additional lore
SWWMLoreLibrary.Add(other.player,"Nugget");
return Super.CreateCopy(other);
}
Default
{
Tag "$T_NUGGETH";
Stamina 200;
Inventory.Icon "graphics/HUD/Icons/I_HealthNugget.png";
Inventory.PickupMessage "$T_NUGGETH";
Inventory.MaxAmount 20;
Inventory.InterHubAmount 20;
SWWMHealth.GiveHealth "HealthNugget";
+INVENTORY.ALWAYSPICKUP;
Radius 6;
Height 20;
}
States
{
Spawn:
XZW1 # -1 NoDelay
{
frame = Random[Nugget](0,7);
}
Stop;
Dummy:
XZW1 ABCDEFGH -1;
Stop;
}
}
Class TetraHealthItem : SWWMHealth
{
override Inventory CreateCopy( Actor other )
{
// additional lore
SWWMLoreLibrary.Add(other.player,"HealthGeom");
return Super.CreateCopy(other);
}
Default
{
Tag "$T_TETRAHEALTH";
Stamina 3000;
Inventory.Icon "graphics/HUD/Icons/I_HealthTetra.png";
Inventory.PickupMessage "$T_TETRAHEALTH";
Inventory.MaxAmount 15;
Inventory.InterHubAmount 15;
SWWMHealth.GiveHealth "TetraHealth";
Radius 8;
Height 24;
}
States
{
Spawn:
XZW1 # -1;
Stop;
}
}
Class CubeHealthItem : SWWMHealth
{
override Inventory CreateCopy( Actor other )
{
// additional lore
SWWMLoreLibrary.Add(other.player,"HealthGeom");
return Super.CreateCopy(other);
}
Default
{
Tag "$T_CUBEHEALTH";
Stamina 8000;
Inventory.Icon "graphics/HUD/Icons/I_HealthCube.png";
Inventory.PickupMessage "$T_CUBEHEALTH";
Inventory.MaxAmount 10;
Inventory.InterHubAmount 10;
SWWMHealth.GiveHealth "CubeHealth";
Radius 8;
Height 24;
}
States
{
Spawn:
XZW1 # -1;
Stop;
}
}
Class RefresherItem : SWWMHealth
{
override Inventory CreateCopy( Actor other )
{
// additional lore
SWWMLoreLibrary.Add(other.player,"Refresher");
return Super.CreateCopy(other);
}
override void AutoUseExtra()
{
let p = Powerup(Owner.FindInventory("RefresherRegen"));
if ( p ) p.EffectTics += p.default.EffectTics;
else Owner.GiveInventory("RefresherRegen",1);
SWWMHandler.DoFlash(Owner,Color(80,224,128,255),20);
}
override bool Use( bool pickup )
{
if ( pickup && !deathmatch ) return false;
return Super.Use(pickup);
}
Default
{
Tag "$T_REFRESHER";
Stamina 160000;
Inventory.Icon "graphics/HUD/Icons/I_Refresher.png";
Inventory.PickupMessage "$T_REFRESHER";
Inventory.PickupSound "misc/p_pkup";
Inventory.UseSound "powerup/refresheruse";
SWWMHealth.GiveHealth "RefresherHealth";
+COUNTITEM;
+INVENTORY.BIGPOWERUP;
+INVENTORY.ALWAYSPICKUP;
Radius 6;
Height 24;
}
States
{
Spawn:
XZW1 # -1;
Stop;
}
}