Heretic's tomed gauntlets health restore
Moderator: wildweasel
- DuduKrazy
- Posts: 402
- Joined: Sun Dec 25, 2005 18:59
Heretic's tomed gauntlets health restore
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.
- DuduKrazy
- Posts: 402
- Joined: Sun Dec 25, 2005 18:59
ok. i managed to make a weapon that restores health when attacking a monster. i made a dummy drain powerup. but the problem is that the powerup doesn't wear off when deselecting the weapon.
The weapon code
The dummy drain powerup code
The weapon code
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
}
}
The dummy drain powerup code
Code: Select all
ACTOR SoulLeecherHealthGiver : PowerupGiver
{
Powerup.Type "Drain"
Powerup.Duration 99999
+AUTOACTIVATE
}