Ejemplo n.º 1
0
    private static void DreamsState_EndOfCycleProgress(On.DreamsState.orig_EndOfCycleProgress orig, DreamsState self, SaveState saveState, string currentRegion, string denPosition)
    {
        bool everSleptInSB   = true;
        bool everSleptInSB_S = true;

        DreamsState.StaticEndOfCycleProgress(saveState, currentRegion, denPosition, ref self.integers[0], ref self.integers[1], ref self.integers[2], ref self.integers[5], ref self.upcomingDream, ref self.eventDream, ref everSleptInSB, ref everSleptInSB_S, ref self.guideHasShownHimselfToPlayer, ref self.integers[4], ref self.guideHasShownMoonThisRound, ref self.integers[3]);
        self.everSleptInSB     = everSleptInSB;
        self.everSleptInSB_S01 = everSleptInSB_S;
    }
Ejemplo n.º 2
0
    private static void RainWorldGame_Win(On.RainWorldGame.orig_Win orig, RainWorldGame self, bool malnourished)
    {
        if (self.manager.upcomingProcess != null)
        {
            return;
        }
        Debug.Log("MALNOURISHED: " + malnourished);
        if (!malnourished && !self.rainWorld.saveBackedUp)
        {
            self.rainWorld.saveBackedUp = true;
            self.rainWorld.progression.BackUpSave("_Backup");
        }
        DreamsState dreamsState = self.GetStorySession.saveState.dreamsState;

        if (self.manager.rainWorld.progression.miscProgressionData.starvationTutorialCounter > -1)
        {
            self.manager.rainWorld.progression.miscProgressionData.starvationTutorialCounter++;
        }

        if (self.GetStorySession.saveState.miscWorldSaveData.privSlOracleState != null && self.GetStorySession.saveState.miscWorldSaveData.privSlOracleState.playerEncounters > EncTresh)
        {
            if (!self.GetStorySession.lastEverMetMoon)
            {
                self.manager.CueAchievement((self.GetStorySession.saveState.miscWorldSaveData.SLOracleState.neuronsLeft < NeuronTresh) ? RainWorld.AchievementID.MoonEncounterBad : RainWorld.AchievementID.MoonEncounterGood, 5f);
                if (dreamsState != null)
                {
                    dreamsState.InitiateEventDream((self.GetStorySession.saveState.miscWorldSaveData.SLOracleState.neuronsLeft < NeuronTresh) ? DreamsState.DreamID.MoonThief : DreamsState.DreamID.MoonFriend);
                }
            }
            else if (dreamsState != null && !dreamsState.everAteMoonNeuron && self.GetStorySession.saveState.miscWorldSaveData.SLOracleState.neuronsLeft < NeuronTresh)
            {
                dreamsState.InitiateEventDream(DreamsState.DreamID.MoonThief);
            }
        }

        if (!self.GetStorySession.lastEverMetPebbles && self.GetStorySession.saveState.miscWorldSaveData.SSaiConversationsHad > 0)
        {
            self.manager.CueAchievement(RainWorld.AchievementID.PebblesEncounter, 5f);
            if (self.StoryCharacter == 2)
            {
                self.manager.rainWorld.progression.miscProgressionData.redHasVisitedPebbles = true;
            }
            if (dreamsState != null)
            {
                dreamsState.InitiateEventDream(DreamsState.DreamID.Pebbles);
            }
        }
        if (dreamsState != null)
        {
            dreamsState.EndOfCycleProgress(self.GetStorySession.saveState, self.world.region.name, self.world.GetAbstractRoom(self.Players[0].pos).name);
        }
        self.GetStorySession.saveState.SessionEnded(self, true, malnourished);
        self.manager.RequestMainProcessSwitch((dreamsState == null || !dreamsState.AnyDreamComingUp) ? ProcessManager.ProcessID.SleepScreen : ProcessManager.ProcessID.Dream);
    }
    public void EndOfCycleProgress(SaveState saveState, string currentRegion, string denPosition)
    {
        bool everSleptInSB   = this.everSleptInSB;
        bool everSleptInSB_S = this.everSleptInSB_S01;

        DreamsState.StaticEndOfCycleProgress(saveState, currentRegion, denPosition, ref this.integers[0], ref this.integers[1], ref this.integers[2], ref this.integers[5], ref this.upcomingDream, ref this.eventDream, ref everSleptInSB, ref everSleptInSB_S, ref this.guideHasShownHimselfToPlayer, ref this.integers[4], ref this.guideHasShownMoonThisRound, ref this.integers[3]);
        this.everSleptInSB     = everSleptInSB;
        this.everSleptInSB_S01 = everSleptInSB_S;
        switch (this.upcomingDream)
        {
        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlLF:
            if (everReadLF)
            {
                this.upcomingDream = null;
            }
            everReadLF = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlLF2:
            if (everReadLF2)
            {
                this.upcomingDream = null;
            }
            everReadLF2 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSH:
            if (everReadSH)
            {
                this.upcomingDream = null;
            }
            everReadSH = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlDS:
            if (everReadDS)
            {
                this.upcomingDream = null;
            }
            everReadDS = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSB:
            if (everReadSB)
            {
                this.upcomingDream = null;
            }
            everReadSB = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSB2:
            if (everReadSB2)
            {
                this.upcomingDream = null;
            }
            everReadSB2 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlGW:
            if (everReadGW)
            {
                this.upcomingDream = null;
            }
            everReadGW = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSL:
            if (everReadSL)
            {
                this.upcomingDream = null;
            }
            everReadSL = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSL2:
            if (everReadSL2)
            {
                this.upcomingDream = null;
            }
            everReadSL2 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSL3:
            if (everReadSL3)
            {
                this.upcomingDream = null;
            }
            everReadSL3 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlIS:
            if (everReadIS)
            {
                this.upcomingDream = null;
            }
            everReadIS = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlFS:
            if (everReadFS)
            {
                this.upcomingDream = null;
            }
            everReadFS = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlMW:
            if (everReadMW)
            {
                this.upcomingDream = null;
            }
            everReadMW = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSI:
            if (everReadSI)
            {
                this.upcomingDream = null;
            }
            everReadSI = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSI2:
            if (everReadSI2)
            {
                this.upcomingDream = null;
            }
            everReadSI2 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSI3:
            if (everReadSI3)
            {
                this.upcomingDream = null;
            }
            everReadSI3 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSI4:
            if (everReadSI4)
            {
                this.upcomingDream = null;
            }
            everReadSI4 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSI5:
            if (everReadSI5)
            {
                this.upcomingDream = null;
            }
            everReadSI5 = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlSU:
            if (everReadSU)
            {
                this.upcomingDream = null;
            }
            everReadSU = true;
            break;

        case (DreamsState.DreamID)patch_DreamsState.DreamID.SRSDreamPearlUW:
            if (everReadUW)
            {
                this.upcomingDream = null;
            }
            everReadUW = true;
            break;
        }
    }
    public void Win(bool malnourished)
    {
        if (this.manager.upcomingProcess != null)
        {
            return;
        }
        Debug.Log("MALNOURISHED: " + malnourished);
        if (!malnourished && !this.rainWorld.saveBackedUp)
        {
            this.rainWorld.saveBackedUp = true;
            this.rainWorld.progression.BackUpSave("_Backup");
        }
        DreamsState dreamsState = this.GetStorySession.saveState.dreamsState;

        if (this.manager.rainWorld.progression.miscProgressionData.starvationTutorialCounter > -1)
        {
            this.manager.rainWorld.progression.miscProgressionData.starvationTutorialCounter++;
        }
        if (this.StoryCharacter != 0)
        {
            if (this.GetStorySession.saveState.miscWorldSaveData.EverMetMoon)
            {
                if (!this.GetStorySession.lastEverMetMoon)
                {
                    this.manager.CueAchievement((this.GetStorySession.saveState.miscWorldSaveData.SLOracleState.neuronsLeft != 5) ? RainWorld.AchievementID.MoonEncounterBad : RainWorld.AchievementID.MoonEncounterGood, 5f);
                    if (dreamsState != null)
                    {
                        dreamsState.InitiateEventDream((this.GetStorySession.saveState.miscWorldSaveData.SLOracleState.neuronsLeft != 5) ? DreamsState.DreamID.MoonThief : DreamsState.DreamID.MoonFriend);
                    }
                }
                else if (dreamsState != null && !dreamsState.everAteMoonNeuron && this.GetStorySession.saveState.miscWorldSaveData.SLOracleState.neuronsLeft < 5)
                {
                    dreamsState.InitiateEventDream(DreamsState.DreamID.MoonThief);
                }
            }
            if (!this.GetStorySession.lastEverMetPebbles && this.GetStorySession.saveState.miscWorldSaveData.SSaiConversationsHad > 0)
            {
                this.manager.CueAchievement(RainWorld.AchievementID.PebblesEncounter, 5f);
                if (this.StoryCharacter == 2)
                {
                    this.manager.rainWorld.progression.miscProgressionData.redHasVisitedPebbles = true;
                }
                if (dreamsState != null)
                {
                    dreamsState.InitiateEventDream(DreamsState.DreamID.Pebbles);
                }
            }
        }
        (this.GetStorySession.saveState as patch_SaveState).BringStomachUpToDate(this);
        if (dreamsState != null)
        {
            dreamsState.EndOfCycleProgress(this.GetStorySession.saveState, this.world.region.name, this.world.GetAbstractRoom(this.Players[0].pos).name);
        }
        this.GetStorySession.saveState.SessionEnded(this, true, malnourished);
        if ((dreamsState as patch_DreamsState).AnyMessageComingUp)
        {
            this.manager.RequestMainProcessSwitch((ProcessManager.ProcessID)patch_ProcessManager.ProcessID.MessageScreen);
        }
        else
        {
            this.manager.RequestMainProcessSwitch((dreamsState == null || !dreamsState.AnyDreamComingUp) ? ProcessManager.ProcessID.SleepScreen : ProcessManager.ProcessID.Dream);
        }
    }