コード例 #1
0
 public override string Summary(Scenario scen)
 {
     return("ScenPart_StatFactor".Translate(stat.label, factor.ToStringPercent()));
 }
コード例 #2
0
		public override string Summary(Scenario scen)
		{
			return ScenSummaryList.SummaryWithList(scen, "PlayerStartsWith", ScenPart_StartingThing_Defined.PlayerStartWithIntro);
		}
コード例 #3
0
 public static IEnumerable <ScenPartDef> AddableParts(Scenario scen)
 {
     return(from d in DefDatabase <ScenPartDef> .AllDefs
            where scen.AllParts.Count((ScenPart p) => p.def == d) < d.maxUses
            select d);
 }
コード例 #4
0
        public static Scenario GenerateNewRandomScenario(string seed)
        {
            Rand.PushState();
            Rand.Seed = seed.GetHashCode();
            int @int = Rand.Int;

            int[] array = new int[10];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = Rand.Int;
            }
            int int2 = Rand.Int;

            ScenarioMaker.scen             = new Scenario();
            ScenarioMaker.scen.Category    = ScenarioCategory.CustomLocal;
            ScenarioMaker.scen.name        = NameGenerator.GenerateName(RulePackDefOf.NamerScenario, (Predicate <string>)null, false, (string)null);
            ScenarioMaker.scen.description = null;
            ScenarioMaker.scen.summary     = null;
            Rand.Seed = @int;
            ScenarioMaker.scen.playerFaction = (ScenPart_PlayerFaction)ScenarioMaker.MakeScenPart(ScenPartDefOf.PlayerFaction);
            ScenarioMaker.scen.parts.Add(ScenarioMaker.MakeScenPart(ScenPartDefOf.ConfigPage_ConfigureStartingPawns));
            ScenarioMaker.scen.parts.Add(ScenarioMaker.MakeScenPart(ScenPartDefOf.PlayerPawnsArriveMethod));
            Rand.Seed = array[0];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.PlayerPawnFilter, Rand.RangeInclusive(-1, 2));
            Rand.Seed = array[1];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.StartingImportant, Rand.RangeInclusive(0, 2));
            Rand.Seed = array[2];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.PlayerPawnModifier, Rand.RangeInclusive(-1, 2));
            Rand.Seed = array[3];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.Rule, Rand.RangeInclusive(-2, 3));
            Rand.Seed = array[4];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.StartingItem, Rand.RangeInclusive(0, 6));
            Rand.Seed = array[5];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.WorldThing, Rand.RangeInclusive(-3, 6));
            Rand.Seed = array[6];
            ScenarioMaker.AddCategoryScenParts(ScenarioMaker.scen, ScenPartCategory.GameCondition, Rand.RangeInclusive(-1, 2));
            Rand.Seed = int2;
            foreach (ScenPart allPart in ScenarioMaker.scen.AllParts)
            {
                allPart.Randomize();
            }
            for (int j = 0; j < ScenarioMaker.scen.parts.Count; j++)
            {
                for (int k = 0; k < ScenarioMaker.scen.parts.Count; k++)
                {
                    if (j != k && ScenarioMaker.scen.parts[j].TryMerge(ScenarioMaker.scen.parts[k]))
                    {
                        ScenarioMaker.scen.parts.RemoveAt(k);
                        k--;
                        if (j > k)
                        {
                            j--;
                        }
                    }
                }
            }
            for (int l = 0; l < ScenarioMaker.scen.parts.Count; l++)
            {
                for (int m = 0; m < ScenarioMaker.scen.parts.Count; m++)
                {
                    if (l != m && !ScenarioMaker.scen.parts[l].CanCoexistWith(ScenarioMaker.scen.parts[m]))
                    {
                        ScenarioMaker.scen.parts.RemoveAt(m);
                        m--;
                        if (l > m)
                        {
                            l--;
                        }
                    }
                }
            }
            foreach (string item in ScenarioMaker.scen.ConfigErrors())
            {
                Log.Error(item);
            }
            Rand.PopState();
            Scenario result = ScenarioMaker.scen;

            ScenarioMaker.scen = null;
            return(result);
        }
コード例 #5
0
 public override string Summary(Scenario scen)
 {
     return("ScenPart_PawnsAreNaked".Translate(this.context.ToStringHuman()).CapitalizeFirst());
 }
コード例 #6
0
 private static void AddCategoryScenParts(Scenario scen, ScenPartCategory cat, int count)
 {
     scen.parts.AddRange(ScenarioMaker.RandomScenPartsOfCategory(scen, cat, count));
 }
コード例 #7
0
 public override string Summary(Scenario scen)
 {
     return(ScenSummaryList.SummaryWithList(scen, "DisallowBuilding", "ScenPart_DisallowBuilding".Translate()));
 }
コード例 #8
0
 public override string Summary(Scenario scen)
 {
     return(ScenSummaryList.SummaryWithList(scen, "MapScatteredWith", "ScenPart_MapScatteredWith".Translate()));
 }
コード例 #9
0
 public virtual string Summary(Scenario scen)
 {
     return(this.def.description);
 }
コード例 #10
0
 public Dialog_ScenarioList_Save(Scenario scen)
 {
     this.interactButLabel = "OverwriteButton".Translate();
     this.typingName       = scen.name;
     this.savingScen       = scen;
 }
コード例 #11
0
 public override string Summary(Scenario scen)
 {
     return("ScenPart_SetNeed".Translate(context.ToStringHuman(), chance.ToStringPercent(), need.label, levelRange.min.ToStringPercent(), levelRange.max.ToStringPercent()).CapitalizeFirst());
 }