[1.6.0]Ammo "elemental " ego can trigger more than 1/turn

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
starsapphire
Thalore
Posts: 132
Joined: Sat Sep 27, 2014 11:33 am
Location: Irkkk

[1.6.0]Ammo "elemental " ego can trigger more than 1/turn

#1 Post by starsapphire »

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:
QQimg20191103224212.png
QQimg20191103224212.png (49.99 KiB) Viewed 2132 times
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
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.

Post Reply