222 lines
4.5 KiB
Text
222 lines
4.5 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) ) return;
|
|
if ( !Owner.GiveBody(int(Strength),500) ) return;
|
|
SWWMScoreObj.Spawn(int(Strength),Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
|
|
SWWMHandler.DoFlash(Owner,Color(32,224,128,255),10);
|
|
Owner.A_StartSound("powerup/refresher",CHAN_ITEM,CHANF_LOCAL,.4);
|
|
if ( Owner is 'Demolitionist' )
|
|
Demolitionist(Owner).lastbump *= 0.99;
|
|
}
|
|
}
|
|
|
|
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 4;
|
|
Height 22;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
XZW1 # -1 NoDelay
|
|
{
|
|
frame = Random[Nugget](0,7);
|
|
}
|
|
Stop;
|
|
Dummy:
|
|
XZW1 ABCDEFGH -1;
|
|
Stop;
|
|
}
|
|
}
|
|
Class HealthNuggetBundleSpawn : Actor
|
|
{
|
|
override void PostBeginPlay()
|
|
{
|
|
if ( bCOUNTSECRET ) level.total_secrets--;
|
|
int bnd = Random[Bundle](2,3);
|
|
for ( int i=0; i<bnd; i++ )
|
|
{
|
|
let a = Spawn("HealthNuggetItem",Vec3Angle(8,i*(360/bnd)));
|
|
a.special = special;
|
|
a.angle = i*(360/bnd);
|
|
for ( int j=0; j<5; j++ ) a.args[j] = args[j];
|
|
if ( bCOUNTSECRET )
|
|
{
|
|
a.bCOUNTSECRET = true;
|
|
level.total_secrets++;
|
|
}
|
|
}
|
|
Destroy();
|
|
}
|
|
}
|
|
|
|
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( bool recursive )
|
|
{
|
|
// regen effect doesn't stack if we autoactivated recursively
|
|
if ( recursive ) return;
|
|
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);
|
|
if ( Owner is 'Demolitionist' )
|
|
Demolitionist(Owner).lastbump *= 0.95;
|
|
}
|
|
override bool Use( bool pickup )
|
|
{
|
|
// never get auto-used on pickup unless we're in deathmatch
|
|
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;
|
|
}
|
|
}
|