[Question] Lifesteal Attack for Monsters?

Archive of the old editing forum
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.
Locked
User avatar
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?

Post by RV-007 »

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.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: [Question] Lifesteal Attack for Monsters?

Post by Ghastly »

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.
It should. Might as well test it. :D
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: [Question] Lifesteal Attack for Monsters?

Post by Blue Shadow »

Well, in my tests it didn't seem to have any effect on monsters.

My guess it's a player-only powerup.
User avatar
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?

Post by NeuralStunner »

I remember looking at that, and don't recall any player-specific code.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: [Question] Lifesteal Attack for Monsters?

Post by amv2k9 »

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.
User avatar
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?

Post by XutaWoo »

Monster melee attacks don't use puffs.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: [Question] Lifesteal Attack for Monsters?

Post by amv2k9 »

XutaWoo wrote:Monster melee attacks don't use puffs.
Yeah... Well, you can just use a hitscan attack/projectile attack as a melee attack, in combination with things like MeleeThreshold and A_JumpIfCloser.
User avatar
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?

Post by RV-007 »

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.
User avatar
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?

Post by XutaWoo »

That's for players, RV. It wouldn't work with monsters.
User avatar
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?

Post by RV-007 »

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
Locked

Return to “Editing (Archive)”