예제 #1
0
        public static void SP_trigger_hurt(edict_t self)
        {
            GameTrigger.InitTrigger(self);

            self.noise_index = GameBase.gi.soundindex("world/electro.wav");
            self.touch       = GameTrigger.hurt_touch;

            if (0 == self.dmg)
            {
                self.dmg = 5;
            }

            if ((self.spawnflags & 1) != 0)
            {
                self.solid = Defines.SOLID_NOT;
            }
            else
            {
                self.solid = Defines.SOLID_TRIGGER;
            }

            if ((self.spawnflags & 2) != 0)
            {
                self.use = GameTrigger.hurt_use;
            }

            GameBase.gi.linkentity(self);
        }
예제 #2
0
        /*
         * QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE Pushes the player "speed"
         * defaults to 1000
         */
        public static void SP_trigger_push(edict_t self)
        {
            GameTrigger.InitTrigger(self);
            GameTrigger.windsound = GameBase.gi.soundindex("misc/windfly.wav");
            self.touch            = GameTrigger.trigger_push_touch;

            if (0 == self.speed)
            {
                self.speed = 1000;
            }

            GameBase.gi.linkentity(self);
        }
예제 #3
0
        public static void SP_trigger_gravity(edict_t self)
        {
            if (GameBase.st.gravity == null)
            {
                GameBase.gi.dprintf("trigger_gravity without gravity set at " + Lib.vtos(self.s.origin) + "\n");
                GameUtil.G_FreeEdict(self);

                return;
            }

            GameTrigger.InitTrigger(self);
            self.gravity = Lib.atoi(GameBase.st.gravity);
            self.touch   = GameTrigger.trigger_gravity_touch;
        }
예제 #4
0
        public static void SP_trigger_monsterjump(edict_t self)
        {
            if (0 == self.speed)
            {
                self.speed = 200;
            }

            if (0 == GameBase.st.height)
            {
                GameBase.st.height = 200;
            }

            if (self.s.angles[Defines.YAW] == 0)
            {
                self.s.angles[Defines.YAW] = 360;
            }

            GameTrigger.InitTrigger(self);
            self.touch      = GameTrigger.trigger_monsterjump_touch;
            self.movedir[2] = GameBase.st.height;
        }