//returns max if there are multiple queens public static int QueenMaturityLevel(Map map) { int level = 0; List <Pawn> queens = map.mapPawns.PawnsInFaction(Faction.OfPlayer).Where(p => p.TryGetComp <CompHQPresence>() != null).ToList(); foreach (Pawn queen in queens) { CompHQPresence pres = queen.TryGetComp <CompHQPresence>(); if (pres != null && pres.QueenMaturity > level) { level = pres.QueenMaturity; } } return(level); }
public static bool QueenExists() { List <Pawn> list = PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_OfPlayerFaction.ToList(); for (int i = 0; i < list.Count(); i++) { Pawn pawn = list[i]; CompHQPresence comp = pawn.TryGetComp <CompHQPresence>(); if (comp != null) { if (comp.Active) { return(true); } } } return(false); }
public static bool QueenExistsOnMap(Map map) { List <Pawn> list = map.mapPawns.PawnsInFaction(Faction.OfPlayer).Where(p => p.RaceProps.Humanlike).ToList(); for (int i = 0; i < list.Count(); i++) { Pawn pawn = list[i]; CompHQPresence comp = pawn.TryGetComp <CompHQPresence>(); if (comp != null) { if (comp.Active) { return(true); } } } return(false); }