initial commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_banana = __TS__Class()
|
||||
local item_banana = ____exports.item_banana
|
||||
item_banana.name = "item_banana"
|
||||
item_banana.____file_path = "scripts/vscripts/items/util_items/item_banana.lua"
|
||||
__TS__ClassExtends(item_banana, BaseItem)
|
||||
function item_banana.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_banana.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_banana.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if not target then
|
||||
return
|
||||
end
|
||||
local manaAmount = self:GetSpecialValueFor("mana")
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
if manaAmount > 0 then
|
||||
target:GiveMana(manaAmount)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_MANA_ADD,
|
||||
target,
|
||||
manaAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
item_banana = __TS__Decorate(
|
||||
item_banana,
|
||||
item_banana,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_banana"}
|
||||
)
|
||||
____exports.item_banana = item_banana
|
||||
return ____exports
|
||||
@@ -0,0 +1,85 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_bread = __TS__Class()
|
||||
local item_bread = ____exports.item_bread
|
||||
item_bread.name = "item_bread"
|
||||
item_bread.____file_path = "scripts/vscripts/items/util_items/item_bread.lua"
|
||||
__TS__ClassExtends(item_bread, BaseItem)
|
||||
function item_bread.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_bread.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_bread.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
local healAmount = self:GetSpecialValueFor("heal")
|
||||
if target ~= nil then
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
target:Heal(healAmount, self)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_HEAL,
|
||||
target,
|
||||
healAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target and target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
end
|
||||
item_bread = __TS__Decorate(
|
||||
item_bread,
|
||||
item_bread,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_bread"}
|
||||
)
|
||||
____exports.item_bread = item_bread
|
||||
return ____exports
|
||||
@@ -0,0 +1,321 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
local registerModifier = ____dota_ts_adapter.registerModifier
|
||||
local BaseModifier = ____dota_ts_adapter.BaseModifier
|
||||
____exports.item_candy = __TS__Class()
|
||||
local item_candy = ____exports.item_candy
|
||||
item_candy.name = "item_candy"
|
||||
item_candy.____file_path = "scripts/vscripts/items/util_items/item_candys.lua"
|
||||
__TS__ClassExtends(item_candy, BaseItem)
|
||||
function item_candy.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_candy.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_candy.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if target == nil then
|
||||
return
|
||||
end
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
if target and target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
local candyModifiers = {____exports.modifier_chocolate_candy.name, ____exports.modifier_caramel_candy.name, ____exports.modifier_mint_candy.name, ____exports.modifier_magic_candy.name}
|
||||
local randomIndex = math.floor(math.random() * #candyModifiers)
|
||||
local selectedModifier = candyModifiers[randomIndex + 1]
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
selectedModifier,
|
||||
{duration = 30}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
end
|
||||
item_candy = __TS__Decorate(
|
||||
item_candy,
|
||||
item_candy,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_candy"}
|
||||
)
|
||||
____exports.item_candy = item_candy
|
||||
____exports.modifier_chocolate_candy = __TS__Class()
|
||||
local modifier_chocolate_candy = ____exports.modifier_chocolate_candy
|
||||
modifier_chocolate_candy.name = "modifier_chocolate_candy"
|
||||
modifier_chocolate_candy.____file_path = "scripts/vscripts/items/util_items/item_candys.lua"
|
||||
__TS__ClassExtends(modifier_chocolate_candy, BaseModifier)
|
||||
function modifier_chocolate_candy.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_chocolate_candy.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_chocolate_candy.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE}
|
||||
end
|
||||
function modifier_chocolate_candy.prototype.GetModifierMoveSpeedBonus_Percentage(self)
|
||||
return 15
|
||||
end
|
||||
function modifier_chocolate_candy.prototype.OnCreated(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
self:StartIntervalThink(0.33)
|
||||
end
|
||||
function modifier_chocolate_candy.prototype.OnIntervalThink(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
local parent = self:GetParent()
|
||||
if not parent or not parent:IsAlive() then
|
||||
return
|
||||
end
|
||||
if parent:IsMoving() then
|
||||
else
|
||||
ApplyDamage({
|
||||
victim = parent,
|
||||
attacker = parent,
|
||||
damage = self:GetParent():GetHealth() * 0.01,
|
||||
damage_type = DAMAGE_TYPE_PURE
|
||||
})
|
||||
end
|
||||
end
|
||||
function modifier_chocolate_candy.prototype.GetTexture(self)
|
||||
return "util_items/candy"
|
||||
end
|
||||
modifier_chocolate_candy = __TS__Decorate(
|
||||
modifier_chocolate_candy,
|
||||
modifier_chocolate_candy,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_chocolate_candy"}
|
||||
)
|
||||
____exports.modifier_chocolate_candy = modifier_chocolate_candy
|
||||
____exports.modifier_caramel_candy = __TS__Class()
|
||||
local modifier_caramel_candy = ____exports.modifier_caramel_candy
|
||||
modifier_caramel_candy.name = "modifier_caramel_candy"
|
||||
modifier_caramel_candy.____file_path = "scripts/vscripts/items/util_items/item_candys.lua"
|
||||
__TS__ClassExtends(modifier_caramel_candy, BaseModifier)
|
||||
function modifier_caramel_candy.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_caramel_candy.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, MODIFIER_EVENT_ON_TAKEDAMAGE}
|
||||
end
|
||||
function modifier_caramel_candy.prototype.GetModifierIncomingDamage_Percentage(self, event)
|
||||
if RandomInt(0, 99) < 20 then
|
||||
return 100
|
||||
end
|
||||
return 0
|
||||
end
|
||||
function modifier_caramel_candy.prototype.OnTakeDamage(self, event)
|
||||
if event.unit ~= self:GetParent() then
|
||||
return
|
||||
end
|
||||
if event.attacker == self:GetParent() then
|
||||
return
|
||||
end
|
||||
if RandomInt(0, 99) < 20 then
|
||||
ApplyDamage({
|
||||
victim = event.attacker,
|
||||
attacker = event.unit,
|
||||
damage = self:GetParent():GetAverageTrueAttackDamage(event.attacker) + event.damage * 0.5,
|
||||
damage_type = DAMAGE_TYPE_PHYSICAL
|
||||
})
|
||||
end
|
||||
end
|
||||
function modifier_caramel_candy.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_caramel_candy.prototype.GetTexture(self)
|
||||
return "util_items/candy"
|
||||
end
|
||||
modifier_caramel_candy = __TS__Decorate(
|
||||
modifier_caramel_candy,
|
||||
modifier_caramel_candy,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_caramel_candy"}
|
||||
)
|
||||
____exports.modifier_caramel_candy = modifier_caramel_candy
|
||||
____exports.modifier_mint_candy = __TS__Class()
|
||||
local modifier_mint_candy = ____exports.modifier_mint_candy
|
||||
modifier_mint_candy.name = "modifier_mint_candy"
|
||||
modifier_mint_candy.____file_path = "scripts/vscripts/items/util_items/item_candys.lua"
|
||||
__TS__ClassExtends(modifier_mint_candy, BaseModifier)
|
||||
function modifier_mint_candy.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.Lock = false
|
||||
end
|
||||
function modifier_mint_candy.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_mint_candy.prototype.OnCreated(self, params)
|
||||
self:StartIntervalThink(0.1)
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_mint_candy.prototype.OnIntervalThink(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
if RandomInt(1, 100) < 50 then
|
||||
self:GetParent():AddNewModifier(
|
||||
self:GetParent(),
|
||||
self:GetAbility(),
|
||||
"modifier_stunned",
|
||||
{duration = 0.15}
|
||||
)
|
||||
end
|
||||
end
|
||||
function modifier_mint_candy.prototype.DeclareFunctions(self)
|
||||
return {
|
||||
MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE,
|
||||
MODIFIER_PROPERTY_BONUS_DAY_VISION,
|
||||
MODIFIER_PROPERTY_BONUS_NIGHT_VISION,
|
||||
MODIFIER_PROPERTY_STATS_AGILITY_BONUS,
|
||||
MODIFIER_PROPERTY_STATS_INTELLECT_BONUS,
|
||||
MODIFIER_PROPERTY_STATS_STRENGTH_BONUS,
|
||||
MODIFIER_PROPERTY_MIN_HEALTH
|
||||
}
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetModifierMinHealth(self)
|
||||
return 1
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetModifierMoveSpeedBonus_Percentage(self)
|
||||
return -50
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetBonusDayVision(self)
|
||||
return -250
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetBonusNightVision(self)
|
||||
return -250
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetModifierBonusStats_Agility(self)
|
||||
if not IsServer() then
|
||||
return 0
|
||||
end
|
||||
if self.Lock then
|
||||
return 0
|
||||
end
|
||||
self.Lock = true
|
||||
local bonus = self:GetParent():GetAgility()
|
||||
local PctBonus = 0.5 * bonus
|
||||
self.Lock = false
|
||||
return -PctBonus
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetModifierBonusStats_Intellect(self)
|
||||
if not IsServer() then
|
||||
return 0
|
||||
end
|
||||
if self.Lock then
|
||||
return 0
|
||||
end
|
||||
self.Lock = true
|
||||
local bonus = self:GetParent():GetIntellect(true)
|
||||
local PctBonus = 0.5 * bonus
|
||||
self.Lock = false
|
||||
return -PctBonus
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetModifierBonusStats_Strength(self)
|
||||
if not IsServer() then
|
||||
return 0
|
||||
end
|
||||
if self.Lock then
|
||||
return 0
|
||||
end
|
||||
self.Lock = true
|
||||
local bonus = self:GetParent():GetStrength()
|
||||
local PctBonus = 0.5 * bonus
|
||||
self.Lock = false
|
||||
return -PctBonus
|
||||
end
|
||||
function modifier_mint_candy.prototype.GetTexture(self)
|
||||
return "util_items/candy"
|
||||
end
|
||||
modifier_mint_candy = __TS__Decorate(
|
||||
modifier_mint_candy,
|
||||
modifier_mint_candy,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_mint_candy"}
|
||||
)
|
||||
____exports.modifier_mint_candy = modifier_mint_candy
|
||||
____exports.modifier_magic_candy = __TS__Class()
|
||||
local modifier_magic_candy = ____exports.modifier_magic_candy
|
||||
modifier_magic_candy.name = "modifier_magic_candy"
|
||||
modifier_magic_candy.____file_path = "scripts/vscripts/items/util_items/item_candys.lua"
|
||||
__TS__ClassExtends(modifier_magic_candy, BaseModifier)
|
||||
function modifier_magic_candy.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_magic_candy.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_magic_candy.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_SPELL_AMPLIFY_PERCENTAGE, MODIFIER_PROPERTY_COOLDOWN_PERCENTAGE, MODIFIER_PROPERTY_DAMAGEOUTGOING_PERCENTAGE}
|
||||
end
|
||||
function modifier_magic_candy.prototype.GetModifierSpellAmplify_Percentage(self)
|
||||
return 15
|
||||
end
|
||||
function modifier_magic_candy.prototype.GetModifierCooldown_Percentage(self)
|
||||
return 15
|
||||
end
|
||||
function modifier_magic_candy.prototype.GetModifierDamageOutgoing_Percentage(self)
|
||||
return -15
|
||||
end
|
||||
function modifier_magic_candy.prototype.GetTexture(self)
|
||||
return "util_items/candy"
|
||||
end
|
||||
modifier_magic_candy = __TS__Decorate(
|
||||
modifier_magic_candy,
|
||||
modifier_magic_candy,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_magic_candy"}
|
||||
)
|
||||
____exports.modifier_magic_candy = modifier_magic_candy
|
||||
return ____exports
|
||||
@@ -0,0 +1,189 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_buff_food_slot = ____modifier_general_hunger.modifier_buff_food_slot
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local BUFF_FOOD_MAX_SLOTS = ____modifier_general_hunger.BUFF_FOOD_MAX_SLOTS
|
||||
local getBuffFoodSlotCount = ____modifier_general_hunger.getBuffFoodSlotCount
|
||||
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 ____vampirism = require("utils.vampirism")
|
||||
local addMagicalVampirism = ____vampirism.addMagicalVampirism
|
||||
local reduceMagicalVampirism = ____vampirism.reduceMagicalVampirism
|
||||
--- Коктейль — бафф-еда: маг вампиризм, маг. усиление, +20% к манакосту
|
||||
____exports.item_cocktail = __TS__Class()
|
||||
local item_cocktail = ____exports.item_cocktail
|
||||
item_cocktail.name = "item_cocktail"
|
||||
item_cocktail.____file_path = "scripts/vscripts/items/util_items/item_cocktail.lua"
|
||||
__TS__ClassExtends(item_cocktail, BaseItem)
|
||||
function item_cocktail.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_cocktail.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return "#dota_hud_error_ability_not_ready"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_cocktail.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if not target then
|
||||
return
|
||||
end
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
if target:IsRealHero() then
|
||||
local buffDuration = self:GetSpecialValueFor("buff_duration")
|
||||
local spellLifesteal = self:GetSpecialValueFor("spell_lifesteal")
|
||||
local spellAmp = self:GetSpecialValueFor("spell_amp")
|
||||
local manacostIncrease = self:GetSpecialValueFor("manacost_increase")
|
||||
local hungerModifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_buff_food_slot.name,
|
||||
{duration = buffDuration}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
____exports.modifier_item_cocktail_buff.name,
|
||||
{duration = buffDuration, spell_lifesteal = spellLifesteal, spell_amp = spellAmp, manacost_increase = manacostIncrease}
|
||||
)
|
||||
if hungerModifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
hungerModifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
item_cocktail = __TS__Decorate(
|
||||
item_cocktail,
|
||||
item_cocktail,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_cocktail"}
|
||||
)
|
||||
____exports.item_cocktail = item_cocktail
|
||||
--- Бафф от коктейля: маг вампиризм, спелл амп, +% к манакосту
|
||||
____exports.modifier_item_cocktail_buff = __TS__Class()
|
||||
local modifier_item_cocktail_buff = ____exports.modifier_item_cocktail_buff
|
||||
modifier_item_cocktail_buff.name = "modifier_item_cocktail_buff"
|
||||
modifier_item_cocktail_buff.____file_path = "scripts/vscripts/items/util_items/item_cocktail.lua"
|
||||
__TS__ClassExtends(modifier_item_cocktail_buff, BaseModifier)
|
||||
function modifier_item_cocktail_buff.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.spellLifesteal = 0
|
||||
self.spellAmp = 0
|
||||
self.manacostIncrease = 0
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.IsPurgable(self)
|
||||
return true
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.IsDebuff(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.GetTexture(self)
|
||||
return "../items/utils/cocktail"
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_SPELL_AMPLIFY_PERCENTAGE, MODIFIER_PROPERTY_MANACOST_PERCENTAGE_STACKING}
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.OnCreated(self, params)
|
||||
if (params and params.spell_lifesteal) ~= nil then
|
||||
self.spellLifesteal = params.spell_lifesteal
|
||||
end
|
||||
if (params and params.spell_amp) ~= nil then
|
||||
self.spellAmp = params.spell_amp
|
||||
end
|
||||
if (params and params.manacost_increase) ~= nil then
|
||||
self.manacostIncrease = params.manacost_increase
|
||||
end
|
||||
local ability = self:GetAbility()
|
||||
if ability then
|
||||
if self.spellLifesteal == 0 then
|
||||
self.spellLifesteal = ability:GetSpecialValueFor("spell_lifesteal")
|
||||
end
|
||||
if self.spellAmp == 0 then
|
||||
self.spellAmp = ability:GetSpecialValueFor("spell_amp")
|
||||
end
|
||||
if self.manacostIncrease == 0 then
|
||||
self.manacostIncrease = ability:GetSpecialValueFor("manacost_increase")
|
||||
end
|
||||
end
|
||||
if IsServer() then
|
||||
local caster = self:GetCaster()
|
||||
if caster and self.spellLifesteal > 0 then
|
||||
addMagicalVampirism(nil, caster, self.spellLifesteal)
|
||||
end
|
||||
end
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.OnDestroy(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
local caster = self:GetCaster()
|
||||
if caster and self.spellLifesteal > 0 then
|
||||
reduceMagicalVampirism(nil, caster, self.spellLifesteal)
|
||||
end
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.GetModifierSpellAmplify_Percentage(self)
|
||||
return self.spellAmp
|
||||
end
|
||||
function modifier_item_cocktail_buff.prototype.GetModifierPercentageManacostStacking(self)
|
||||
return -self.manacostIncrease
|
||||
end
|
||||
modifier_item_cocktail_buff = __TS__Decorate(
|
||||
modifier_item_cocktail_buff,
|
||||
modifier_item_cocktail_buff,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_item_cocktail_buff"}
|
||||
)
|
||||
____exports.modifier_item_cocktail_buff = modifier_item_cocktail_buff
|
||||
return ____exports
|
||||
@@ -0,0 +1,76 @@
|
||||
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 registerAbility = ____dota_ts_adapter.registerAbility
|
||||
--- Кофейные зёрна — восстанавливают ману и не занимают слоты бафф-еды
|
||||
____exports.item_coffe_bean = __TS__Class()
|
||||
local item_coffe_bean = ____exports.item_coffe_bean
|
||||
item_coffe_bean.name = "item_coffe_bean"
|
||||
item_coffe_bean.____file_path = "scripts/vscripts/items/util_items/item_coffe_bean.lua"
|
||||
__TS__ClassExtends(item_coffe_bean, BaseItem)
|
||||
function item_coffe_bean.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_coffe_bean.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_coffe_bean.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if not target then
|
||||
return
|
||||
end
|
||||
local maxMana = target:GetMaxMana()
|
||||
local manaPercentRestore = self:GetSpecialValueFor("mana_pct")
|
||||
local flatManaRestore = self:GetSpecialValueFor("mana")
|
||||
local manaAmount = maxMana * manaPercentRestore / 100 + flatManaRestore
|
||||
local currentMana = target:GetMana()
|
||||
local manaToGive = math.min(manaAmount, maxMana - currentMana)
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
if manaToGive > 0 then
|
||||
target:GiveMana(manaToGive)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_MANA_ADD,
|
||||
target,
|
||||
manaToGive,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target:IsRealHero() then
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
item_coffe_bean = __TS__Decorate(
|
||||
item_coffe_bean,
|
||||
item_coffe_bean,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_coffe_bean"}
|
||||
)
|
||||
____exports.item_coffe_bean = item_coffe_bean
|
||||
return ____exports
|
||||
@@ -0,0 +1,163 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_buff_food_slot = ____modifier_general_hunger.modifier_buff_food_slot
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local BUFF_FOOD_MAX_SLOTS = ____modifier_general_hunger.BUFF_FOOD_MAX_SLOTS
|
||||
local getBuffFoodSlotCount = ____modifier_general_hunger.getBuffFoodSlotCount
|
||||
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
|
||||
--- Кофе — бафф-еда: уменьшает кд способностей и ускоряет скорость каста
|
||||
____exports.item_coffee = __TS__Class()
|
||||
local item_coffee = ____exports.item_coffee
|
||||
item_coffee.name = "item_coffee"
|
||||
item_coffee.____file_path = "scripts/vscripts/items/util_items/item_coffee.lua"
|
||||
__TS__ClassExtends(item_coffee, BaseItem)
|
||||
function item_coffee.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_coffee.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return "#dota_hud_error_ability_not_ready"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_coffee.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if not target then
|
||||
return
|
||||
end
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
if target:IsRealHero() then
|
||||
local buffDuration = self:GetSpecialValueFor("buff_duration")
|
||||
local cooldownReduction = self:GetSpecialValueFor("cooldown_reduction")
|
||||
local casttimeReduction = self:GetSpecialValueFor("casttime_reduction")
|
||||
local hungerModifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_buff_food_slot.name,
|
||||
{duration = buffDuration}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
____exports.modifier_item_coffee_buff.name,
|
||||
{duration = buffDuration, cooldown_reduction = cooldownReduction, casttime_reduction = casttimeReduction}
|
||||
)
|
||||
if hungerModifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
hungerModifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
item_coffee = __TS__Decorate(
|
||||
item_coffee,
|
||||
item_coffee,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_coffee"}
|
||||
)
|
||||
____exports.item_coffee = item_coffee
|
||||
--- Бафф от кофе: снижение кд и ускорение каста
|
||||
____exports.modifier_item_coffee_buff = __TS__Class()
|
||||
local modifier_item_coffee_buff = ____exports.modifier_item_coffee_buff
|
||||
modifier_item_coffee_buff.name = "modifier_item_coffee_buff"
|
||||
modifier_item_coffee_buff.____file_path = "scripts/vscripts/items/util_items/item_coffee.lua"
|
||||
__TS__ClassExtends(modifier_item_coffee_buff, BaseModifier)
|
||||
function modifier_item_coffee_buff.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.cooldownReduction = 0
|
||||
self.casttimeReduction = 0
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.IsPurgable(self)
|
||||
return true
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.IsDebuff(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.GetTexture(self)
|
||||
return "utils/coffee"
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_COOLDOWN_PERCENTAGE, MODIFIER_PROPERTY_CASTTIME_PERCENTAGE}
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.OnCreated(self, params)
|
||||
if (params and params.cooldown_reduction) ~= nil then
|
||||
self.cooldownReduction = params.cooldown_reduction
|
||||
end
|
||||
if (params and params.casttime_reduction) ~= nil then
|
||||
self.casttimeReduction = params.casttime_reduction
|
||||
end
|
||||
local ability = self:GetAbility()
|
||||
if ability then
|
||||
if self.cooldownReduction == 0 then
|
||||
self.cooldownReduction = ability:GetSpecialValueFor("cooldown_reduction")
|
||||
end
|
||||
if self.casttimeReduction == 0 then
|
||||
self.casttimeReduction = ability:GetSpecialValueFor("casttime_reduction")
|
||||
end
|
||||
end
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.GetModifierPercentageCooldown(self)
|
||||
return self.cooldownReduction
|
||||
end
|
||||
function modifier_item_coffee_buff.prototype.GetModifierPercentageCasttime(self)
|
||||
return self.casttimeReduction
|
||||
end
|
||||
modifier_item_coffee_buff = __TS__Decorate(
|
||||
modifier_item_coffee_buff,
|
||||
modifier_item_coffee_buff,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_item_coffee_buff"}
|
||||
)
|
||||
____exports.modifier_item_coffee_buff = modifier_item_coffee_buff
|
||||
return ____exports
|
||||
@@ -0,0 +1,216 @@
|
||||
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
|
||||
____exports.item_easter_egg = __TS__Class()
|
||||
local item_easter_egg = ____exports.item_easter_egg
|
||||
item_easter_egg.name = "item_easter_egg"
|
||||
item_easter_egg.____file_path = "scripts/vscripts/items/util_items/item_easter_egg.lua"
|
||||
__TS__ClassExtends(item_easter_egg, BaseItem)
|
||||
function item_easter_egg.prototype.OnSpellStart(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
local caster = self:GetCaster()
|
||||
caster:AddNewModifier(caster, self, "modifier_orbiting_wisp", {duration = 60})
|
||||
self:RemoveSelf()
|
||||
end
|
||||
item_easter_egg = __TS__Decorate(
|
||||
item_easter_egg,
|
||||
item_easter_egg,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_easter_egg"}
|
||||
)
|
||||
____exports.item_easter_egg = item_easter_egg
|
||||
____exports.modifier_orbiting_wisp = __TS__Class()
|
||||
local modifier_orbiting_wisp = ____exports.modifier_orbiting_wisp
|
||||
modifier_orbiting_wisp.name = "modifier_orbiting_wisp"
|
||||
modifier_orbiting_wisp.____file_path = "scripts/vscripts/items/util_items/item_easter_egg.lua"
|
||||
__TS__ClassExtends(modifier_orbiting_wisp, BaseModifier)
|
||||
function modifier_orbiting_wisp.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.interval = 0.03
|
||||
self.rotation = 0
|
||||
self.rotateDelta = 0
|
||||
self.rotateRadius = 200
|
||||
self.revolution = 2
|
||||
self.baseFacing = Vector(0, 1, 0)
|
||||
self.relativePos = Vector(0, 0, 0)
|
||||
self.position = Vector(0, 0, 0)
|
||||
self.facing = Vector(0, 0, 0)
|
||||
self.zero = Vector(0, 0, 0)
|
||||
end
|
||||
function modifier_orbiting_wisp.prototype.GetTexture(self)
|
||||
return "util_items/eggs"
|
||||
end
|
||||
function modifier_orbiting_wisp.prototype.OnCreated(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
local parent = self:GetParent()
|
||||
self.rotateDelta = 360 / self.revolution * self.interval
|
||||
self.relativePos = Vector(-self.rotateRadius, 0, 100)
|
||||
local origin = parent:GetAbsOrigin()
|
||||
self.position = Vector(origin.x + self.relativePos.x, origin.y + self.relativePos.y, origin.z + self.relativePos.z)
|
||||
self.rotation = 0
|
||||
self.facing = self.baseFacing
|
||||
self.wisp = CreateUnitByName(
|
||||
"npc_dota_golden_fish",
|
||||
self.position,
|
||||
true,
|
||||
parent,
|
||||
parent:GetOwner(),
|
||||
parent:GetTeamNumber()
|
||||
)
|
||||
if self.wisp ~= nil then
|
||||
self.wisp:SetForwardVector(self.facing)
|
||||
self.wisp:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self:GetAbility(),
|
||||
"modifier_wisp_orbiting",
|
||||
{}
|
||||
)
|
||||
self.wisp:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self:GetAbility(),
|
||||
"modifier_wisp_attack",
|
||||
{duration = 60}
|
||||
)
|
||||
end
|
||||
self:StartIntervalThink(self.interval)
|
||||
end
|
||||
function modifier_orbiting_wisp.prototype.OnIntervalThink(self)
|
||||
if not IsServer() or not self.wisp then
|
||||
return
|
||||
end
|
||||
local parent = self:GetParent()
|
||||
self.rotation = self.rotation + self.rotateDelta
|
||||
local origin = parent:GetAbsOrigin()
|
||||
local targetPos = Vector(origin.x + self.relativePos.x, origin.y + self.relativePos.y, origin.z + self.relativePos.z)
|
||||
local rotatedPos = rotatePositionYaw(nil, origin, -self.rotation, targetPos)
|
||||
self.position = rotatedPos
|
||||
self.facing = rotatePositionYaw(nil, self.zero, -self.rotation, self.baseFacing)
|
||||
self.wisp:SetAbsOrigin(self.position)
|
||||
self.wisp:SetForwardVector(self.facing)
|
||||
end
|
||||
function modifier_orbiting_wisp.prototype.OnDestroy(self)
|
||||
if IsClient() then
|
||||
return
|
||||
end
|
||||
if self.wisp then
|
||||
UTIL_Remove(self.wisp)
|
||||
end
|
||||
end
|
||||
modifier_orbiting_wisp = __TS__Decorate(
|
||||
modifier_orbiting_wisp,
|
||||
modifier_orbiting_wisp,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_orbiting_wisp"}
|
||||
)
|
||||
____exports.modifier_orbiting_wisp = modifier_orbiting_wisp
|
||||
____exports.modifier_wisp_orbiting = __TS__Class()
|
||||
local modifier_wisp_orbiting = ____exports.modifier_wisp_orbiting
|
||||
modifier_wisp_orbiting.name = "modifier_wisp_orbiting"
|
||||
modifier_wisp_orbiting.____file_path = "scripts/vscripts/items/util_items/item_easter_egg.lua"
|
||||
__TS__ClassExtends(modifier_wisp_orbiting, BaseModifier)
|
||||
function modifier_wisp_orbiting.prototype.IsHidden(self)
|
||||
return true
|
||||
end
|
||||
function modifier_wisp_orbiting.prototype.GetEffectName(self)
|
||||
return "particles/econ/items/lifestealer/lifestealer_immortal_backbone_gold/lifestealer_immortal_backbone_gold_rage.vpcf"
|
||||
end
|
||||
function modifier_wisp_orbiting.prototype.GetEffectAttachType(self)
|
||||
return PATTACH_OVERHEAD_FOLLOW
|
||||
end
|
||||
function modifier_wisp_orbiting.prototype.CheckState(self)
|
||||
return {
|
||||
[MODIFIER_STATE_INVULNERABLE] = true,
|
||||
[MODIFIER_STATE_UNSELECTABLE] = true,
|
||||
[MODIFIER_STATE_UNTARGETABLE] = true,
|
||||
[MODIFIER_STATE_OUT_OF_GAME] = true,
|
||||
[MODIFIER_STATE_NO_HEALTH_BAR] = true
|
||||
}
|
||||
end
|
||||
modifier_wisp_orbiting = __TS__Decorate(
|
||||
modifier_wisp_orbiting,
|
||||
modifier_wisp_orbiting,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_wisp_orbiting"}
|
||||
)
|
||||
____exports.modifier_wisp_orbiting = modifier_wisp_orbiting
|
||||
____exports.modifier_wisp_attack = __TS__Class()
|
||||
local modifier_wisp_attack = ____exports.modifier_wisp_attack
|
||||
modifier_wisp_attack.name = "modifier_wisp_attack"
|
||||
modifier_wisp_attack.____file_path = "scripts/vscripts/items/util_items/item_easter_egg.lua"
|
||||
__TS__ClassExtends(modifier_wisp_attack, BaseModifier)
|
||||
function modifier_wisp_attack.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.interval = 0.33
|
||||
end
|
||||
function modifier_wisp_attack.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_wisp_attack.prototype.IsPurgable(self)
|
||||
return false
|
||||
end
|
||||
function modifier_wisp_attack.prototype.OnCreated(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
self:StartIntervalThink(self.interval)
|
||||
end
|
||||
function modifier_wisp_attack.prototype.OnIntervalThink(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
local parent = self:GetParent()
|
||||
local caster = self:GetCaster()
|
||||
if not caster then
|
||||
return
|
||||
end
|
||||
if RandomFloat(0, 100) <= 50 then
|
||||
self:CreateGoldBag(parent:GetAbsOrigin())
|
||||
end
|
||||
end
|
||||
function modifier_wisp_attack.prototype.CreateGoldBag(self, position)
|
||||
local goldBag = CreateItem("item_bag_of_gold", nil, nil)
|
||||
if goldBag then
|
||||
local physicalItem = CreateItemOnPositionForLaunch(position, goldBag)
|
||||
if physicalItem ~= nil then
|
||||
local randomAngle = RandomFloat(0, 2 * math.pi)
|
||||
local randomDistance = RandomFloat(50, 200)
|
||||
local randomX = position.x + randomDistance * math.cos(randomAngle)
|
||||
local randomY = position.y + randomDistance * math.sin(randomAngle)
|
||||
local randomPos = Vector(randomX, randomY, position.z)
|
||||
goldBag:LaunchLootInitialHeight(
|
||||
false,
|
||||
0,
|
||||
100,
|
||||
0.5,
|
||||
randomPos
|
||||
)
|
||||
Timers:CreateTimer(
|
||||
15,
|
||||
function()
|
||||
if IsValidEntity(physicalItem) then
|
||||
UTIL_Remove(physicalItem)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
modifier_wisp_attack = __TS__Decorate(
|
||||
modifier_wisp_attack,
|
||||
modifier_wisp_attack,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_wisp_attack"}
|
||||
)
|
||||
____exports.modifier_wisp_attack = modifier_wisp_attack
|
||||
return ____exports
|
||||
@@ -0,0 +1,194 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_buff_food_slot = ____modifier_general_hunger.modifier_buff_food_slot
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local BUFF_FOOD_MAX_SLOTS = ____modifier_general_hunger.BUFF_FOOD_MAX_SLOTS
|
||||
local getBuffFoodSlotCount = ____modifier_general_hunger.getBuffFoodSlotCount
|
||||
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 ____heal_tracker = require("utils.heal_tracker")
|
||||
local HealWithBattlePass = ____heal_tracker.HealWithBattlePass
|
||||
--- Энергетический напиток — еда: лечение, мана, голод + бафф скорости и регенерации на время
|
||||
____exports.item_energy_drink = __TS__Class()
|
||||
local item_energy_drink = ____exports.item_energy_drink
|
||||
item_energy_drink.name = "item_energy_drink"
|
||||
item_energy_drink.____file_path = "scripts/vscripts/items/util_items/item_energy_drink.lua"
|
||||
__TS__ClassExtends(item_energy_drink, BaseItem)
|
||||
function item_energy_drink.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_energy_drink.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return "#dota_hud_error_ability_not_ready"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_energy_drink.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if not target then
|
||||
return
|
||||
end
|
||||
local healAmount = self:GetSpecialValueFor("heal")
|
||||
local manaAmount = self:GetSpecialValueFor("mana")
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
HealWithBattlePass(
|
||||
nil,
|
||||
target,
|
||||
healAmount,
|
||||
self,
|
||||
self:GetCaster(),
|
||||
true
|
||||
)
|
||||
if healAmount > 0 then
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_HEAL,
|
||||
target,
|
||||
healAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if manaAmount > 0 then
|
||||
target:GiveMana(manaAmount)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_MANA_ADD,
|
||||
target,
|
||||
manaAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target:IsRealHero() then
|
||||
local buffDuration = self:GetSpecialValueFor("buff_duration")
|
||||
local buffMoveSpeedPct = self:GetSpecialValueFor("buff_move_speed_pct")
|
||||
local buffAttackSpeed = self:GetSpecialValueFor("buff_attack_speed")
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_buff_food_slot.name,
|
||||
{duration = buffDuration}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
____exports.modifier_energy_drink_buff.name,
|
||||
{duration = buffDuration, buff_move_speed_pct = buffMoveSpeedPct, buff_attack_speed = buffAttackSpeed}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
item_energy_drink = __TS__Decorate(
|
||||
item_energy_drink,
|
||||
item_energy_drink,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_energy_drink"}
|
||||
)
|
||||
____exports.item_energy_drink = item_energy_drink
|
||||
--- Бафф от энергетического напитка: скорость передвижения и атаки
|
||||
____exports.modifier_energy_drink_buff = __TS__Class()
|
||||
local modifier_energy_drink_buff = ____exports.modifier_energy_drink_buff
|
||||
modifier_energy_drink_buff.name = "modifier_energy_drink_buff"
|
||||
modifier_energy_drink_buff.____file_path = "scripts/vscripts/items/util_items/item_energy_drink.lua"
|
||||
__TS__ClassExtends(modifier_energy_drink_buff, BaseModifier)
|
||||
function modifier_energy_drink_buff.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.buffMoveSpeedPct = 0
|
||||
self.buffAttackSpeed = 0
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.IsPurgable(self)
|
||||
return true
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.IsDebuff(self)
|
||||
return false
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.OnCreated(self, params)
|
||||
if params and params.buff_move_speed_pct ~= nil then
|
||||
self.buffMoveSpeedPct = params.buff_move_speed_pct
|
||||
end
|
||||
if params and params.buff_attack_speed ~= nil then
|
||||
self.buffAttackSpeed = params.buff_attack_speed
|
||||
end
|
||||
local ability = self:GetAbility()
|
||||
if ability then
|
||||
if self.buffMoveSpeedPct == 0 then
|
||||
self.buffMoveSpeedPct = ability:GetSpecialValueFor("buff_move_speed_pct")
|
||||
end
|
||||
if self.buffAttackSpeed == 0 then
|
||||
self.buffAttackSpeed = ability:GetSpecialValueFor("buff_attack_speed")
|
||||
end
|
||||
end
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, MODIFIER_PROPERTY_ATTACKSPEED_PERCENTAGE}
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.GetModifierMoveSpeedBonus_Percentage(self)
|
||||
return self.buffMoveSpeedPct
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.GetModifierAttackSpeedPercentage(self)
|
||||
return self.buffAttackSpeed
|
||||
end
|
||||
function modifier_energy_drink_buff.prototype.GetTexture(self)
|
||||
return "../items/utils/energetic"
|
||||
end
|
||||
modifier_energy_drink_buff = __TS__Decorate(
|
||||
modifier_energy_drink_buff,
|
||||
modifier_energy_drink_buff,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_energy_drink_buff"}
|
||||
)
|
||||
____exports.modifier_energy_drink_buff = modifier_energy_drink_buff
|
||||
return ____exports
|
||||
@@ -0,0 +1,61 @@
|
||||
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 ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_firecore = __TS__Class()
|
||||
local item_firecore = ____exports.item_firecore
|
||||
item_firecore.name = "item_firecore"
|
||||
item_firecore.____file_path = "scripts/vscripts/items/util_items/item_firecore.lua"
|
||||
__TS__ClassExtends(item_firecore, BaseItem)
|
||||
function item_firecore.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if target:GetUnitName() ~= "npc_mound" then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_firecore.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if target:GetUnitName() ~= "npc_mound" then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_firecore.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
GameRules:SendCustomMessage("#wait_some_time_before_tree_growth", 0, 0)
|
||||
UTIL_Remove(item)
|
||||
Timers:CreateTimer(
|
||||
60,
|
||||
function()
|
||||
local mound = Entities:FindByName(nil, "npc_mound")
|
||||
local moundpoint = mound:GetAbsOrigin()
|
||||
local tree = CreateUnitByName(
|
||||
"npc_sakura_tree",
|
||||
moundpoint,
|
||||
true,
|
||||
nil,
|
||||
nil,
|
||||
DOTA_TEAM_NEUTRALS
|
||||
)
|
||||
UTIL_Remove(mound)
|
||||
end
|
||||
)
|
||||
end
|
||||
item_firecore = __TS__Decorate(
|
||||
item_firecore,
|
||||
item_firecore,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_firecore"}
|
||||
)
|
||||
____exports.item_firecore = item_firecore
|
||||
return ____exports
|
||||
@@ -0,0 +1,86 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_fish = __TS__Class()
|
||||
local item_fish = ____exports.item_fish
|
||||
item_fish.name = "item_fish"
|
||||
item_fish.____file_path = "scripts/vscripts/items/util_items/item_fish.lua"
|
||||
__TS__ClassExtends(item_fish, BaseItem)
|
||||
function item_fish.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_fish.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_fish.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
local healAmount = self:GetSpecialValueFor("heal")
|
||||
if target ~= nil then
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
target:Heal(healAmount, self)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_HEAL,
|
||||
target,
|
||||
healAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target and target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
end
|
||||
item_fish = __TS__Decorate(
|
||||
item_fish,
|
||||
item_fish,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_fish"}
|
||||
)
|
||||
____exports.item_fish = item_fish
|
||||
return ____exports
|
||||
@@ -0,0 +1,86 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_grilled_meat = __TS__Class()
|
||||
local item_grilled_meat = ____exports.item_grilled_meat
|
||||
item_grilled_meat.name = "item_grilled_meat"
|
||||
item_grilled_meat.____file_path = "scripts/vscripts/items/util_items/item_grilled_meat.lua"
|
||||
__TS__ClassExtends(item_grilled_meat, BaseItem)
|
||||
function item_grilled_meat.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_grilled_meat.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_grilled_meat.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
local healAmount = self:GetSpecialValueFor("heal")
|
||||
if target ~= nil then
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
target:Heal(healAmount, self)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_HEAL,
|
||||
target,
|
||||
healAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target and target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
end
|
||||
item_grilled_meat = __TS__Decorate(
|
||||
item_grilled_meat,
|
||||
item_grilled_meat,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_grilled_meat"}
|
||||
)
|
||||
____exports.item_grilled_meat = item_grilled_meat
|
||||
return ____exports
|
||||
@@ -0,0 +1,86 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_meat = __TS__Class()
|
||||
local item_meat = ____exports.item_meat
|
||||
item_meat.name = "item_meat"
|
||||
item_meat.____file_path = "scripts/vscripts/items/util_items/item_meat.lua"
|
||||
__TS__ClassExtends(item_meat, BaseItem)
|
||||
function item_meat.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_meat.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_meat.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
local healAmount = self:GetSpecialValueFor("heal")
|
||||
if target ~= nil then
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
target:Heal(healAmount, self)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_HEAL,
|
||||
target,
|
||||
healAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
end
|
||||
if target and target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
end
|
||||
item_meat = __TS__Decorate(
|
||||
item_meat,
|
||||
item_meat,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_meat"}
|
||||
)
|
||||
____exports.item_meat = item_meat
|
||||
return ____exports
|
||||
@@ -0,0 +1,87 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_milk = __TS__Class()
|
||||
local item_milk = ____exports.item_milk
|
||||
item_milk.name = "item_milk"
|
||||
item_milk.____file_path = "scripts/vscripts/items/util_items/item_milk.lua"
|
||||
__TS__ClassExtends(item_milk, BaseItem)
|
||||
function item_milk.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_milk.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_milk.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
local healAmount = self:GetSpecialValueFor("mana")
|
||||
if target == nil then
|
||||
return
|
||||
end
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
target:GiveMana(healAmount)
|
||||
SendOverheadEventMessage(
|
||||
nil,
|
||||
OVERHEAD_ALERT_MANA_ADD,
|
||||
target,
|
||||
healAmount,
|
||||
target:GetPlayerOwner()
|
||||
)
|
||||
if target and target:IsRealHero() then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
end
|
||||
item_milk = __TS__Decorate(
|
||||
item_milk,
|
||||
item_milk,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_milk"}
|
||||
)
|
||||
____exports.item_milk = item_milk
|
||||
return ____exports
|
||||
@@ -0,0 +1,201 @@
|
||||
local ____lualib = require("lualib_bundle")
|
||||
local __TS__Class = ____lualib.__TS__Class
|
||||
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
||||
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
||||
local __TS__Decorate = ____lualib.__TS__Decorate
|
||||
local ____exports = {}
|
||||
local ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local BaseItem = ____dota_ts_adapter.BaseItem
|
||||
local BaseModifier = ____dota_ts_adapter.BaseModifier
|
||||
local registerModifier = ____dota_ts_adapter.registerModifier
|
||||
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_pizza = __TS__Class()
|
||||
local item_pizza = ____exports.item_pizza
|
||||
item_pizza.name = "item_pizza"
|
||||
item_pizza.____file_path = "scripts/vscripts/items/util_items/item_pizza.lua"
|
||||
__TS__ClassExtends(item_pizza, BaseItem)
|
||||
function item_pizza.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_pizza.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_pizza.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
local castedOnGurd = (target and target:GetName()) == "npc_quest_giver_friend"
|
||||
if target and target:IsRealHero() and target:GetName() ~= "npc_quest_giver_friend" then
|
||||
local modifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
local modifier_pizza = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
____exports.modifier_item_pizza.name,
|
||||
{}
|
||||
)
|
||||
if not ____exports.item_pizza.wasGivenToGurd then
|
||||
Timers:CreateTimer(
|
||||
50,
|
||||
function()
|
||||
EmitGlobalSound("Hero_Bloodseeker.Thirst.Cast")
|
||||
local soundCount = 0
|
||||
local maxRepeats = 20
|
||||
local repeatSound
|
||||
repeatSound = function()
|
||||
if soundCount < maxRepeats then
|
||||
EmitGlobalSound("Hero_Pudge.Dismember")
|
||||
soundCount = soundCount + 1
|
||||
Timers:CreateTimer(0.5, repeatSound)
|
||||
end
|
||||
end
|
||||
repeatSound(nil)
|
||||
local questGiver = Entities:FindByName(nil, "npc_quest_giver_friend")
|
||||
local questGiverVictim1 = Entities:FindByName(nil, "npc_quest_giver_maiden")
|
||||
local questGiverVictim2 = Entities:FindByName(nil, "npc_quest_giver_lina")
|
||||
if not questGiver then
|
||||
return
|
||||
end
|
||||
__TS__ArrayForEach(
|
||||
FindUnitsInRadius(
|
||||
2,
|
||||
questGiver:GetAbsOrigin(),
|
||||
nil,
|
||||
2000,
|
||||
1,
|
||||
1,
|
||||
8192,
|
||||
1,
|
||||
false
|
||||
),
|
||||
function(____, unit)
|
||||
unit:ForceKill(false)
|
||||
end
|
||||
)
|
||||
UTIL_Remove(questGiver)
|
||||
UTIL_Remove(questGiverVictim1)
|
||||
UTIL_Remove(questGiverVictim2)
|
||||
end
|
||||
)
|
||||
end
|
||||
if modifier_pizza then
|
||||
modifier_pizza:SetStackCount(modifier_pizza:GetStackCount() + self:GetSpecialValueFor("stack_count"))
|
||||
end
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
else
|
||||
if castedOnGurd then
|
||||
____exports.item_pizza.wasGivenToGurd = true
|
||||
end
|
||||
local heroes = HeroList:GetAllHeroes()
|
||||
GameRules:SendCustomMessage("#friend_quest_pizza_prep_message_complete_2", 0, 0)
|
||||
for ____, hero in ipairs(heroes) do
|
||||
if hero:IsRealHero() and hero:GetName() ~= "npc_quest_giver_friend" then
|
||||
local modifier = hero:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
local modifier_pizza = hero:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
____exports.modifier_item_pizza.name,
|
||||
{}
|
||||
)
|
||||
if modifier_pizza then
|
||||
modifier_pizza:SetStackCount(modifier_pizza:GetStackCount() + self:GetSpecialValueFor("stack_count"))
|
||||
end
|
||||
if modifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
modifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
UTIL_Remove(item)
|
||||
end
|
||||
end
|
||||
item_pizza.wasGivenToGurd = false
|
||||
item_pizza = __TS__Decorate(
|
||||
item_pizza,
|
||||
item_pizza,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_pizza"}
|
||||
)
|
||||
____exports.item_pizza = item_pizza
|
||||
____exports.modifier_item_pizza = __TS__Class()
|
||||
local modifier_item_pizza = ____exports.modifier_item_pizza
|
||||
modifier_item_pizza.name = "modifier_item_pizza"
|
||||
modifier_item_pizza.____file_path = "scripts/vscripts/items/util_items/item_pizza.lua"
|
||||
__TS__ClassExtends(modifier_item_pizza, BaseModifier)
|
||||
function modifier_item_pizza.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_pizza.prototype.IsPurgable(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_pizza.prototype.IsDebuff(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_pizza.prototype.RemoveOnDeath(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_pizza.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_STATS_AGILITY_BONUS, MODIFIER_PROPERTY_STATS_INTELLECT_BONUS, MODIFIER_PROPERTY_STATS_STRENGTH_BONUS}
|
||||
end
|
||||
function modifier_item_pizza.prototype.GetModifierBonusStats_Agility(self)
|
||||
return self:GetStackCount()
|
||||
end
|
||||
function modifier_item_pizza.prototype.GetModifierBonusStats_Intellect(self)
|
||||
return self:GetStackCount()
|
||||
end
|
||||
function modifier_item_pizza.prototype.GetModifierBonusStats_Strength(self)
|
||||
return self:GetStackCount()
|
||||
end
|
||||
function modifier_item_pizza.prototype.GetTexture(self)
|
||||
return "../items/utils/pizza"
|
||||
end
|
||||
modifier_item_pizza = __TS__Decorate(
|
||||
modifier_item_pizza,
|
||||
modifier_item_pizza,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_item_pizza"}
|
||||
)
|
||||
____exports.modifier_item_pizza = modifier_item_pizza
|
||||
return ____exports
|
||||
@@ -0,0 +1,37 @@
|
||||
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 ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
____exports.item_rofl_for_kaban_pumba = __TS__Class()
|
||||
local item_rofl_for_kaban_pumba = ____exports.item_rofl_for_kaban_pumba
|
||||
item_rofl_for_kaban_pumba.name = "item_rofl_for_kaban_pumba"
|
||||
item_rofl_for_kaban_pumba.____file_path = "scripts/vscripts/items/util_items/item_rofl_for_kaban_pumba.lua"
|
||||
__TS__ClassExtends(item_rofl_for_kaban_pumba, BaseItem)
|
||||
function item_rofl_for_kaban_pumba.prototype.OnSpellStart(self)
|
||||
if not IsServer() then
|
||||
return
|
||||
end
|
||||
local caster = self:GetCaster()
|
||||
local point = self:GetCursorPosition()
|
||||
local unit = CreateUnitByName(
|
||||
"npc_dota_rofl_kaban_pumba",
|
||||
point,
|
||||
true,
|
||||
caster,
|
||||
caster,
|
||||
DOTA_TEAM_BADGUYS
|
||||
)
|
||||
end
|
||||
item_rofl_for_kaban_pumba = __TS__Decorate(
|
||||
item_rofl_for_kaban_pumba,
|
||||
item_rofl_for_kaban_pumba,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_rofl_for_kaban_pumba"}
|
||||
)
|
||||
____exports.item_rofl_for_kaban_pumba = item_rofl_for_kaban_pumba
|
||||
return ____exports
|
||||
@@ -0,0 +1,190 @@
|
||||
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 ____modifier_general_hunger = require("abilities.modifiers.modifier_general_hunger")
|
||||
local modifier_buff_food_slot = ____modifier_general_hunger.modifier_buff_food_slot
|
||||
local modifier_general_hunger = ____modifier_general_hunger.modifier_general_hunger
|
||||
local BUFF_FOOD_MAX_SLOTS = ____modifier_general_hunger.BUFF_FOOD_MAX_SLOTS
|
||||
local getBuffFoodSlotCount = ____modifier_general_hunger.getBuffFoodSlotCount
|
||||
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
|
||||
--- Сэндвич — бафф-еда: увеличивает размер, броню, урон, но замедляет
|
||||
____exports.item_sandwich = __TS__Class()
|
||||
local item_sandwich = ____exports.item_sandwich
|
||||
item_sandwich.name = "item_sandwich"
|
||||
item_sandwich.____file_path = "scripts/vscripts/items/util_items/item_sandwich.lua"
|
||||
__TS__ClassExtends(item_sandwich, BaseItem)
|
||||
function item_sandwich.prototype.CastFilterResultTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return UF_FAIL_CUSTOM
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
return UF_SUCCESS
|
||||
end
|
||||
function item_sandwich.prototype.GetCustomCastErrorTarget(self, target)
|
||||
if IsServer() then
|
||||
if not target:IsRealHero() then
|
||||
return "#dota_hud_error_cheese_bad_target"
|
||||
end
|
||||
if getBuffFoodSlotCount(nil, target) >= BUFF_FOOD_MAX_SLOTS then
|
||||
return "#dota_hud_error_ability_not_ready"
|
||||
end
|
||||
if self:GetCurrentCharges() < self:GetInitialCharges() then
|
||||
return "#dota_hud_error_havent_charges"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function item_sandwich.prototype.OnSpellStart(self)
|
||||
local target = self:GetCursorTarget()
|
||||
local item = self
|
||||
if not target then
|
||||
return
|
||||
end
|
||||
target:EmitSound("DOTA_Item.Cheese.Activate")
|
||||
if target:IsRealHero() then
|
||||
local buffDuration = self:GetSpecialValueFor("buff_duration")
|
||||
local bonusDamage = self:GetSpecialValueFor("bonus_damage")
|
||||
local bonusArmor = self:GetSpecialValueFor("bonus_armor")
|
||||
local moveSpeedSlowPct = self:GetSpecialValueFor("move_speed_slow_pct")
|
||||
local modelScale = self:GetSpecialValueFor("model_scale")
|
||||
local hungerModifier = target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_general_hunger.name,
|
||||
{}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
modifier_buff_food_slot.name,
|
||||
{duration = buffDuration}
|
||||
)
|
||||
target:AddNewModifier(
|
||||
self:GetCaster(),
|
||||
self,
|
||||
____exports.modifier_item_sandwich_buff.name,
|
||||
{
|
||||
duration = buffDuration,
|
||||
bonus_damage = bonusDamage,
|
||||
bonus_armor = bonusArmor,
|
||||
move_speed_slow_pct = moveSpeedSlowPct,
|
||||
model_scale = modelScale
|
||||
}
|
||||
)
|
||||
if hungerModifier then
|
||||
local hunger_bonus = self:GetSpecialValueFor("hunger_bonus")
|
||||
do
|
||||
local i = 0
|
||||
while i < hunger_bonus do
|
||||
hungerModifier:IncrementStackCount()
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
if item:GetCurrentCharges() <= item:GetInitialCharges() then
|
||||
UTIL_Remove(item)
|
||||
return
|
||||
end
|
||||
item:SetCurrentCharges(item:GetCurrentCharges() - item:GetInitialCharges())
|
||||
end
|
||||
end
|
||||
item_sandwich = __TS__Decorate(
|
||||
item_sandwich,
|
||||
item_sandwich,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "item_sandwich"}
|
||||
)
|
||||
____exports.item_sandwich = item_sandwich
|
||||
____exports.modifier_item_sandwich_buff = __TS__Class()
|
||||
local modifier_item_sandwich_buff = ____exports.modifier_item_sandwich_buff
|
||||
modifier_item_sandwich_buff.name = "modifier_item_sandwich_buff"
|
||||
modifier_item_sandwich_buff.____file_path = "scripts/vscripts/items/util_items/item_sandwich.lua"
|
||||
__TS__ClassExtends(modifier_item_sandwich_buff, BaseModifier)
|
||||
function modifier_item_sandwich_buff.prototype.____constructor(self, ...)
|
||||
BaseModifier.prototype.____constructor(self, ...)
|
||||
self.bonusDamage = 0
|
||||
self.bonusArmor = 0
|
||||
self.moveSpeedSlowPct = 0
|
||||
self.modelScale = 0
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.IsHidden(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.IsPurgable(self)
|
||||
return true
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.IsDebuff(self)
|
||||
return false
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.GetAttributes(self)
|
||||
return MODIFIER_ATTRIBUTE_MULTIPLE
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.GetTexture(self)
|
||||
return "../items/utils/sandwich"
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE, MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, MODIFIER_PROPERTY_MODEL_SCALE}
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.OnCreated(self, params)
|
||||
if (params and params.bonus_damage) ~= nil then
|
||||
self.bonusDamage = params.bonus_damage
|
||||
end
|
||||
if (params and params.bonus_armor) ~= nil then
|
||||
self.bonusArmor = params.bonus_armor
|
||||
end
|
||||
if (params and params.move_speed_slow_pct) ~= nil then
|
||||
self.moveSpeedSlowPct = params.move_speed_slow_pct
|
||||
end
|
||||
if (params and params.model_scale) ~= nil then
|
||||
self.modelScale = params.model_scale
|
||||
end
|
||||
local ability = self:GetAbility()
|
||||
if ability then
|
||||
if self.bonusDamage == 0 then
|
||||
self.bonusDamage = ability:GetSpecialValueFor("bonus_damage")
|
||||
end
|
||||
if self.bonusArmor == 0 then
|
||||
self.bonusArmor = ability:GetSpecialValueFor("bonus_armor")
|
||||
end
|
||||
if self.moveSpeedSlowPct == 0 then
|
||||
self.moveSpeedSlowPct = ability:GetSpecialValueFor("move_speed_slow_pct")
|
||||
end
|
||||
if self.modelScale == 0 then
|
||||
self.modelScale = ability:GetSpecialValueFor("model_scale")
|
||||
end
|
||||
end
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.GetModifierPreAttack_BonusDamage(self)
|
||||
return self.bonusDamage
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.GetModifierPhysicalArmorBonus(self)
|
||||
return self.bonusArmor
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.GetModifierMoveSpeedBonus_Percentage(self)
|
||||
return -self.moveSpeedSlowPct
|
||||
end
|
||||
function modifier_item_sandwich_buff.prototype.GetModifierModelScale(self)
|
||||
return self.modelScale
|
||||
end
|
||||
modifier_item_sandwich_buff = __TS__Decorate(
|
||||
modifier_item_sandwich_buff,
|
||||
modifier_item_sandwich_buff,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_item_sandwich_buff"}
|
||||
)
|
||||
____exports.modifier_item_sandwich_buff = modifier_item_sandwich_buff
|
||||
return ____exports
|
||||
Reference in New Issue
Block a user