myspace / Lua /CharacterEffectCompositeDef /BloodlustPerk.generated.lua
sirnii's picture
Upload 1816 files
b6a38d7 verified
raw
history blame
2.05 kB
-- ========== GENERATED BY CharacterEffectCompositeDef Editor DO NOT EDIT MANUALLY! ==========
UndefineClass('BloodlustPerk')
DefineClass.BloodlustPerk = {
__parents = { "Perk" },
__generated_by_class = "CharacterEffectCompositeDef",
object_class = "Perk",
unit_reactions = {
PlaceObj('UnitReaction', {
Event = "OnBeginTurn",
Handler = function (self, target)
self:SetParameter("target", false)
end,
}),
PlaceObj('UnitReaction', {
Event = "OnUnitAttack",
Handler = function (self, target, attacker, action, attack_target, results, attack_args)
if target == attacker then
if action.ActionType ~= "Melee Attack" or not IsKindOf(attack_target, "Unit") then
self:SetParameter("target", false)
else
self:SetParameter("target", attack_target.handle)
end
end
end,
}),
PlaceObj('UnitReaction', {
Event = "OnCalcDamageAndEffects",
Handler = function (self, target, attacker, attack_target, action, weapon, attack_args, hit, data)
if target == attacker and action then
local last_target = self:ResolveValue("target")
if action.ActionType == "Melee Attack" and last_target and IsKindOf(attack_target, "Unit") and attack_target.handle ~= last_target then
local bonus = MulDivRound(attacker.Strength, self:ResolveValue("Str_to_bonus_dmg_conversion"), 100)
data.base_damage = MulDivRound(data.base_damage, 100 + bonus, 100)
data.breakdown[#data.breakdown + 1] = { name = self.DisplayName, value = bonus }
end
end
end,
}),
},
DisplayName = T(700118302261, --[[CharacterEffectCompositeDef BloodlustPerk DisplayName]] "Killing Spree"),
Description = T(419165368911, --[[CharacterEffectCompositeDef BloodlustPerk Description]] "Subsequent <em>Melee Attacks</em> against <em>different targets</em> during the same turn deal <em><percent(StatPercent('Strength', Str_to_bonus_dmg_conversion))></em> extra <em>Damage</em> (based on Strength)."),
Icon = "UI/Icons/Perks/BloodlustPerk",
Tier = "Bronze",
Stat = "Strength",
StatValue = 70,
}