Пример #1
0
 public static void SP_target_spawner(edict_t self)
 {
     self.use     = use_target_spawner;
     self.svflags = Defines.SVF_NOCLIENT;
     if (self.speed != 0)
     {
         GameBase.G_SetMovedir(self.s.angles, self.movedir);
         Math3D.VectorScale(self.movedir, self.speed, self.movedir);
     }
 }
Пример #2
0
 public static void SP_target_splash(edict_t self)
 {
     self.use = use_target_splash;
     GameBase.G_SetMovedir(self.s.angles, self.movedir);
     if (0 == self.count)
     {
         self.count = 32;
     }
     self.svflags = Defines.SVF_NOCLIENT;
 }
Пример #3
0
 public static void InitTrigger(edict_t self)
 {
     if (!Math3D.VectorEquals(self.s.angles, Globals.vec3_origin))
     {
         GameBase.G_SetMovedir(self.s.angles, self.movedir);
     }
     self.solid    = Defines.SOLID_TRIGGER;
     self.movetype = Defines.MOVETYPE_NONE;
     GameBase.gi.Setmodel(self, self.model);
     self.svflags = Defines.SVF_NOCLIENT;
 }
Пример #4
0
 public static void SP_target_blaster(edict_t self)
 {
     self.use = use_target_blaster;
     GameBase.G_SetMovedir(self.s.angles, self.movedir);
     self.noise_index = GameBase.gi.Soundindex("weapons/laser2.wav");
     if (0 == self.dmg)
     {
         self.dmg = 15;
     }
     if (0 == self.speed)
     {
         self.speed = 1000;
     }
     self.svflags = Defines.SVF_NOCLIENT;
 }
Пример #5
0
        public static void SP_trigger_multiple(edict_t ent)
        {
            if (ent.sounds == 1)
            {
                ent.noise_index = GameBase.gi.Soundindex("misc/secret.wav");
            }
            else if (ent.sounds == 2)
            {
                ent.noise_index = GameBase.gi.Soundindex("misc/talk.wav");
            }
            else if (ent.sounds == 3)
            {
                ent.noise_index = GameBase.gi.Soundindex("misc/trigger1.wav");
            }
            if (ent.wait == 0)
            {
                ent.wait = 0.2F;
            }
            ent.touch    = Touch_Multi;
            ent.movetype = Defines.MOVETYPE_NONE;
            ent.svflags |= Defines.SVF_NOCLIENT;
            if ((ent.spawnflags & 4) != 0)
            {
                ent.solid = Defines.SOLID_NOT;
                ent.use   = trigger_enable;
            }
            else
            {
                ent.solid = Defines.SOLID_TRIGGER;
                ent.use   = Use_Multi;
            }

            if (!Math3D.VectorEquals(ent.s.angles, Globals.vec3_origin))
            {
                GameBase.G_SetMovedir(ent.s.angles, ent.movedir);
            }
            GameBase.gi.Setmodel(ent, ent.model);
            GameBase.gi.Linkentity(ent);
        }
Пример #6
0
            public override Boolean Think(edict_t self)
            {
                self.movetype     = Defines.MOVETYPE_NONE;
                self.solid        = Defines.SOLID_NOT;
                self.s.renderfx  |= Defines.RF_BEAM | Defines.RF_TRANSLUCENT;
                self.s.modelindex = 1;
                if ((self.spawnflags & 64) != 0)
                {
                    self.s.frame = 16;
                }
                else
                {
                    self.s.frame = 4;
                }
                if ((self.spawnflags & 2) != 0)
                {
                    self.s.skinnum = unchecked (( Int32 )0xf2f2f0f0);
                }
                else if ((self.spawnflags & 4) != 0)
                {
                    self.s.skinnum = unchecked (( Int32 )0xd0d1d2d3);
                }
                else if ((self.spawnflags & 8) != 0)
                {
                    self.s.skinnum = unchecked (( Int32 )0xf3f3f1f1);
                }
                else if ((self.spawnflags & 16) != 0)
                {
                    self.s.skinnum = unchecked (( Int32 )0xdcdddedf);
                }
                else if ((self.spawnflags & 32) != 0)
                {
                    self.s.skinnum = unchecked (( Int32 )0xe0e1e2e3);
                }
                if (null == self.enemy)
                {
                    if (self.target != null)
                    {
                        EdictIterator edit = GameBase.G_Find(null, GameBase.findByTarget, self.target);
                        if (edit == null)
                        {
                            GameBase.gi.Dprintf(self.classname + " at " + Lib.Vtos(self.s.origin) + ": " + self.target + " is a bad target\\n");
                        }
                        self.enemy = edit.o;
                    }
                    else
                    {
                        GameBase.G_SetMovedir(self.s.angles, self.movedir);
                    }
                }

                self.use   = target_laser_use;
                self.think = target_laser_think;
                if (0 == self.dmg)
                {
                    self.dmg = 1;
                }
                Math3D.VectorSet(self.mins, -8, -8, -8);
                Math3D.VectorSet(self.maxs, 8, 8, 8);
                GameBase.gi.Linkentity(self);
                if ((self.spawnflags & 1) != 0)
                {
                    Target_laser_on(self);
                }
                else
                {
                    Target_laser_off(self);
                }
                return(true);
            }