Skip to content

Instantly share code, notes, and snippets.

@slippycheeze
Created May 3, 2022 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slippycheeze/5fd20838007052769302102a71c799d9 to your computer and use it in GitHub Desktop.
Save slippycheeze/5fd20838007052769302102a71c799d9 to your computer and use it in GitHub Desktop.
// This is just an excerpt, of course...
namespace CrashLanding {
public class Ticker_MTcounter : Building {
public void DoSpawn(int tickAmt) {
Predicate<IntVec3> validator = (Predicate<IntVec3>) (x => {
foreach (IntVec3 c in GenAdj.OccupiedRect(x, Rot4.North, new IntVec2(3, 3))) {
if (!c.InBounds(this.Map) || c.Fogged(this.Map) || !c.Standable(this.Map) || c.Roofed(this.Map) && c.GetRoof(this.Map).isThickRoof)
return false;
foreach (Thing thing in c.GetThingList(this.Map)) {
if (thing.def.preventSkyfallersLandingOn)
return false;
}
}
return true;
});
// rest of the method left as an exercise for the reader and their own decompiler
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment