Exemplo n.º 1
0
        public void use(Entity self, Entity other, Entity activator) {
          if (self.count == 0) return;

          self.count--;

          if (self.count != 0) {
            if (0 == (self.spawnflags & 1)) {
              ServerGame.PF_centerprintf(activator, self.count + " more to go...");
              ServerGame.PF_StartSound(
                  activator,
                  Constants.CHAN_AUTO,
                  ServerInit.SV_SoundIndex("misc/talk1.wav"),
                  (float) 1,
                  (float) Constants.ATTN_NORM,
                  (float) 0);
            }
            return;
          }

          if (0 == (self.spawnflags & 1)) {
            ServerGame.PF_centerprintf(activator, "Sequence completed!");
            ServerGame.PF_StartSound(
                activator,
                Constants.CHAN_AUTO,
                ServerInit.SV_SoundIndex("misc/talk1.wav"),
                (float) 1,
                (float) Constants.ATTN_NORM,
                (float) 0);
          }
          self.activator = activator;
          multi_trigger(self);
        }
Exemplo n.º 2
0
        public void touch(Entity self, Entity other, Plane plane, Surface surf) {
          if (other.client != null) {
            if ((self.spawnflags & 2) != 0) return;
          } else if ((other.svflags & Constants.SVF_MONSTER) != 0) {
            if (0 == (self.spawnflags & 1)) return;
          } else return;

          if (!Math3D.VectorEquals(self.movedir, Globals.vec3_origin)) {
            float[] forward = {0, 0, 0};

            Math3D.AngleVectors(other.s.angles, forward, null, null);
            if (Math3D.DotProduct(forward, self.movedir) < 0) return;
          }

          self.activator = other;
          multi_trigger(self);
        }
Exemplo n.º 3
0
 public void use(Entity ent, Entity other, Entity activator) {
   ent.activator = activator;
   multi_trigger(ent);
 }