コード例 #1
0
        private void UpdatePuritySpiritIndex()
        {
            CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>();

            if (InvasionWorld.CyberWrath)
            {
                return;
            }
            invasionI = -1;
        }
コード例 #2
0
ファイル: InvasionData.cs プロジェクト: astranauta/Tremor
        private void UpdatePuritySpiritIndex()
        {
            Mod mod = ModLoader.GetMod("Tremor");
            CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>(mod);

            if (InvasionWorld.CyberWrath)
            {
                return;
            }
            invasionI = -1;
        }
コード例 #3
0
        private bool UpdatePuritySpiritIndex()
        {
            CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>();

            if (InvasionWorld.CyberWrath)
            {
                return(true);
            }
            invasionI = -1;
            return(invasionI >= 0);
        }
コード例 #4
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            CyberWrathInvasion modPlayer1 = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>();

            if (InvasionWorld.CyberWrath)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                LegacyGameInterfaceLayer orionProgress = new LegacyGameInterfaceLayer("Tremor: Invasion2",
                                                                                      delegate
                {
                    DrawOrionEvent(Main.spriteBatch);
                    return(true);
                },
                                                                                      InterfaceScaleType.UI);
                layers.Insert(index, orionProgress);
            }
        }
コード例 #5
0
        public override void PostUpdate()
        {
            bool      First   = true;
            const int XOffset = 400;
            const int YOffset = 400;

            CyberWrathInvasion modPlayer = player.GetModPlayer <CyberWrathInvasion>(mod);

            if (!InvasionWorld.CyberWrath)
            {
                InvasionWorld.CyberWrathPoints1 = 0;
            }

            if (InvasionWorld.CyberWrath)
            {
                //Main.spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(200, 200, 200) * 0.5f);
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("InvisibleSoul"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("InvisibleSoul"));
                }

                if (Main.rand.Next(150) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("CyberBat"));
                }
                if (Main.rand.Next(150) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y - YOffset, mod.NPCType("CyberBat"));
                }

                if (Main.rand.Next(500) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("ParadoxSun"));
                }
                if (Main.rand.Next(500) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y - YOffset, mod.NPCType("ParadoxSun"));
                }
            }

            InvasionWorld.CyberWrathPoints = InvasionWorld.CyberWrathPoints1;


            if (InvasionWorld.CyberWrathPoints1 == 15)
            {
                NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum"));
                InvasionWorld.CyberWrathPoints1 = 16;
            }

            if (InvasionWorld.CyberWrathPoints1 == 35)
            {
                NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum"));
                InvasionWorld.CyberWrathPoints1 = 36;
            }

            if (InvasionWorld.CyberWrathPoints1 == 50)
            {
                NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum"));
                InvasionWorld.CyberWrathPoints1 = 51;
            }

            if (InvasionWorld.CyberWrathPoints1 == 85)
            {
                NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum"));
                InvasionWorld.CyberWrathPoints1 = 86;
            }

            if (InvasionWorld.CyberWrathPoints1 >= 100 && !NPC.AnyNPCs(mod.NPCType("Titan")))
            {
                //Main.NewText("Wave 1: Complete!", 255, 255, 0);
                //Main.NewText("Wave 2: Complete 0%", 0, 255, 255);
                InvasionWorld.CyberWrath = false;
            }

            if (InvasionWorld.CyberWrathPoints1 > 100 && !NPC.AnyNPCs(mod.NPCType("Titan")))
            {
                InvasionWorld.CyberWrathPoints1 = 100;
            }

            if (InvasionWorld.CyberWrathPoints1 > 98 && NPC.AnyNPCs(mod.NPCType("Titan")))
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }

            if (NPC.AnyNPCs(mod.NPCType("Titan_")) && InvasionWorld.CyberWrathPoints1 == 98)
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }

            if (NPC.AnyNPCs(mod.NPCType("Titan")) && InvasionWorld.CyberWrathPoints1 == 98)
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }

            if (!NPC.AnyNPCs(mod.NPCType("Titan_")) && InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 < 98)
            {
                NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 200, mod.NPCType("Titan_"));
            }

            /*if (modPlayer.CyberWrathPoints1 == 94)
             * {
             *      NPC.NewNPC((int)player.position.X, (int)player.position.Y - 200, mod.NPCType("Titan"));
             *      Main.NewText("Your life happens?", Color.Red.R, Color.Orange.G, Color.Red.B);
             *      modPlayer.CyberWrathPoints1 = 95;
             * } */

            if (NPC.AnyNPCs(mod.NPCType("Titan")) && InvasionWorld.CyberWrathPoints1 > 98)
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }

            if (NPC.AnyNPCs(mod.NPCType("Zerokk")) && InvasionWorld.CyberWrathPoints1 == 98)
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }

            if (NPC.AnyNPCs(mod.NPCType("Titan_")) && InvasionWorld.CyberWrathPoints1 > 98)
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }

            if (NPC.AnyNPCs(mod.NPCType("Zerokk")) && InvasionWorld.CyberWrathPoints1 > 98)
            {
                InvasionWorld.CyberWrathPoints1 = 98;
            }


            if (InvasionWorld.CyberWrathPoints1 == 100 && !NPC.AnyNPCs(mod.NPCType("Titan_")) && !NPC.AnyNPCs(mod.NPCType("Titan")))
            {
                Main.NewText("Paradox Cohort has been defeated!", 39, 86, 134);
                InvasionWorld.CyberWrathPoints1 = 0;
            }
        }
コード例 #6
0
        public override void UpdateMusic(ref int music)
        {
            if (Main.myPlayer != -1 && !Main.gameMenu)
            {
                int[] NoOverride = { MusicID.Boss1,                MusicID.Boss2,                 MusicID.Boss3,                MusicID.Boss4,                MusicID.Boss5,
                                     MusicID.LunarBoss,            MusicID.PumpkinMoon,           MusicID.TheTowers,            MusicID.FrostMoon,            MusicID.GoblinInvasion,      MusicID.Eclipse,               MusicID.MartianMadness,
                                     MusicID.PirateInvasion,       GetSoundSlot(SoundType.Music,  "Sounds/Music/CyberKing"),    GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"),       GetSoundSlot(SoundType.Music,  "Sounds/Music/Trinity"),
                                     GetSoundSlot(SoundType.Music, "Sounds/Music/SlimeRain"),     GetSoundSlot(SoundType.Music, "Sounds/Music/EvilCorn"),     GetSoundSlot(SoundType.Music,"Sounds/Music/TikiTotem"),     GetSoundSlot(SoundType.Music,"Sounds/Music/CogLord"),
                                     GetSoundSlot(SoundType.Music, "Sounds/Music/NightOfUndead"), GetSoundSlot(SoundType.Music, "Sounds/Music/CyberWrath") };
                bool  playMusic = true;
                foreach (int n in NoOverride)
                {
                    if (music == n)
                    {
                        playMusic = false;
                    }
                }
                for (int i = 0; i < Main.npc.Length; ++i)
                {
                    if (Main.npc[i].boss)
                    {
                        playMusic = false;
                    }
                }

                Player player = Main.player[Main.myPlayer];

                if (Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].GetModPlayer <TremorPlayer>(this).ZoneGranite&& playMusic)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Granite");
                }

                if (ZWorld.ZInvasion && playMusic)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/NightOfUndead");
                }

                CyberWrathInvasion modPlayer1 = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>();
                if (InvasionWorld.CyberWrath)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/CyberWrath");
                }

                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("CogLord")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/CogLord");
                }

                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(50))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6");
                }

                if (Main.player[Main.myPlayer].active && (NPC.AnyNPCs(NPCType("TikiTotem")) || NPC.AnyNPCs(NPCType("HappySoul")) || NPC.AnyNPCs(NPCType("AngerSoul")) || NPC.AnyNPCs(NPCType("IndifferenceSoul"))))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/TikiTotem");
                }

                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("EvilCorn")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/EvilCorn");
                }

                if (Main.player[Main.myPlayer].active && Main.invasionType == 2)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6");
                }

                if (Main.player[Main.myPlayer].active && Main.slimeRain && !NPC.AnyNPCs(50) && !Main.eclipse && playMusic)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/SlimeRain");
                }

                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("SoulofTruth")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity");
                }
                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("SoulofTrust")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity");
                }
                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("SoulofHope")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity");
                }
                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("FrostKing")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6");
                }
                if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("CyberKing")))
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/CyberKing");
                }


                if (Main.cloudAlpha > 0f &&
                    Main.player[Main.myPlayer].position.Y <
                    Main.worldSurface * 16.0 + Main.screenHeight / 2 && Main.player[Main.myPlayer].ZoneSnow && playMusic)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Snow2");
                }

                if (player.active && player.GetModPlayer <TremorPlayer>(this).ZoneIce&& !Main.gameMenu && playMusic)
                {
                    music = GetSoundSlot(SoundType.Music, "Sounds/Music/Snow2");
                }
            }
        }
コード例 #7
0
        public void DrawOrionEvent(SpriteBatch spriteBatch)
        {
            CyberWrathInvasion modPlayer1 = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>();

            if (InvasionWorld.CyberWrath && !Main.gameMenu)
            {
                float        scaleMultiplier  = 0.5f + 1 * 0.5f;
                float        alpha            = 0.5f;
                Texture2D    progressBg       = Main.colorBarTexture;
                Texture2D    progressColor    = Main.colorBarTexture;
                Texture2D    orionIcon        = Tremor.instance.GetTexture("Invasion/InvasionIcon");
                const string orionDescription = "Paradox Cohort";
                Color        descColor        = new Color(39, 86, 134);

                Color waveColor    = new Color(255, 241, 51);
                Color barrierColor = new Color(255, 241, 51);

                try
                {
                    //draw the background for the waves counter
                    const int offsetX        = 20;
                    const int offsetY        = 20;
                    int       width          = (int)(200f * scaleMultiplier);
                    int       height         = (int)(46f * scaleMultiplier);
                    Rectangle waveBackground = Utils.CenteredRectangle(new Vector2(Main.screenWidth - offsetX - 100f, Main.screenHeight - offsetY - 23f), new Vector2(width, height));
                    Utils.DrawInvBG(spriteBatch, waveBackground, new Color(63, 65, 151, 255) * 0.785f);

                    //draw wave text

                    string waveText = "Cleared " + InvasionWorld.CyberWrathPoints1 + "%";
                    Utils.DrawBorderString(spriteBatch, waveText, new Vector2(waveBackground.X + waveBackground.Width / 2, waveBackground.Y), Color.White, scaleMultiplier, 0.5f, -0.1f);

                    //draw the progress bar

                    if (InvasionWorld.CyberWrathPoints1 == 0)
                    {
                    }

                    Rectangle waveProgressBar    = Utils.CenteredRectangle(new Vector2(waveBackground.X + waveBackground.Width * 0.5f, waveBackground.Y + waveBackground.Height * 0.75f), new Vector2(progressColor.Width, progressColor.Height));
                    Rectangle waveProgressAmount = new Rectangle(0, 0, (int)(progressColor.Width * 0.01f * MathHelper.Clamp(InvasionWorld.CyberWrathPoints1, 0f, 100f)), progressColor.Height);
                    Vector2   offset             = new Vector2((waveProgressBar.Width - (int)(waveProgressBar.Width * scaleMultiplier)) * 0.5f, (waveProgressBar.Height - (int)(waveProgressBar.Height * scaleMultiplier)) * 0.5f);


                    spriteBatch.Draw(progressBg, waveProgressBar.Location.ToVector2() + offset, null, Color.White * alpha, 0f, new Vector2(0f), scaleMultiplier, SpriteEffects.None, 0f);
                    spriteBatch.Draw(progressBg, waveProgressBar.Location.ToVector2() + offset, waveProgressAmount, waveColor, 0f, new Vector2(0f), scaleMultiplier, SpriteEffects.None, 0f);

                    //draw the icon with the event description

                    //draw the background
                    const int internalOffset    = 6;
                    Vector2   descSize          = new Vector2(154, 40) * scaleMultiplier;
                    Rectangle barrierBackground = Utils.CenteredRectangle(new Vector2(Main.screenWidth - offsetX - 100f, Main.screenHeight - offsetY - 19f), new Vector2(width, height));
                    Rectangle descBackground    = Utils.CenteredRectangle(new Vector2(barrierBackground.X + barrierBackground.Width * 0.5f, barrierBackground.Y - internalOffset - descSize.Y * 0.5f), descSize);
                    Utils.DrawInvBG(spriteBatch, descBackground, descColor * alpha);

                    //draw the icon
                    int       descOffset = (descBackground.Height - (int)(32f * scaleMultiplier)) / 2;
                    Rectangle icon       = new Rectangle(descBackground.X + descOffset, descBackground.Y + descOffset, (int)(32 * scaleMultiplier), (int)(32 * scaleMultiplier));
                    spriteBatch.Draw(orionIcon, icon, Color.White);

                    //draw text

                    Utils.DrawBorderString(spriteBatch, orionDescription, new Vector2(barrierBackground.X + barrierBackground.Width * 0.5f, barrierBackground.Y - internalOffset - descSize.Y * 0.5f), Color.White, 0.80f, 0.3f, 0.4f);
                }
                catch (Exception e)
                {
                    ErrorLogger.Log(e.ToString());
                }
            }
        }