コード例 #1
0
        public override void Notify_QuestSignalReceived(Signal signal)
        {
            base.Notify_QuestSignalReceived(signal);
            if (!(signal.tag == inSignal))
            {
                return;
            }
            loc = IntVec3.Invalid;
            if (mapParent == null || !mapParent.HasMap)
            {
                return;
            }
            Thing thing = InfestationUtility.SpawnTunnels(hivesCount, mapParent.Map, spawnAnywhereIfNoGoodCell: true, ignoreRoofedRequirement: true, tag);

            if (thing != null)
            {
                loc = thing.Position;
                if (sendStandardLetter)
                {
                    TaggedString label = (customLetterLabel.NullOrEmpty() ? ((TaggedString)IncidentDefOf.Infestation.letterLabel) : customLetterLabel.Formatted(IncidentDefOf.Infestation.letterLabel.Named("BASELABEL")));
                    TaggedString text  = (customLetterText.NullOrEmpty() ? ((TaggedString)IncidentDefOf.Infestation.letterText) : customLetterText.Formatted(IncidentDefOf.Infestation.letterText.Named("BASETEXT")));
                    Find.LetterStack.ReceiveLetter(label, text, customLetterDef ?? IncidentDefOf.Infestation.letterDef, new TargetInfo(loc, mapParent.Map), null, quest);
                }
            }
        }
コード例 #2
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map   map = (Map)parms.target;
            Thing t   = InfestationUtility.SpawnTunnels(Mathf.Max(GenMath.RoundRandom(parms.points / 220f), 1), map);

            SendStandardLetter(parms, t);
            Find.TickManager.slower.SignalForceNormalSpeedShort();
            return(true);
        }