Code: Select all
newDamageType{
name = "mind", type = "MIND", text_color = "#YELLOW#",
projector = function(src, x, y, type, dam)
local target = game.level.map(x, y, Map.ACTOR)
if target then
local mindpower, mentalresist, alwaysHit, crossTierChance
if _G.type(dam) == "table" then dam, mindpower, mentalresist, alwaysHit, crossTierChance = dam.dam, dam.mindpower, dam.mentalresist, dam.alwaysHit, dam.crossTierChance end
local hit_power = mindpower or src:combatMindpower()
if alwaysHit or target:checkHit(hit_power, mentalresist or target:combatMentalResist(), 0, 95, 15) then
if crossTierChance and rng.percent(crossTierChance) then
target:crossTierEffect(target.EFF_BRAINLOCKED, src:combatMindpower())
end
return DamageType.defaultProjector(src, x, y, type, dam)
else
game.logSeen(target, "%s resists the mind attack!", target.name:capitalize())
return DamageType.defaultProjector(src, x, y, type, dam / 2)
end
end
return 0
end,
death_message = {"psyched", "mentally tortured", "mindraped"},
}
My suggestion is that it should be limited to mind damage from talents, such as the many doomed talents.