Ejemplo n.º 1
0
 public void ExposeData()
 {
     Scribe_Values.Look(ref uidOfReferencedTaleNews, "newsUID", -1);
     Scribe_Values.Look(ref hasBeenActivated, "activated", false);
     Scribe_Values.Look(ref shockGrade, "shockGrade", WitnessShockGrade.BY_NEWS);
     // test
     Scribe_Values.Look(ref tickReceived, "tickReceived", Find.TickManager.TicksGame);
     // Scribe_Values.Look(ref cachedImportance, "cachedNewsImportance", -1);
     // Scribe_Values.Look(ref locallyForgotten, "locallyForgotten", false);
     Scribe_Values.Look(ref newsIsShocking, "newsIsShocking", false);
     Scribe_Deep.Look(ref newsImportance, "newsImportance");
     //Scribe_Values.Look(ref forgetfulness, "forgetfulness", ForgetfulnessStage.UNKNOWN);
     //Scribe_Values.Look(ref forgetfulnessState, "forgetfulnessState", ForgetfulnessState.UNKNOWN);
     // Scribe_Deep.Look(ref underlyingTaleNews, "underlyingTaleNews");
     // Scribe_References.Look(ref recipient, "recipient");
 }
Ejemplo n.º 2
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <Vector3>(ref this.origin, "origin", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.destination, "destination", default(Vector3), false);
     Scribe_Values.Look <int>(ref this.ticksToImpact, "ticksToImpact", 0, false);
     Scribe_Values.Look <int>(ref this.timesToDamage, "timesToDamage", 0, false);
     Scribe_Values.Look <int>(ref this.verVal, "verVal", 0, false);
     Scribe_Values.Look <int>(ref this.pwrVal, "pwrVal", 0, false);
     Scribe_Values.Look <bool>(ref this.damageLaunched, "damageLaunched", true, false);
     Scribe_Values.Look <bool>(ref this.explosion, "explosion", false, false);
     Scribe_References.Look <Thing>(ref this.assignedTarget, "assignedTarget", false);
     //Scribe_References.Look<Thing>(ref this.launcher, "launcher", false);
     Scribe_Deep.Look <Thing>(ref this.flyingThing, "flyingThing", new object[0]);
     Scribe_References.Look <Pawn>(ref this.pawn, "pawn", false);
 }
Ejemplo n.º 3
0
 public void ExposeData()
 {
     Scribe_Collections.Look <Pawn>(ref this.pawnsForcefullyKeptAsWorldPawns, true, "pawnsForcefullyKeptAsWorldPawns", LookMode.Reference);
     Scribe_Collections.Look <Pawn>(ref this.pawnsAlive, "pawnsAlive", LookMode.Deep);
     Scribe_Collections.Look <Pawn>(ref this.pawnsMothballed, "pawnsMothballed", LookMode.Deep);
     Scribe_Collections.Look <Pawn>(ref this.pawnsDead, true, "pawnsDead", LookMode.Deep);
     Scribe_Deep.Look <WorldPawnGC>(ref this.gc, "gc", new object[0]);
     if (this.pawnsMothballed == null)
     {
         this.pawnsMothballed = new HashSet <Pawn>();
     }
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.WorldPawnPostLoadInit(this);
     }
 }
Ejemplo n.º 4
0
        public static T ReadExposable <T>(byte[] data, Action <T> beforeFinish = null) where T : IExposable
        {
            StartLoading(data);
            SupplyCrossRefs();
            T element = default(T);

            Scribe_Deep.Look(ref element, RootNode);

            beforeFinish?.Invoke(element);

            FinalizeLoading();

            // Default cross refs restored in LoadedObjectsClearPatch

            return(element);
        }
 public void ExposeData()
 {
     Scribe_Deep.Look(ref curStateInt, "curState");
     Scribe_Values.Look(ref neverFleeIndividual, "neverFleeIndividual", defaultValue: false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         if (curStateInt != null)
         {
             curStateInt.pawn = pawn;
         }
         if (Current.ProgramState != 0 && pawn.Spawned)
         {
             pawn.Map.attackTargetsCache.UpdateTarget(pawn);
         }
     }
 }
Ejemplo n.º 6
0
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.Look(ref origin, nameof(origin));
            Scribe_Values.Look(ref destination, nameof(destination));
            Scribe_Values.Look(ref ticksToImpact, nameof(ticksToImpact));
            Scribe_Values.Look(ref timesToDamage, nameof(timesToDamage));
            Scribe_Values.Look(ref damageLaunched, nameof(damageLaunched), true);
#pragma warning disable CS0618 // Type or member is obsolete
            Scribe_Values.Look(ref explosion, nameof(explosion));
#pragma warning restore CS0618 // Type or member is obsolete
            Scribe_Deep.Look(ref props, nameof(props));
            Scribe_References.Look(ref usedTarget, nameof(usedTarget));
            Scribe_References.Look(ref launcher, nameof(launcher));
            Scribe_References.Look(ref flyingThing, nameof(flyingThing));
        }
Ejemplo n.º 7
0
 public void ExposeData()
 {
     Scribe_Deep.Look <MentalState>(ref this.curStateInt, "curState", new object[0]);
     Scribe_Values.Look <bool>(ref this.neverFleeIndividual, "neverFleeIndividual", false, false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         if (this.curStateInt != null)
         {
             this.curStateInt.pawn = this.pawn;
         }
         if (Current.ProgramState != ProgramState.Entry && this.pawn.Spawned)
         {
             this.pawn.Map.attackTargetsCache.UpdateTarget(this.pawn);
         }
     }
 }
Ejemplo n.º 8
0
        public void ExposeData()
        {
            Scribe_References.Look(ref ownerEx, "owner");

            Scribe_Collections.Look <ThingStuffPairExposable>(ref rememberedWeapons, "rememberedWeapons", LookMode.Deep);

            Scribe_Deep.Look <ThingStuffPairExposable?>(ref forcedWeaponEx, "forcedWeapon");
            Scribe_Values.Look <bool>(ref forcedUnarmedEx, "forcedUnarmed");
            Scribe_Deep.Look <ThingStuffPairExposable?>(ref forcedWeaponWhileDraftedEx, "forcedWeaponWhileDrafted");
            Scribe_Values.Look <bool>(ref forcedUnarmedWhileDraftedEx, "forcedUnarmedWhileDrafted");

            Scribe_Values.Look <bool>(ref preferredUnarmedEx, "preferredUnarmed");
            Scribe_Deep.Look <ThingStuffPairExposable?>(ref defaultRangedWeaponEx, "prefferedRangedWeapon");
            Scribe_Deep.Look <ThingStuffPairExposable?>(ref preferredMeleeWeaponEx, "prefferedMeleeWeapon");
            Scribe_Values.Look <PrimaryWeaponMode>(ref primaryWeaponMode, "primaryWeaponMode");
        }
Ejemplo n.º 9
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <string>(ref this.customLabel, "customLabel", null, false);
     Scribe_Deep.Look <SiteCore>(ref this.core, "core", new object[0]);
     Scribe_Collections.Look <SitePart>(ref this.parts, "parts", LookMode.Deep, new object[0]);
     Scribe_Values.Look <bool>(ref this.startedCountdown, "startedCountdown", false, false);
     Scribe_Values.Look <bool>(ref this.anyEnemiesInitially, "anyEnemiesInitially", false, false);
     Scribe_Values.Look <bool>(ref this.sitePartsKnown, "sitePartsKnown", false, false);
     Scribe_Values.Look <bool>(ref this.factionMustRemainHostile, "factionMustRemainHostile", false, false);
     Scribe_Values.Look <float>(ref this.desiredThreatPoints, "desiredThreatPoints", 0f, false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.SitePostLoadInit(this);
     }
 }
Ejemplo n.º 10
0
 public void ExposeData()
 {
     Scribe_Values.Look <string>(ref this.name, "name", null, false);
     Scribe_Values.Look <string>(ref this.summary, "summary", null, false);
     Scribe_Values.Look <string>(ref this.description, "description", null, false);
     Scribe_Values.Look <PublishedFileId_t>(ref this.publishedFileIdInt, "publishedFileId", PublishedFileId_t.Invalid, false);
     Scribe_Deep.Look <ScenPart_PlayerFaction>(ref this.playerFaction, "playerFaction", new object[0]);
     Scribe_Collections.Look <ScenPart>(ref this.parts, "parts", LookMode.Deep, new object[0]);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         if (this.parts.RemoveAll((ScenPart x) => x == null) != 0)
         {
             Log.Warning("Some ScenParts were null after loading.", false);
         }
     }
 }
        public void ExposeData()
        {
            Scribe_Values.Look <sbyte>(ref CurrentMapIndex, "currentMapIndex", -1);

            Scribe_Values.Look <int>(ref MapSize, "mapSize");

            Scribe_Deep.Look(ref info, "info");

            Scribe_Deep.Look(ref rules, "rules");

            Scribe_Deep.Look(ref scenario, "scenario");

            Scribe_Deep.Look(ref this.playSettings, "playSettings");

            Scribe_Deep.Look(ref this.storyWatcher, "storyWatcher");

            Scribe_Deep.Look(ref this.gameEnder, "gameEnder");

            Scribe_Deep.Look(ref this.letterStack, "letterStack");

            Scribe_Deep.Look(ref this.researchManager, "researchManager");

            Scribe_Deep.Look(ref this.storyteller, "storyteller");

            Scribe_Deep.Look(ref this.history, "history");

            Scribe_Deep.Look(ref this.taleManager, "taleManager");

            Scribe_Deep.Look(ref this.playLog, "playLog");

            Scribe_Deep.Look(ref this.battleLog, "battleLog");

            Scribe_Deep.Look(ref this.outfitDatabase, "outfitDatabase");

            Scribe_Deep.Look(ref this.drugPolicyDatabase, "drugPolicyDatabase");

            Scribe_Deep.Look(ref this.foodRestrictionDatabase, "foodRestrictionDatabase");

            Scribe_Deep.Look(ref this.tutor, "tutor");

            Scribe_Deep.Look(ref this.dateNotifier, "dateNotifier");

            Scribe_Collections.Look(ref this.gameComponents, "components", LookMode.Deep, new object[] { Current.Game });

            Scribe_Values.Look(ref this.CamRootPos, "camRootPos");
            Scribe_Values.Look(ref this.DesiredSize, "desiredSize");
        }
Ejemplo n.º 12
0
 public override void ExposeData()
 {
     base.ExposeData();
     if (Scribe.mode == LoadSaveMode.Saving)
     {
         this.pawns.RemoveAll((Pawn x) => x.Destroyed);
     }
     Scribe_Values.Look <int>(ref this.uniqueId, "uniqueId", 0, false);
     Scribe_Values.Look <string>(ref this.nameInt, "name", null, false);
     Scribe_Deep.Look <ThingOwner <Pawn> >(ref this.pawns, "pawns", new object[]
     {
         this
     });
     Scribe_Values.Look <bool>(ref this.autoJoinable, "autoJoinable", false, false);
     Scribe_Deep.Look <Caravan_PathFollower>(ref this.pather, "pather", new object[]
     {
         this
     });
     Scribe_Deep.Look <Caravan_TraderTracker>(ref this.trader, "trader", new object[]
     {
         this
     });
     Scribe_Deep.Look <Caravan_ForageTracker>(ref this.forage, "forage", new object[]
     {
         this
     });
     Scribe_Deep.Look <Caravan_NeedsTracker>(ref this.needs, "needs", new object[]
     {
         this
     });
     Scribe_Deep.Look <Caravan_CarryTracker>(ref this.carryTracker, "carryTracker", new object[]
     {
         this
     });
     Scribe_Deep.Look <Caravan_BedsTracker>(ref this.beds, "beds", new object[]
     {
         this
     });
     Scribe_Deep.Look <StoryState>(ref this.storyState, "storyState", new object[]
     {
         this
     });
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.CaravanPostLoadInit(this);
     }
 }
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Values.Look(ref sourceName, "sourceName");
            Scribe_Defs.Look(ref kindDef, "kindDef");

            string childhoodIdentifier = (backStoryChild == null) ? null : backStoryChild.identifier;

            Scribe_Values.Look(ref childhoodIdentifier, "backStoryChild");
            if (Scribe.mode == LoadSaveMode.LoadingVars && !childhoodIdentifier.NullOrEmpty())
            {
                if (!BackstoryDatabase.TryGetWithIdentifier(childhoodIdentifier, out backStoryChild, true))
                {
                    Log.Error("Couldn't load child backstory with identifier " + childhoodIdentifier + ". Giving random.", false);
                    backStoryChild = BackstoryDatabase.RandomBackstory(BackstorySlot.Childhood);
                }
            }

            string adulthoodIdentifier = (backStoryAdult == null) ? null : backStoryAdult.identifier;

            Scribe_Values.Look(ref adulthoodIdentifier, "backStoryAdult");
            if (Scribe.mode == LoadSaveMode.LoadingVars && !adulthoodIdentifier.NullOrEmpty())
            {
                if (!BackstoryDatabase.TryGetWithIdentifier(adulthoodIdentifier, out backStoryAdult, true))
                {
                    Log.Error("Couldn't load adult backstory with identifier " + adulthoodIdentifier + ". Giving random.", false);
                    backStoryAdult = BackstoryDatabase.RandomBackstory(BackstorySlot.Adulthood);
                }
            }

            Scribe_Collections.Look(ref skills, "skills", LookMode.Deep);
            Scribe_Values.Look(ref isAnimal, "isAnimal");
            Scribe_Deep.Look(ref trainingLearned, "trainingLearned");
            Scribe_Deep.Look(ref trainingSteps, "trainingSteps");
            Scribe_Collections.Look(ref hediffInfos, "hediffInfos", LookMode.Deep);

            if (Scribe.mode == LoadSaveMode.LoadingVars && hediffInfos != null)
            {
                //remove any hediffs where the def is missing. Most commonly occurs when a mod is removed from a save.
                int removed = hediffInfos.RemoveAll(h => h.def == null);
                if (removed > 0)
                {
                    QEEMod.TryLog("Removed " + removed + " null hediffs from hediffInfo list for " + sourceName + "'s brain template ");
                }
            }
        }
Ejemplo n.º 14
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Collections.Look <ActiveDropPodInfo>(ref this.pods, "pods", LookMode.Deep, new object[0]);
     Scribe_Values.Look <int>(ref this.destinationTile, "destinationTile", 0, false);
     Scribe_Deep.Look <TransportPodsArrivalAction>(ref this.arrivalAction, "arrivalAction", new object[0]);
     Scribe_Values.Look <bool>(ref this.arrived, "arrived", false, false);
     Scribe_Values.Look <int>(ref this.initialTile, "initialTile", 0, false);
     Scribe_Values.Look <float>(ref this.traveledPct, "traveledPct", 0f, false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         for (int i = 0; i < this.pods.Count; i++)
         {
             this.pods[i].parent = this;
         }
     }
 }
        public override void ExposeData()
        {
            // scribe base things
            base.ExposeData();

            // settings, references first!
            Scribe_References.Look(ref ForagingArea, "ForagingArea");
            Scribe_Deep.Look(ref Trigger, "trigger", manager);
            Scribe_Collections.Look(ref AllowedPlants, "AllowedPlants", LookMode.Def, LookMode.Value);
            Scribe_Values.Look(ref ForceFullyMature, "ForceFullyMature", false);

            if (Manager.LoadSaveMode == Manager.Modes.Normal)
            {
                // scribe history
                Scribe_Deep.Look(ref History, "History");
            }
        }
Ejemplo n.º 16
0
 private static void SaveCurrentGame()
 {
     try
     {
         string path = FilePathForTmpSave();
         SafeSaver.Save(path, "savegame", delegate
         {
             ScribeMetaHeaderUtility.WriteMetaHeader();
             Game target = Current.Game;
             Scribe_Deep.Look(ref target, "game");
         });
     }
     catch (Exception arg)
     {
         Log.Error("Exception while saving tmp game: " + arg);
     }
 }
Ejemplo n.º 17
0
 public void ExposeData()
 {
     Scribe_Deep.Look(ref parms, "parms");
     Scribe_Deep.Look(ref things, "things", this);
     Scribe_Defs.Look(ref def, "def");
     Scribe_Values.Look(ref lastRaidTick, "lastRaidTick", -1);
     Scribe_Values.Look(ref conditionCauserWasSpawned, "conditionCauserWasSpawned", defaultValue: false);
     Scribe_Values.Look(ref hidden, "hidden", defaultValue: false);
     if (conditionCauserWasSpawned)
     {
         Scribe_References.Look(ref conditionCauser, "conditionCauser");
     }
     else
     {
         Scribe_Deep.Look(ref conditionCauser, "conditionCauser");
     }
 }
Ejemplo n.º 18
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look(ref inSignal, "inSignal");
     Scribe_Deep.Look(ref letter, "letter");
     Scribe_Values.Look(ref getLookTargetsFromSignal, "getLookTargetsFromSignal", defaultValue: true);
     Scribe_References.Look(ref useColonistsOnMap, "useColonistsOnMap");
     Scribe_Values.Look(ref useColonistsFromCaravanArg, "useColonistsFromCaravanArg", defaultValue: false);
     Scribe_Values.Look(ref chosenPawnSignal, "chosenPawnSignal");
     Scribe_Values.Look(ref filterDeadPawnsFromLookTargets, "filterDeadPawnsFromLookTargets", defaultValue: false);
     Scribe_Values.Look(ref getColonistsFromSignal, "getColonistsFromSignal");
     Scribe_Collections.Look(ref colonistsFromSignal, "colonistsFromSignal", LookMode.Reference);
     if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
     {
         colonistsFromSignal.RemoveAll((Pawn x) => x == null);
     }
 }
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <Vector3>(ref this.origin, "origin", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.destination, "destination", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.trueOrigin, "trueOrigin", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.trueDestination, "trueDestination", default(Vector3), false);
     Scribe_Values.Look <int>(ref this.ticksToImpact, "ticksToImpact", 0, false);
     Scribe_Values.Look <int>(ref this.weaponDmg, "weaponDmg", 0, false);
     Scribe_Values.Look <int>(ref this.dashStep, "dashStep", 0, false);
     Scribe_Values.Look <float>(ref this.trueAngle, "trueAngle", 0, false);
     Scribe_Values.Look <bool>(ref this.damageLaunched, "damageLaunched", true, false);
     Scribe_Values.Look <bool>(ref this.explosion, "explosion", false, false);
     Scribe_References.Look <Thing>(ref this.assignedTarget, "assignedTarget", false);
     Scribe_References.Look <Pawn>(ref this.pawn, "pawn", false);
     Scribe_Deep.Look <Thing>(ref this.flyingThing, "flyingThing", new object[0]);
 }
Ejemplo n.º 20
0
 public override void PostExposeData()
 {
     base.PostExposeData();
     Scribe.EnterNode("CompUpgrade_" + Props.referenceId);
     Scribe_Values.Look(ref complete, "complete");
     if (!(Scribe.mode == LoadSaveMode.Saving && complete))
     {
         Scribe_Values.Look(ref workDone, "workDone");
         Scribe_Values.Look(ref wantsWork, "wantsWork");
         Scribe_Deep.Look(ref ingredients, "ingredients", this);
     }
     if (ingredients == null)
     {
         ingredients = new ThingOwner <Thing>(this);
     }
     Scribe.ExitNode();
 }
Ejemplo n.º 21
0
        public void ExposeData()
        {
            Scribe_Values.Look(ref id, "id");

            Scribe_Values.Look(ref PlayerOwner, "PlayerOwner");
            Scribe_References.Look(ref FactionOwner, "FactionOwner");
            Scribe_Defs.Look(ref AllianceGoalDef, "goal");
            Scribe_Collections.Look(ref Factions, "Factions", LookMode.Reference);
            Scribe_Values.Look(ref Name, "Name");
            Scribe_Deep.Look(ref storyState, "storyState", this);
            Scribe_Collections.Look(ref allianceAgreements, "AllianceAgreements", LookMode.Deep);

            if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
            {
                InitializeStorytellerComps();
            }
        }
Ejemplo n.º 22
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Collections.Look(ref pods, "pods", LookMode.Deep);
     Scribe_Values.Look(ref destinationTile, "destinationTile", 0);
     Scribe_Deep.Look(ref arrivalAction, "arrivalAction");
     Scribe_Values.Look(ref arrived, "arrived", defaultValue: false);
     Scribe_Values.Look(ref initialTile, "initialTile", 0);
     Scribe_Values.Look(ref traveledPct, "traveledPct", 0f);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         for (int i = 0; i < pods.Count; i++)
         {
             pods[i].parent = this;
         }
     }
 }
Ejemplo n.º 23
0
 public void ExposeData()
 {
     Scribe_References.Look(ref meleeThreat, "meleeThreat");
     Scribe_References.Look(ref enemyTarget, "enemyTarget");
     Scribe_References.Look(ref knownExploder, "knownExploder");
     Scribe_References.Look(ref lastMannedThing, "lastMannedThing");
     Scribe_TargetInfo.Look(ref lastAttackedTarget, "lastAttackedTarget");
     Scribe_Collections.Look(ref thinkData, "thinkData", LookMode.Value, LookMode.Value);
     Scribe_Values.Look(ref activeInt, "active", defaultValue: true);
     Scribe_Values.Look(ref lastJobTag, "lastJobTag", JobTag.Misc);
     Scribe_Values.Look(ref lastIngestTick, "lastIngestTick", -99999);
     Scribe_Values.Look(ref nextApparelOptimizeTick, "nextApparelOptimizeTick", -99999);
     Scribe_Values.Look(ref lastEngageTargetTick, "lastEngageTargetTick", 0);
     Scribe_Values.Look(ref lastAttackTargetTick, "lastAttackTargetTick", 0);
     Scribe_Values.Look(ref canFleeIndividual, "canFleeIndividual", defaultValue: false);
     Scribe_Values.Look(ref exitMapAfterTick, "exitMapAfterTick", -99999);
     Scribe_Values.Look(ref forcedGotoPosition, "forcedGotoPosition", IntVec3.Invalid);
     Scribe_Values.Look(ref lastMeleeThreatHarmTick, "lastMeleeThreatHarmTick", 0);
     Scribe_Values.Look(ref lastAssignedInteractTime, "lastAssignedInteractTime", -99999);
     Scribe_Values.Look(ref interactionsToday, "interactionsToday", 0);
     Scribe_Values.Look(ref lastInventoryRawFoodUseTick, "lastInventoryRawFoodUseTick", 0);
     Scribe_Values.Look(ref lastDisturbanceTick, "lastDisturbanceTick", -99999);
     Scribe_Values.Look(ref wantsToTradeWithColony, "wantsToTradeWithColony", defaultValue: false);
     Scribe_Values.Look(ref canLovinTick, "canLovinTick", -99999);
     Scribe_Values.Look(ref canSleepTick, "canSleepTick", -99999);
     Scribe_Values.Look(ref nextMoveOrderIsWait, "nextMoveOrderIsWait", defaultValue: true);
     Scribe_Values.Look(ref lastTakeCombatEnhancingDrugTick, "lastTakeCombatEnhancingDrugTick", -99999);
     Scribe_Values.Look(ref lastHarmTick, "lastHarmTick", -99999);
     Scribe_Values.Look(ref anyCloseHostilesRecently, "anyCloseHostilesRecently", defaultValue: false);
     Scribe_Deep.Look(ref duty, "duty");
     Scribe_Deep.Look(ref mentalStateHandler, "mentalStateHandler", pawn);
     Scribe_Deep.Look(ref mentalBreaker, "mentalBreaker", pawn);
     Scribe_Deep.Look(ref inspirationHandler, "inspirationHandler", pawn);
     Scribe_Deep.Look(ref priorityWork, "priorityWork", pawn);
     Scribe_Values.Look(ref applyBedThoughtsTick, "applyBedThoughtsTick", 0);
     Scribe_Values.Look(ref applyThroneThoughtsTick, "applyThroneThoughtsTick", 0);
     Scribe_Values.Look(ref applyBedThoughtsOnLeave, "applyBedThoughtsOnLeave", defaultValue: false);
     Scribe_Values.Look(ref willJoinColonyIfRescuedInt, "willJoinColonyIfRescued", defaultValue: false);
     Scribe_Values.Look(ref wildManEverReachedOutsideInt, "wildManEverReachedOutside", defaultValue: false);
     Scribe_Values.Look(ref timesGuestTendedToByPlayer, "timesGuestTendedToByPlayer", 0);
     Scribe_Values.Look(ref noAidRelationsGainUntilTick, "noAidRelationsGainUntilTick", -99999);
     Scribe_Values.Look(ref lastSelfTendTick, "lastSelfTendTick", 0);
     Scribe_Values.Look(ref spawnedByInfestationThingComp, "spawnedByInfestationThingComp", defaultValue: false);
     Scribe_Values.Look(ref lastPredatorHuntingPlayerNotificationTick, "lastPredatorHuntingPlayerNotificationTick", -99999);
     BackCompatibility.PostExposeData(this);
 }
Ejemplo n.º 24
0
        public override void ExposeData()
        {
            base.ExposeData();

            // settings, references first!
            Scribe_References.Look(ref TameArea, "TameArea");
            Scribe_References.Look(ref SlaughterArea, "SlaughterArea");
            Scribe_References.Look(ref MilkArea, "MilkArea");
            Scribe_References.Look(ref ShearArea, "ShearArea");
            Scribe_References.Look(ref TrainingArea, "TrainingArea");
            Scribe_References.Look(ref Master, "Master");
            Scribe_References.Look(ref Trainer, "Trainer");
            Scribe_Collections.Look(ref RestrictArea, "AreaRestrictions", LookMode.Reference);
            Scribe_Deep.Look(ref Trigger, "trigger", manager);
            Scribe_Deep.Look(ref Training, "Training");
            Scribe_Deep.Look(ref _history, "History");
            Scribe_Values.Look(ref ButcherExcess, "ButcherExcess", true);
            Scribe_Values.Look(ref ButcherTrained, "ButcherTrained");
            Scribe_Values.Look(ref ButcherPregnant, "ButcherPregnant");
            Scribe_Values.Look(ref ButcherBonded, "ButcherBonded");
            Scribe_Values.Look(ref RestrictToArea, "RestrictToArea");
            Scribe_Values.Look(ref SendToSlaughterArea, "SendToSlaughterArea");
            Scribe_Values.Look(ref SendToMilkingArea, "SendToMilkingArea");
            Scribe_Values.Look(ref SendToShearingArea, "SendToShearingArea");
            Scribe_Values.Look(ref SendToTrainingArea, "SendToTrainingArea");
            Scribe_Values.Look(ref TryTameMore, "TryTameMore");
            Scribe_Values.Look(ref SetFollow, "SetFollow", true);
            Scribe_Values.Look(ref FollowDrafted, "FollowDrafted", true);
            Scribe_Values.Look(ref FollowFieldwork, "FollowFieldwork", true);
            Scribe_Values.Look(ref FollowTraining, "FollowTraining");
            Scribe_Values.Look(ref Masters, "Masters");
            Scribe_Values.Look(ref Trainers, "Trainers");
            Scribe_Values.Look(ref RespectBonds, "RespectBonds", true);

            // our current designations
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                // populate with all designations.
                _designations.AddRange(
                    manager.map.designationManager.SpawnedDesignationsOfDef(DesignationDefOf.Slaughter)
                    .Where(des => ((Pawn)des.target.Thing).kindDef == Trigger.pawnKind));
                _designations.AddRange(
                    manager.map.designationManager.SpawnedDesignationsOfDef(DesignationDefOf.Tame)
                    .Where(des => ((Pawn)des.target.Thing).kindDef == Trigger.pawnKind));
            }
        }
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <float>(ref this.directionAngle, "directionAngle", 0, false);
     Scribe_Values.Look <int>(ref this.ticksToImpact, "ticksToImpact", 0, false);
     Scribe_Values.Look <int>(ref this.pwrVal, "pwrVal", 0, false);
     Scribe_Values.Look <int>(ref this.verVal, "verVal", 0, false);
     Scribe_Values.Look <float>(ref this.radius, "radius", 1.4f, false);
     Scribe_Values.Look <int>(ref this.proximityFrequency, "proximityFrequency", 6, false);
     Scribe_Values.Look <float>(ref this.proximityRadius, "proximityRadius", .4f, false);
     Scribe_Values.Look <bool>(ref this.damageLaunched, "damageLaunched", true, false);
     Scribe_Values.Look <bool>(ref this.explosion, "explosion", false, false);
     Scribe_Values.Look <bool>(ref this.initialized, "initialized", false, false);
     Scribe_References.Look <Thing>(ref this.assignedTarget, "assignedTarget", false);
     Scribe_References.Look <Pawn>(ref this.pawn, "pawn", false);
     Scribe_Deep.Look <Thing>(ref this.flyingThing, "flyingThing", new object[0]);
 }
Ejemplo n.º 26
0
        /* ---------------------------------- */

        public override void ExposeData()
        {
            try
            {
                Scribe_Deep.Look(ref main, "main");
                Scribe_Deep.Look(ref vehicles, "vehicles");
                Scribe_Deep.Look(ref upgrades, "upgrades");
                Scribe_Deep.Look(ref debug, "debug");

                Scribe_Values.Look(ref showAllCargoItems, "showAllCargoItems");
                Scribe_Deep.Look(ref colorStorage, "colorStorage");
            }
            catch (Exception ex)
            {
                Log.Error($"Exception thrown while trying to load mod settings. Deleting the Vehicles config file might fix this.\nException={ex.Message}\nInnerException={ex.InnerException}");
            }
        }
Ejemplo n.º 27
0
 public override void PostExposeData()
 {
     Scribe_Values.Look <bool>(ref loaded, "loaded", false, false);
     Scribe_Defs.Look <ThingDef>(ref loadedBedding, "loadedBedding");
     Scribe_Deep.Look <Thing>(ref blanket, "bedding", new object[0]);
     Scribe_Defs.Look <ThingDef>(ref blanketStuff, "blanketStuff");
     //if (loaded && blanketDef != null)
     //{
     //    Building_Blanket blanket = this.blanket as Building_Blanket;
     //    //Scribe_Values.Look<bool>(ref blanket.hasColor, "hasColor", false, false);
     //}
     Scribe_Deep.Look <StorageSettings>(ref settings, "settings", new object[] { this });
     if (settings == null)
     {
         SetUpStorageSettings();
     }
 }
Ejemplo n.º 28
0
        public override void ExposeData()           // Added new variables, removed bool loaded (not used in CE)
        {
            base.ExposeData();

            // New variables
            Scribe_Deep.Look(ref gunInt, "gunInt");
            InitGun();
            Scribe_Values.Look(ref isReloading, "isReloading", false);
            Scribe_Values.Look(ref ticksUntilAutoReload, "ticksUntilAutoReload", 0);
            //lastSurroundingAmmoCheck should never be saved

            Scribe_Values.Look <int>(ref this.burstCooldownTicksLeft, "burstCooldownTicksLeft", 0, false);
            Scribe_Values.Look <int>(ref this.burstWarmupTicksLeft, "burstWarmupTicksLeft", 0, false);
            Scribe_TargetInfo.Look(ref this.currentTargetInt, "currentTarget");
            Scribe_Values.Look <bool>(ref this.holdFire, "holdFire", false, false);
            BackCompatibility.PostExposeData(this);
        }
        public override void PostExposeData()
        {
            Scribe_Values.Look <bool>(ref this.givenTask, "givenTask", false);
            Scribe_Values.Look <bool>(ref this.startedTask, "startedTask", false);
            Scribe_Values.Look <bool>(ref this.taskCompleted, "taskCompleted", false);

            Scribe_Values.Look <bool>(ref this.playedAcceptSound, "playedAcceptSound", false);

            Scribe_References.Look(ref this.creator, "creator");
            Scribe_Values.Look(ref this.quality, "quality");

            Scribe_Values.Look <int>(ref this.givenTaskTick, "givenTaskTick", -1);
            Scribe_Values.Look <int>(ref this.acquiredEquipmentTick, "acquiredWeaponTick", -1);

            Scribe_Deep.Look(ref savedJob, "savedJob");
            Scribe_Defs.Look(ref lastStartedJobDef, "lastStartedJobDef");
            Scribe_TargetInfo.Look(ref lastStartedJobTarget, "lastStartedJobTarget");
            Scribe_Values.Look <int>(ref lastStartedJobTick, "lastStartedJobTick");

            Scribe_Deep.Look(ref voice, "Voice");

            Scribe_Collections.Look(ref jobList, "jobList");
            Scribe_Collections.Look(ref jobResults, "jobResult");
            Scribe_Collections.Look(ref jobTargets, "jobTargets", LookMode.Deep);

            Scribe_Collections.Look(ref createdMeeseeks, "createdMeeseeks", LookMode.Reference);

            if (jobList == null)
            {
                jobList = new List <string>();
            }
            if (jobResults == null)
            {
                jobResults = new List <string>();
            }
            if (jobTargets == null)
            {
                jobTargets = new List <SavedTargetInfo>();
            }

            if (Scribe.mode == LoadSaveMode.PostLoadInit && voice == null)
            {
                voice = new Voice();
            }
        }
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Deep.Look <Thing>(ref gun, "activeGun");

            Scribe_Values.Look <bool>(ref collectingGunAllowed, "collectingGunAllowed");
            Scribe_Values.Look <int>(ref burstCooldownTicksLeft, "burstCooldownTicksLeft", 0, false);
            Scribe_Values.Look <int>(ref this.burstWarmupTicksLeft, "burstWarmupTicksLeft", 0, false);
            Scribe_TargetInfo.Look(ref this.currentTargetInt, "currentTarget");
            Scribe_Values.Look <bool>(ref this.loaded, "loaded", false, false);
            Scribe_Values.Look <bool>(ref this.holdFire, "holdFire", false, false);

            if (gun != null)
            {
                forceCreateGunAndTop = true;
            }
        }