Ejemplo n.º 1
0
        public Blood(PacketReader reader)
        {
            this.Location =
                new Vector2(
                    NetPacker.ShortToBigFloat(reader.ReadInt16()),
                    NetPacker.ShortToBigFloat(reader.ReadInt16()));

            this.Trajectory =
                new Vector2(
                    NetPacker.ShortToBigFloat(reader.ReadInt16()),
                    NetPacker.ShortToBigFloat(reader.ReadInt16()));

            this.r = NetPacker.ByteToTinyFloat(reader.ReadByte());
            this.g = NetPacker.ByteToTinyFloat(reader.ReadByte());
            this.b = NetPacker.ByteToTinyFloat(reader.ReadByte());
            this.a = NetPacker.ByteToTinyFloat(reader.ReadByte());

            this.size = NetPacker.ShortToSmallFloat(reader.ReadInt16());
            this.flag = NetPacker.SbyteToInt(reader.ReadSByte());

            this.owner    = -1;
            this.Exists   = true;
            this.rotation = GlobalFunctions.GetAngle(new Vector2(), Trajectory);
            this.frame    = Rand.GetRandomFloat(0.3f, 0.7f);
        }
Ejemplo n.º 2
0
        public Smoke(PacketReader reader)
        {
            this.Location =
                new Vector2(
                    NetPacker.ShortToBigFloat(reader.ReadInt16()),
                    NetPacker.ShortToBigFloat(reader.ReadInt16()));

            this.Trajectory =
                new Vector2(
                    NetPacker.ShortToBigFloat(reader.ReadInt16()),
                    NetPacker.ShortToBigFloat(reader.ReadInt16()));

            this.r = NetPacker.ByteToTinyFloat(reader.ReadByte());
            this.g = NetPacker.ByteToTinyFloat(reader.ReadByte());
            this.b = NetPacker.ByteToTinyFloat(reader.ReadByte());
            this.a = NetPacker.ByteToTinyFloat(reader.ReadByte());

            this.size = NetPacker.ShortToSmallFloat(reader.ReadInt16());
            this.flag = NetPacker.SbyteToInt(reader.ReadSByte());

            this.owner  = -1;
            this.Exists = true;
            this.frame  = 1.0f;
        }