Modifying damage taken

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Modifying damage taken

Post by nichg »

Is there a way to modify the amount of damage taken by an enemy from an attack (say, inside the onDamage hook?). For instance, lets say I wanted an enemy that took an extra 50% damage from fire attacks. Or I wanted to implement a variant on the Goromorg shield without the advantage of having the hard-coded thing to work with.

A partial solution would be to use setHealth I guess, but then it doesn't display the right number to the player, which would be bad if you're trying to give the impression that some things are more or less effective than others. You could use damageTile, except then you'd have to restrict it to monsters that can't form squads. Champions have a 'damage' function, but I don't think monsters do...
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Re: Modifying damage taken

Post by Wolfrug »

nichg wrote:Is there a way to modify the amount of damage taken by an enemy from an attack (say, inside the onDamage hook?). For instance, lets say I wanted an enemy that took an extra 50% damage from fire attacks. Or I wanted to implement a variant on the Goromorg shield without the advantage of having the hard-coded thing to work with.

A partial solution would be to use setHealth I guess, but then it doesn't display the right number to the player, which would be bad if you're trying to give the impression that some things are more or less effective than others. You could use damageTile, except then you'd have to restrict it to monsters that can't form squads. Champions have a 'damage' function, but I don't think monsters do...

I've been thinking about this myself, and would be happy to know if there's a solution! My first instinct would be to give the critter resistances to all other things, so that it LOOKS like your fire damage is especially powerful (even though it's simply doing its normal damage). The problem with this is of course that unless all monsters have these resistances in one way or another, it's still going to look a little odd (e.g. I know my improved fireball does about 100-120 damage a pop, and if one monster suddenly only gets 50 damage from it, I'll know something is up - even if it gets full damage from frostbolt).

-Wolfrug
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Re: Modifying damage taken

Post by nichg »

The problem is, I think you can give critters immunity, but not resistance. So you'd have monsters that are only vulnerable to one thing.
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Re: Modifying damage taken

Post by Wolfrug »

Oh right. I didn't see that. :S How unfortunate.

I suppose an onDamage hook coupled with damageTile is your best bet. From the onDamage hook you can get the champion doing the damage, the amount, and the type, which you can then translate into the damageTile command (for instance *2'ing the damage from he onDamage hook), including information on who is doing the damage (which should hopefully retain the XP). This still leaves the problem of group-style enemies though, but should work for everyone else.

-Wolfrug
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Re: Modifying damage taken

Post by nichg »

I see, so you always return false for real player-sourced damage, but then use damageTile to do all the damage you really want them to take. It'd probably break some things like enemies getting damaged by traps though.
Post Reply

Return to “Modding”