initial commit
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
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 BaseAbility = ____dota_ts_adapter.BaseAbility
|
||||
local BaseModifier = ____dota_ts_adapter.BaseModifier
|
||||
local registerAbility = ____dota_ts_adapter.registerAbility
|
||||
local registerModifier = ____dota_ts_adapter.registerModifier
|
||||
____exports.invul_npc = __TS__Class()
|
||||
local invul_npc = ____exports.invul_npc
|
||||
invul_npc.name = "invul_npc"
|
||||
invul_npc.____file_path = "scripts/vscripts/abilities/invul_npc.lua"
|
||||
__TS__ClassExtends(invul_npc, BaseAbility)
|
||||
function invul_npc.prototype.GetIntrinsicModifierName(self)
|
||||
return "modifier_invul_npc"
|
||||
end
|
||||
invul_npc = __TS__Decorate(
|
||||
invul_npc,
|
||||
invul_npc,
|
||||
{registerAbility(nil)},
|
||||
{kind = "class", name = "invul_npc"}
|
||||
)
|
||||
____exports.invul_npc = invul_npc
|
||||
____exports.modifier_invul_npc = __TS__Class()
|
||||
local modifier_invul_npc = ____exports.modifier_invul_npc
|
||||
modifier_invul_npc.name = "modifier_invul_npc"
|
||||
modifier_invul_npc.____file_path = "scripts/vscripts/abilities/invul_npc.lua"
|
||||
__TS__ClassExtends(modifier_invul_npc, BaseModifier)
|
||||
function modifier_invul_npc.prototype.IsHidden(self)
|
||||
return true
|
||||
end
|
||||
function modifier_invul_npc.prototype.IsPurgable(self)
|
||||
return false
|
||||
end
|
||||
function modifier_invul_npc.prototype.IsDebuff(self)
|
||||
return false
|
||||
end
|
||||
function modifier_invul_npc.prototype.CheckState(self)
|
||||
if self:GetParent():GetUnitName() == "npc_quest_giver_friend" or self:GetParent():GetUnitName() == "npc_mound" or self:GetParent():GetUnitName() == "npc_wisps" then
|
||||
return {[MODIFIER_STATE_NO_HEALTH_BAR] = true, [MODIFIER_STATE_NOT_ON_MINIMAP] = true}
|
||||
end
|
||||
if self:GetParent():GetUnitName() == "npc_capture_point" or self:GetParent():GetUnitName() == "npc_teleport" then
|
||||
return {
|
||||
[MODIFIER_STATE_NO_HEALTH_BAR] = true,
|
||||
[MODIFIER_STATE_NOT_ON_MINIMAP] = true,
|
||||
[MODIFIER_STATE_INVULNERABLE] = true,
|
||||
[MODIFIER_STATE_UNSELECTABLE] = true,
|
||||
[MODIFIER_STATE_NO_UNIT_COLLISION] = true
|
||||
}
|
||||
end
|
||||
if self:GetParent():GetUnitName() == "npc_dota_camera" then
|
||||
return {
|
||||
[MODIFIER_STATE_INVULNERABLE] = true,
|
||||
[MODIFIER_STATE_NOT_ON_MINIMAP] = true,
|
||||
[MODIFIER_STATE_UNSELECTABLE] = true,
|
||||
[MODIFIER_STATE_MAGIC_IMMUNE] = true,
|
||||
[MODIFIER_STATE_NO_UNIT_COLLISION] = true,
|
||||
[MODIFIER_STATE_FLYING_FOR_PATHING_PURPOSES_ONLY] = true,
|
||||
[MODIFIER_STATE_NO_HEALTH_BAR] = true
|
||||
}
|
||||
else
|
||||
return {[MODIFIER_STATE_NO_HEALTH_BAR] = true, [MODIFIER_STATE_OUT_OF_GAME] = true, [MODIFIER_STATE_NOT_ON_MINIMAP] = true}
|
||||
end
|
||||
end
|
||||
function modifier_invul_npc.prototype.DeclareFunctions(self)
|
||||
return {MODIFIER_PROPERTY_MIN_HEALTH}
|
||||
end
|
||||
function modifier_invul_npc.prototype.GetEffectName(self)
|
||||
local unitName = self:GetParent():GetUnitName()
|
||||
if unitName == "npc_wisps" then
|
||||
return "particles/units/heroes/hero_wisp/wisp_ambient.vpcf"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
function modifier_invul_npc.prototype.GetEffectAttachType(self)
|
||||
local unitName = self:GetParent():GetUnitName()
|
||||
if unitName == "npc_wisps" then
|
||||
return PATTACH_ROOTBONE_FOLLOW
|
||||
end
|
||||
return PATTACH_ABSORIGIN_FOLLOW
|
||||
end
|
||||
function modifier_invul_npc.prototype.GetMinHealth(self)
|
||||
local unitName = self:GetParent():GetUnitName()
|
||||
if unitName == "npc_wisps" or unitName == "npc_mound" or unitName == "npc_campfire" then
|
||||
return 1
|
||||
end
|
||||
return 0
|
||||
end
|
||||
modifier_invul_npc = __TS__Decorate(
|
||||
modifier_invul_npc,
|
||||
modifier_invul_npc,
|
||||
{registerModifier(nil)},
|
||||
{kind = "class", name = "modifier_invul_npc"}
|
||||
)
|
||||
____exports.modifier_invul_npc = modifier_invul_npc
|
||||
return ____exports
|
||||
Reference in New Issue
Block a user