public static bool CanLandInSpecificCell(IEnumerable <IThingHolder> pods, MapParent mapParent) { if (mapParent == null || !mapParent.Spawned || !mapParent.HasMap) { return(false); } if (mapParent.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(mapParent.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, MapParent escapeShip) { if (escapeShip == null || !escapeShip.Spawned || escapeShip.GetComponent <EscapeShipComp>() == null) { return(false); } if (escapeShip.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(escapeShip.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanEnter(Caravan caravan, MapParent mapParent) { if (mapParent == null || !mapParent.Spawned || !mapParent.HasMap) { return(false); } if (mapParent.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(mapParent.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanAttack(Caravan caravan, SettlementBase settlement) { if (settlement == null || !settlement.Spawned || !settlement.Attackable) { return(false); } if (settlement.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(settlement.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, Site site) { if (site == null || !site.Spawned) { return(false); } if (site.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(site.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanVisit(IEnumerable <IThingHolder> pods, Site site) { if (site == null || !site.Spawned || !site.core.def.transportPodsCanLandAndGenerateMap) { return(false); } if (!TransportPodsArrivalActionUtility.AnyNonDownedColonist(pods)) { return(false); } if (site.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(site.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanAttack(IEnumerable <IThingHolder> pods, SettlementBase settlement) { if (settlement == null || !settlement.Spawned || !settlement.Attackable) { return(false); } if (!TransportPodsArrivalActionUtility.AnyNonDownedColonist(pods)) { return(false); } if (settlement.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(settlement.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanEngage(Caravan caravan, WarObject wo) { if (wo == null || !wo.Spawned) { return(false); } if (wo.Faction != null && wo.Faction.HostileTo(caravan.Faction)) { return(false); } if (wo is Trader) { Trader trader = wo as Trader; if (!trader.tradedWithPlayer) //trader.TradedWith.Contains(caravan)) { return(FloatMenuAcceptanceReport.WithFailMessage("Already Traded")); } } return(true); }
public static FloatMenuAcceptanceReport CanAttack(Caravan caravan, SettlementBase settlement) { FloatMenuAcceptanceReport result; if (settlement == null || !settlement.Spawned || !settlement.Attackable) { result = false; } else if (settlement.EnterCooldownBlocksEntering()) { result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[] { settlement.EnterCooldownDaysLeft().ToString("0.#") })); } else { result = true; } return(result); }
public static FloatMenuAcceptanceReport CanEnter(Caravan caravan, MapParent mapParent) { FloatMenuAcceptanceReport result; if (mapParent == null || !mapParent.Spawned || !mapParent.HasMap) { result = false; } else if (mapParent.EnterCooldownBlocksEntering()) { result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[] { mapParent.EnterCooldownDaysLeft().ToString("0.#") })); } else { result = true; } return(result); }
public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, MapParent escapeShip) { FloatMenuAcceptanceReport result; if (escapeShip == null || !escapeShip.Spawned || escapeShip.GetComponent <EscapeShipComp>() == null) { result = false; } else if (escapeShip.EnterCooldownBlocksEntering()) { result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[] { escapeShip.EnterCooldownDaysLeft().ToString("0.#") })); } else { result = true; } return(result); }
public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, Site site) { FloatMenuAcceptanceReport result; if (site == null || !site.Spawned) { result = false; } else if (site.EnterCooldownBlocksEntering()) { result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[] { site.EnterCooldownDaysLeft().ToString("0.#") })); } else { result = true; } return(result); }
public static bool CanLandInSpecificCell(MapParent mapParent) { return(mapParent != null && mapParent.Spawned && mapParent.HasMap && (!mapParent.EnterCooldownBlocksEntering() || FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(mapParent.EnterCooldownTicksLeft().ToStringTicksToPeriod(true, false, true, true))))); }
public static bool CanLandInSpecificCell(IEnumerable <IThingHolder> pods, MapParent mapParent) { return(mapParent != null && mapParent.Spawned && mapParent.HasMap && (!mapParent.EnterCooldownBlocksEntering() || FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(mapParent.EnterCooldownDaysLeft().ToString("0.#"))))); }