Page 1 of 1

[1.6.4] Mitosis wrong split chance

Posted: Sun Dec 08, 2019 8:50 pm
by zczczc1680
Codes in Actor.lua

Code: Select all

if value > 0 and self:knowTalent(self.T_MITOSIS) and self:isTalentActive(self.T_MITOSIS) then
		local t = self:getTalentFromId(self.T_MITOSIS)
		local chance = t.getChance(self, t)
		local perc = math.min(1, 3 * value / self.life)
		if rng.percent(chance * perc) then
			t.spawn(self, t, value * 2)
		end

The tooltip says: format(t.getMaxHP(self, t), t.getChance(self, t)*3/100, t.getMax(self, t), t.getSummonTime(self, t), t.getOozeResist(self, t), xs)


1. The split chance indecated by tooltip is actually 3 times the real (max) chance : chance * perc <= chance * 1 = t.getChance(self, t)
For example, assumed that the chance dispalyed in tooltip says "percentage of your health lost times 1.59" (refer image attachment), one hit with value equals player's current life only has 1.59/3 = 53% chance to spawn an ooze.

2. Interaction with "die_at": if player's life is lower than 0, the chance will be negative(since 3 * value / self.life < 0) and oozes will never spawn.

Re: [1.6.4] Mitosis wrong split chance

Posted: Sun Dec 29, 2019 5:46 pm
by Steven Aus
Yes, please fix.

Re: [1.6.4] Mitosis wrong split chance

Posted: Sun Dec 29, 2019 7:19 pm
by darkgod
Fixed the die_at part; not sure what you mean for the chance?

Re: [1.6.4] Mitosis wrong split chance

Posted: Sun Dec 29, 2019 7:52 pm
by Steven Aus
From what I can gather from the OP, the chance indicated in the tooltip is different from the actual functional code.

Re: [1.6.4] Mitosis wrong split chance

Posted: Mon Dec 30, 2019 4:08 pm
by visage
zczczc1680 wrote:Codes in Actor.lua

Code: Select all

if value > 0 and self:knowTalent(self.T_MITOSIS) and self:isTalentActive(self.T_MITOSIS) then
		local t = self:getTalentFromId(self.T_MITOSIS)
		local chance = t.getChance(self, t)
		local perc = math.min(1, 3 * value / self.life)
		if rng.percent(chance * perc) then
			t.spawn(self, t, value * 2)
		end
The tooltip says: ... t.getChance(self, t)*3/100
Ok, so if you're hit for 50% of your current life, then...

According to the tooltip, the likelihood of spawning an ooze is 50% * 3 * getChance.

According to the actual code, it's the lower of getChance * 1 and getChance * 3 * 50%.

It looks like the only place that the talent description is misleading is that life lost above 1/3 of your current is ignored in this calculation. (This could be fixed by including getChance before the math.min is applied.)

Am I reading this correctly?