Ejemplo n.º 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);
  }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 /*
  * QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE Pushes the player "speed"
  * defaults to 1000
  */
 public static void SP_trigger_push(Entity self) {
   InitTrigger(self);
   windsound = ServerInit.SV_SoundIndex("misc/windfly.wav");
   self.touch = trigger_push_touch;
   if (0 == self.speed) self.speed = 1000;
   World.SV_LinkEdict(self);
 }
Ejemplo n.º 4
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);
  }
Ejemplo n.º 5
0
 public void use(Entity self, Entity other, Entity activator) {
   self.solid = Constants.SOLID_TRIGGER;
   self.use = Use_Multi;
   World.SV_LinkEdict(self);
 }