Exemple #1
0
        public LauncherArchetype(string datapath, FLDataFile.Section sec, ILogController log)
            : base(datapath, sec, log)
        {
            if (sec.SettingExists("damage_per_fire"))
            {
                DamagePerFire = sec.GetSetting("damage_per_fire").Float(0);
            }
            if (sec.SettingExists("power_usage"))
            {
                PowerUsage = sec.GetSetting("power_usage").Float(0);
            }
            if (sec.SettingExists("refire_delay"))
            {
                RefireDelay = sec.GetSetting("refire_delay").Float(0);
            }

            if (sec.SettingExists("muzzle_velocity"))
            {
                MuzzleVelocity = new Vector(0, 0, -sec.GetSetting("muzzle_velocity").Float(0));
            }

            if (sec.SettingExists("projectile_archetype"))
            {
                uint projectileArchID = FLUtility.CreateID(sec.GetSetting("projectile_archetype").Str(0));
                ProjectileArch = ArchetypeDB.Find(projectileArchID) as ProjectileArchetype;
                if (ProjectileArch == null)
                {
                    log.AddLog(LogType.ERROR, "error: projectile not found: " + sec.Desc);
                }
            }
        }
Exemple #2
0
        public MunitionArchetype(string datapath, FLDataFile.Section sec, ILogController log)
            : base(datapath, sec, log)
        {
            if (sec.SettingExists("hull_damage"))
            {
                HullDamage = sec.GetSetting("hull_damage").Float(0);
            }
            if (sec.SettingExists("energy_damage"))
            {
                EnergyDamage = sec.GetSetting("energy_damage").Float(0);
            }
            if (sec.SettingExists("weapon_type"))
            {
                WeaponType = ArchetypeDB.FindWeaponType(sec.GetSetting("weapon_type").Str(0));
                if (WeaponType == null)
                {
                    log.AddLog(LogType.ERROR, "error: weapon_type not found " + sec.Desc);
                }
            }
            if (sec.SettingExists("seeker"))
            {
                Seeker = sec.GetSetting("seeker").Str(0);
            }
            if (sec.SettingExists("time_to_lock"))
            {
                TimeToLock = sec.GetSetting("time_to_lock").Float(0);
            }
            if (sec.SettingExists("seeker_range"))
            {
                SeekerRange = sec.GetSetting("seeker_range").Float(0);
            }
            if (sec.SettingExists("seeker_fov_deg"))
            {
                SeekerFovDeg = sec.GetSetting("seeker_fov_deg").Float(0);
            }
            if (sec.SettingExists("detonation_dist"))
            {
                DetonationDist = sec.GetSetting("detonation_dist").Float(0);
            }
            if (sec.SettingExists("cruise_disruptor"))
            {
                CruiseDisruptor = sec.GetSetting("cruise_disruptor").Str(0) == "true";
            }
            if (sec.SettingExists("max_angular_velocity"))
            {
                MaxAngularVelocity = sec.GetSetting("max_angular_velocity").Float(0);
            }

            if (sec.SettingExists("motor"))
            {
                uint motorID = FLUtility.CreateID(sec.GetSetting("motor").Str(0));
                MotorArch = ArchetypeDB.Find(motorID) as MotorArchetype;
                if (MotorArch == null)
                {
                    log.AddLog(LogType.ERROR, "error: motor not found " + sec.Desc);
                }
            }
        }