Files
Dota-Zombie-Invasion/scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua
T
2026-05-29 15:11:31 +07:00

644 lines
28 KiB
Lua

local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__Decorate = ____lualib.__TS__Decorate
local ____exports = {}
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
local BaseItem = ____dota_ts_adapter.BaseItem
local BaseModifier = ____dota_ts_adapter.BaseModifier
local registerAbility = ____dota_ts_adapter.registerAbility
local registerModifier = ____dota_ts_adapter.registerModifier
local ____modifier_stats_multiplier = require("modifiers.modifier_stats_multiplier")
local removeStatsMultiplierSource = ____modifier_stats_multiplier.removeStatsMultiplierSource
local setStatsMultiplierSource = ____modifier_stats_multiplier.setStatsMultiplierSource
local ____luck = require("utils.luck")
local rollLuckChance = ____luck.rollLuckChance
local ____incoming_damage_reduction_combine = require("utils.incoming_damage_reduction_combine")
local removeIncomingDamageReductionSource = ____incoming_damage_reduction_combine.removeIncomingDamageReductionSource
local setIncomingDamageReductionSource = ____incoming_damage_reduction_combine.setIncomingDamageReductionSource
local CRIMSON_SHIVAS_SOURCE_PREFIX = "item_crimson_shivas_custom"
local CRIMSON_SHIVAS_ALLY_AURA_INCOMING_SOURCE = "modifier_item_crimson_shivas_custom_ally_aura_buff"
local CRIMSON_SHIVAS_GUARD_BUFF_INCOMING_SOURCE = "modifier_item_crimson_shivas_custom_guard_buff"
local SHIVAS_BLAST_PARTICLE = "particles/items2_fx/shivas_guard_active.vpcf"
local SHIVAS_IMPACT_PARTICLE = "particles/items2_fx/shivas_guard_impact.vpcf"
local SHIVAS_SLOW_PARTICLE = "particles/generic_gameplay/generic_slowed_cold.vpcf"
local GUARD_BUFF_PARTICLE = "particles/units/heroes/hero_grimstroke/grimstroke_ink_swell_buff.vpcf"
local MELEE_STRENGTH_BLOCK_PCT = 50
____exports.item_crimson_shivas_custom = __TS__Class()
local item_crimson_shivas_custom = ____exports.item_crimson_shivas_custom
item_crimson_shivas_custom.name = "item_crimson_shivas_custom"
item_crimson_shivas_custom.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(item_crimson_shivas_custom, BaseItem)
function item_crimson_shivas_custom.prototype.Precache(self, context)
PrecacheResource("particle", SHIVAS_BLAST_PARTICLE, context)
PrecacheResource("particle", SHIVAS_IMPACT_PARTICLE, context)
PrecacheResource("particle", SHIVAS_SLOW_PARTICLE, context)
PrecacheResource("particle", GUARD_BUFF_PARTICLE, context)
PrecacheResource("soundfile", "soundevents/game_sounds_items.vsndevts", context)
end
function item_crimson_shivas_custom.prototype.GetIntrinsicModifierName(self)
return ____exports.modifier_item_crimson_shivas_custom.name
end
function item_crimson_shivas_custom.prototype.GetAOERadius(self)
return self:GetSpecialValueFor("guard_radius")
end
function item_crimson_shivas_custom.prototype.GetCastRange(self)
local blastRadius = self:GetSpecialValueFor("blast_radius")
if IsServer() then
return blastRadius
end
local ____opt_0 = self:GetCaster()
local bonus = ____opt_0 and ____opt_0:GetCastRangeBonus() or 0
return blastRadius - bonus
end
function item_crimson_shivas_custom.prototype.OnSpellStart(self)
if not IsServer() then
return
end
local caster = self:GetCaster()
local blastRadius = self:GetSpecialValueFor("blast_radius")
local blastSpeed = self:GetSpecialValueFor("blast_speed")
local guardRadius = self:GetSpecialValueFor("guard_radius")
local guardDuration = self:GetSpecialValueFor("guard_duration")
caster:EmitSound("DOTA_Item.ShivasGuard.Activate")
caster:AddNewModifier(caster, self, ____exports.modifier_item_crimson_shivas_custom_blast_thinker.name, {duration = blastRadius / blastSpeed})
local allies = FindUnitsInRadius(
caster:GetTeamNumber(),
caster:GetAbsOrigin(),
nil,
guardRadius,
DOTA_UNIT_TARGET_TEAM_FRIENDLY,
DOTA_UNIT_TARGET_HERO,
DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES,
FIND_CLOSEST,
false
)
for ____, ally in ipairs(allies) do
ally:AddNewModifier(caster, self, ____exports.modifier_item_crimson_shivas_custom_guard_buff.name, {duration = guardDuration})
ally:EmitSound("Hero_LegionCommander.Overwhelming.Cast")
end
end
item_crimson_shivas_custom = __TS__Decorate(
item_crimson_shivas_custom,
item_crimson_shivas_custom,
{registerAbility(nil)},
{kind = "class", name = "item_crimson_shivas_custom"}
)
____exports.item_crimson_shivas_custom = item_crimson_shivas_custom
--- Пассив владельца: статы, блок, аура замедления атаки врагам.
____exports.modifier_item_crimson_shivas_custom = __TS__Class()
local modifier_item_crimson_shivas_custom = ____exports.modifier_item_crimson_shivas_custom
modifier_item_crimson_shivas_custom.name = "modifier_item_crimson_shivas_custom"
modifier_item_crimson_shivas_custom.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom, BaseModifier)
function modifier_item_crimson_shivas_custom.prototype.____constructor(self, ...)
BaseModifier.prototype.____constructor(self, ...)
self.statsSourceId = ""
end
function modifier_item_crimson_shivas_custom.prototype.IsHidden(self)
return true
end
function modifier_item_crimson_shivas_custom.prototype.IsPurgable(self)
return false
end
function modifier_item_crimson_shivas_custom.prototype.GetAttributes(self)
return MODIFIER_ATTRIBUTE_MULTIPLE
end
function modifier_item_crimson_shivas_custom.prototype.DeclareFunctions(self)
return {
MODIFIER_PROPERTY_STATS_STRENGTH_BONUS,
MODIFIER_PROPERTY_STATS_AGILITY_BONUS,
MODIFIER_PROPERTY_STATS_INTELLECT_BONUS,
MODIFIER_PROPERTY_HEALTH_BONUS,
MODIFIER_PROPERTY_MANA_BONUS,
MODIFIER_PROPERTY_HEALTH_REGEN_CONSTANT,
MODIFIER_PROPERTY_MANA_REGEN_CONSTANT,
MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS,
MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK
}
end
function modifier_item_crimson_shivas_custom.prototype.IsAura(self)
return true
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierAura(self)
return ____exports.modifier_item_crimson_shivas_custom_enemy_aura.name
end
function modifier_item_crimson_shivas_custom.prototype.GetAuraRadius(self)
return self:GetAbility():GetSpecialValueFor("aura_radius")
end
function modifier_item_crimson_shivas_custom.prototype.GetAuraDuration(self)
return 1
end
function modifier_item_crimson_shivas_custom.prototype.GetAuraSearchTeam(self)
return DOTA_UNIT_TARGET_TEAM_ENEMY
end
function modifier_item_crimson_shivas_custom.prototype.GetAuraSearchType(self)
return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC
end
function modifier_item_crimson_shivas_custom.prototype.GetAuraSearchFlags(self)
return DOTA_UNIT_TARGET_FLAG_NONE
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierBonusStats_Strength(self)
local ability = self:GetAbility()
return ability:GetSpecialValueFor("bonus_stats")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierBonusStats_Agility(self)
local ability = self:GetAbility()
return ability:GetSpecialValueFor("bonus_stats")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierBonusStats_Intellect(self)
local ability = self:GetAbility()
return ability:GetSpecialValueFor("bonus_stats")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierHealthBonus(self)
return self:GetAbility():GetSpecialValueFor("bonus_health")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierManaBonus(self)
return self:GetAbility():GetSpecialValueFor("bonus_mana")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierConstantHealthRegen(self)
return self:GetAbility():GetSpecialValueFor("bonus_hp_regen")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierConstantManaRegen(self)
return self:GetAbility():GetSpecialValueFor("bonus_mana_regen")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierPhysicalArmorBonus(self)
return self:GetAbility():GetSpecialValueFor("bonus_armor")
end
function modifier_item_crimson_shivas_custom.prototype.GetModifierPhysical_ConstantBlock(self)
if not IsServer() then
return 0
end
local ability = self:GetAbility()
if not ability then
return 0
end
local chancePct = ability:GetSpecialValueFor("damage_block_chance")
local parent = self:GetParent()
local ____parent_IsRealHero_result_2
if parent:IsRealHero() then
____parent_IsRealHero_result_2 = rollLuckChance(nil, parent, chancePct / 100)
else
____parent_IsRealHero_result_2 = RollPercentage(chancePct)
end
local blocked = ____parent_IsRealHero_result_2
if not blocked then
return 0
end
local blockAmount = ability:GetSpecialValueFor("damage_block")
local baseBlock = parent:IsRangedAttacker() and blockAmount * 0.5 or blockAmount
if not parent:IsRealHero() or parent:IsRangedAttacker() then
return baseBlock
end
return baseBlock + parent:GetStrength() * (MELEE_STRENGTH_BLOCK_PCT / 100)
end
function modifier_item_crimson_shivas_custom.prototype.OnCreated(self)
if not IsServer() then
return
end
local ability = self:GetAbility()
if not ability then
return
end
self:GetParent():AddNewModifier(
self:GetParent(),
ability,
____exports.modifier_item_crimson_shivas_custom_ally_aura.name,
{}
)
local hero = self:GetParent()
if hero and hero:IsRealHero() then
self.statsSourceId = (CRIMSON_SHIVAS_SOURCE_PREFIX .. "_") .. tostring(hero:entindex())
setStatsMultiplierSource(
nil,
hero,
self.statsSourceId,
function()
if not hero or not IsValidEntity(hero) or not hero:IsRealHero() then
return 0
end
return ability:GetSpecialValueFor("all_stats_pct")
end,
"all_stats_pct"
)
end
end
function modifier_item_crimson_shivas_custom.prototype.OnDestroy(self)
if not IsServer() then
return
end
self:GetParent():RemoveModifierByName(____exports.modifier_item_crimson_shivas_custom_ally_aura.name)
if self.statsSourceId ~= "" then
local hero = self:GetParent()
if hero and IsValidEntity(hero) then
removeStatsMultiplierSource(nil, hero, self.statsSourceId)
end
self.statsSourceId = ""
end
end
modifier_item_crimson_shivas_custom = __TS__Decorate(
modifier_item_crimson_shivas_custom,
modifier_item_crimson_shivas_custom,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom"}
)
____exports.modifier_item_crimson_shivas_custom = modifier_item_crimson_shivas_custom
--- Пассивная аура на союзников вокруг владельца.
____exports.modifier_item_crimson_shivas_custom_ally_aura = __TS__Class()
local modifier_item_crimson_shivas_custom_ally_aura = ____exports.modifier_item_crimson_shivas_custom_ally_aura
modifier_item_crimson_shivas_custom_ally_aura.name = "modifier_item_crimson_shivas_custom_ally_aura"
modifier_item_crimson_shivas_custom_ally_aura.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom_ally_aura, BaseModifier)
function modifier_item_crimson_shivas_custom_ally_aura.prototype.IsHidden(self)
return true
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.IsPurgable(self)
return false
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.IsAura(self)
return true
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.GetModifierAura(self)
return ____exports.modifier_item_crimson_shivas_custom_ally_aura_buff.name
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.GetAuraRadius(self)
return self:GetAbility():GetSpecialValueFor("aura_radius")
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.GetAuraDuration(self)
return 1
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.GetAuraSearchTeam(self)
return DOTA_UNIT_TARGET_TEAM_FRIENDLY
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.GetAuraSearchType(self)
return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC
end
function modifier_item_crimson_shivas_custom_ally_aura.prototype.GetAuraSearchFlags(self)
return DOTA_UNIT_TARGET_FLAG_NONE
end
modifier_item_crimson_shivas_custom_ally_aura = __TS__Decorate(
modifier_item_crimson_shivas_custom_ally_aura,
modifier_item_crimson_shivas_custom_ally_aura,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom_ally_aura"}
)
____exports.modifier_item_crimson_shivas_custom_ally_aura = modifier_item_crimson_shivas_custom_ally_aura
--- Аура Шивы: снижение скорости атаки врагам.
____exports.modifier_item_crimson_shivas_custom_enemy_aura = __TS__Class()
local modifier_item_crimson_shivas_custom_enemy_aura = ____exports.modifier_item_crimson_shivas_custom_enemy_aura
modifier_item_crimson_shivas_custom_enemy_aura.name = "modifier_item_crimson_shivas_custom_enemy_aura"
modifier_item_crimson_shivas_custom_enemy_aura.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom_enemy_aura, BaseModifier)
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.IsDebuff(self)
return true
end
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.IsHidden(self)
return false
end
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.IsPurgable(self)
return false
end
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.DeclareFunctions(self)
return {MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT, MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE}
end
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.GetModifierAttackSpeedBonus_Constant(self)
return -self:GetAbility():GetSpecialValueFor("aura_as_reduction")
end
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.GetModifierIncomingDamage_Percentage(self)
return self:GetAbility():GetSpecialValueFor("aura_enemy_incoming_amp")
end
function modifier_item_crimson_shivas_custom_enemy_aura.prototype.GetTexture(self)
return "item_shivas_guard"
end
modifier_item_crimson_shivas_custom_enemy_aura = __TS__Decorate(
modifier_item_crimson_shivas_custom_enemy_aura,
modifier_item_crimson_shivas_custom_enemy_aura,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom_enemy_aura"}
)
____exports.modifier_item_crimson_shivas_custom_enemy_aura = modifier_item_crimson_shivas_custom_enemy_aura
--- Аура на союзников: снижение входящего урона.
____exports.modifier_item_crimson_shivas_custom_ally_aura_buff = __TS__Class()
local modifier_item_crimson_shivas_custom_ally_aura_buff = ____exports.modifier_item_crimson_shivas_custom_ally_aura_buff
modifier_item_crimson_shivas_custom_ally_aura_buff.name = "modifier_item_crimson_shivas_custom_ally_aura_buff"
modifier_item_crimson_shivas_custom_ally_aura_buff.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom_ally_aura_buff, BaseModifier)
function modifier_item_crimson_shivas_custom_ally_aura_buff.prototype.IsHidden(self)
return false
end
function modifier_item_crimson_shivas_custom_ally_aura_buff.prototype.IsPurgable(self)
return false
end
function modifier_item_crimson_shivas_custom_ally_aura_buff.prototype.OnCreated(self)
if not IsServer() then
return
end
setIncomingDamageReductionSource(
nil,
self:GetParent(),
CRIMSON_SHIVAS_ALLY_AURA_INCOMING_SOURCE,
function()
local ability = self:GetAbility()
if not ability then
return 0
end
return math.max(
0,
ability:GetSpecialValueFor("aura_ally_incoming_reduction")
)
end
)
end
function modifier_item_crimson_shivas_custom_ally_aura_buff.prototype.OnDestroy(self)
if not IsServer() then
return
end
removeIncomingDamageReductionSource(
nil,
self:GetParent(),
CRIMSON_SHIVAS_ALLY_AURA_INCOMING_SOURCE
)
end
function modifier_item_crimson_shivas_custom_ally_aura_buff.prototype.GetTexture(self)
return "item_crimson_guard"
end
modifier_item_crimson_shivas_custom_ally_aura_buff = __TS__Decorate(
modifier_item_crimson_shivas_custom_ally_aura_buff,
modifier_item_crimson_shivas_custom_ally_aura_buff,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom_ally_aura_buff"}
)
____exports.modifier_item_crimson_shivas_custom_ally_aura_buff = modifier_item_crimson_shivas_custom_ally_aura_buff
--- Расходящаяся волна Шивы.
____exports.modifier_item_crimson_shivas_custom_blast_thinker = __TS__Class()
local modifier_item_crimson_shivas_custom_blast_thinker = ____exports.modifier_item_crimson_shivas_custom_blast_thinker
modifier_item_crimson_shivas_custom_blast_thinker.name = "modifier_item_crimson_shivas_custom_blast_thinker"
modifier_item_crimson_shivas_custom_blast_thinker.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom_blast_thinker, BaseModifier)
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.____constructor(self, ...)
BaseModifier.prototype.____constructor(self, ...)
self.hitted = {}
end
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.IsHidden(self)
return true
end
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.IsPurgable(self)
return false
end
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.GetAttributes(self)
return MODIFIER_ATTRIBUTE_MULTIPLE
end
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.OnCreated(self)
if not IsServer() then
return
end
local ability = self:GetAbility()
self.hitted = {}
self:StartIntervalThink(FrameTime())
local particle = ParticleManager:CreateParticle(
SHIVAS_BLAST_PARTICLE,
PATTACH_ABSORIGIN_FOLLOW,
self:GetParent()
)
ParticleManager:SetParticleControl(
particle,
1,
Vector(
ability:GetSpecialValueFor("blast_radius"),
self:GetDuration() * 1.33,
ability:GetSpecialValueFor("blast_speed")
)
)
self:AddParticle(
particle,
false,
false,
15,
false,
false
)
end
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.OnIntervalThink(self)
local ability = self:GetAbility()
local caster = self:GetCaster()
if not ability or not caster then
return
end
local radiusIncrease = ability:GetSpecialValueFor("blast_speed") / (1 / FrameTime()) * 100
self:SetStackCount(self:GetStackCount() + radiusIncrease)
local radius = self:GetStackCount() / 100
AddFOWViewer(
caster:GetTeamNumber(),
self:GetParent():GetAbsOrigin(),
radius,
FrameTime(),
false
)
local enemies = FindUnitsInRadius(
caster:GetTeamNumber(),
self:GetParent():GetAbsOrigin(),
nil,
radius,
DOTA_UNIT_TARGET_TEAM_ENEMY,
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
DOTA_UNIT_TARGET_FLAG_NONE,
FIND_ANY_ORDER,
false
)
local blastDamage = ability:GetSpecialValueFor("blast_damage")
local slowDuration = ability:GetSpecialValueFor("slow_duration")
for ____, enemy in ipairs(enemies) do
do
local entIndex = enemy:entindex()
if self.hitted[entIndex] then
goto __continue77
end
self.hitted[entIndex] = true
local impact = ParticleManager:CreateParticle(SHIVAS_IMPACT_PARTICLE, PATTACH_ABSORIGIN_FOLLOW, enemy)
ParticleManager:SetParticleControl(
impact,
1,
self:GetParent():GetAbsOrigin()
)
ParticleManager:ReleaseParticleIndex(impact)
ApplyDamage({
victim = enemy,
attacker = caster,
damage = blastDamage,
damage_type = DAMAGE_TYPE_MAGICAL,
ability = ability
})
local duration = slowDuration * (1 - enemy:GetStatusResistance())
enemy:AddNewModifier(caster, ability, ____exports.modifier_item_crimson_shivas_custom_blast_debuff.name, {duration = duration})
end
::__continue77::
end
end
function modifier_item_crimson_shivas_custom_blast_thinker.prototype.OnDestroy(self)
if not IsServer() then
return
end
local ability = self:GetAbility()
local caster = self:GetCaster()
if ability and caster then
local radius = self:GetStackCount() / 100
AddFOWViewer(
caster:GetTeamNumber(),
self:GetParent():GetAbsOrigin(),
radius,
ability:GetSpecialValueFor("slow_duration"),
false
)
end
self.hitted = {}
end
modifier_item_crimson_shivas_custom_blast_thinker = __TS__Decorate(
modifier_item_crimson_shivas_custom_blast_thinker,
modifier_item_crimson_shivas_custom_blast_thinker,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom_blast_thinker"}
)
____exports.modifier_item_crimson_shivas_custom_blast_thinker = modifier_item_crimson_shivas_custom_blast_thinker
--- Замедление от волны Шивы.
____exports.modifier_item_crimson_shivas_custom_blast_debuff = __TS__Class()
local modifier_item_crimson_shivas_custom_blast_debuff = ____exports.modifier_item_crimson_shivas_custom_blast_debuff
modifier_item_crimson_shivas_custom_blast_debuff.name = "modifier_item_crimson_shivas_custom_blast_debuff"
modifier_item_crimson_shivas_custom_blast_debuff.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom_blast_debuff, BaseModifier)
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.IsDebuff(self)
return true
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.IsHidden(self)
return false
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.IsPurgable(self)
return true
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.DeclareFunctions(self)
return {MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT, MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE}
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.GetModifierMoveSpeedBonus_Percentage(self)
return self:GetAbility():GetSpecialValueFor("slow_move_pct")
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.GetModifierAttackSpeedBonus_Constant(self)
return self:GetAbility():GetSpecialValueFor("active_as_reduction")
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.GetModifierIncomingDamage_Percentage(self)
return self:GetAbility():GetSpecialValueFor("aura_enemy_incoming_amp")
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.GetEffectName(self)
return SHIVAS_SLOW_PARTICLE
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.GetEffectAttachType(self)
return PATTACH_ABSORIGIN_FOLLOW
end
function modifier_item_crimson_shivas_custom_blast_debuff.prototype.GetTexture(self)
return "item_shivas_guard"
end
modifier_item_crimson_shivas_custom_blast_debuff = __TS__Decorate(
modifier_item_crimson_shivas_custom_blast_debuff,
modifier_item_crimson_shivas_custom_blast_debuff,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom_blast_debuff"}
)
____exports.modifier_item_crimson_shivas_custom_blast_debuff = modifier_item_crimson_shivas_custom_blast_debuff
--- Актив Crimson Guard: усиление союзников.
____exports.modifier_item_crimson_shivas_custom_guard_buff = __TS__Class()
local modifier_item_crimson_shivas_custom_guard_buff = ____exports.modifier_item_crimson_shivas_custom_guard_buff
modifier_item_crimson_shivas_custom_guard_buff.name = "modifier_item_crimson_shivas_custom_guard_buff"
modifier_item_crimson_shivas_custom_guard_buff.____file_path = "scripts/vscripts/items/default_items/item_crimson_shivas_custom.lua"
__TS__ClassExtends(modifier_item_crimson_shivas_custom_guard_buff, BaseModifier)
function modifier_item_crimson_shivas_custom_guard_buff.prototype.IsHidden(self)
return false
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.IsPurgable(self)
return true
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.OnCreated(self)
if not IsServer() then
return
end
local parent = self:GetParent()
self.buffParticle = ParticleManager:CreateParticle(GUARD_BUFF_PARTICLE, PATTACH_ABSORIGIN, parent)
if parent:ScriptLookupAttachment("attach_hitloc") == 0 then
ParticleManager:SetParticleControl(
self.buffParticle,
1,
parent:GetAbsOrigin():__add(Vector(0, 0, 120))
)
else
ParticleManager:SetParticleControlEnt(
self.buffParticle,
1,
parent,
PATTACH_POINT_FOLLOW,
"attach_hitloc",
Vector(0, 0, 0),
true
)
end
setIncomingDamageReductionSource(
nil,
parent,
CRIMSON_SHIVAS_GUARD_BUFF_INCOMING_SOURCE,
function()
local ability = self:GetAbility()
if not ability then
return 0
end
return math.max(
0,
ability:GetSpecialValueFor("aura_ally_incoming_reduction")
)
end
)
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.OnDestroy(self)
if not IsServer() then
return
end
removeIncomingDamageReductionSource(
nil,
self:GetParent(),
CRIMSON_SHIVAS_GUARD_BUFF_INCOMING_SOURCE
)
if self.buffParticle ~= nil then
ParticleManager:DestroyParticle(self.buffParticle, false)
ParticleManager:ReleaseParticleIndex(self.buffParticle)
self.buffParticle = nil
end
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.DeclareFunctions(self)
return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT, MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, MODIFIER_PROPERTY_PHYSICAL_CONSTANT_BLOCK}
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.GetModifierPhysicalArmorBonus(self)
return self:GetAbility():GetSpecialValueFor("bonus_armor_active")
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.GetModifierAttackSpeedBonus_Constant(self)
return self:GetAbility():GetSpecialValueFor("bonus_attack_speed_active")
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.GetModifierMoveSpeedBonus_Percentage(self)
return self:GetAbility():GetSpecialValueFor("bonus_movespeed_active")
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.GetModifierPhysical_ConstantBlock(self)
local ability = self:GetAbility()
local caster = self:GetCaster()
if not ability or not caster then
return 0
end
local baseBlock = ability:GetSpecialValueFor("damage_block_active")
local strBonus = caster:GetStrength() * (ability:GetSpecialValueFor("block_strength_pct") / 100)
return baseBlock + strBonus
end
function modifier_item_crimson_shivas_custom_guard_buff.prototype.GetTexture(self)
return "item_crimson_guard"
end
modifier_item_crimson_shivas_custom_guard_buff = __TS__Decorate(
modifier_item_crimson_shivas_custom_guard_buff,
modifier_item_crimson_shivas_custom_guard_buff,
{registerModifier(nil)},
{kind = "class", name = "modifier_item_crimson_shivas_custom_guard_buff"}
)
____exports.modifier_item_crimson_shivas_custom_guard_buff = modifier_item_crimson_shivas_custom_guard_buff
return ____exports