Infinite Furnace Vent procs from enemy

Where bugs go to lie down and rest

Moderator: Moderator

Message
Author
ibanix
Wyrmic
Posts: 244
Joined: Thu May 23, 2013 12:25 am

Re: Infinite Furnace Vent procs from enemy

#16 Post by ibanix »

In addition, we saw the base NPC triggering the 19 Furnance Vents, none ones that said "NPC-name's temporal clone", which is normal.
Please help with the ToME wiki!

InC
Wayist
Posts: 24
Joined: Tue Mar 15, 2016 9:38 am

Re: Infinite Furnace Vent procs from enemy

#17 Post by InC »

I'm pretty sure I know what's causing it, and it doesn't have anything to do with clones specifically. Looking at this part:

Code: Select all

      if mp and mp.stacks >= 10 and self:isTalentActive(self.T_MELTING_POINT) and self:getSteam() > 15 then
         self:callTalent(self.T_MELTING_POINT, "cleanActor") -- remove physical effect, remove 15 steam
         self:forceUseTalent(self.T_FURNACE_VENT, {ignore_energy=true, force_target={x=src.x, y=src.y}}) [NEIGH]
         self:removeEffect(self.EFF_FURNACE_MOLTEN_POINT, true, true)
      end

      if not self.turn_procs.molten_metal then self:setEffect(self.EFF_FURNACE_MOLTEN_POINT, 1, {}) end
      self.turn_procs.molten_metal = true
What's happening is that when one actor's vent triggers another actor's vent (most likely to happen with clones): forceUseTalent(T_FURNACE_VENT) from the first actor deals damage to the second actor, triggering callbackOnDamage on the second actor, which then triggers forceUseTalent(T_FURNACE_VENT) that damages the first actor and triggers callbackOnDamage again before the first one resolves. We got a feedback loop, the molten points never get removed because the code doesn't go past the [NEIGH] tag, instead it just digs deeper and deeper down stacks of forced Furnace Vent until either actor runs out of steam.

Just putting a turn limit on Melting Point procs would fix it, as long as the flag is set before calling forceUseTalent.

twas Brillig
Wyrmic
Posts: 279
Joined: Sun Nov 30, 2014 9:06 pm

Re: Infinite Furnace Vent procs from enemy

#18 Post by twas Brillig »

D'oh. That does make sense. I didn't even consider what would happen if you caused damage before resolving your own on damage callback. The only reason this is happening with clones more than sawbutcher PCs fighting sawbutcher rares is probably because clones are either taking AoE damage at the same time, or spawning with the same number of stacks -- if you get any two actors with nine stacks next to each other, one of them is going to die if someone takes energy damage.

ibanix
Wyrmic
Posts: 244
Joined: Thu May 23, 2013 12:25 am

Re: Infinite Furnace Vent procs from enemy

#19 Post by ibanix »

Good thought, InC. That's a completely reasonable possibility to explain what is happening here.

Unfortunately it's not an obvious fix; the removeEffect call can't be put before the forceUseTalent, because Furnace Vent exits immediately if the EFF_FURNACE_MOLTEN_POINT is not active.

Edit: Actually...

Since the callback is happening on damage, the fix may be for Furnace Vent to remove the Molten Point effect before the damage projection happens. Here's what's going on in Furnace Vent:

Code: Select all

action = function(self, t)
		local mp = self:hasEffect(self.EFF_FURNACE_MOLTEN_POINT)
		if not mp then return nil end
		local tg = self:getTalentTarget(t)
		local x, y = self:getTarget(tg)
		if not x or not y then return nil end
		self:project(tg, x, y, DamageType.FIRE, self:steamCrit(t.getDamage(self, t) * mp.stacks / 10))

		game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_fire", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
		game:playSoundNear(self, "talents/fireflash")
		self:removeEffect(self.EFF_FURNACE_MOLTEN_POINT, true, true)
		return true
	end,
If "self:removeEffect(self.EFF_FURNACE_MOLTEN_POINT, true, true)" got moved before the self:project call, then the issue should effectively go away. I'm assuming the callback happens as soon as the self:project happens, preventing the subsequent code from resolving until all the callbacks end.
Please help with the ToME wiki!

elboyo
Halfling
Posts: 113
Joined: Thu Jan 02, 2014 4:22 am

Re: Infinite Furnace Vent procs from enemy

#20 Post by elboyo »

Well, I'm glad that my character's death has not been in vain. I was only a few floors away from my second Embers Insane RL win though, so that still sucked. I will be extra careful around temporal cloners in the future.

GlassGo
Uruivellas
Posts: 732
Joined: Wed Nov 06, 2013 1:21 pm
Location: From Russia with atchoum!

Re: Infinite Furnace Vent procs from enemy

#21 Post by GlassGo »

Me too.
English isn't my native language.

Post Reply