ok, i want to make a vampire like weapon, this gun can drain life(cause damage) and give some heath for the player.
its possible to do using only "pain state"?(A_TakeFromTarget/A_GiveToTarget).
thanks.
if someone know a monster/gun similat a it, please tel me, and i can study the codes.
how to make a life drain gun?(regen heath, cause damage)
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: how to make a life drain gun?(regen heath, cause damage)
There are two ways I can think of to do this. The first is having the gun give a [wiki]Classes:PowerDrain[/wiki] when equipped or attacking, since it needs to be a gun. If it were a melee attack, [wiki]A_CustomPunch[/wiki] has a life steal property built right in, of which there seems to be no close equivalent for projectile and hitscan attacks.
Re: how to make a life drain gun?(regen heath, cause damage)
powerdrain seem to work for me.
i thinked about pain state.
////
pain.lifedrain:
POSS G 3 A_pain
POSS G 1 A_GiveToTarget(heath)
goto ready
////
also, the bullet/projectile has "damagetype "lifedrain", or something like it.
powerdrain help a lot, thanks
i thinked about pain state.
////
pain.lifedrain:
POSS G 3 A_pain
POSS G 1 A_GiveToTarget(heath)
goto ready
////
also, the bullet/projectile has "damagetype "lifedrain", or something like it.
powerdrain help a lot, thanks
Re: how to make a life drain gun?(regen heath, cause damage)
Code: Select all
ACTOR VampirePuff:BulletPuff
{
+PUFFGETSOWNER
States
{
XDeath:
TNT1 A 0 A_GiveToTarget("HealthBonus")
PUFF ABCDE 3 BRIGHT
Stop
}
}
Re: how to make a life drain gun?(regen heath, cause damage)
So, give power drain for just the duration of the states? This would apply to the death state of the projectile as well, correct?