Beispiel #1
0
 public void AnnounceDishonorable()
 {
     SimpleMessage.PostMessage("No honor codes in effect. Vanilla only.", "", 10 * 60);
     //Main.PlaySound( SoundID.NPCDeath20.WithVolume( 0.5f ) );	// Pig Squeal
     //Main.PlaySound( SoundID.NPCDeath59.WithVolume( 0.5f ) );    // Cultist cry
     Main.PlaySound(SoundID.Item16.WithVolume(0.5f));                    // Fart
 }
Beispiel #2
0
        ////////////////

        public void AnnounceHonorifics()
        {
            int    i = 0;
            string honorificsList = "";

            foreach (string honorific in this.CurrentActiveHonorifics)
            {
                honorificsList += honorific;

                if (i < this.CurrentActiveHonorifics.Count - 1)
                {
                    honorificsList += ", ";
                    if (i > 0 && i % 5 == 0)
                    {
                        honorificsList += '\n';
                    }
                }
                i++;
            }
            SimpleMessage.PostMessage("The following honor codes are now in effect:", honorificsList, 15 * 60);
            Main.PlaySound(SoundID.Item47.WithVolume(0.5f));
        }
        public void Update()
        {
            var mymod = TheLunaticMod.Instance;

            // Simply idle (and keep track of day) until ready
            if (!this.IsReady())
            {
                this.IsDay = Main.dayTime;
                return;
            }

            if (mymod.Config.DebugModeInfo)
            {
                var modworld = ModContent.GetInstance <TheLunaticWorld>();
                DebugHelpers.Print("WorldID", "" + modworld.ID, 20);
                DebugHelpers.Print("IsApocalypse", "" + this.IsApocalypse, 20);
                DebugHelpers.Print("IsSafe", "" + this.IsSafe, 20);
                DebugHelpers.Print("HasLoonyArrived", "" + this.HasLoonyArrived, 20);
                DebugHelpers.Print("HasLoonyQuit", "" + this.HasLoonyQuit, 20);
                DebugHelpers.Print("HasGameEnded", "" + this.HasGameEnded, 20);
                DebugHelpers.Print("HalfDaysElapsed", "" + this.HalfDaysElapsed + " (" + (mymod.Config.DaysUntil * 2) + ")", 20);
                DebugHelpers.Print("HaveWeEndSigns", "" + this.HaveWeEndSigns(), 20);
                DebugHelpers.Print("HaveHope", "" + this.HaveWeHopeToWin(), 20);
                DebugHelpers.Print("TintScale", "" + mymod.Sky.TintScale, 20);
                DebugHelpers.Print("RemainingMasks", String.Join(",", modworld.MaskLogic.GetRemainingVanillaMasks()), 20);
                DebugHelpers.Print("GivenMasks", String.Join(",", modworld.MaskLogic.GivenVanillaMasksByType), 20);
            }
            if (mymod.Config.DebugModeFastTime)
            {
                Main.time += 24;
            }

            // Indicate when our loony is here to stay
            if (!this.HasLoonyArrived && TheLunaticTownNPC.AmHere)
            {
                this.HasLoonyArrived = true;
            }

            if (!this.IsSafe && !this.HasLoonyQuit)
            {
                if (!this.IsApocalypse && !NPC.LunarApocalypseIsUp)                     //!NPC.downedAncientCultist && NPC.MoonLordCountdown == 0 && !NPC.AnyNPCs(398)
                // Advance elapsed time until the end
                {
                    if (this.IsDay != Main.dayTime)
                    {
                        this.HalfDaysElapsed++;
                    }

                    this.UpdateEndSigns();
                }

                this.UpdateStateOfApocalypse();
            }

            this.IsDay = Main.dayTime;

            // Is loony gone for good?
            if (!this.HasLoonyQuit)
            {
                if (!this.HasLoonyArrived)
                {
                    if (!TheLunaticTownNPC.WantsToSpawnAnew())
                    {
                        this.Quit();
                    }
                }
                else if (!TheLunaticTownNPC.WantsToSpawn())
                {
                    this.Quit();
                }
            }

            // Have we won?
            if (!this.HasWon && this.HaveWeWon())
            {
                this.WinTheGame();
            }

            // Indicate final day
            if (!this.HasGameEnded)
            {
                if (!this.IsLastDay)
                {
                    if (this.HalfDaysElapsed >= (mymod.Config.DaysUntil - 1) * 2)
                    {
                        SimpleMessage.PostMessage("Final Day", "", 60 * 5);
                        this.IsLastDay = true;
                    }
                }
                else
                {
                    if (this.HalfDaysElapsed < (mymod.Config.DaysUntil - 1) * 2)
                    {
                        this.IsLastDay = false;
                    }
                }
            }
        }