コード例 #1
0
        public QTempEntityMessage(BinaryReader br)
        {
            ID   = QMessageID.TempEntity;
            Type = (TempEntityType)br.ReadByte();

            switch (Type)
            {
            case TempEntityType.Spike:
            case TempEntityType.SuperSpike:
            case TempEntityType.Gunshot:
            case TempEntityType.Explosion:
            case TempEntityType.TarExplosion:
            case TempEntityType.WizSpike:
            case TempEntityType.KnightSpike:
            case TempEntityType.LavaSplash:
            case TempEntityType.Teleport:
                Origin = QCoords.Read(br);
                return;

            case TempEntityType.Lightning1:
            case TempEntityType.Lightning2:
            case TempEntityType.Lightning3:
            case TempEntityType.Unknown_13:
                Entity      = br.ReadInt16();
                Origin      = QCoords.Read(br);
                TraceEndpos = QCoords.Read(br);
                return;

            case TempEntityType.Unknown_12:
                Origin = QCoords.Read(br);
                Color  = br.ReadByte();
                Range  = br.ReadByte();
                return;
            }
        }
コード例 #2
0
 public QSpawnStaticSoundMessage(BinaryReader br)
 {
     ID          = QMessageID.SpawnStaticSound;
     Origin      = QCoords.Read(br);
     SoundNum    = br.ReadByte();
     Volume      = br.ReadByte();
     Attenuation = br.ReadByte();
 }
コード例 #3
0
 public QParticleMessage(BinaryReader br)
 {
     ID     = QMessageID.Particle;
     Origin = QCoords.Read(br);
     VelX   = br.ReadByte() * 0.0625;
     VelY   = br.ReadByte() * 0.0625;
     VelZ   = br.ReadByte() * 0.0625;
     Color  = br.ReadByte();
     Count  = br.ReadByte();
 }
コード例 #4
0
        public QSoundMessage(BinaryReader br)
        {
            ID   = QMessageID.Sound;
            Mask = (MessageMask)br.ReadByte();

            if (Mask.HasFlag(MessageMask.Volume))
            {
                Volume = br.ReadByte();
            }
            if (Mask.HasFlag(MessageMask.Attenuation))
            {
                Attenuation = br.ReadByte();
            }
            EntityChan = br.ReadInt16();
            SoundNum   = br.ReadByte();
            Origin     = QCoords.Read(br);
        }
コード例 #5
0
 public QDamageMessage(BinaryReader br)
 {
     Save   = br.ReadByte();
     Take   = br.ReadByte();
     Origin = QCoords.Read(br);
 }