Пример #1
0
        public static militaryForce createMilitaryForceFromFaction(Faction faction, bool handicap)
        {
            double militaryLevel;
            double efficiency;

            switch (faction.def.techLevel)
            {
            case TechLevel.Undefined:
                militaryLevel = 1;
                efficiency    = .5;
                break;

            case TechLevel.Animal:
                militaryLevel = 2;
                efficiency    = .5;
                break;

            case TechLevel.Neolithic:
                militaryLevel = 3;
                efficiency    = 1;
                break;

            case TechLevel.Medieval:
                militaryLevel = 4;
                efficiency    = 1.2;
                break;

            case TechLevel.Industrial:
                militaryLevel = 4;
                efficiency    = 1.2;
                break;

            case TechLevel.Spacer:
                militaryLevel = 5;
                efficiency    = 1.3;
                break;

            case TechLevel.Ultra:
                militaryLevel = 6;
                efficiency    = 1.3;
                break;

            case TechLevel.Archotech:
                militaryLevel = 6;
                efficiency    = 1.5;
                break;

            default:
                militaryLevel = 1;
                efficiency    = 1;
                Log.Message("Defaulted createMilitaryForceFromEnemyFaction switch case - Empire Mod");
                break;
            }
            if (faction.def.defName == "VFEI_Insect")
            {
                militaryLevel = 4;
                efficiency    = 1.2;
            }
            double value = militaryLevel + FactionColonies.randomAttackModifier();

            if (handicap)
            {
                value = Math.Min(value, (2 + Math.Round((double)(Find.TickManager.TicksGame - Find.World.GetComponent <FactionFC>().timeStart - GenDate.TicksPerSeason) / GenDate.TicksPerSeason)));
                //Log.Message(value.ToString());
            }

            militaryForce returnForce = new militaryForce(value, efficiency, null, faction);

            return(returnForce);
        }