Esempio n. 1
0
        protected void GenerateAndSendHelp(int price, Map map, Dictionary <ThingDef, int> items)
        {
            if (!DarkNetPriceUtils.TakeSilverFromPlayer(price, map))
            {
                return;
            }

            List <Thing> toDrop = new List <Thing>();

            foreach (var item in items)
            {
                Thing newItem = ThingMaker.MakeThing(item.Key);
                newItem.stackCount = item.Value;

                toDrop.Add(newItem);
            }

            DropItems(toDrop, map);

            totalUses++;
            alreadyUsed = true;

            if (totalUses >= 3)
            {
                lastHelpTicks = Find.TickManager.TicksGame;
            }
        }
Esempio n. 2
0
        private void GenerateAndSendPawns(int price, Map map, float points, Dictionary <SkillDef, int> skillsData, List <TraitDef> forceTraits, Faction generateFaction)
        {
            if (!DarkNetPriceUtils.TakeSilverFromPlayer(price, map))
            {
                return;
            }

            CommunicationComponent_SlyHelp slyHelp = new CommunicationComponent_SlyHelp(2 * 60000);

            slyHelp.id = QuestsManager.Communications.UniqueIdManager.GetNextComponentID();

            slyHelp.GeneratePawns(points, skillsData, forceTraits, generateFaction);

            slyHelp.SendPawns(map);

            QuestsManager.Communications.RegisterComponent(slyHelp);

            alreadyUsed = true;

            Find.LetterStack.ReceiveLetter("SlyService_RaidHelp_HelpSendedTitle".Translate(), "SlyService_RaidHelp_HelpSendedDesc".Translate(), LetterDefOf.PositiveEvent);
        }
Esempio n. 3
0
        protected void GenerateAndSendHelp(int price, Map map, FloatRange priceRange, IntRange countRange, List <ThingDef> items)
        {
            if (!DarkNetPriceUtils.TakeSilverFromPlayer(price, map))
            {
                return;
            }

            List <Thing> toDrop             = new List <Thing>();
            ThingSetMaker_MarketValue maker = new ThingSetMaker_MarketValue();

            ThingSetMakerParams parms = default;

            parms.totalMarketValueRange = priceRange;
            parms.countRange            = countRange;

            ThingFilter filter = new ThingFilter();

            foreach (var item in items)
            {
                filter.SetAllow(item, true);
            }

            parms.filter = filter;

            maker.fixedParams = parms;

            toDrop = maker.Generate();

            DropItems(toDrop, map);

            totalUses++;
            alreadyUsed = true;

            if (totalUses >= 3)
            {
                lastHelpTicks = Find.TickManager.TicksGame;
            }
        }
Esempio n. 4
0
 private bool TakePrePayment(int prepayment)
 {
     return(DarkNetPriceUtils.TakeSilverFromPlayer(prepayment, Find.AnyPlayerHomeMap));
 }