public void Awake() { //Debug.Log("CharacterState.Awake()"); //Debug.Log("-- " + gameObject.name); statusListeners = new ArrayList(); state = new PersistentCharacterState(); item = null; followerAction = null; oneLinerTarget = null; currentSeat = null; lastPCDialogueEndedInSeconds = - 100.0f; state.lastSoberingMinute = 0; state.nightsSlept = 0; state.name = name; state.money = money; state.drunkness = 0.0f; state.justHadSex = false; state.startedBlindDate = false; state.variableSet = null; blindDateStartingTime = new DateTime(1, 1, 1); blindDateLength = new TimeSpan(0, 0, 0); currentTask = new TaskInfo(Task.NONE, null); }
public void Load() { //Debug.Log("CharacterState.Load()"); PersistentCharacterState tmp = (PersistentCharacterState)SaveLoad.ReadSaveFile(PersistentCharacterState.GetSaveFileName(state.name)); if(tmp != null) { state = tmp; } else { Debug.LogError("CharacterState.Load(): Failed to load stated file for " + state.name); SaveLoad.ResetSave(); } // Now we need to do some fixing to make thigs OK... if(state.startedBlindDate) { //CharacterState chrisState = (CharacterState)CharacterManager.GetMajorNPC("Chris").GetComponent("CharacterState"); //chrisState.StartBlindDate(new TimeSpan(2, 30, 0)); StartBlindDate(new TimeSpan(2, 30, 0)); } if (JustHadSex()){ //Debug.Log("Just had sex!"); ActionRunner actionRunner = GetComponent(typeof(ActionRunner)) as ActionRunner; actionRunner.FullReset(new StartDialogueAction(gameObject, CharacterManager.GetPC(), name, "after_sex")); SetJustHadSex(false); } }