/* * Author: Needles * https://steamcommunity.com/profiles/76561198026257137/ */ printl("*** HANDLER/GAS"); local GasHandler = 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 */ constructor() { base.constructor(); } function OnAdd() { local particleAttachment = ::Particle.Validate(self); if (particleAttachment != null) particleAttachment.AddEffect("gas_can_drips_red"); } function OnRemove() { local particleAttachment = ::Particle.Validate(self); if (particleAttachment != null) particleAttachment.RemoveEffect("gas_can_drips_red"); } function OnEvent_DamagePre(params) { if (params.const_entity != self) return; if (params.attacker != null && params.attacker.GetTeam() == self.GetTeam()) return; // Damage ignites gassed entities! ::Handler.AddHandler(self, "burn", params.attacker, ::Const.BURN_DURATION_MAX); ::Handler.RemoveHandler(self, "gas"); } } ::Handler.RegisterHandler("gas", @() GasHandler());