[1.6.0]Ammo "elemental " ego can trigger more than 1/turn
Posted: Sun Nov 03, 2019 2:44 pm
Bug description:
Ammo's "elemental " egos says it will only trigger once per turn.
But in fact, It will trigger more than once per turn.
Step to reproduce: Wear an ammo with "elemental " ego.
Use an multi-attack archery skill (e.g. T_SKIRMISHER_NOGGIN_KNOCKER)
Corresponding code: `data/general/objects/egos/ammo.lua:325`
Possible cause:
After printing `self.turn_procs` in `mod.class.interface.Archery`, we can find out that, the exact same ammo player wear is treated as individual objects(with individual lua object ID) between shots. This is contrary to the case of melee "elemental " ego, it can correctly identify the two weapons you wear and only trigger once/twice in a flurry attack.
Possible Fix:
While I myself is not sure the cause of the object ID change of ammo between shots, unlike melee weapon, you can not wear more than one ammo. We can just use the old way like we have done in T_BLENDED_THREADS, and delete the "same ammo" check.
Ammo's "elemental " egos says it will only trigger once per turn.
But in fact, It will trigger more than once per turn.
Step to reproduce: Wear an ammo with "elemental " ego.
Use an multi-attack archery skill (e.g. T_SKIRMISHER_NOGGIN_KNOCKER)
Corresponding code: `data/general/objects/egos/ammo.lua:325`
Code: Select all
fct=function(combat, who, target, dam, special)
if table.get(who.turn_procs, "elemental_ego", combat) then return end
table.set(who.turn_procs, "elemental_ego", combat, true)
local dam = who:spellCrit(special.explosion(combat, who))
local elem = combat.elemental_element
local tg = {type="ball", radius=3, range=10, selffire = false, friendlyfire=false}
who:project(tg, target.x, target.y, elem[1], dam, {type=elem[2]})
end
After printing `self.turn_procs` in `mod.class.interface.Archery`, we can find out that, the exact same ammo player wear is treated as individual objects(with individual lua object ID) between shots. This is contrary to the case of melee "elemental " ego, it can correctly identify the two weapons you wear and only trigger once/twice in a flurry attack.
Possible Fix:
While I myself is not sure the cause of the object ID change of ammo between shots, unlike melee weapon, you can not wear more than one ammo. We can just use the old way like we have done in T_BLENDED_THREADS, and delete the "same ammo" check.