* Constantly heals the player when below 20 HP.
* Administers a morphine shot in the form of PowerProtection when below 30 HP, limited to doing so once every 3 minutes.
* Stays active permanently, even if the player dies and respawns, for the sake of functioning in coop with respawning enabled.
I know how to achieve the last part of this, I think, but I know bugger all for how to achieve the first two. What I've got so far:
- Code: Select all • Expand view
actor HarnessHeal : PowerRegeneration /// Slow healing powerup, given via script.
{
Powerup.Duration 0x7FFFFFFF
Powerup.Strength 1
+INVENTORY.HUBPOWER
+INVENTORY.PERSISTENTPOWER
}
actor HarnessMorphine : PowerProtection /// Damage resistance, given via script.
{
Powerup.Duration -60
DamageFactor "Normal", 0.7
+INVENTORY.HUBPOWER
+INVENTORY.PERSISTENTPOWER
}
actor MedicalHarness : CustomInventory
{
Inventory.PickupMessage "Picked up a Medical Harness!"
Tag "MT-12B Medical Harness (Heals below 20 HP, morphine below 30 HP)"
Inventory.Icon "MDHRB0"
Inventory.Amount 1
Inventory.MaxAmount 1
+AUTOACTIVATE
+INVENTORY.INVBAR
States
{
Spawn:
MDHR A -1
Loop
Pickup:
MDHR A 0 A_GiveInventory("HarnessToken",1) /// Token would probably be necessary for the health script to function.
MDHR A 0 A_GiveInventory("MorphineToken",1) /// Ditto
Stop
}
}
actor HarnessToken : Inventory /// Token for healing
{
Inventory.MaxAmount 1
}
actor MorphineToken : Inventory /// Token for morphine
{
Inventory.MaxAmount 1
}
A script was written for me for handling a weapon limit system, and I've reverse engineered that to work with similar items that grants permanent damage resistance and increases run speed/jump height, respectively. I started working a similar script based off that, but quickly realized that I have no idea what I am doing here.
Any help would be much appreciated!