public virtual void Read(ICsvReader reader) { this.Version = reader.GetInt('v'); this.Id = reader.GetInt(); this.Name = reader.GetString(); this.SkillLogic = reader.GetString(); this.Description = reader.GetString(); this.Hitpoints = reader.GetInt(); this.Weight = reader.GetInt(); this.ClassId = this.Version < 31 ? 0 : reader.GetInt(); this.Armors = reader.GetInstances <ArmorValues>(6); this.BarrelLength = reader.GetShort(); this.FireHeight = reader.GetShort(); if (this.Version >= 34) { this.PhysicalRadius = reader.GetShort(); this.TriggerRadius = reader.GetShort(); } else { short dummy = reader.GetShort(); this.PhysicalRadius = dummy; this.TriggerRadius = dummy; if (dummy != -1) { dummy -= 8; this.PhysicalRadius = (dummy >= 1) ? dummy : (short)1; } } if (this.Version >= 11) { this.VehiclePhysicsOwned = reader.GetShort(); this.VehiclePhysicsUnowned = reader.GetShort(); this.WeaponPhysicsOwned = reader.GetShort(); this.WeaponPhysicsUnowned = reader.GetShort(); } else { reader.Skip(); reader.Skip(); } this.LowZ = reader.GetShort(); this.HighZ = reader.GetShort(); this.PickupItemId = reader.GetShort(); this.IsControllable = reader.GetShort(); this.IsWarpable = (this.Version >= 8) ? reader.GetShort() : (short)1; this.EnergyCostPerTick = reader.GetInt(); this.NormalWeight = reader.GetInt(); this.StopWeight = reader.GetInt(); this.DisplayHealth = (this.Version >= 1) ? reader.GetShort() : (short)0; this.InventoryItems = reader.GetInts(6); this.ChildVehicles = reader.GetInts(8); if (this.Version >= 6 && this.Version < 31) { reader.Skip(31); } this.ExplodeItemId = (this.Version >= 17) ? reader.GetShort() : (short)0; this.RadarPrize = (this.Version >= 35) ? reader.GetInt() : -1; this.VehicleGetInMode = (this.Version >= 36) ? reader.GetInt() : 0; this.VisualHeight = (this.Version >= 37) ? reader.GetShort() : (short)0; this.DropItemId = (this.Version >= 46) ? reader.GetShort() : (short)0; this.DropItemQuantity = (this.Version >= 46) ? reader.GetShort() : (short)0; if (this.Version >= 5) { this.Sprites[0].Read(this.Version, reader); this.Sprites[1].Read(this.Version, reader); } this.EnergyMax = (this.Version >= 5) ? reader.GetInt() : -1; this.EnergyRate = (this.Version >= 5) ? reader.GetInt() : -1; this.EnergyMin = (this.Version >= 21) ? reader.GetInt() : -1; this.ThrowTime = (this.Version >= 9) ? reader.GetShort() : (short)-1; if (this.Version >= 9 && this.Version < 24) { reader.Skip(); } this.AllowWeapons = (this.Version >= 9) ? reader.GetShort() : (short)-1; this.Style1BallSpeed = (this.Version >= 9) ? reader.GetShort() : (short)0; this.Style1LowFireAngle = (this.Version >= 9) ? reader.GetShort() : (short)45; this.Style1HighFireAngle = (this.Version >= 9) ? reader.GetShort() : (short)45; this.Style1KeyAssignment = (this.Version >= 15) ? reader.GetShort() : (short)1; this.Style1BallFriction = (this.Version >= 15) ? reader.GetShort() : (short)-1; this.Style2BallSpeed = (this.Version >= 15) ? reader.GetShort() : (short)0; this.Style2LowFireAngle = (this.Version >= 15) ? reader.GetShort() : (short)0; this.Style2HighFireAngle = (this.Version >= 15) ? reader.GetShort() : (short)0; this.Style2KeyAssignment = (this.Version >= 15) ? reader.GetShort() : (short)0; this.Style2BallFriction = (this.Version >= 9) ? reader.GetShort() : (short)1; if (this.Version >= 24) { this.TerrainModifiers = reader.GetShorts(16); } else { for (int i = 0; i < this.TerrainModifiers.Length; i++) { this.TerrainModifiers[i] = -1; } } if (this.Version >= 9 && this.Version < 23) { reader.Skip(); } this.BallCarryRollVehicleItem = (this.Version >= 29) ? reader.GetShort() : (short)0; this.BallCarryArmorVehicleItem = (this.Version >= 29) ? reader.GetShort() : (short)0; this.FlagCarryRollVehicleItem = (this.Version >= 29) ? reader.GetShort() : (short)0; this.FlagCarryArmorVehicleItem = (this.Version >= 29) ? reader.GetShort() : (short)0; this.EventString1 = (this.Version >= 33) ? reader.GetString() : ""; this.EventString2 = (this.Version >= 38) ? reader.GetString() : ""; this.EventString3 = (this.Version >= 38) ? reader.GetString() : ""; this.LosDistance = (this.Version >= 42) ? reader.GetInt() : 0; this.LosAngle = (this.Version >= 42) ? reader.GetInt() : 0; this.LosXRay = (this.Version >= 42) ? reader.GetInt() : 0; this.CombatAwarenessTime = (this.Version >= 42) ? reader.GetInt() : 0; this.SiblingKillsShared = (this.Version >= 42) ? reader.GetShort() : (short)0; this.RelativeId = (this.Version >= 47) ? reader.GetShort() : (short)0; this.DisplayOnFriendlyRadar = (this.Version >= 52) ? reader.GetInt() : 1; this.FriendlyRadarColor = (this.Version >= 50) ? reader.GetInt() : -1; this.DisplayOnEnemyRadar = (this.Version >= 52) ? reader.GetInt() : 1; this.EnemyRadarColor = (this.Version >= 50) ? reader.GetInt() : -1; if (this.Version >= 48) { for (int i = 0; i < 30; i++) { this.HoldItemLimits[i] = reader.GetShort(); this.HoldItemExtendedLimits[i] = reader.GetShort(); } } }