--=======================================================================================
-- Generated by TypescriptToLua transpiler https://github.com/Perryvw/TypescriptToLua 
-- Date: Sun May 13 2018
--=======================================================================================
require("typescript_lualib")
--LinkLuaModifier("modifier_killstreak_mutator_redux","",LUA_MODIFIER_MOTION_NONE)
modifier_killstreak_mutator_redux = {}
modifier_killstreak_mutator_redux.__index = modifier_killstreak_mutator_redux
function modifier_killstreak_mutator_redux.new(construct, ...)
    local instance = setmetatable({}, modifier_killstreak_mutator_redux)
    if construct and modifier_killstreak_mutator_redux.constructor then modifier_killstreak_mutator_redux.constructor(instance, ...) end
    return instance
end
function modifier_killstreak_mutator_redux.IsPermanent(self)
    return true
end
function modifier_killstreak_mutator_redux.IsPurgable(self)
    return false
end
function modifier_killstreak_mutator_redux.IsHidden(self)
    return self:GetStackCount() == 0
end
function modifier_killstreak_mutator_redux.OnCreated(self)
    self.damage_multiplier=20
end
function modifier_killstreak_mutator_redux.DeclareFunctions(self)
    return {MODIFIER_PROPERTY_TOTALDAMAGEOUTGOING_PERCENTAGE ,MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE,MODIFIER_PROPERTY_MODEL_SCALE,MODIFIER_EVENT_ON_DEATH}
end
function modifier_killstreak_mutator_redux:GetTexture()
    return "custom/empress_hellbolt"
end
function modifier_killstreak_mutator_redux.OnDeath(self,kv)
    if self:GetParent()==kv.unit then
        self:SetStackCount(0)
    else
        if self:GetParent()==kv.attacker and kv.unit:IsRealHero() then
            self:IncrementStackCount()
        end
    end
end
function modifier_killstreak_mutator_redux.GetModifierIncomingDamage_Percentage(self)
    if IsClient() then
        return 0
    end
    local unit = self:GetParent()

    if unit:PassivesDisabled() or unit:IsIllusion() then
        return 0
    end
    local killStreak = self:GetStackCount()

    return self.damage_multiplier*killStreak
end
function modifier_killstreak_mutator_redux.GetModifierTotalDamageOutgoing_Percentage(self)
    if IsClient() then
        return 0
    end
    local unit = self:GetParent()

    if unit:PassivesDisabled() or unit:IsIllusion() then
        return 0
    end
    local killStreak = self:GetStackCount()

    return self.damage_multiplier*killStreak
end
function modifier_killstreak_mutator_redux.GetModifierModelScale(self)
    return 1+(self.damage_multiplier*self:GetStackCount())
end
