Damage types
Posted: Mon Jan 10, 2011 6:07 am
During talk on IRC about various things, the need/usefulness of a random blind damage type came up. Edge coded this up in a jiffy.
I would recommend any further damage type changes/ideas to be posted here with code.
Code: Select all
newDamageType{
name = "Random Blind", type = "RANDOM_BLIND",
projector = function(src, x, y, type, dam)
local target = game.level.map(x, y, Map.ACTOR)
if target and rng.percent(10) then
if target:checkHit(src:combatAttackDex(), target:combatPhysicalResist(), 0, 95, 15) and target:canBe("blind") then
target:setEffect(target.EFF_BLINDED, 4, {})
else
game.logSeen(target, "%s resists!", target.name:capitalize())
end
end
end,
}