Esempio n. 1
0
 public void ExposeData()
 {
     if (Scribe.mode == LoadSaveMode.Saving)
     {
         lastJobGiverKey = ((lastJobGiver == null) ? (-1) : lastJobGiver.UniqueSaveKey);
     }
     Scribe_Values.Look(ref lastJobGiverKey, "lastJobGiverKey", -1);
     if (Scribe.mode == LoadSaveMode.PostLoadInit && lastJobGiverKey != -1 && !lastJobGiverThinkTree.TryGetThinkNodeWithSaveKey(lastJobGiverKey, out lastJobGiver))
     {
         Log.Warning("Could not find think node with key " + lastJobGiverKey);
     }
     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_Defs.Look(ref lastJobGiverThinkTree, "lastJobGiverThinkTree");
     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 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 lastSelfTendTick, "lastSelfTendTick", 0);
     Scribe_Values.Look(ref spawnedByInfestationThingComp, "spawnedByInfestationThingComp", defaultValue: false);
     Scribe_Values.Look(ref lastPredatorHuntingPlayerNotificationTick, "lastPredatorHuntingPlayerNotificationTick", -99999);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.MindStatePostLoadInit(this);
     }
 }
Esempio n. 2
0
 public void ExposeData()
 {
     if (Scribe.mode == LoadSaveMode.Saving)
     {
         this.lastJobGiverKey = ((this.lastJobGiver == null) ? -1 : this.lastJobGiver.UniqueSaveKey);
     }
     Scribe_Values.Look <int>(ref this.lastJobGiverKey, "lastJobGiverKey", -1, false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit && this.lastJobGiverKey != -1 && !this.lastJobGiverThinkTree.TryGetThinkNodeWithSaveKey(this.lastJobGiverKey, out this.lastJobGiver))
     {
         Log.Warning("Could not find think node with key " + this.lastJobGiverKey);
     }
     Scribe_References.Look <Pawn>(ref this.meleeThreat, "meleeThreat", false);
     Scribe_References.Look <Thing>(ref this.enemyTarget, "enemyTarget", false);
     Scribe_References.Look <Thing>(ref this.knownExploder, "knownExploder", false);
     Scribe_References.Look <Thing>(ref this.lastMannedThing, "lastMannedThing", false);
     Scribe_Defs.Look <ThinkTreeDef>(ref this.lastJobGiverThinkTree, "lastJobGiverThinkTree");
     Scribe_TargetInfo.Look(ref this.lastAttackedTarget, "lastAttackedTarget");
     Scribe_Collections.Look <int, int>(ref this.thinkData, "thinkData", LookMode.Value, LookMode.Value);
     Scribe_Values.Look <bool>(ref this.activeInt, "active", true, false);
     Scribe_Values.Look <JobTag>(ref this.lastJobTag, "lastJobTag", JobTag.Misc, false);
     Scribe_Values.Look <int>(ref this.lastIngestTick, "lastIngestTick", -99999, false);
     Scribe_Values.Look <int>(ref this.nextApparelOptimizeTick, "nextApparelOptimizeTick", -99999, false);
     Scribe_Values.Look <int>(ref this.lastEngageTargetTick, "lastEngageTargetTick", 0, false);
     Scribe_Values.Look <int>(ref this.lastAttackTargetTick, "lastAttackTargetTick", 0, false);
     Scribe_Values.Look <bool>(ref this.canFleeIndividual, "canFleeIndividual", false, false);
     Scribe_Values.Look <int>(ref this.exitMapAfterTick, "exitMapAfterTick", -99999, false);
     Scribe_Values.Look <IntVec3>(ref this.forcedGotoPosition, "forcedGotoPosition", IntVec3.Invalid, false);
     Scribe_Values.Look <int>(ref this.lastMeleeThreatHarmTick, "lastMeleeThreatHarmTick", 0, false);
     Scribe_Values.Look <int>(ref this.lastAssignedInteractTime, "lastAssignedInteractTime", -99999, false);
     Scribe_Values.Look <int>(ref this.lastInventoryRawFoodUseTick, "lastInventoryRawFoodUseTick", 0, false);
     Scribe_Values.Look <int>(ref this.lastDisturbanceTick, "lastDisturbanceTick", -99999, false);
     Scribe_Values.Look <bool>(ref this.wantsToTradeWithColony, "wantsToTradeWithColony", false, false);
     Scribe_Values.Look <int>(ref this.canLovinTick, "canLovinTick", -99999, false);
     Scribe_Values.Look <int>(ref this.canSleepTick, "canSleepTick", -99999, false);
     Scribe_Values.Look <bool>(ref this.nextMoveOrderIsWait, "nextMoveOrderIsWait", true, false);
     Scribe_Values.Look <int>(ref this.lastTakeCombatEnhancingDrugTick, "lastTakeCombatEnhancingDrugTick", -99999, false);
     Scribe_Values.Look <int>(ref this.lastHarmTick, "lastHarmTick", -99999, false);
     Scribe_Values.Look <bool>(ref this.anyCloseHostilesRecently, "anyCloseHostilesRecently", false, false);
     Scribe_Deep.Look <PawnDuty>(ref this.duty, "duty", new object[0]);
     Scribe_Deep.Look <MentalStateHandler>(ref this.mentalStateHandler, "mentalStateHandler", new object[]
     {
         this.pawn
     });
     Scribe_Deep.Look <MentalBreaker>(ref this.mentalBreaker, "mentalBreaker", new object[]
     {
         this.pawn
     });
     Scribe_Deep.Look <InspirationHandler>(ref this.inspirationHandler, "inspirationHandler", new object[]
     {
         this.pawn
     });
     Scribe_Deep.Look <PriorityWork>(ref this.priorityWork, "priorityWork", new object[]
     {
         this.pawn
     });
     Scribe_Values.Look <int>(ref this.applyBedThoughtsTick, "applyBedThoughtsTick", 0, false);
     Scribe_Values.Look <bool>(ref this.applyBedThoughtsOnLeave, "applyBedThoughtsOnLeave", false, false);
     Scribe_Values.Look <bool>(ref this.willJoinColonyIfRescued, "willJoinColonyIfRescued", false, false);
     Scribe_Values.Look <bool>(ref this.wildManEverReachedOutside, "wildManEverReachedOutside", false, false);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.MindStatePostLoadInit(this);
     }
 }