예제 #1
0
        public static bool mineOut(Map map, IntVec3 pos)
        {
            Designator_Mine mine = Find.ReverseDesignatorDatabase.Get <Designator_Mine>();

            if (mine != null && mine.CanDesignateCell(pos).Equals(AcceptanceReport.WasAccepted))
            {
                mine.DesignateSingleCell(pos);
                return(true);
            }
            return(false);
        }
예제 #2
0
        static void Postfix(Pawn pawn)
        {
            // A cell grid around the mining pawn covering an area two cells away from it
            var cellsAround = GenAdj.CellsOccupiedBy(pawn.Position, pawn.Rotation, new IntVec2(5, 5));
            var dm          = new Designator_Mine();

            foreach (IntVec3 cell in cellsAround)
            {
                // Find out what Thing, of the Bulding, category is on the cell
                Thing thing = pawn.Map.thingGrid.ThingAt(cell, ThingCategory.Building);
                if (
                    thing != null &&
                    IsOre(thing.def) &&
                    HasntBeenDesignatedYet(dm, cell) &&
                    CanReach(pawn, cell)
                    )
                {
                    // "Order" the cell to be mined
                    dm.DesignateSingleCell(cell);
                }
            }
        }