示例#1
0
  public static void SP_trigger_multiple(Entity ent) {
    if (ent.sounds == 1) ent.noise_index = ServerInit.SV_SoundIndex("misc/secret.wav");
    else if (ent.sounds == 2) ent.noise_index = ServerInit.SV_SoundIndex("misc/talk.wav");
    else if (ent.sounds == 3) ent.noise_index = ServerInit.SV_SoundIndex("misc/trigger1.wav");

    if (ent.wait == 0) ent.wait = 0.2f;

    ent.touch = Touch_Multi;
    ent.movetype = Constants.MOVETYPE_NONE;
    ent.svflags |= Constants.SVF_NOCLIENT;

    if ((ent.spawnflags & 4) != 0) {
      ent.solid = Constants.SOLID_NOT;
      ent.use = trigger_enable;
    } else {
      ent.solid = Constants.SOLID_TRIGGER;
      ent.use = Use_Multi;
    }

    if (!Math3D.VectorEquals(ent.s.angles, Globals.vec3_origin))
      GameBase.G_SetMovedir(ent.s.angles, ent.movedir);

    ServerGame.PF_setmodel(ent, ent.model);
    World.SV_LinkEdict(ent);
  }
示例#2
0
        public void use(Entity self, Entity other, Entity activator) {
          if (self.solid == Constants.SOLID_NOT) self.solid = Constants.SOLID_TRIGGER;
          else self.solid = Constants.SOLID_NOT;
          World.SV_LinkEdict(self);

          if (0 == (self.spawnflags & 2)) self.use = null;
        }
示例#3
0
  public static void SP_trigger_hurt(Entity self) {
    InitTrigger(self);

    self.noise_index = ServerInit.SV_SoundIndex("world/electro.wav");
    self.touch = hurt_touch;

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

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

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

    World.SV_LinkEdict(self);
  }
示例#4
0
  public static void InitTrigger(Entity self) {
    if (!Math3D.VectorEquals(self.s.angles, Globals.vec3_origin))
      GameBase.G_SetMovedir(self.s.angles, self.movedir);

    self.solid = Constants.SOLID_TRIGGER;
    self.movetype = Constants.MOVETYPE_NONE;
    ServerGame.PF_setmodel(self, self.model);
    self.svflags = Constants.SVF_NOCLIENT;
  }
示例#5
0
 public void use(Entity self, Entity other, Entity activator) {
   self.solid = Constants.SOLID_TRIGGER;
   self.use = Use_Multi;
   World.SV_LinkEdict(self);
 }