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 Rocket(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.frame  = 4f;
            this.Exists = true;
        }
Ejemplo 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;
        }
Ejemplo 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;
        }