Example #1
0
        /*
         * ==============================================================================
         *
         * trigger_always
         *
         * ==============================================================================
         */

        /*
         * QUAKED trigger_always (.5 .5 .5) (-8 -8 -8) (8 8 8) This trigger will
         * always fire. It is activated by the world.
         */
        public static void SP_trigger_always(edict_t ent)
        {
            // we must have some delay to make sure our use targets are present
            if (ent.delay < 0.2f)
            {
                ent.delay = 0.2f;
            }

            GameUtil.G_UseTargets(ent, ent);
        }
Example #2
0
        // the trigger was just activated
        // ent.activator should be set to the activator so it can be held through a
        // delay so wait for the delay time before firing
        public static void multi_trigger(edict_t ent)
        {
            if (ent.nextthink != 0)
            {
                return;                 // already been triggered
            }
            GameUtil.G_UseTargets(ent, ent.activator);

            if (ent.wait > 0)
            {
                ent.think     = GameTrigger.multi_wait;
                ent.nextthink = GameBase.level.time + ent.wait;
            }
            else
            {
                // we can't just remove (self) here, because this is a touch
                // function
                // called while looping through area links...
                ent.touch     = null;
                ent.nextthink = GameBase.level.time + Defines.FRAMETIME;
                ent.think     = GameUtil.G_FreeEdictA;
            }
        }
Example #3
0
        /*
         * ================ monster_death_use
         *
         * When a monster dies, it fires all of its targets with the current enemy
         * as activator. ================
         */
        public static void monster_death_use(edict_t self)
        {
            self.flags &= ~(Defines.FL_FLY | Defines.FL_SWIM);
            self.monsterinfo.aiflags &= Defines.AI_GOOD_GUY;

            if (self.item != null)
            {
                GameItems.Drop_Item(self, self.item);
                self.item = null;
            }

            if (self.deathtarget != null)
            {
                self.target = self.deathtarget;
            }

            if (self.target == null)
            {
                return;
            }

            GameUtil.G_UseTargets(self, self.enemy);
        }