Exemple #1
0
        // Token: 0x06002240 RID: 8768 RVA: 0x00101E74 File Offset: 0x00100274
        public override bool TryMerge(ScenPart other)
        {
            ScenPart_StartingAnimalofGender scenPart_StartingAnimal = other as ScenPart_StartingAnimalofGender;

            if (scenPart_StartingAnimal != null && scenPart_StartingAnimal.animalKind == this.animalKind)
            {
                this.count += scenPart_StartingAnimal.count;
                return(true);
            }
            return(false);
        }
Exemple #2
0
        //public override void Randomize()
        //{
        //    if (Rand.Value < 0.5f)
        //    {
        //        this.pawnKind = null;
        //    }
        //    else
        //    {
        //        this.pawnKind = this.PossibleAnimals().RandomElement<PawnKindDef>();
        //    }
        //    this.count = ScenPart_StartingSlave.PetCountChances.RandomElementByWeight((Pair<int, float> pa) => pa.Second).First;
        //    this.bondToRandomPlayerPawnChance = 0f;
        //}

        public override bool TryMerge(ScenPart other)
        {
            ScenPart_StartingSlave ScenPart_StartingSlave = other as ScenPart_StartingSlave;

            if (ScenPart_StartingSlave != null)
            {
                this.count += ScenPart_StartingSlave.count;
                return(true);
            }
            return(false);
        }
Exemple #3
0
 public override bool TryMerge(ScenPart other)
 {
     if (other is ScenPart_KnownFactions knownFactions)
     {
         factionsFriendly =
             Mathf.Max(Mathf.RoundToInt((factionsFriendly + knownFactions.factionsFriendly) / 2f), 0);
         factionsHostile = Mathf.Max(
             Mathf.RoundToInt((factionsHostile + knownFactions.factionsHostile) / 2f), 1);
         return(true);
     }
     return(false);
 }
        public override bool TryMerge(ScenPart other)
        {
            ScenPart_StartingHumanlikes others = other as ScenPart_StartingHumanlikes;

            if (others == null || others.kindDef != this.kindDef)
            {
                return(false);
            }

            this.pawnCount += others.pawnCount;
            return(true);
        }
 public override bool CanCoexistWith(ScenPart other)
 {
     if (other is ScenLand || other is ScenPart_StartingAnimal || (other is ScenPart_StartingThing_Defined || other is ScenPart_ScatterThingsNearPlayerStart))
     {
         return(false);
     }
     if (other is ScenPart_ConfigPage_ConfigureStartingPawns)
     {
         Find.Scenario.RemovePart(other);
     }
     if (other is ScenPart_PlayerPawnsArriveMethod)
     {
         Find.Scenario.RemovePart(other);
     }
     return(true);
 }
Exemple #6
0
        public Rect GetScenPartRect(ScenPart part, float height)
        {
            string label = part.Label;
            Rect   rect  = base.GetRect(height);

            Widgets.DrawBoxSolid(rect, new Color(1f, 1f, 1f, 0.08f));
            WidgetRow widgetRow = new WidgetRow(rect.x, rect.y, UIDirection.RightThenDown, 72f, 0f);

            if (part.def.PlayerAddRemovable)
            {
                WidgetRow widgetRow2     = widgetRow;
                Texture2D deleteX        = TexButton.DeleteX;
                Color?    mouseoverColor = new Color?(GenUI.SubtleMouseoverColor);
                if (widgetRow2.ButtonIcon(deleteX, null, mouseoverColor))
                {
                    this.scen.RemovePart(part);
                    SoundDefOf.Click.PlayOneShotOnCamera(null);
                }
            }
            if (this.scen.CanReorder(part, ReorderDirection.Up))
            {
                if (widgetRow.ButtonIcon(TexButton.ReorderUp, null, null))
                {
                    this.scen.Reorder(part, ReorderDirection.Up);
                    SoundDefOf.Tick_High.PlayOneShotOnCamera(null);
                }
            }
            if (this.scen.CanReorder(part, ReorderDirection.Down))
            {
                if (widgetRow.ButtonIcon(TexButton.ReorderDown, null, null))
                {
                    this.scen.Reorder(part, ReorderDirection.Down);
                    SoundDefOf.Tick_Low.PlayOneShotOnCamera(null);
                }
            }
            Text.Anchor = TextAnchor.UpperRight;
            Rect rect2 = rect.LeftPart(0.5f).Rounded();

            rect2.xMax -= 4f;
            Widgets.Label(rect2, label);
            Text.Anchor = TextAnchor.UpperLeft;
            base.Gap(4f);
            return(rect.RightPart(0.5f).Rounded());
        }
        public CustomStartingSite()
        {
            OneWayToShow = true;

            WorldEditor.InitEditor();

            absorbInputAroundWindow = false;
            shadowAlpha             = 0f;
            preventCameraMotion     = false;

            var init = new GameInitData
            {
                playerFaction = Find.FactionManager.OfPlayer
            };

            Current.Game.InitData = init;
            Current.Game.Scenario.PreConfigure();

            ScenPart scenPart = Current.Game.Scenario.AllParts.Where(p => p is ScenPart_ConfigPage_ConfigureStartingPawns).FirstOrDefault();

            Current.Game.InitData.startingPawnCount = (scenPart as ScenPart_ConfigPage_ConfigureStartingPawns).pawnCount;

            Current.Game.InitData.startingAndOptionalPawns = WorldEditor.LoadedTemplate.StartPawns;
        }
 public override bool CanCoexistWith(ScenPart other)
 {
     return(!(other is ScenPart_StartCity));
 }
Exemple #9
0
 public override bool CanCoexistWith(ScenPart other)
 {
     // TODO: Fix
     return(true);
 }
Exemple #10
0
 public override bool CanCoexistWith(ScenPart other)
 {
     return(!(other is ScenPart_KnownFactions));
 }