public static bool HasTerrainChecks(this PawnKindDef kind) { if (kind.race.modExtensions != null) { foreach (DefModExtension ext in kind.race.modExtensions) { TerrainMovementPawnRestrictions restrictions = LoadTerrainMovementPawnRestrictionsExtension(ext); if (restrictions != null) { return(true); } } } return(false); }
public static bool AllowsBasicMovement(this PawnKindDef kind) { if (kind.race.modExtensions != null) { foreach (DefModExtension ext in kind.race.modExtensions) { TerrainMovementPawnRestrictions restrictions = LoadTerrainMovementPawnRestrictionsExtension(ext); if (restrictions != null && !restrictions.defaultMovementAllowed) { return(false); } } } return(true); }
public static bool UnreachableTerrainCheck(IEnumerable <DefModExtension> modExtensions, TerrainDef terrain) { if (modExtensions != null) { foreach (DefModExtension ext in modExtensions) { TerrainMovementPawnRestrictions restrictions = LoadTerrainMovementPawnRestrictionsExtension(ext); if (restrictions != null) { if (restrictions.stayOffTerrainTag != null && terrain.HasTag(restrictions.stayOffTerrainTag)) { return(true); } if (restrictions.stayOnTerrainTag != null && !terrain.HasTag(restrictions.stayOnTerrainTag)) { return(true); } } } } return(false); }
public static bool UnreachableTerrainCheck(this Pawn pawn, TerrainDef terrain) { if (pawn != null && pawn.def.modExtensions != null) { foreach (DefModExtension ext in pawn.def.modExtensions) { TerrainMovementPawnRestrictions restrictions = pawn.LoadTerrainMovementPawnRestrictionsExtension(ext); if (restrictions != null) { if (restrictions.stayOffTerrainTag != null && terrain.HasTag(restrictions.stayOffTerrainTag)) { return(true); } if (restrictions.stayOnTerrainTag != null && !terrain.HasTag(restrictions.stayOnTerrainTag)) { return(true); } } } } return(false); }