コード例 #1
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            //--Log.Message("IncidentWorker_NymphVisitorGroup::TryExecute() called");

            if (!RJWSettings.NymphRaidEasy)
            {
                return(false);
            }
            if (MP.IsInMultiplayer)
            {
                return(false);
            }

            Map map = (Map)parms.target;

            if (map == null)
            {
                //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is null, abort!");
                return(false);
            }
            else
            {
                //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is ok");
            }

            //Rand.PopState();
            //Rand.PushState(RJW_Multiplayer.PredictableSeed());
            if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f))
            {
                //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - no entry, abort!");
                return(false);
            }

            //var PlayerHomeMap = Find.Maps.Find(map => map.IsPlayerHome);
            var count = (Find.World.worldPawns.AllPawnsAlive.Count + map.mapPawns.FreeColonistsAndPrisonersSpawnedCount);

            //Log.Message("IncidentWorker_NymphJoins::TryExecute() -count:" + count + " map:" + PlayerHomeMap);
            for (int i = 1; i <= count || i <= 100; ++i)
            {
                Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map);
                //pawn.SetFaction(Faction.OfPlayer);
                GenSpawn.Spawn(pawn, loc, map);

                pawn.ChangeKind(PawnKindDefOf.WildMan);
                //if (pawn.Faction != null)
                //	pawn.SetFaction(null);
                if (RJWSettings.NymphPermanentManhunter)
                {
                    pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent);
                }
                else
                {
                    pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter);
                }
            }
            Find.LetterStack.ReceiveLetter("Nymphs!!!", "A whole group of nymphs has wandered into your colony.", LetterDefOf.ThreatBig, null);

            return(true);
        }
コード例 #2
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() called");

            if (!RJWSettings.NymphWild)
            {
                return(false);
            }
            if (MP.IsInMultiplayer)
            {
                return(false);
            }
            Map map = (Map)parms.target;

            if (map == null)
            {
                //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() - map is null, abort!");
                return(false);
            }
            else
            {
                //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() - map is ok");
            }

            //Rand.PopState();
            //Rand.PushState(RJW_Multiplayer.PredictableSeed());
            if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f))
            {
                //--Log.Message("IncidentWorker_NymphVisitor::TryExecute() - no entry, abort!");
                return(false);
            }

            Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map);             //generates with null faction, mod conflict ?!

            GenSpawn.Spawn(pawn, loc, map);

            pawn.ChangeKind(PawnKindDefOf.WildMan);
            //if (pawn.Faction != null)
            //	pawn.SetFaction(null);

            if (RJWSettings.NymphPermanentManhunter)
            {
                pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent);
            }
            else
            {
                pawn.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Manhunter);
            }

            Find.LetterStack.ReceiveLetter("Nymph! ", "A wandering nymph has decided to visit your colony.", LetterDefOf.ThreatSmall, pawn);

            return(true);
        }
コード例 #3
0
 static void Before_GenerateNewPawnInternal(ref PawnGenerationRequest request)
 {
     if (Nymph_Generator.IsNymph(request))
     {
         request = new PawnGenerationRequest(
             kind: request.KindDef = Nymph_Generator.GetFixedNymphPawnKindDef(),
             canGeneratePawnRelations: request.CanGeneratePawnRelations = false,
             validatorPreGear: Nymph_Generator.IsNymphBodyType,
             validatorPostGear: Nymph_Generator.IsNymphBodyType,
             fixedGender: request.FixedGender = Nymph_Generator.RandomNymphGender()
             );
     }
 }
コード例 #4
0
        static void After_GenerateNewPawnInternal(ref PawnGenerationRequest request, ref Pawn __result)
        {
            if (Nymph_Generator.IsNymph(request))
            {
                Nymph_Generator.set_story(__result);
                Nymph_Generator.set_skills(__result);
            }

            //Log.Message("[RJW]After_GenerateNewPawnInternal:: " + xxx.get_pawnname(__result));
            if (CompRJW.Comp(__result) != null && CompRJW.Comp(__result).orientation == Orientation.None)
            {
                //Log.Message("[RJW]After_GenerateNewPawnInternal::Sexualize " + xxx.get_pawnname(__result));
                CompRJW.Comp(__result).Sexualize(__result);
            }
        }
コード例 #5
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            //--Log.Message("IncidentWorker_NymphJoins::TryExecute() called");

            if (!RJWSettings.NymphTamed)
            {
                return(false);
            }
            if (MP.IsInMultiplayer)
            {
                return(false);
            }
            Map map = (Map)parms.target;

            if (map == null)
            {
                //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is null, abort!");
                return(false);
            }
            else
            {
                //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - map is ok");
            }

            //Rand.PopState();
            //Rand.PushState(RJW_Multiplayer.PredictableSeed());
            if (!RCellFinder.TryFindRandomPawnEntryCell(out IntVec3 loc, map, CellFinder.EdgeRoadChance_Friendly + 0.2f))
            {
                //--Log.Message("IncidentWorker_NymphJoins::TryExecute() - no entry, abort!");
                return(false);
            }

            Pawn pawn = Nymph_Generator.GenerateNymph(loc, ref map);             //generates with null faction, mod conflict ?!

            pawn.SetFaction(Faction.OfPlayer);
            GenSpawn.Spawn(pawn, loc, map);

            Find.LetterStack.ReceiveLetter("Nymph Joins", "A wandering nymph has decided to join your colony.", LetterDefOf.PositiveEvent, pawn);

            return(true);
        }