protected override void StrikeAction(ActiveArtilleryStrike strike, CellRect mapRect, CellRect baseRect, ref bool destroyed)
        {
            Log.Message(Site.AllComps.ToStringSafeEnumerable());
            var radialCells = GenRadial.RadialCellsAround(mapRect.RandomCell, strike.shellDef.projectile.explosionRadius, true);
            int cellsInRect = radialCells.Count(c => baseRect.Contains(c));

            // Destroy outpost and give reward
            if (cellsInRect > 0 && Rand.Chance(cellsInRect * DestroyChancePerCellInRect))
            {
                QuestUtility.SendQuestTargetSignals(Site.questTags, QuestUtility.QuestTargetSignalPart_AllEnemiesDefeated, Site.Named("SUBJECT"));
                NonPublicFields.Site_allEnemiesDefeatedSignalSent.SetValue(Site, true);
                Find.WorldObjects.Remove(worldObject);
                destroyed = true;
            }
        }
コード例 #2
0
        protected override void StrikeAction(ActiveArtilleryStrike strike, CellRect mapRect, CellRect baseRect, ref bool destroyed)
        {
            var radialCells = GenRadial.RadialCellsAround(mapRect.RandomCell, strike.shellDef.projectile.explosionRadius, true);
            int cellsInRect = radialCells.Count(c => baseRect.Contains(c));

            // Destroy settlement
            if (cellsInRect > 0 && Rand.Chance(cellsInRect * DestroyChancePerCellInRect))
            {
                Find.LetterStack.ReceiveLetter("LetterLabelFactionBaseDefeated".Translate(), "VFESecurity.LetterFactionBaseDefeatedStrike".Translate(Settlement.Label), LetterDefOf.PositiveEvent,
                                               new GlobalTargetInfo(Settlement.Tile), Settlement.Faction, null);
                var destroyedSettlement = (DestroyedSettlement)WorldObjectMaker.MakeWorldObject(RimWorld.WorldObjectDefOf.DestroyedSettlement);
                destroyedSettlement.Tile = Settlement.Tile;
                Find.WorldObjects.Add(destroyedSettlement);
                Find.WorldObjects.Remove(Settlement);
                destroyed = true;
            }
        }
コード例 #3
0
        protected override void StrikeAction(ActiveArtilleryStrike strike, CellRect mapRect, CellRect baseRect, ref bool destroyed)
        {
            var radialCells = GenRadial.RadialCellsAround(mapRect.RandomCell, strike.shellDef.projectile.explosionRadius, true);
            int cellsInRect = radialCells.Count(c => baseRect.Contains(c));

            // Aggro the insects
            if (cellsInRect > 0 && Rand.Chance(cellsInRect * DestroyChancePerCellInRect))
            {
                var artilleryComp = Settlement.GetComponent<ArtilleryComp>();
                var parms = new IncidentParms();
                parms.target = sourceMap;
                parms.points = StorytellerUtility.DefaultThreatPointsNow(sourceMap) * (1 + ((float)artilleryComp.recentRetaliationTicks / RetaliationTicksPerExtraPointsMultiplier));
                parms.faction = Settlement.Faction;
                parms.generateFightersOnly = true;
                parms.forced = true;
                Find.Storyteller.incidentQueue.Add(IncidentDefOf.RaidEnemy, Find.TickManager.TicksGame + RaidIntervalRange.RandomInRange, parms);
                artilleryComp.recentRetaliationTicks += RetaliationTicksPerRetaliation;
            }
        }
 protected virtual void StrikeAction(ActiveArtilleryStrike strike, CellRect mapRect, CellRect baseRect, ref bool destroyed)
 {
 }