예제 #1
0
        public static void Prefix(uGUI_HardcoreGameOver __instance)
        {
            DeathRun.setCause("Victory");
            DeathRun.saveData.runData.updateVitals(true);
            DeathRun.statsData.SaveStats();

            TimeSpan timeSpan = TimeSpan.FromSeconds((double)DeathRun.saveData.playerSave.allLives);
            string   text     = "Victory! In " + DeathRunUtils.sayTime(timeSpan) + " (" + (DeathRun.saveData.playerSave.numDeaths + 1) + " ";

            if (DeathRun.saveData.playerSave.numDeaths == 0)
            {
                text += "life";
            }
            else
            {
                text += "lives";
            }

            text += ")";

            DeathRunUtils.CenterMessage(text, 10);
            CattleLogger.Message(text);

            string text2 = "Score: " + DeathRun.saveData.runData.Score;

            DeathRunUtils.CenterMessage(text, 10, 1);
            CattleLogger.Message(text);

            //ErrorMessage.AddMessage(text);
        }
예제 #2
0
        public static bool Prefix(DamageType damageType)
        {
            try
            {
                setCauseOfDeath(damageType);

                DeathRun.saveData.playerSave.numDeaths++;

                DeathRun.saveData.playerSave.timeOfDeath = DayNightCycle.main.timePassedAsFloat;
                DeathRun.saveData.playerSave.spanAtDeath = DeathRun.saveData.playerSave.allLives;

                TimeSpan timeSpan = TimeSpan.FromSeconds((double)DeathRun.saveData.playerSave.currentLife);

                string text = "Time of Death";
                if (DeathRun.saveData.playerSave.numDeaths > 1)
                {
                    text += " #" + DeathRun.saveData.playerSave.numDeaths;
                }
                text += ": ";

                text += DeathRunUtils.sayTime(timeSpan);

                DeathRunUtils.CenterMessage(text, 10);
                CattleLogger.Message(text);

                text = "Cause of Death: " + DeathRun.cause;
                DeathRunUtils.CenterMessage(text, 10, 1);

                //ErrorMessage.AddMessage(text);

                DeathRun.saveData.playerSave.killOpening = true;
                DeathRun.saveData.runData.updateVitals(false);

                DeathRun.saveData.nitroSave.setDefaults(); // Reset all nitrogen state

                DeathRun.playerIsDead = true;
            }
            catch (Exception ex)
            {
                CattleLogger.GenericError("During Player.OnKill - ", ex);
            }

            return(true);
        }
예제 #3
0
        private static void doRespawnMessages()
        {
            if (DeathRun.playerMonitor.JustWentAbove(DeathRun.saveData.playerSave.timeOfDeath + 10))
            {
                DeathRun.playerIsDead = false;
            }

            if (DeathRun.playerMonitor.JustWentAbove(DeathRun.saveData.playerSave.timeOfDeath + 15))
            {
                ErrorMessage.AddMessage(DeathRunUtils.centerMessages[0].getText());

                if (DeathRun.saveData.playerSave.numDeaths > 1)
                {
                    TimeSpan timeSpan2 = TimeSpan.FromSeconds((double)DeathRun.saveData.playerSave.spanAtDeath);
                    string   text;
                    if (DeathRun.saveData.playerSave.numDeaths == 2)
                    {
                        text = "Both Lives: ";
                    }
                    else
                    {
                        text = "All " + DeathRun.saveData.playerSave.numDeaths + " Lives: ";
                    }
                    text += DeathRunUtils.sayTime(timeSpan2);
                    DeathRunUtils.CenterMessage(text, 10);
                }
            }

            if (DeathRun.playerMonitor.JustWentAbove(DeathRun.saveData.playerSave.timeOfDeath + 25))
            {
                TimeSpan timeSpan2 = TimeSpan.FromSeconds((double)DeathRun.saveData.playerSave.spanAtDeath);
                string   text;
                if (DeathRun.saveData.playerSave.numDeaths == 2)
                {
                    text = "Both Lives: ";
                }
                else
                {
                    text = "All " + DeathRun.saveData.playerSave.numDeaths + " Lives: ";
                }
                text += DeathRunUtils.sayTime(timeSpan2);
                ErrorMessage.AddMessage(text);
            }
        }