[1.5.5] Grinding Shield code or description error

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

[1.5.5] Grinding Shield code or description error

#1 Post by jenx »

The code says it gives you projectile evasion but the description says melee evasion.

Is this a bug?

Code: Select all

	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

Erenion
Archmage
Posts: 319
Joined: Mon Feb 13, 2017 4:43 pm

Re: [1.5.5] Grinding Shield code or description error

#2 Post by Erenion »

It gives both, actually.

Code: Select all

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: Select all

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.
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.
Breaking Projection since 1.5

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.5.5] Grinding Shield code or description error

#3 Post by jenx »

Erenion wrote:It gives both, actually.

Code: Select all

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: Select all

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.
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

Post Reply