示例#1
0
        public bool TryGenerateTradeRequest(TradeRequestComp target, Map map)
        {
            int num = this.RandomOfferDurationTicks(map.Tile, target.parent.Tile);

            if (num < 1)
            {
                return(false);
            }
            if (!IncidentWorker_QuestTradeRequest.TryFindRandomRequestedThingDef(map, out target.requestThingDef, out target.requestCount))
            {
                return(false);
            }
            target.rewards.ClearAndDestroyContents(DestroyMode.Vanish);
            target.rewards.TryAddRangeOrTransfer(IncidentWorker_QuestTradeRequest.GenerateRewardsFor(target.requestThingDef, target.requestCount, target.parent.Faction, map), true, true);
            target.expiration = Find.TickManager.TicksGame + num;
            return(true);
        }