public override void CommunicateWithUpcomingProcess(MainLoopProcess nextProcess)
 {
     orig_CommunicateWithUpcomingProcess(nextProcess);
     if (nextProcess is MessageScreen)
     {
         int karma = this.GetStorySession.saveState.deathPersistentSaveData.karma;
         Debug.Log("savKarma: " + karma);
         if (this.sawAGhost > -1)
         {
             Debug.Log("Ghost end of process stuff");
             this.manager.CueAchievement(GhostWorldPresence.PassageAchievementID((GhostWorldPresence.GhostID) this.sawAGhost), 2f);
             if (this.GetStorySession.saveState.deathPersistentSaveData.karmaCap == 8)
             {
                 this.manager.CueAchievement(RainWorld.AchievementID.AllGhostsEncountered, 10f);
             }
             this.GetStorySession.saveState.GhostEncounter(this.sawAGhost, this.rainWorld);
         }
         int num = karma;
         if (nextProcess.ID == ProcessManager.ProcessID.DeathScreen && !this.GetStorySession.saveState.deathPersistentSaveData.reinforcedKarma)
         {
             num = Custom.IntClamp(num - 1, 0, this.GetStorySession.saveState.deathPersistentSaveData.karmaCap);
         }
         Debug.Log("next screen MAP KARMA: " + num);
         this.cameras[0].hud.map.mapData.UpdateData(this.world, 1 + this.GetStorySession.saveState.deathPersistentSaveData.foodReplenishBonus, num, this.GetStorySession.saveState.deathPersistentSaveData.karmaFlowerPosition, true);
         int     num2   = this.Players[0].pos.room;
         Vector2 vector = this.Players[0].pos.Tile.ToVector2() * 20f;
         if (nextProcess.ID == ProcessManager.ProcessID.DeathScreen && this.cameras[0].hud != null && this.cameras[0].hud.textPrompt != null)
         {
             num2   = this.cameras[0].hud.textPrompt.deathRoom;
             vector = this.cameras[0].hud.textPrompt.deathPos;
         }
         else if (this.Players[0].realizedCreature != null)
         {
             vector = this.Players[0].realizedCreature.mainBodyChunk.pos;
         }
         if (this.Players[0].realizedCreature != null && this.Players[0].realizedCreature.room != null && num2 == this.Players[0].realizedCreature.room.abstractRoom.index)
         {
             vector = Custom.RestrictInRect(vector, this.Players[0].realizedCreature.room.RoomRect.Grow(50f));
         }
         KarmaLadderScreen.SleepDeathScreenDataPackage package = new KarmaLadderScreen.SleepDeathScreenDataPackage((nextProcess.ID != ProcessManager.ProcessID.SleepScreen && nextProcess.ID != ProcessManager.ProcessID.Dream) ? this.cameras[0].hud.textPrompt.foodInStomach : this.GetStorySession.saveState.food, new IntVector2(karma, this.GetStorySession.saveState.deathPersistentSaveData.karmaCap), this.GetStorySession.saveState.deathPersistentSaveData.reinforcedKarma, num2, vector, this.cameras[0].hud.map.mapData, this.GetStorySession.saveState, this.GetStorySession.characterStats, this.GetStorySession.playerSessionRecords[0], this.GetStorySession.saveState.lastMalnourished, this.GetStorySession.saveState.malnourished);
         (nextProcess as MessageScreen).GetDataFromGame(((this.GetStorySession.saveState.dreamsState as patch_DreamsState).everSeenMissonComplete), ((this.GetStorySession.saveState.dreamsState as patch_DreamsState).everSeenTraitor), this.GetStorySession.saveState.dreamsState.UpcomingDreamID, package);
     }
 }
Ejemplo n.º 2
0
        public static float GWPGhostModeHook(On.GhostWorldPresence.orig_GhostMode orig, GhostWorldPresence presence, Room room, int camPos)
        {
            if (!RoomCameraHK.ShouldScroll(room))
            {
                return(orig(presence, room, camPos));
            }
            Vector2[] cameraPositions = room.cameraPositions;
            room.cameraPositions = RoomCameraHK.origCameraPositions[room.abstractRoom.name];
            float res = orig(presence, room, camPos);

            room.cameraPositions = cameraPositions;
            return(res);
        }