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,
}