Beispiel #1
0
        private void ActionFight(Caravan caravan, List <Pawn> attackers)
        {
            Faction enemyFaction = attackers[0].Faction;

            TaleRecorder.RecordTale(TaleDefOf.CaravanAmbushedByHumanlike, caravan.RandomOwner());
            LongEventHandler.QueueLongEvent(delegate
            {
                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, attackers);
                LordJob_AssaultColony lordJob_AssaultColony = new LordJob_AssaultColony(enemyFaction, true, false, false, false, true);
                if (lordJob_AssaultColony != null)
                {
                    LordMaker.MakeNewLord(enemyFaction, lordJob_AssaultColony, map, attackers);
                }
                Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
                CameraJumper.TryJump(attackers[0]);
            }, "GeneratingMapForNewEncounter", false, null);
        }
Beispiel #2
0
        private void ActionFight(Caravan caravan, List <Pawn> attackers)
        {
            Faction enemyFaction = attackers[0].Faction;

            TaleRecorder.RecordTale(TaleDefOf.CaravanAmbushedByHumanlike, caravan.RandomOwner());
            LongEventHandler.QueueLongEvent(delegate
            {
                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, attackers, sendLetterIfRelatedPawns: true);
                LordJob_AssaultColony lordJob_AssaultColony = new LordJob_AssaultColony(enemyFaction, canKidnap: true, canTimeoutOrFlee: false);
                if (lordJob_AssaultColony != null)
                {
                    LordMaker.MakeNewLord(enemyFaction, lordJob_AssaultColony, map, attackers);
                }
                Find.TickManager.Notify_GeneratedPotentiallyHostileMap();
                CameraJumper.TryJump(attackers[0]);
            }, "GeneratingMapForNewEncounter", doAsynchronously: false, null);
        }
        protected override LordJob MakeLordJob(IncidentParms parms, Map map, List <Pawn> pawns, int raidSeed)
        {
            IntVec3 originCell = (!parms.spawnCenter.IsValid) ? pawns[0].PositionHeld : parms.spawnCenter;
            LordJob result;

            if (parms.faction.HostileTo(Faction.OfPlayer))
            {
                result = new LordJob_AssaultColony(parms.faction, true, true, false, false, true);
            }
            else
            {
                IntVec3 fallbackLocation;
                RCellFinder.TryFindRandomSpotJustOutsideColony(originCell, map, out fallbackLocation);
                result = new LordJob_AssistColony(parms.faction, fallbackLocation);
            }
            return(result);
        }