Exemplo 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);
        }
Exemplo n.º 2
0
        public Hit(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.owner = NetPacker.SbyteToInt(reader.ReadSByte());
            this.flag = NetPacker.SbyteToInt(reader.ReadSByte());

            this.Exists = true;
            this.frame = 0.5f;
        }
Exemplo n.º 3
0
        public Fire(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.size = NetPacker.ShortToSmallFloat(reader.ReadInt16());
            this.flag = NetPacker.SbyteToInt(reader.ReadSByte());
            this.frame = NetPacker.ShortToSmallFloat(reader.ReadInt16());

            this.Exists = true;
            this.additive = true;
        }
Exemplo n.º 4
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;
        }