[Question] Lifesteal Attack for Monsters?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- RV-007
- Posts: 1501
- Joined: Fri Sep 02, 2011 9:00 pm
- Location: Dying w/ civilization or living after it
- Contact:
[Question] Lifesteal Attack for Monsters?
Is there some script/code that allows monsters to be vampires and stuff like that? The best I can think of is the PowerDrain and its PowerupGiver inventory. I can't really tell if it really works for monsters so that's why I asked here.
Re: [Question] Lifesteal Attack for Monsters?
It should. Might as well test it.RV-007 wrote:The best I can think of is the PowerDrain and its PowerupGiver inventory. I can't really tell if it really works for monsters so that's why I asked here.

-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: [Question] Lifesteal Attack for Monsters?
Well, in my tests it didn't seem to have any effect on monsters.
My guess it's a player-only powerup.
My guess it's a player-only powerup.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: [Question] Lifesteal Attack for Monsters?
I remember looking at that, and don't recall any player-specific code.
Re: [Question] Lifesteal Attack for Monsters?
Since puffs can have Death, XDeath, and Crash states that they jump to depending on whether they hit level geometry, bleeding targets, or non-bleeding targets respectively, you could use those on a puff to determine when to "steal" life. In the puff's XDeath state you'd run a script that added to the shooter's health.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: [Question] Lifesteal Attack for Monsters?
Monster melee attacks don't use puffs.
Re: [Question] Lifesteal Attack for Monsters?
Yeah... Well, you can just use a hitscan attack/projectile attack as a melee attack, in combination with things like MeleeThreshold and A_JumpIfCloser.XutaWoo wrote:Monster melee attacks don't use puffs.
- RV-007
- Posts: 1501
- Joined: Fri Sep 02, 2011 9:00 pm
- Location: Dying w/ civilization or living after it
- Contact:
Re: [Question] Lifesteal Attack for Monsters?
http://zdoom.org/wiki/A_CustomPunch
A_CustomPunch (int damage [, bool norandom [, int flags [, string pufftype, [float range[, float lifesteal]]]]]) is one statement (other than PowerDrain) that deals with lifesteal. I don't think that there is a monster attack that directly allows lifesteal. This is not much to get monsters to lifesteal targets, but I thought I put this up here.
Puff works too, in fact, it might be a automated spawn of one actor. I guess there is some script to have monsters to use PowerDrain.
There is also DamageType value DrainLife, but I have yet to use this yet.
A_CustomPunch (int damage [, bool norandom [, int flags [, string pufftype, [float range[, float lifesteal]]]]]) is one statement (other than PowerDrain) that deals with lifesteal. I don't think that there is a monster attack that directly allows lifesteal. This is not much to get monsters to lifesteal targets, but I thought I put this up here.
Puff works too, in fact, it might be a automated spawn of one actor. I guess there is some script to have monsters to use PowerDrain.
There is also DamageType value DrainLife, but I have yet to use this yet.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: [Question] Lifesteal Attack for Monsters?
That's for players, RV. It wouldn't work with monsters.
- RV-007
- Posts: 1501
- Joined: Fri Sep 02, 2011 9:00 pm
- Location: Dying w/ civilization or living after it
- Contact:
Re: [Question] Lifesteal Attack for Monsters?
There is a LifeDrain value for the DamageType actor property, but I am not sure if that would work for melee monsters (possibly for range monster) unless I used those Archvile statements (still not melee, but close enough). Still need to try out the string Pufftype later on for both melee and range.
http://zdoom.org/wiki/Damage_types
http://zdoom.org/wiki/A_VileTarget
http://zdoom.org/wiki/A_VileAttack
http://zdoom.org/wiki/A_CustomMeleeAttack
http://zdoom.org/wiki/Damage_types
http://zdoom.org/wiki/A_VileTarget
http://zdoom.org/wiki/A_VileAttack
http://zdoom.org/wiki/A_CustomMeleeAttack