Arcane shield
Posted: Mon Sep 17, 2012 10:17 pm
Presently Arcane Shield does not generate a dam shield if another shield is already present. It makes sense is a real shield is actually active. But frequently you can have very small shields generated for instance by the fiery choker and some fire damage. The user can remove the shield, but it is tedious and if he forgets to do that and expect the raise of a good protection the consequences can be fatal.
So I would suggest to automatically replace an existing shield if:
1/ the duration of the old shield is not longer than the duration of the arcane shield (3 or 4 if Shielding is maxed)
2/ the present power of the old shield is <= (power of the new arcane shield)
3/ the max power of the old shield is <= 2 * (power of the new shield) (in case the player wants to refill it with Aegis).
There can some more sophisticated way to deal with that, taking into account aegis/Shielding boost and the actual aegis/Aegis refill value, but this method is simple and catches all the small shields (and the user always as the option to previously cancel its present shield).
Here is the code to insert in mod/class/Actor.lua
So I would suggest to automatically replace an existing shield if:
1/ the duration of the old shield is not longer than the duration of the arcane shield (3 or 4 if Shielding is maxed)
2/ the present power of the old shield is <= (power of the new arcane shield)
3/ the max power of the old shield is <= 2 * (power of the new shield) (in case the player wants to refill it with Aegis).
There can some more sophisticated way to deal with that, taking into account aegis/Shielding boost and the actual aegis/Aegis refill value, but this method is simple and catches all the small shields (and the user always as the option to previously cancel its present shield).
Here is the code to insert in mod/class/Actor.lua
Code: Select all
if self:attr("arcane_shield") and value > 0 then
local eff = self:hasEffect(self.EFF_DAMAGE_SHIELD)
if not eff or (
eff
and (eff.dur <= 3 + self.shield_dur)
and (100 * self.damage_shield_absorb <= value * self.arcane_shield)
and (50 * self.damage_shield_absorb_max <= value * self.arcane_shield)
) then
self:setEffect(self.EFF_DAMAGE_SHIELD, 3, {power=value * self.arcane_shield / 100})
end
end