Page 1 of 1

Arcane shield

Posted: Mon Sep 17, 2012 10:17 pm
by ghostbuster
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

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

Re: Arcane shield

Posted: Tue Sep 18, 2012 2:47 am
by Suslik
The idea of replacing a shield under certain conditions visited me as well. I do not understand what those 3 +, 100 * and 50 * in code are for though.

Another suggestion - what if shields stacked infinitely? Like what if we could have had numerous damage shields at the same time, every with its own absorption rate and time left? Only max value could be shown inside hp bar.