ToME: the Tales of Maj'Eyal
http://forums.te4.org/

How does the Ghoul talent work, and why did my ghoul die?
http://forums.te4.org/viewtopic.php?f=38&t=47842
Page 1 of 1

Author:  Bananadine [ Thu May 18, 2017 3:07 am ]
Post subject:  How does the Ghoul talent work, and why did my ghoul die?

The Ghoul talent says it puts a cap on an incoming "blow", at 50% of your maximal health. I put in the talent points to get this. A random boss snake used Telekinetic Smash to inflict 290 damage on me at a time when my maximal health was 402. This surprised me.

But the 290 damage was the sum of ten components (81 physical, 2 nature, 8 acid, et cetera), none of which was higher than 201 by itself. Also, the attack, according to the description of Telekinetic Smash and the pattern I see in the numbers, was probably actually two weapon strikes, inflicting 6 and 4 of those 10 components respectively; and it looks like neither of the two strikes hurt for more than 201.

So I'm guessing the 50% cap applied to each of the two strikes, not to the entire attack (because that would have clamped the 290 down to 201) and not to each of the ten components of the attack (because that would be strange). Am I right?

If so, I guess I need to be more careful around melee fighters, because they do tend to have various ways of dividing single ability uses into multiple weapon strikes. :(

Author:  Micbran [ Thu May 18, 2017 3:13 am ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

Its for one instance of damage, yes. You'd have to take a large amount of damage from a single source and have it do more than half your HP.

Author:  Bananadine [ Thu May 18, 2017 3:55 am ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

It looks like you're confirming my analysis, but I don't immediately understand what an "instance" of damage is.

Author:  Number43 [ Thu May 18, 2017 4:23 am ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

Basically, any damage that is listed separately in the damage log, even if it's part of the same line.

Author:  Bananadine [ Thu May 18, 2017 4:39 am ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

So the cap really does get applied ten times in my example, and not two, and not one?

More simply: If Jimmy the Barbarian is wielding his starting greatsword and wearing storm gloves that add 6 lightning damage, and he does a single, basic attack on a ghoul with 5 points in Ghoul, and this single attack tries to inflict 10 physical damage and 6 lightning damage, and the ghoul's maximal health is 14, then the damage will be clamped down to 7 physical, 6 lightning?

I would expect it to be clamped down to 7 damage period, which I guess would require the game to reduce the two types proportionately; but it's not like that's difficult math or anything. It's clearly incorrect behavior (according to the Ghoul talent description) for every little bit of extra flat damage from equipment to be capped by itself. Like, if you have storm gloves, a ring of blinding strikes, and some kind of hat that adds four damage types, does that mean that every time you swing your sword you are also adding a punch, a ring-nudge, and four headbutts?

Of course the easy way to fix such a bug would be to simply change the description.

Author:  Micbran [ Thu May 18, 2017 11:42 am ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

Quote:
Your body also becomes incredibly resilient to damage, you can never take a blow that deals more than 10–50 your maximum life.


A single blow implies one instance of damage. If a rogue hits you with flurry for 800 damage while you're a Ghoul with 800 life, you'll be one hit ko'd... or maybe not. If the first hit crits and deals 600, it will be reduced to 400. That's intended. If the other hits all did 100,200,100,200,100 respectively you'd still die. That's intended.

Author:  Bananadine [ Thu May 18, 2017 2:34 pm ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

Yeah and what if you take a SINGLE plain attack for 800--okay then it's supposed to be reduced to 400. Except maybe the attacker then puts on a ring of elemental fury or some such and does it again, and now the attack is split into several small chunks that all slip below the threshold, so you die from the same single "blow". If I'm understanding right.

I would hope that's not what's intended; that's silly and unintuitive, and it fails to match the text. Although I'm still not clear on whether that's how it works. I guess this game is open-source? Maybe I'll just look at the code or something.

Author:  Erenion [ Thu May 18, 2017 2:43 pm ]
Post subject:  Re: How does the Ghoul talent work, and why did my ghoul die

Relevant code to save some search time:

Ghoul racial
Code:
newTalent{
   name = "Ghoul",
   type = {"undead/ghoul", 1},
   mode = "passive",
   require = undeads_req1,
   points = 5,
   statBonus = function(self, t) return math.ceil(self:combatTalentScale(t, 2, 15, 0.75)) end,
   getMaxDamage = function(self, t) return math.max(50, 100 - self:getTalentLevelRaw(t) * 10) end,
   passives = function(self, t, p)
      self:talentTemporaryValue(p, "inc_stats", {[self.STAT_STR]=t.statBonus(self, t)})
      self:talentTemporaryValue(p, "inc_stats", {[self.STAT_CON]=t.statBonus(self, t)})
      self:talentTemporaryValue(p, "flat_damage_cap", {all=t.getMaxDamage(self, t)})
   end,
   info = function(self, t)
      return ([[Improves your ghoulish body, increasing Strength and Constitution by %d.
      Your body also becomes incredibly resilient to damage, you can never take a blow that deals more than %d%% of your maximum life.]])
      :format(t.statBonus(self, t), t.getMaxDamage(self, t))
   end,
}


Where the reduction is handled (actor.lua)
Code:
if self.flat_damage_cap and self.max_life and death_note and death_note.damtype then
      local cap = nil
      if self.flat_damage_cap.all then cap = self.flat_damage_cap.all end
      if self.flat_damage_cap[death_note.damtype] then cap = self.flat_damage_cap[death_note.damtype] end
      if cap and cap > 0 then
         local ignored = math.max(0, value - cap * self.max_life / 100)
         if ignored > 0 then game:delayedLogDamage(src, self, 0, ("#LIGHT_GREY#(%d resilience)#LAST#"):format(ignored), false) end
         value = value - ignored
         print("[TAKE HIT] after flat damage cap", value)
      end
   end

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/