changing Deep drill's next resource

Started by EVERYNAMEISUNAVAILABLE, April 14, 2022, 10:26:09 AM

Previous topic - Next topic

EVERYNAMEISUNAVAILABLE

Hi!
I am trying to make a gizmo that changes the deep drill's next resource (to ores like gold, iron, etc) and I wanted to know if there was a way to do it?

I know that is uses this
public static ThingDef GetNextResource(IntVec3 p, Map map)
{
ThingDef result;
int num;
IntVec3 intVec;
DeepDrillUtility.GetNextResource(p, map, out result, out num, out intVec);
return result;
}

and
public static ThingDef GetBaseResource(Map map, IntVec3 cell)
{
if (!map.Biome.hasBedrock)
{
return null;
}
Rand.PushState();
Rand.Seed = cell.GetHashCode();
ThingDef result = (from rock in Find.World.NaturalRockTypesIn(map.Tile)
select rock.building.mineableThing).RandomElement<ThingDef>();
Rand.PopState();
return result;
}


I have my gizmo code ready I just need to add the action (and find out how to actually add the gizmo to the deep drill)

Any help is appreciated