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); }
public override void NetWrite(PacketWriter writer) { writer.Write(NetGame.MSG_PARTICLE); writer.Write(Particle.PARTICLE_FOG); writer.Write(Background); writer.Write(NetPacker.BigFloatToShort(Location.X)); writer.Write(NetPacker.BigFloatToShort(Location.Y)); }
public override void NetWrite(PacketWriter writer) { writer.Write(NetGame.MSG_PARTICLE); writer.Write(Particle.PARTICLE_SHOCKWAVE); writer.Write(Background); writer.Write(NetPacker.BigFloatToShort(Location.X)); writer.Write(NetPacker.BigFloatToShort(Location.Y)); writer.Write(NetPacker.MidFloatToShort(size)); writer.Write(refract); }
public override void NetWrite(PacketWriter writer) { writer.Write(NetGame.MSG_PARTICLE); writer.Write(Particle.PARTICLE_HEAT); writer.Write(Background); writer.Write(NetPacker.BigFloatToShort(Location.X)); writer.Write(NetPacker.BigFloatToShort(Location.Y)); writer.Write(NetPacker.BigFloatToShort(Trajectory.X)); writer.Write(NetPacker.BigFloatToShort(Trajectory.Y)); writer.Write(NetPacker.SmallFloatToShort(size)); }
public override void NetWrite(PacketWriter writer) { writer.Write(NetGame.MSG_PARTICLE); writer.Write(Particle.PARTICLE_ROCKET); writer.Write(Background); writer.Write(NetPacker.BigFloatToShort(Location.X)); writer.Write(NetPacker.BigFloatToShort(Location.Y)); writer.Write(NetPacker.BigFloatToShort(Trajectory.X)); writer.Write(NetPacker.BigFloatToShort(Trajectory.Y)); writer.Write(NetPacker.IntToSbyte(owner)); }
public Shockwave(PacketReader reader) { this.Location = new Vector2( NetPacker.ShortToBigFloat(reader.ReadInt16()), NetPacker.ShortToBigFloat(reader.ReadInt16())); this.size = NetPacker.ShortToMidFloat(reader.ReadInt16()); this.refract = reader.ReadBoolean(); this.owner = -1; this.Exists = true; this.frame = .5f; }
public Fog(PacketReader reader) { this.Location = new Vector2( NetPacker.ShortToBigFloat(reader.ReadInt16()), NetPacker.ShortToBigFloat(reader.ReadInt16())); this.Trajectory = new Vector2(80f, -30f); this.size = Rand.GetRandomFloat(6f, 8f); this.flag = Rand.GetRandomInt(0, 4); this.owner = -1; this.Exists = true; this.frame = (float)Math.PI * 2f; this.additive = true; this.rotation = Rand.GetRandomFloat(0f, 6.28f); }
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; }
public override void NetWrite(PacketWriter writer) { writer.Write(NetGame.MSG_PARTICLE); writer.Write(Particle.PARTICLE_BLOOD); writer.Write(Background); writer.Write(NetPacker.BigFloatToShort(Location.X)); writer.Write(NetPacker.BigFloatToShort(Location.Y)); writer.Write(NetPacker.BigFloatToShort(Trajectory.X)); writer.Write(NetPacker.BigFloatToShort(Trajectory.Y)); writer.Write(NetPacker.TinyFloatToByte(r)); writer.Write(NetPacker.TinyFloatToByte(g)); writer.Write(NetPacker.TinyFloatToByte(b)); writer.Write(NetPacker.TinyFloatToByte(a)); writer.Write(NetPacker.SmallFloatToShort(size)); writer.Write(NetPacker.IntToSbyte(flag)); }
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; }
public MuzzleFlash(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.rotation = Rand.GetRandomFloat(0f, 6.28f); this.Exists = true; this.frame = 0.05f; this.additive = true; }
public void WriteToNet(PacketWriter writer) { writer.Write(NetGame.MSG_CHARACTER); writer.Write(NetPacker.IntToSbyte(charDef.DefID)); writer.Write(NetPacker.IntToSbyte(Team)); writer.Write(NetPacker.IntToSbyte(ID)); writer.Write(NetPacker.BigFloatToShort(Loc.X)); writer.Write(NetPacker.BigFloatToShort(Loc.Y)); writer.Write(NetPacker.IntToShort(Anim)); writer.Write(NetPacker.IntToShort(AnimFrame)); writer.Write(NetPacker.MidFloatToShort(frame)); if (State == CharState.Air) { writer.Write(true); } else { writer.Write(false); } if (Face == CharDir.Right) { writer.Write(true); } else { writer.Write(false); } writer.Write(NetPacker.BigFloatToShort(Trajectory.X)); writer.Write(NetPacker.BigFloatToShort(Trajectory.Y)); writer.Write(KeyRight); writer.Write(KeyLeft); writer.Write(NetPacker.IntToShort(HP)); }
public Heat(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 = Rand.GetRandomInt(0, 4); this.owner = -1; this.Exists = true; this.rotation = Rand.GetRandomFloat(0f, 6.28f); this.frame = Rand.GetRandomFloat(.5f, .785f); this.refract = true; }
public Bullet(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.ShortToInt(reader.ReadInt16()); this.rotation = GlobalFunctions.GetAngle(new Vector2(), Trajectory); this.Exists = true; this.frame = 0.5f; this.additive = true; }
public void ReadFromNet(PacketReader reader) { Loc.X = NetPacker.ShortToBigFloat(reader.ReadInt16()); Loc.Y = NetPacker.ShortToBigFloat(reader.ReadInt16()); Anim = NetPacker.ShortToInt(reader.ReadInt16()); AnimFrame = NetPacker.ShortToInt(reader.ReadInt16()); AnimName = charDef.GetAnimation(Anim).name; frame = NetPacker.ShortToMidFloat(reader.ReadInt16()); if (reader.ReadBoolean()) { State = CharState.Air; } else { State = CharState.Grounded; } if (reader.ReadBoolean()) { Face = CharDir.Right; } else { Face = CharDir.Left; } Trajectory.X = NetPacker.ShortToBigFloat(reader.ReadInt16()); Trajectory.Y = NetPacker.ShortToBigFloat(reader.ReadInt16()); KeyRight = reader.ReadBoolean(); KeyLeft = reader.ReadBoolean(); HP = NetPacker.ShortToInt(reader.ReadInt16()); ReceivedNetUpdate = true; }
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; }