Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Herska

Poison effect to a powerup?

Recommended Posts

Hi there!

I was wondering, does anyone know how to make a poison effect, take health away gradually for a desired period of time?

I tried making a powerup with an effect that upon touching, player starts losing health but can gain health by killing enemies (drain effect).

I don't know how to make this properly, the code looks like this at the moment and it takes all the to_be_gradually_removed health away upon impact. I would like the poison effect to last for a minute and 300 health points were to be taken away gradually in that time. Help me out!

//BloodLustSphere start
actor BloodthirstSphere : CustomInventory 10077
{
inventory.pickupmessage "You wither without your enemies' blood..."
inventory.maxamount 0
inventory.pickupsound "misc/p_pkup"
+INVENTORY.FANCYPICKUPSOUND
+INVENTORY.AUTOACTIVATE
+COUNTITEM
+INVENTORY.ALWAYSPICKUP
states
{
Spawn:
BLST ABCD 6 BRIGHT
loop
Pickup:
TNT1 A 0 A_GiveInventory("BloodthirstSphereHealth",1)
TNT1 A 0 A_GiveInventory("BloodthirstSphereDrain",1)
stop
}
}
actor BloodthirstSphereHealth : Health
{
inventory.pickupmessage ""
inventory.amount -50
inventory.maxamount 200
+INVENTORY.AUTOACTIVATE
-COUNTITEM
+INVENTORY.ALWAYSPICKUP
states
{
Spawn:
TNT1 A -1
stop
}
}
actor BloodthirstSphereDrain : PowerupGiver
{
inventory.pickupmessage ""
powerup.type "Drain"
powerup.duration -60
inventory.maxamount 0
+INVENTORY.AUTOACTIVATE
-COUNTITEM
+INVENTORY.ALWAYSPICKUP
states
{
Spawn:
TNT1 A -1
stop
}
}
//Bloodthirstsphere end

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×