Heretic's tomed gauntlets health restore
Posted: Sun Jun 15, 2008 20:31
How do i make a weapon restore the player's health when attacking from a certain distance? something like in Heretic when using the Gauntlets and the Tome of Power.
Code: Select all
ACTOR SoulLeecherStaff : Weapon
{
Inventory.PickupMessage "Soul Leecher Staff"
Inventory.PickupSound "misc/w_pkup"
Weapon.AmmoGive 50
Weapon.AmmoType "Clip"
Weapon.Ammouse 1
Weapon.Kickback 50
+NOALERT
+FLOATBOB
States
{
Spawn:
SLEC A -1
LOOP
Ready:
SLCH A 0 SetPlayerProperty(0,1,6)
SLCH A 1 A_WeaponReady
Goto Ready
Deselect:
SLCH A 0 SetPlayerProperty(0,0,6)
SLCH A 0 A_TakeInventory("SoulLeecherHealthGiver",999) //Here
SLCH A 1 A_Lower
Goto Deselect
Select:
SLCH A 0 A_GiveInventory("SoulLeecherHealthGiver",1)
SLCH A 1 A_Raise
Goto Select
Fire:
SLCH B 0 A_Light1
SLCH B 0 A_PlayWeaponSound("weapons/soulleechfire")
SLCH B 2 Bright A_FireBullets(6,4,2,5,"BloodPuff",1)
SLCH C 0 A_Light2
SLCH C 2 Bright
SLCH D 0 A_Light0
SLCH D 2
SLCH A 1 A_ReFire
Goto Ready
}
}
Code: Select all
ACTOR SoulLeecherHealthGiver : PowerupGiver
{
Powerup.Type "Drain"
Powerup.Duration 99999
+AUTOACTIVATE
}