protected override bool TryExecuteWorker(IncidentParms parms)
        {
            int tile;

            if (!TileFinder.TryFindNewSiteTile(out tile, minDist, maxDist, false, true, -1))
            {
                return(false);
            }
            WorldObject_InterceptedMessageLGE interceptedMessage = (WorldObject_InterceptedMessageLGE)WorldObjectMaker.MakeWorldObject(SiteDefOf.InterceptedMessageLGE);

            interceptedMessage.Tile = tile;
            interceptedMessage.GetComponent <TimeoutComp>().StartTimeout(TimeoutDaysRange.RandomInRange * 60000);
            Find.WorldObjects.Add(interceptedMessage);
            Find.LetterStack.ReceiveLetter("LetterLabelInterceptedMessageLGE".Translate(), "LetterInterceptedMessageLGE".Translate(), LetterDefOf.NeutralEvent, interceptedMessage, null);
            return(true);
        }
Пример #2
0
 public CaravanArrivalAction_VisitInterceptedMessageLGE(WorldObject_InterceptedMessageLGE interceptedMessage)
 {
     this.interceptedMessage = interceptedMessage;
 }
Пример #3
0
 public static IEnumerable <FloatMenuOption> GetFloatMenuOptions(Caravan caravan, WorldObject_InterceptedMessageLGE interceptedMessage)
 {
     return(CaravanArrivalActionUtility.GetFloatMenuOptions <CaravanArrivalAction_VisitInterceptedMessageLGE>(() => CanVisit(caravan, interceptedMessage), () => new CaravanArrivalAction_VisitInterceptedMessageLGE(interceptedMessage), "VisitPeaceTalks".Translate(interceptedMessage.Label), caravan, interceptedMessage.Tile, interceptedMessage));
 }
Пример #4
0
 public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, WorldObject_InterceptedMessageLGE interceptedMessage)
 {
     return(interceptedMessage != null && interceptedMessage.Spawned);
 }