[1.6b]Counter Shot

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
nsrr
Sher'Tul
Posts: 1126
Joined: Mon Sep 21, 2015 8:45 pm
Location: Middle of Nowhere

[1.6b]Counter Shot

#1 Post by nsrr »

Bug
Counter Shot (Buckler Training #4) does not fire a counter shot when deflecting a projectile, as the talent states.

Fix
Update mod/class/Actor.lua:on_project_acquire to trigger the talent if it is know when a projectile is deflected, as below.

Code: Select all

function _M:on_project_acquire(tx, ty, who, t, x, y, damtype, dam, particles, is_projectile, mods)
   if is_projectile and self:attr("projectile_evasion") and rng.percent(self.projectile_evasion) then
      if self:knowTalent(self.T_SKIRMISHER_COUNTER_SHOT) then
          local tal = self:getTalentFromId(self.T_SKIRMISHER_COUNTER_SHOT)
          tal.doCounter(self, tal, who)
      end
      local spread = self.projectile_evasion_spread or 1
      mods.x = x + rng.range(-spread, spread)
      mods.y = y + rng.range(-spread, spread)

      local dir = game.level.map:compassDirection(mods.x-x, mods.y-y)
      if not dir then
         dir = "but fumbles!"
      else
         dir = "to the "..dir.."!"
      end
      self:logCombat(who, "#Source# deflects the projectile from #Target# %s", dir)
      return true
   end
end
Edit: Corrected the talent id in the fixed code. I forgot that Skirmisher talents all have defined short_names with 'SKIRMISHER' at the beginig for some reason.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [1.6b]Counter Shot

#2 Post by darkgod »

fixed
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply