2016-10-18 16:11:13 +00:00
|
|
|
|
|
|
|
// Healing Radius Artifact --------------------------------------------------
|
|
|
|
|
2016-11-26 23:18:07 +00:00
|
|
|
class ArtiHealingRadius : Inventory
|
2016-10-18 16:11:13 +00:00
|
|
|
{
|
2016-11-26 23:18:07 +00:00
|
|
|
const HEAL_RADIUS_DIST = 255.;
|
|
|
|
|
2016-10-18 16:11:13 +00:00
|
|
|
Default
|
|
|
|
{
|
|
|
|
+COUNTITEM
|
|
|
|
+FLOATBOB
|
|
|
|
Inventory.DefMaxAmount;
|
|
|
|
+INVENTORY.INVBAR
|
|
|
|
+INVENTORY.FANCYPICKUPSOUND
|
|
|
|
Inventory.PickupFlash "PickupFlash";
|
|
|
|
Inventory.Icon "ARTIHRAD";
|
|
|
|
Inventory.PickupSound "misc/p_pkup";
|
|
|
|
Inventory.PickupMessage "$TXT_ARTIHEALINGRADIUS";
|
|
|
|
Tag "$TAG_ARTIHEALINGRADIUS";
|
|
|
|
}
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
HRAD ABCDEFGHIJKLMNOP 4 Bright;
|
|
|
|
Loop;
|
2016-11-26 23:18:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override bool Use (bool pickup)
|
|
|
|
{
|
|
|
|
bool effective = false;
|
|
|
|
Name mode = 'Health';
|
|
|
|
|
|
|
|
PlayerPawn pp = PlayerPawn(Owner);
|
|
|
|
if (pp) mode = pp.HealingRadiusType;
|
|
|
|
|
|
|
|
for (int i = 0; i < MAXPLAYERS; ++i)
|
|
|
|
{
|
2018-04-03 09:41:51 +00:00
|
|
|
if (!playeringame[i])
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2016-11-26 23:18:07 +00:00
|
|
|
PlayerPawn mo = players[i].mo;
|
2018-04-03 09:41:51 +00:00
|
|
|
if (mo != null && mo.health > 0 && mo.Distance2D (Owner) <= HEAL_RADIUS_DIST)
|
2016-11-26 23:18:07 +00:00
|
|
|
{
|
|
|
|
// Q: Is it worth it to make this selectable as a player property?
|
|
|
|
// A: Probably not - but it sure doesn't hurt.
|
|
|
|
bool gotsome=false;
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case 'Armor':
|
|
|
|
for (int j = 0; j < 4; ++j)
|
|
|
|
{
|
|
|
|
HexenArmor armor = HexenArmor(Spawn("HexenArmor"));
|
|
|
|
armor.health = j;
|
|
|
|
armor.Amount = 1;
|
|
|
|
if (!armor.CallTryPickup (mo))
|
|
|
|
{
|
|
|
|
armor.Destroy ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gotsome = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'Mana':
|
|
|
|
{
|
2018-12-21 11:32:36 +00:00
|
|
|
int amount = random[HealRadius](50, 99);
|
2016-11-26 23:18:07 +00:00
|
|
|
|
|
|
|
if (mo.GiveAmmo ("Mana1", amount) ||
|
|
|
|
mo.GiveAmmo ("Mana2", amount))
|
|
|
|
{
|
|
|
|
gotsome = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
//case NAME_Health:
|
2018-12-21 11:32:36 +00:00
|
|
|
gotsome = mo.GiveBody (random[HealRadius](50, 99));
|
2016-11-26 23:18:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (gotsome)
|
|
|
|
{
|
|
|
|
mo.A_PlaySound ("MysticIncant", CHAN_AUTO);
|
|
|
|
effective=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return effective;
|
|
|
|
|
2016-10-18 16:11:13 +00:00
|
|
|
}
|
2016-11-26 23:18:07 +00:00
|
|
|
|
2016-10-18 16:11:13 +00:00
|
|
|
}
|
|
|
|
|