Пример #1
0
        public FCPolicy(FCPolicyDef def)
        {
            FactionFC faction = Find.World.GetComponent <FactionFC>();

            this.def    = def;
            timeEnacted = Find.TickManager.TicksGame;


            //Road Builder Trait
            if (def == FCPolicyDefOf.roadBuilders)
            {
                ResearchProjectDef researchdef = DefDatabase <ResearchProjectDef> .GetNamed("FCRoadBuildingDirt", false);

                if (researchdef == null)
                {
                    Log.Message("Empire Error - Road research returned Null");
                }
                if (!(Find.ResearchManager.GetProgress(researchdef) == researchdef.baseCost))
                {
                    Find.ResearchManager.FinishProject(researchdef);
                }
            }

            //Mercantile Trait
            if (def == FCPolicyDefOf.mercantile)
            {
                faction.resetTraitMercantileCaravanTime();
            }
        }
        string returnPolicyText(FCPolicyDef def)
        {
            string str = "";

            str += def.LabelCap + "\n";

            foreach (string positive in def.positiveEffects)
            {
                str += "\n" + positive;
            }

            str += "\n==========";
            foreach (string negative in def.negativeEffects)
            {
                str += "\n" + negative;
            }

            return(str);
        }