public static float computeGrowerPriority(Pawn p, TargetInfo t) { FertilityGrid myGrid = new FertilityGrid(t.Map); float priority = myGrid.FertilityAt(t.Cell); Zone zone = p.Map.zoneManager.ZoneAt(t.Cell); if (zone != null && zone is Zone_Growing && (zone as Zone_Growing).GetPlantDefToGrow().defName == "Plant_Haygrass") { priority -= 1; } return(priority); }
public override AcceptanceReport CanDesignateCell(IntVec3 c) { if (!base.CanDesignateCell(c).Accepted) { return(false); } FertilityGrid grid = Map.fertilityGrid; if (grid.FertilityAt(c) < ThingDefOf.Plant_Potato.plant.fertilityMin) { return(false); } if (Find.DesignatorManager.Dragger.Dragging) { IntVec3 startDragCell = (IntVec3)startDragCellInfo.GetValue(Find.DesignatorManager.Dragger); if (grid.FertilityAt(c) != grid.FertilityAt(startDragCell)) { return(false); } } return(true); }