public static Command_SetStoneType SetStoneToMineCommand(Building_CoreSampleDrill passingbuilding)
        {
            return(new Command_SetStoneType()
            {
                hotKey = KeyBindingDefOf.Misc1,

                building = passingbuilding
            });
        }
Exemple #2
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            foreach (Gizmo g in base.CompGetGizmosExtra())
            {
                yield return(g);
            }
            Building_CoreSampleDrill building = this.parent as Building_CoreSampleDrill;

            yield return(StoneTypeSettableUtility.SetStoneToMineCommand(building));
        }
Exemple #3
0
        public override string CompInspectStringExtra()
        {
            if (!this.parent.Spawned)
            {
                return(null);
            }
            Building_CoreSampleDrill building = this.parent as Building_CoreSampleDrill;

            if (building.RockTypeToMine == "Random")
            {
                return("AB_DrillingStoneTypeRandom".Translate() + "\n" + "AB_ProgressToNextPortion".Translate() + ": " + this.ProgressToNextPortionPercent.ToStringPercent("F0"));
            }
            else
            {
                return("AB_DrillingStoneType".Translate() + ThingDef.Named(building.RockTypeToMine).LabelCap + "\n" + "AB_ProgressToNextPortion".Translate() + ": " + this.ProgressToNextPortionPercent.ToStringPercent("F0"));
            }
        }
Exemple #4
0
        private void TryProducePortion(float yieldPct)
        {
            string[] vanillaRockTypes = { "ChunkMarble", "ChunkSandstone", "ChunkLimestone", "ChunkGranite", "ChunkSlate" };

            Thing thing = null;
            Building_CoreSampleDrill building = this.parent as Building_CoreSampleDrill;

            if (building.RockTypeToMine == "Random")
            {
                thing = ThingMaker.MakeThing(ThingDef.Named(vanillaRockTypes.RandomElement()), null);
            }
            else
            {
                thing = ThingMaker.MakeThing(ThingDef.Named(building.RockTypeToMine), null);
            }


            GenPlace.TryPlaceThing(thing, this.parent.InteractionCell, this.parent.Map, ThingPlaceMode.Near, null, null, default(Rot4));
        }