ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Sep 23, 2020 10:59 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jun 22, 2017 10:11 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
The code says it gives you projectile evasion but the description says melee evasion.

Is this a bug?

Code:
   getEvasion = function(self, t) return self:combatTalentLimit(t, 50, 12, 25), 1 end,
   getFlatMax = function(self, t) return self:combatTalentLimit(t, 50, 100, 70), 1 end,
   callbackOnHit = function(self, t, val, src, death_note)
      if src and src.x and src.y and self.x and self.y and core.fov.distance(self.x, self.y, src.x, src.y) > 1 then return end
      local ev, spread = t.getEvasion(self, t)
      val.value = val.value * (100 - ev) / 100
      return true
   end,
   activate = function(self, t)
      local ret = {}
      local ev, spread = t.getEvasion(self, t)
      self:talentTemporaryValue(ret, "projectile_evasion", ev)
      self:talentTemporaryValue(ret, "projectile_evasion_spread", spread)
      self:talentTemporaryValue(ret, "flat_damage_cap", {all = t.getFlatMax(self, t)})
      if self:knowTalent(self.T_BATTLEFIELD_VETERAN) then
         self:talentTemporaryValue(ret, "die_at", -self:callTalent(self.T_BATTLEFIELD_VETERAN, "getLife"))
      end
      return ret
   end,
   deactivate = function(self, t, p)
      return true
   end,
   info = function(self, t)
      local ev, spread = t.getEvasion(self, t)
      local flat = t.getFlatMax(self, t)
      return ([[Spin your saws wildly around you to create a wall of steamy sawteeth.
      All melee damage against you is reduced by %d%%, you have %d%% chance to evade projectiles and you can never take a blow that deals more than %d%% of your max life.
      #{italic}#Split their bones on the saws of death!#{normal}#]])
      :format(ev, ev, flat)
   end,
}

_________________
MADNESS rocks


Top
 Profile  
 
PostPosted: Thu Jun 22, 2017 10:29 am 
Offline
Wyrmic

Joined: Mon Feb 13, 2017 4:43 pm
Posts: 227
It gives both, actually.

Code:
callbackOnHit = function(self, t, val, src, death_note)
      if src and src.x and src.y and self.x and self.y and core.fov.distance(self.x, self.y, src.x, src.y) > 1 then return end
      local ev, spread = t.getEvasion(self, t)
      val.value = val.value * (100 - ev) / 100
      return true
end,

This part handles melee damage reduction. As the description says, all damage you take from attackers in melee distance is reduced.

Code:
local ev, spread = t.getEvasion(self, t)
self:talentTemporaryValue(ret, "projectile_evasion", ev)
self:talentTemporaryValue(ret, "projectile_evasion_spread", spread)

This part handles the projectile evasion.

Quote:
All melee damage against you is reduced by %d%%, you have %d%% chance to evade projectiles and you can never take a blow that deals more than %d%% of your max life.

And as we can see, both are mentioned in the description.


Top
 Profile  
 
PostPosted: Thu Jun 22, 2017 10:44 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
Erenion wrote:
It gives both, actually.

Code:
callbackOnHit = function(self, t, val, src, death_note)
      if src and src.x and src.y and self.x and self.y and core.fov.distance(self.x, self.y, src.x, src.y) > 1 then return end
      local ev, spread = t.getEvasion(self, t)
      val.value = val.value * (100 - ev) / 100
      return true
end,

This part handles melee damage reduction. As the description says, all damage you take from attackers in melee distance is reduced.

Code:
local ev, spread = t.getEvasion(self, t)
self:talentTemporaryValue(ret, "projectile_evasion", ev)
self:talentTemporaryValue(ret, "projectile_evasion_spread", spread)

This part handles the projectile evasion.

Quote:
All melee damage against you is reduced by %d%%, you have %d%% chance to evade projectiles and you can never take a blow that deals more than %d%% of your max life.

And as we can see, both are mentioned in the description.


Aha!! You have helped me solve a mystery in another part of the code !! Thanks.

And yes, this then is not a bug.

_________________
MADNESS rocks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group