Beispiel #1
0
            public TurretInfo(ListVehicleProfile.ListTurret turret, int id)
            {
                TraverseSpeed = turret.traverse_speed;
                ViewRange     = turret.view_range;

                var module = API.TURRETS[id];

                Armor  = new ArmorStats(module.armor);
                HP     = module.hp;
                Name   = module.name;
                Tier   = module.tier;
                ID     = id;
                Weight = module.weight;
            }
Beispiel #2
0
        public VehicleStats(GunDetailed gun, BaseTurretWithTraverse turret, BaseEngine engine, BaseSuspension tracks, BaseVehicle vehicle, CamoInfo camo)
        {
            Camo = camo;
            var profile = vehicle.default_profile;
            int weight  = profile.hull_weight + gun.weight + turret.weight + engine.weight + tracks.weight;

            Weight               = weight / 1000.0;
            HorsePower           = engine.power;
            HorsePowerToTonRatio = HorsePower / Weight;
            TraverseSpeed        = tracks.traverse_speed * ((double)engine.power / profile.engine.power) * (profile.weight / (double)weight);
            SpeedForward         = profile.speed_forward;
            SpeedBackward        = profile.speed_backward;

            //var gunShells = API.GUNS[profile.gun_id]
            //Shells = gunShells.ToDictionary(s => s.type, s => new ShellInfo(s));
            //DefaultShell = gunShells[0];
            Info         = new VehicleInfo(vehicle);
            SignalRange  = profile.signal_range;
            TurretArmor  = new ArmorStats();
            HullArmor    = new ArmorStats(profile.armor.hull);
            FireChance   = engine.fire_chance;
            LoadLimit    = tracks.load_limit;
            AmmoCapacity = profile.max_ammo;
            Hitpoints    = profile.hull_hp + turret.hp;

            Dispersion         = gun.dispersion;
            AimTime            = gun.aim_time;
            ClipCapacity       = gun.clip_capacity;
            GunElevation       = gun.move_up_arc;
            GunDepression      = gun.move_down_arc;
            ReloadTime         = gun.reload_time;
            GunTraverseSpeed   = gun.traverse_speed;
            ClipReloadTime     = gun.clip_reload_time;
            FireRate           = gun.fire_rate;
            DamagePerMinute    = FireRate * DefaultShell.damage;
            AdvDamagePerMinute = (FireRate + 1) * DefaultShell.damage;

            ViewRange           = turret.view_range;
            GunArcLeft          = turret.traverse_left_arc;
            GunArcRight         = turret.traverse_right_arc;
            TurretTraverseSpeed = turret.traverse_speed;

            ModulesInfo = new Dictionary <ModuleType, BaseModule>(4);
            ModulesInfo.Add(ModuleType.vehicleEngine, engine);
            ModulesInfo.Add(ModuleType.vehicleGun, gun);
            ModulesInfo.Add(ModuleType.vehicleTurret, turret);
            ModulesInfo.Add(ModuleType.vehicleChassis, tracks);
            ModulesInfo.Add(ModuleType.vehicleHull, new BaseModule(vehicle.name, profile.hull_weight, vehicle.tier));
        }
Beispiel #3
0
        public StaticVehicleStats(BaseVehicle vehicleStock, ListVehicleProfile[] topSuspensionEngineProfiles)
        {
            var profile = topSuspensionEngineProfiles.First();

            int[] profileIDs = profile.profile_id.Split('-').Select(i => Convert.ToInt32(i)).ToArray();
            EngineID     = profileIDs.First(i => vehicleStock.engines.Contains(i));
            SuspensionID = profileIDs.First(i => i != EngineID && vehicleStock.suspensions.Contains(i));
            var engine = API.ENGINES[EngineID];
            var tracks = API.SUSPENSIONS[SuspensionID];

            BaseWeight   = profile.hull_weight + engine.weight + tracks.weight;
            StockWeight  = vehicleStock.default_profile.weight;
            BaseHP       = vehicleStock.default_profile.hull_hp;
            BaseTraverse = tracks.traverse_speed;

            HorsePower    = engine.power;
            BaseTraverse  = tracks.traverse_speed * ((double)engine.power / vehicleStock.default_profile.engine.power);
            SpeedForward  = profile.speed_forward;
            SpeedBackward = profile.speed_backward;

            Info        = new VehicleInfo(vehicleStock);
            SignalRange = profile.signal_range;
            HullArmor   = new ArmorStats(profile.armor.hull);
            FireChance  = engine.fire_chance;
            LoadLimit   = tracks.load_limit;

            GunArcLeft  = vehicleStock.default_profile.turret.traverse_left_arc;
            GunArcRight = vehicleStock.default_profile.turret.traverse_right_arc;

            Name     = vehicleStock.name;
            Tier     = vehicleStock.tier;
            ID       = vehicleStock.tank_id;
            Guns     = vehicleStock.guns;
            Turrets  = vehicleStock.turrets;
            Profiles = topSuspensionEngineProfiles.Select(p => new DynamicVehicleStats(p, this)).ToArray();
        }