Superloading Damage Types and Categories
Posted: Sat Feb 22, 2014 6:34 pm
Currently I'm working on a modification for the Necromancer. Among other things, it's going to make Necrosis generic to solve the lack of generic sinks, but I can't figure out how to do that. I'm guessing it involves superloading the line defining Necrosis in spells.lua and putting is_generic="true", but I can't figure out a) what the exact sorta syntax would be for loading that and b) how to superload spells.lua in the first place!
In addition, I'm putting in a new damage tree, Acid. The first 3 talents are working and very fun, but the capstone is this:
Dissolution - Your acid damage melts away at weakened targets, causing it to instantly kill targets below x% health. Targets killed by this effect explode into a cloud of corrosive vapour, dealing Acid damage equal to y% of their total health every turn for 3 turns in a 1 radius ball.
So what I planned to do as the first step was superload Acid in damage_types.lua with a line similar to Natural Acid, namely that if Dissolution was sustained, it'd do something like this:
if target:canBe("instakill") and target.life > 0 and ((target.life < target.max_life * 0.25 and target.rank < 3.5) or target.life < target.max_life * 0.10) then
target:die(who)
game.logSeen(target, "#RED#%s#GOLD# has been bursts into a cloud of acid!#LAST#", target.name:capitalize())
end
(code taken from the ultimatum axe, real values would use the talent rather than a flat life %)
And in addition, after target:die it would create a lasting map effect. But unfortunately I can't figure out how to superload damage_types and specifically modify Acid, and to be honest I've no idea if the above code would work once I did put it in (although at least I could give it a try).
Any help would be greatly appreciated.
In addition, I'm putting in a new damage tree, Acid. The first 3 talents are working and very fun, but the capstone is this:
Dissolution - Your acid damage melts away at weakened targets, causing it to instantly kill targets below x% health. Targets killed by this effect explode into a cloud of corrosive vapour, dealing Acid damage equal to y% of their total health every turn for 3 turns in a 1 radius ball.
So what I planned to do as the first step was superload Acid in damage_types.lua with a line similar to Natural Acid, namely that if Dissolution was sustained, it'd do something like this:
if target:canBe("instakill") and target.life > 0 and ((target.life < target.max_life * 0.25 and target.rank < 3.5) or target.life < target.max_life * 0.10) then
target:die(who)
game.logSeen(target, "#RED#%s#GOLD# has been bursts into a cloud of acid!#LAST#", target.name:capitalize())
end
(code taken from the ultimatum axe, real values would use the talent rather than a flat life %)
And in addition, after target:die it would create a lasting map effect. But unfortunately I can't figure out how to superload damage_types and specifically modify Acid, and to be honest I've no idea if the above code would work once I did put it in (although at least I could give it a try).
Any help would be greatly appreciated.