/* * Author: Needles * https://steamcommunity.com/profiles/76561198026257137/ */ printl("*** HANDLER/JARATE"); local JarateHandler = 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 */ function OnAdd() { local particleAttachment = ::Particle.Validate(self); if (particleAttachment != null) particleAttachment.AddEffect("peejar_drips"); NetProps.SetPropInt(self, "m_clrRender", ::Color.GetQuickColor(COLOR.YELLOW).ToHex()); } function OnRemove() { local particleAttachment = ::Particle.Validate(self); if (particleAttachment != null) particleAttachment.RemoveEffect("peejar_drips"); NetProps.SetPropInt(self, "m_clrRender", ::Color.GetQuickColor(COLOR.WHITE).ToHex()); } 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("jarate", @() JarateHandler());