ToME: the Tales of Maj'Eyal

Infinite Furnace Vent procs from enemy
Page 2 of 2

Author:  ibanix [ Sat Mar 26, 2016 11:49 pm ]
Post subject:  Re: Infinite Furnace Vent procs from enemy

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

Author:  InC [ Sun Mar 27, 2016 1:08 am ]
Post subject:  Re: Infinite Furnace Vent procs from enemy

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:
      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)

      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.

Author:  twas Brillig [ Sun Mar 27, 2016 1:39 am ]
Post subject:  Re: Infinite Furnace Vent procs from enemy

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.

Author:  ibanix [ Sun Mar 27, 2016 2:44 am ]
Post subject:  Re: Infinite Furnace Vent procs from enemy

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:

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)), 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

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.

Author:  elboyo [ Sun Mar 27, 2016 2:39 pm ]
Post subject:  Re: Infinite Furnace Vent procs from enemy

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.

Author:  GlassGo [ Sat Apr 02, 2016 7:46 am ]
Post subject:  Re: Infinite Furnace Vent procs from enemy

Me too.

Page 2 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group