public virtual void ExposeData()
 {
     Scribe_Deep.Look <Job>(ref this.curJob, "curJob", new object[0]);
     Scribe_Deep.Look <JobDriver>(ref this.curDriver, "curDriver", new object[0]);
     Scribe_Deep.Look <JobQueue>(ref this.jobQueue, "jobQueue", new object[0]);
     Scribe_Values.Look <PawnPosture>(ref this.posture, "posture", PawnPosture.Standing, false);
     if (Scribe.mode == LoadSaveMode.LoadingVars)
     {
         if (this.curDriver != null)
         {
             this.curDriver.pawn = this.pawn;
             this.curDriver.job  = this.curJob;
         }
     }
     else if (Scribe.mode == LoadSaveMode.PostLoadInit && this.curDriver == null && this.curJob != null)
     {
         Log.Warning(string.Format("Cleaning up invalid job state on {0}", this.pawn), false);
         this.EndCurrentJob(JobCondition.Errored, true);
     }
 }
Example #2
0
 public void ExposeData()
 {
     if (Scribe.mode == LoadSaveMode.Saving && curMeleeVerb != null && !curMeleeVerb.IsStillUsableBy(pawn))
     {
         curMeleeVerb = null;
     }
     Scribe_References.Look(ref curMeleeVerb, "curMeleeVerb");
     Scribe_Values.Look(ref curMeleeVerbUpdateTick, "curMeleeVerbUpdateTick", 0);
     Scribe_Deep.Look(ref terrainVerbs, "terrainVerbs");
     Scribe_Values.Look(ref lastTerrainBasedVerbUseTick, "lastTerrainBasedVerbUseTick", -99999);
     if (Scribe.mode == LoadSaveMode.LoadingVars && terrainVerbs != null)
     {
         terrainVerbs.parent = this;
     }
     if (Scribe.mode == LoadSaveMode.PostLoadInit && curMeleeVerb != null && curMeleeVerb.BuggedAfterLoading)
     {
         curMeleeVerb = null;
         Log.Warning(pawn.ToStringSafe() + " had a bugged melee verb after loading.");
     }
 }
Example #3
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look(ref initialTile, "initialTile", 0, false);
     Scribe_Values.Look(ref curPos, "curPos", Vector3.zero, false);
     Scribe_Values.Look(ref destinationTile, "destinationTile", 0, false);
     Scribe_Values.Look(ref arrived, "arrived", false, false);
     Scribe_Values.Look(ref remainingTick, "remainingTick", 0, false);
     Scribe_Values.Look(ref stageRemainingTick, "stageRemainingTick", 0, false);
     Scribe_Values.Look(ref broadcastMessageCoolDownTick, "broadcastMessageCoolDownTick", 0, false);
     Scribe_Values.Look(ref negotiateCoolDownTick, "negotiateCoolDownTick", 0, false);
     Scribe_Values.Look(ref delayCoolDownTick, "delayCoolDownTick", 0, false);
     Scribe_Values.Look(ref StagedBefore, "StagedBefore", false, false);
     Scribe_Deep.Look(ref incident, "incident");
     Scribe_Values.Look(ref detected, "detected", false, false);
     Scribe_Values.Look(ref confirmed, "confirmed", false, false);
     Scribe_Values.Look(ref CommunicationEstablished, "CommunicationEstablished", false, false);
     Scribe_Values.Look(ref Communicable, "Communicable", false, false);
     Scribe_Values.Look(ref relationInformed, "relationInformed", false, false);
 }
Example #4
0
 public void ExposeData()
 {
     Scribe_Deep.Look(ref info, "info");
     Scribe_Deep.Look(ref grid, "grid");
     if (Scribe.mode == LoadSaveMode.LoadingVars)
     {
         if (grid == null || !grid.HasWorldData)
         {
             WorldGenerator.GenerateWithoutWorldData(info.seedString);
         }
         else
         {
             WorldGenerator.GenerateFromScribe(info.seedString);
         }
     }
     else
     {
         ExposeComponents();
     }
 }
Example #5
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 <Vector3>(ref this.direction, "direction", default(Vector3), false);
     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]);
 }
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_References.Look(ref MiningArea, "MiningArea");
            Scribe_Deep.Look(ref Trigger, "Trigger", manager);
            Scribe_Collections.Look(ref AllowedMinerals, "AllowedMinerals", LookMode.Def, LookMode.Value);
            Scribe_Collections.Look(ref AllowedBuildings, "AllowedBuildings", LookMode.Def, LookMode.Value);
            Scribe_Values.Look(ref SyncFilterAndAllowed, "SyncFilterAndAllowed", true);
            Scribe_Values.Look(ref DeconstructBuildings, "DeconstructBuildings");
            Scribe_Values.Look(ref CheckRoofSupport, "CheckRoofSupport", true);
            Scribe_Values.Look(ref CheckRoofSupportAdvanced, "CheckRoofSupportAdvanced");
            Scribe_Values.Look(ref CheckRoomDivision, "CheckRoomDivision", true);

            // don't store history in import/export mode.
            if (Manager.LoadSaveMode == Manager.Modes.Normal)
            {
                Scribe_Deep.Look(ref History, "History");
            }
        }
 public void ExposeData()
 {
     Scribe_Values.Look <int>(ref this.loadID, "loadID", 0, false);
     Scribe_References.Look <Faction>(ref this.faction, "faction", false);
     Scribe_Collections.Look <Thing>(ref this.extraForbiddenThings, "extraForbiddenThings", LookMode.Reference, new object[0]);
     Scribe_Collections.Look <Pawn>(ref this.ownedPawns, "ownedPawns", LookMode.Reference, new object[0]);
     Scribe_Deep.Look <LordJob>(ref this.curJob, "lordJob", new object[0]);
     Scribe_Values.Look <bool>(ref this.initialized, "initialized", true, false);
     Scribe_Values.Look <int>(ref this.ticksInToil, "ticksInToil", 0, false);
     Scribe_Values.Look <int>(ref this.numPawnsEverGained, "numPawnsEverGained", 0, false);
     Scribe_Values.Look <int>(ref this.numPawnsLostViolently, "numPawnsLostViolently", 0, false);
     Scribe_Values.Look <int>(ref this.initialColonyHealthTotal, "initialColonyHealthTotal", 0, false);
     Scribe_Values.Look <int>(ref this.lastPawnHarmTick, "lastPawnHarmTick", -99999, false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         this.extraForbiddenThings.RemoveAll((Thing x) => x == null);
         this.ownedPawns.RemoveAll((Pawn x) => x == null);
     }
     this.ExposeData_StateGraph();
 }
Example #8
0
 public virtual void ExposeData()
 {
     Scribe_Values.Look(ref loadID, "loadID", 0);
     Scribe_Defs.Look(ref recipe, "recipe");
     Scribe_Values.Look(ref suspended, "suspended", defaultValue: false);
     Scribe_Values.Look(ref ingredientSearchRadius, "ingredientSearchRadius", 999f);
     Scribe_Values.Look(ref allowedSkillRange, "allowedSkillRange");
     Scribe_References.Look(ref pawnRestriction, "pawnRestriction");
     if (Scribe.mode == LoadSaveMode.Saving && recipe.fixedIngredientFilter != null)
     {
         foreach (ThingDef allDef in DefDatabase <ThingDef> .AllDefs)
         {
             if (!recipe.fixedIngredientFilter.Allows(allDef))
             {
                 ingredientFilter.SetAllow(allDef, allow: false);
             }
         }
     }
     Scribe_Deep.Look(ref ingredientFilter, "ingredientFilter");
 }
        public override void ExposeData()
        {
            Scribe_Values.Look(ref username, "username");
            Scribe_Values.Look(ref showCursors, "showCursors", true);
            Scribe_Values.Look(ref autoAcceptSteam, "autoAcceptSteam");
            Scribe_Values.Look(ref transparentChat, "transparentChat");
            Scribe_Values.Look(ref autosaveSlots, "autosaveSlots", 5);
            Scribe_Values.Look(ref aggressiveTicking, "aggressiveTicking", true);
            Scribe_Values.Look(ref showDevInfo, "showDevInfo");
            Scribe_Values.Look(ref serverAddress, "serverAddress", "127.0.0.1");
            Scribe_Values.Look(ref appendNameToAutosave, "appendNameToAutosave", false);
            Scribe_Values.Look(ref pauseAutosaveCounter, "pauseAutosaveCounter", true);

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

            if (serverSettings == null)
            {
                serverSettings = new ServerSettings();
            }
        }
Example #10
0
 public virtual void ExposeData()
 {
     Scribe_Values.Look <int>(ref this.loadID, "loadID", 0, false);
     Scribe_Defs.Look <RecipeDef>(ref this.recipe, "recipe");
     Scribe_Values.Look <bool>(ref this.suspended, "suspended", false, false);
     Scribe_Values.Look <float>(ref this.ingredientSearchRadius, "ingredientSearchRadius", 999f, false);
     Scribe_Values.Look <IntRange>(ref this.allowedSkillRange, "allowedSkillRange", default(IntRange), false);
     Scribe_References.Look <Pawn>(ref this.pawnRestriction, "pawnRestriction", false);
     if (Scribe.mode == LoadSaveMode.Saving && this.recipe.fixedIngredientFilter != null)
     {
         foreach (ThingDef current in DefDatabase <ThingDef> .AllDefs)
         {
             if (!this.recipe.fixedIngredientFilter.Allows(current))
             {
                 this.ingredientFilter.SetAllow(current, false);
             }
         }
     }
     Scribe_Deep.Look <ThingFilter>(ref this.ingredientFilter, "ingredientFilter", new object[0]);
 }
Example #11
0
 public void ExposeData()
 {
     Scribe_Deep.Look <WorldInfo>(ref this.info, "info", new object[0]);
     Scribe_Deep.Look <WorldGrid>(ref this.grid, "grid", new object[0]);
     if (Scribe.mode == LoadSaveMode.LoadingVars)
     {
         if (this.grid == null || !this.grid.HasWorldData)
         {
             WorldGenerator.GenerateWithoutWorldData(this.info.seedString);
         }
         else
         {
             WorldGenerator.GenerateFromScribe(this.info.seedString);
         }
     }
     else
     {
         this.ExposeComponents();
     }
 }
Example #12
0
 public override void ExposeData()
 {
     base.ExposeData();
     if (Scribe.mode == LoadSaveMode.Saving)
     {
         pawns.RemoveAll((Pawn x) => x.Destroyed);
     }
     Scribe_Values.Look(ref uniqueId, "uniqueId", 0);
     Scribe_Values.Look(ref nameInt, "name");
     Scribe_Deep.Look(ref pawns, "pawns", this);
     Scribe_Values.Look(ref autoJoinable, "autoJoinable", defaultValue: false);
     Scribe_Deep.Look(ref pather, "pather", this);
     Scribe_Deep.Look(ref trader, "trader", this);
     Scribe_Deep.Look(ref forage, "forage", this);
     Scribe_Deep.Look(ref needs, "needs", this);
     Scribe_Deep.Look(ref carryTracker, "carryTracker", this);
     Scribe_Deep.Look(ref beds, "beds", this);
     Scribe_Deep.Look(ref storyState, "storyState", this);
     BackCompatibility.PostExposeData(this);
 }
Example #13
0
        private static bool SaveMap(Map map, string fileName)
        {
            try
            {
                LongEventHandler.SetCurrentEventText("Saving...");
                string path = FilePathForSavedMap(fileName);
                SafeSaver.Save(path, "mapsave", delegate
                {
                    Map target = map;
                    Scribe_Deep.Look(ref target, "li");
                });
            }
            catch (Exception arg)
            {
                Log.Error("Exception while saving map: " + arg);
                return(false);
            }

            return(true);
        }
Example #14
0
 public virtual void ExposeData()
 {
     Scribe_Deep.Look(ref curJob, "curJob");
     Scribe_Deep.Look(ref curDriver, "curDriver");
     Scribe_Deep.Look(ref jobQueue, "jobQueue");
     Scribe_Values.Look(ref posture, "posture", PawnPosture.Standing);
     if (Scribe.mode == LoadSaveMode.LoadingVars)
     {
         if (curDriver != null)
         {
             curDriver.pawn = pawn;
             curDriver.job  = curJob;
         }
     }
     else if (Scribe.mode == LoadSaveMode.PostLoadInit && curDriver == null && curJob != null)
     {
         Log.Warning($"Cleaning up invalid job state on {pawn}");
         EndCurrentJob(JobCondition.Errored);
     }
 }
        //
        // Static Methods
        //
        public static void SaveToFile(PrepareCarefully loadout, Page_ConfigureStartingPawnsCarefully page, string colonistName)
        {
            try {
                Scribe.InitWriting(ColonistFiles.FilePathForSavedColonist(colonistName), "colonist");
                string versionStringFull = "3";
                Scribe_Values.LookValue <string>(ref versionStringFull, "version", null, false);
                string modString = GenText.ToCommaList(Enumerable.Select <ModContentPack, string>(LoadedModManager.RunningMods, (Func <ModContentPack, string>)(mod => mod.Name)), true);
                Scribe_Values.LookValue <string>(ref modString, "mods", null, false);

                SaveRecordPawnV3 pawn = new SaveRecordPawnV3(page.SelectedPawn);
                Scribe_Deep.LookDeep <SaveRecordPawnV3>(ref pawn, "colonist");
            }
            catch (Exception e) {
                Log.Error("Failed to save preset file");
                throw e;
            }
            finally {
                Scribe.FinalizeWriting();
                Scribe.mode = LoadSaveMode.Inactive;
            }
        }
Example #16
0
        public void ExposeData()
        {
            Scribe_Values.Look(ref id, "id");

            Scribe_References.Look(ref DeclaredWarFaction, "DeclaredWarFaction");
            Scribe_References.Look(ref DefendingFaction, "DefendingFaction");
            Scribe_Defs.Look(ref WarGoalDef, "WarGoalDef");

            Scribe_Deep.Look(ref Worker, "Worker");
            Scribe_Deep.Look(ref StatWorker, "StatWorker");

            Scribe_Collections.Look(ref AssaultFactions, "AssaultFactions", LookMode.Reference);
            Scribe_Collections.Look(ref DefendingFactions, "DefendingFactions", LookMode.Reference);
            Scribe_Values.Look(ref StartTicks, "StartTicks");
            Scribe_Values.Look(ref started, "started");
            Scribe_Values.Look(ref WarName, "WarName");

            Scribe_Values.Look(ref LastTruceTicks, "LastTruceTicks");
            Scribe_Values.Look(ref nextTicksSituations, "nextTicksSituations");
            Scribe_Collections.Look(ref armys, "armys", LookMode.Deep);
        }
Example #17
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <int>(ref this.age, "age", -1, false);
     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 <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<Thing>(ref this.launcher, "launcher", false);
     Scribe_References.Look <Pawn>(ref this.pawn, "pawn", false);
     Scribe_Deep.Look <Thing>(ref this.flyingThing, "flyingThing", new object[0]);
     Scribe_Values.Look <SoLAction>(ref solAction, "solAction", SoLAction.Pending, false);
     Scribe_Values.Look <SoLAction>(ref queuedAction, "queuedAction", SoLAction.Null, false);
     Scribe_Values.Look <float>(ref this.lightEnergy, "lightEnergy", 0f, false);
     Scribe_Values.Look <IntVec3>(ref this.glowCenter, "glowCenter", default(IntVec3), false);
     Scribe_Values.Look <bool>(ref this.glowing, "glowing", false, false);
 }
Example #18
0
 public override void PostExposeData()
 {
     base.PostExposeData();
     Scribe_TargetInfo.Look(ref this.forcedTarget, "forcedTarget" + Props.gizmoID);
     Scribe_TargetInfo.Look(ref this.lastAttackedTarget, "lastAttackedTarget" + Props.gizmoID);
     Scribe_Deep.Look <ThingOwner>(ref this.innerContainer, "innerContainer" + Props.gizmoID, new object[]
     {
         this
     });
     Scribe_Values.Look <int>(ref this.lastAttackTargetTick, "lastAttackTargetTick" + Props.gizmoID, 0, false);
     Scribe_Values.Look <int>(ref this.stunedticks, "stunedticks" + Props.gizmoID, 0, false);
     Scribe_Values.Look <int>(ref this.remainingCharges, "remainingCharges" + Props.gizmoID, -999, false);
     Scribe_Deep.Look <VerbTracker>(ref this.verbTracker, "verbTracker" + Props.gizmoID, new object[]
     {
         this
     });
     if (Scribe.mode == LoadSaveMode.PostLoadInit && this.remainingCharges == -999)
     {
         this.remainingCharges = this.MaxCharges;
     }
 }
Example #19
0
        public void ExposeData()
        {
            if (Scribe.mode == LoadSaveMode.Saving)
            {
                if (originalBill.DeletedOrDereferenced)
                {
                    originalBill = null;
                }
            }

            Scribe_References.Look(ref originalBill, "originalBill");

            Scribe_References.Look(ref billGiver, "billGiver");
            Scribe_Deep.Look(ref billStack, "billStack", billGiver as IBillGiver);

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                // Hmm so the billstacks billgiver is going to be null at this point anyway, so lets set it directly
                billStack.billGiver = billGiver as IBillGiver;
            }
        }
Example #20
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 <Vector3>(ref this.trueOrigin, "trueOrigin", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.nearApex, "nearApex", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.farApex, "farApex", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.direction, "direction", 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.verVal, "verVal", 0, false);
     Scribe_Values.Look <int>(ref this.destinationCurvePoint, "destinationCurvePoint", 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]);
     Scribe_Collections.Look <IntVec3>(ref this.targetCells, "targetCells", LookMode.Value);
     Scribe_Collections.Look <Vector3>(ref this.curvePoints, "curvePoints", LookMode.Value);
 }
Example #21
0
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.Look(ref id, "id", -1, true);
            Scribe_Values.Look(ref HelpShown, "HelpShown");
            Scribe_Deep.Look(ref _stack, "JobStack", this);

            foreach (var tab in Tabs)
            {
                var exposableTab = tab as IExposable;
                if (exposableTab != null)
                {
                    Scribe_Deep.Look(ref exposableTab, tab.Label, this);
                }
            }

            if (_stack == null)
            {
                _stack = new JobStack(this);
            }
        }
        public void ExposeData()
        {
            Scribe_References.Look(ref ownerEx, "owner");

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

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

            Scribe_Values.Look <bool>(ref preferredUnarmedEx, "preferredUnarmed");
            Scribe_Deep.Look <ThingDefStuffDefPair?>(ref defaultRangedWeaponEx, "defaultRangedWeapon");
            Scribe_Deep.Look <ThingDefStuffDefPair?>(ref preferredMeleeWeaponEx, "preferredMeleeWeapon");
            Scribe_Values.Look <PrimaryWeaponMode>(ref primaryWeaponMode, "primaryWeaponMode");

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                NullChecks(this.Owner);
            }
        }
Example #23
0
        public static bool PreFSaveGame(string fileName)
        {
            try
            {
                Traverse traverse = Traverse.CreateWithType("GameDataSaveLoader").Field("lastSaveTick");
                SafeSaver.Save(GenFilePaths.FilePathForSavedGame(fileName), "savegame", delegate
                {
                    ScribeMetaHeaderUtility.WriteMetaHeader();
                    Game game = Current.Game;
                    Scribe_Deep.Look <Game>(ref game, "Κgame", new object[0]);
                });
                traverse.SetValue(Find.TickManager.TicksGame);
            }
            catch (Exception e)
            {
                Log.Message(string.Format("EXCEPTION! {0}.{1} \n\tMESSAGE: {2} \n\tException occurred calling {3} method", e.TargetSite.ReflectedType.Name,
                                          e.TargetSite.Name, e.Message));
            }

            return(false);
        }
Example #24
0
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Deep.Look(ref innerContainer, "innerContainer", this);
            Scribe_Values.Look(ref contentsKnown, "contentsKnown", defaultValue: false);

            Scribe_Defs.Look(ref activeBrainTemplateToBeProcessed, "activeBrainTemplateToBeProcessed");
            Scribe_Values.Look(ref removeActiveBrainTemplate, "removeActiveBrainTemplate", false);

            Scribe_Values.Look <int>(ref this.totalTicksToGrow, "totalTicksToGrow", 0, true);
            Scribe_Values.Look <int>(ref this.curTicksToGrow, "curTicksToGrow", 0, true);

            Scribe_Values.Look <float>(ref this.totalGrowthCost, "totalGrowthCost", 0f, true);
            Scribe_Values.Look <bool>(ref this.contentsKnown, "contentsKnown", false, true);
            Scribe_Values.Look <bool>(ref this.active, "active", false, true);
            Scribe_Values.Look <bool>(ref this.isRunningOutPower, "isRunningOutPower", false, true);
            Scribe_Values.Look <bool>(ref this.isRunningOutFuel, "isRunningOutFuel", false, true);

            Scribe_Values.Look <int>(ref this.runningOutPowerInTicks, "runningOutPowerInTicks", 0, true);
            Scribe_Values.Look <bool>(ref this.innerPawnIsDead, "innerPawnIsDead", false, true);
        }
Example #25
0
        public override void ExposeData()
        {
            base.ExposeData();

            //PawnFlyer
            Scribe_References.Look <PawnFlyer>(ref this.pawnFlyer, "pawnFlyer");

            //Vanilla
            Scribe_Values.Look <int>(ref this.groupID, "groupID", 0, false);
            Scribe_Values.Look <int>(ref this.destinationTile, "destinationTile", 0, false);
            Scribe_Values.Look <IntVec3>(ref this.destinationCell, "destinationCell", default(IntVec3), false);
            Scribe_Values.Look <PawnsArrivalModeDef>(ref this.arriveMode, "arriveMode", PawnsArrivalModeDefOf.EdgeDrop, false);
            Scribe_Values.Look <bool>(ref this.attackOnArrival, "attackOnArrival", false, false);
            Scribe_Values.Look <int>(ref this.ticksSinceStart, "ticksSinceStart", 0, false);
            Scribe_Deep.Look <ActiveDropPodInfo>(ref this.contents, "contents", new object[]
            {
                this
            });
            Scribe_Values.Look <bool>(ref this.alreadyLeft, "alreadyLeft", false, false);
            Scribe_Values.Look <bool>(ref this.soundPlayed, "soundPlayed", false, false);
        }
Example #26
0
 public override void PostExposeData()
 {
     base.PostExposeData();
     Scribe_Deep.Look(ref verbTracker, "verbTracker", (object)this);
     if (Scribe.mode != LoadSaveMode.PostLoadInit)
     {
         return;
     }
     if (verbTracker == null)
     {
         verbTracker = new VerbTracker(this);
     }
     if (!(parent?.holdingOwner?.Owner is Pawn_ApparelTracker tracker))
     {
         return;
     }
     foreach (var verb in verbTracker.AllVerbs)
     {
         verb.caster = tracker.pawn;
     }
 }
Example #27
0
        public override void PostExposeData()
        {
            Scribe_Values.Look(ref IsInitialized, "IsInitialized", false);
            Scribe_Deep.Look(ref abilityData, "abilityData", this);

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                var tempAbilities = new List <PawnAbility>(AbilityData.Powers);
                if (!tempAbilities.NullOrEmpty())
                {
                    foreach (var pa in tempAbilities)
                    {
                        if (pa.Def.abilityClass != pa.GetType())
                        {
                            RemovePawnAbility(pa.Def);
                            AddPawnAbility(pa.Def);
                        }
                    }
                }
            }
        }
        public override void PostExposeData()
        {
            base.PostExposeData();

            Scribe_Values.Look(ref this.progress, nameof(this.progress), -1f);
            Scribe_Values.Look(ref this.duration, nameof(this.duration));

            Scribe_Deep.Look(ref this.growthCell, nameof(this.growthCell));

            Scribe_References.Look(ref this.genomeDominant, nameof(this.genomeDominant));
            Scribe_References.Look(ref this.genomeSecondary, nameof(this.genomeSecondary));
            Scribe_References.Look(ref this.frame, nameof(this.frame));
            Scribe_References.Look(ref this.booster, nameof(this.booster));
            Scribe_Deep.Look(ref this.mainResult, nameof(this.mainResult));


            Scribe_Values.Look(ref this.genomeDominantLabel, nameof(this.genomeDominantLabel));
            Scribe_Values.Look(ref this.genomeSecondaryLabel, nameof(this.genomeSecondaryLabel));
            Scribe_Values.Look(ref this.frameLabel, nameof(this.frameLabel));
            Scribe_Values.Look(ref this.boosterLabel, nameof(this.boosterLabel));
        }
Example #29
0
        public T FromXml <T>(string dataXML)
            where T : new()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(dataXML);
            Scribe.loader.curXmlParent = xmlDocument.DocumentElement;
            Scribe.mode = LoadSaveMode.LoadingVars;
            try
            {
                Scribe.EnterNode(rootElementName);
                var thing = new T();
                Scribe_Deep.Look <T>(ref thing, "saveable", new object[0]);
                return(thing);
            }
            finally
            {
                //Finish()
                Scribe.loader.FinalizeLoading();
            }
        }
Example #30
0
        public override void CompExposeData()
        {
            base.CompExposeData();

            Scribe_Deep.Look <VerbTracker>(ref this.verbTracker, "verbTracker", new object[]
            {
                this
            });
            if (Scribe.mode == LoadSaveMode.PostLoadInit && this.verbTracker == null)
            {
                this.verbTracker = new VerbTracker(this);
            }

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

            //Scribe_Deep.Look<Verb>(ref this.rangedVerb, "rangedVerb", null, false);
            if (Scribe.mode == LoadSaveMode.PostLoadInit && (this.rangedVerb == null || this.rangedVerbLabel == null))
            {
                this.InitializeRangedVerb();
            }
        }