/* * Author: Needles * https://steamcommunity.com/profiles/76561198026257137/ */ printl("*** HANDLER/MARK"); local MarkHandler = class extends ::Handler.BaseHandler { /* BASE CLASS self = The entity that the handler is assigned to activator = The entity that assigned the handler time = When this handler was assigned */ ent_particleSystem = null; constructor() { base.constructor(); ent_particleSystem = null; } function OnAdd() { local attachment = ::Attachment.Validate(self); if (attachment != null) { local point = attachment.GetPoint("particle_top"); ent_particleSystem = SpawnEntityFromTable("info_particle_system", { origin = self.GetOrigin() + point.origin, angles = self.GetAbsAngles() + point.angles, effect_name = "halloween_boss_victim", start_active = true, }); EntFireByHandle(ent_particleSystem, "SetParent", "!activator", -1.0, self, null); AddDependency(ent_particleSystem); } } /* function OnRemove() { if (ent_particleSystem != null && ent_particleSystem.IsValid()) ent_particleSystem.Destroy(); } */ function OnEvent_DamagePre(params) { if (params.const_entity != self) return; if (params.idef == ITEM_DEFINITION_INDEX.BUSHWACKA) params.crit = CRIT_TYPE.FULL; else if (params.crit != CRIT_TYPE.FULL) params.crit = CRIT_TYPE.MINI; } } ::Handler.RegisterHandler("mark", @() MarkHandler());