How does the Ghoul talent work, and why did my ghoul die?

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
Bananadine
Halfling
Posts: 91
Joined: Wed Mar 25, 2009 3:27 pm

How does the Ghoul talent work, and why did my ghoul die?

#1 Post by Bananadine »

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. :(

Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

Re: How does the Ghoul talent work, and why did my ghoul die

#2 Post by Micbran »

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.
A little bit of a starters guide written by yours truly here.

Bananadine
Halfling
Posts: 91
Joined: Wed Mar 25, 2009 3:27 pm

Re: How does the Ghoul talent work, and why did my ghoul die

#3 Post by Bananadine »

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

Number43
Wyrmic
Posts: 239
Joined: Tue Dec 20, 2016 7:46 pm

Re: How does the Ghoul talent work, and why did my ghoul die

#4 Post by Number43 »

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

Bananadine
Halfling
Posts: 91
Joined: Wed Mar 25, 2009 3:27 pm

Re: How does the Ghoul talent work, and why did my ghoul die

#5 Post by Bananadine »

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.

Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

Re: How does the Ghoul talent work, and why did my ghoul die

#6 Post by Micbran »

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.
A little bit of a starters guide written by yours truly here.

Bananadine
Halfling
Posts: 91
Joined: Wed Mar 25, 2009 3:27 pm

Re: How does the Ghoul talent work, and why did my ghoul die

#7 Post by Bananadine »

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.

Erenion
Archmage
Posts: 319
Joined: Mon Feb 13, 2017 4:43 pm

Re: How does the Ghoul talent work, and why did my ghoul die

#8 Post by Erenion »

Relevant code to save some search time:

Ghoul racial

Code: Select all

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: Select all

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
Breaking Projection since 1.5

Post Reply