Exemplo n.º 1
0
 public override bool CanUseItem(Player player)
 {
     if (!player.ZoneGlowshroom)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.ToadstoolFalse1"), Color.Blue, false);
             }
         }
         return(false);
     }
     if (NPC.AnyNPCs(ModContent.NPCType <TruffleToad>()))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.ToadstoolFalse2"), Color.Blue, false);
             }
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
        public static void SetVariable(string UserName,
                                       string ModuleName, string VarName, object VarValue)
        {
            DataPersistance dp  = BaseFramework.GetDefaultDp();
            UserVariable    Var = new UserVariable();

            Var.UserName   = UserName;
            Var.ModuleName = ModuleName;
            Var.VarName    = VarName;
            Var.VarValue   = string.Empty;
            if (VarValue == null)
            {
                Var.BinValue = null;
            }
            else
            {
                Type tp = VarValue.GetType();
                if (tp == typeof(Bitmap) ||
                    tp == typeof(Image))
                {
                    Helper.ConvertImageToByteArray((Image)VarValue);
                    Var.BinValue = Helper.ConvertImageToByteArray(
                        (Image)VarValue);
                }
                else if (tp == typeof(byte[]))
                {
                    Var.BinValue = (byte[])VarValue;
                }
                else
                {
                    Var.VarValue = BaseUtility.ConvertToString(VarValue);
                }
            }
            Var.Save();
        }
Exemplo n.º 3
0
 public override bool CanUseItem(Player player)
 {
     if (!Main.dayTime)
     {
         if (player.whoAmI == Main.myPlayer)
         {
             BaseUtility.Chat("The bell rings on deaf ears. The dragons are asleep now.", Color.DarkOrange.R, Color.DarkOrange.G, Color.DarkOrange.B, false);
         }
         return(false);
     }
     if (player.GetModPlayer <AAPlayer>(mod).ZoneInferno)
     {
         if (NPC.AnyNPCs(mod.NPCType("Broodmother")))
         {
             if (player.whoAmI == Main.myPlayer)
             {
                 BaseUtility.Chat("The Broodmother has already been called", Color.DarkOrange.R, Color.DarkOrange.G, Color.DarkOrange.B, false);
             }
             return(false);
         }
         return(true);
     }
     if (player.whoAmI == Main.myPlayer)
     {
         BaseUtility.Chat("The bell rings on deaf ears. The dragons are not here.", Color.DarkOrange.R, Color.DarkOrange.G, Color.DarkOrange.B, false);
     }
     return(false);
 }
Exemplo n.º 4
0
        public override void NPCLoot()
        {
            Dead = true;
            if (!Tag)
            {
                npc.DropLoot(Items.Vanity.Mask.YamataMask.type, 1f / 7f);
                if (!Main.expertMode)
                {
                    AAWorld.downedYamata = true;
                    npc.DropLoot(mod.ItemType("DreadScale"), 20, 30);
                    string[] lootTable = { "Flairdra", "Crescent", "Hydraslayer", "AbyssArrow", "HydraStabber", "MidnightWrath", "YamataTerratool" };
                    int loot = Main.rand.Next(lootTable.Length);
                    npc.DropLoot(mod.ItemType(lootTable[loot]));
                    npc.DropLoot(Items.Boss.Yamata.YamataTrophy.type, 1f / 10);
                    if (Main.netMode != 1) BaseUtility.Chat(Lang.BossChat("Yamata1"), new Color(45, 46, 70));
                    npc.DropLoot(Items.Vanity.Mask.YamataMask.type, 1f / 7);
                    if (!AAWorld.downedYamata)
                    {
                        if (Main.netMode != 1) BaseUtility.Chat(Lang.BossChat("Yamata2"), Color.Indigo);
                    }
                }
                if (Main.expertMode)
                {
                    int npcID = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("YamataTransition"), 0, 0, 0, 0, 0, npc.target);
                    Main.npc[npcID].Center = npc.Center;
                    Main.npc[npcID].netUpdate2 = true; Main.npc[npcID].netUpdate = true;
                }
                npc.value = 0f;
                npc.boss = false;
            }

        }
Exemplo n.º 5
0
        public override void NPCLoot()
        {
            int Ashe = NPC.CountNPCS(mod.NPCType("Ashe"));

            if (Ashe == 0)
            {
                NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AHDeath>());
                if (Main.expertMode)
                {
                    npc.DropBossBags();
                }
            }
            if (!Main.expertMode)
            {
                string[] lootTableH = { "HarukaKunai", "Masamune", "MizuArashi", "HarukaBox" };
                int      lootH      = Main.rand.Next(lootTableH.Length);
                npc.DropLoot(mod.ItemType(lootTableH[lootH]));
            }
            if (Main.rand.Next(10) == 0)
            {
                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HarukaTrophy"));
            }
            NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <HarukaVanish>());
            if (Main.netMode != 1)
            {
                BaseUtility.Chat(Lang.BossChat("HarukaDowned"), new Color(72, 78, 117));
            }
            npc.value = 0f;
            npc.boss  = false;
        }
Exemplo n.º 6
0
 public override bool CanUseItem(Player player)
 {
     if (Main.dayTime)
     {
         if (player.whoAmI == Main.myPlayer)
         {
             BaseUtility.Chat("Nothing is coming. The creatures of the Mire sleep.", Color.Indigo.R, Color.Indigo.G, Color.Indigo.B, false);
         }
         return(false);
     }
     if (player.GetModPlayer <AAPlayer>(mod).ZoneMire)
     {
         if (NPC.AnyNPCs(mod.NPCType("Hydra")))
         {
             if (player.whoAmI == Main.myPlayer)
             {
                 BaseUtility.Chat("The Hydra wants that food.", Color.Indigo.R, Color.Indigo.G, Color.Indigo.B, false);
             }
             return(false);
         }
         return(true);
     }
     if (player.whoAmI == Main.myPlayer)
     {
         BaseUtility.Chat("Nothing is coming. Now you look dumb holding out this smelly ball of gunk.", Color.Indigo.R, Color.Indigo.G, Color.Indigo.B, false);
     }
     return(false);
 }
Exemplo n.º 7
0
        public override bool NewRightClick(int i, int j)
        {
            Player player = Main.LocalPlayer;
            Tile   tile   = Main.tile[i, j];
            int    spawnX = i - (tile.frameX / 18);
            int    spawnY = j + 2;

            spawnX += tile.frameX >= 72 ? 5 : 2;
            if (tile.frameY % 38 != 0)
            {
                spawnY--;
            }
            player.FindSpawn();
            if (player.SpawnX == spawnX && player.SpawnY == spawnY)
            {
                player.RemoveSpawn();
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.TilesInfo("Spawnpointremoved"), 255, 240, 20, false);
                }
            }
            else if (Player.CheckSpawn(spawnX, spawnY))
            {
                player.ChangeSpawn(spawnX, spawnY);
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.TilesInfo("Spawnpointset"), 255, 240, 20, false);
                }
            }
            return(true);
        }
Exemplo n.º 8
0
 // We use the CanUseItem hook to prevent a player from using this item while the boss is present in the world.
 public override bool CanUseItem(Player player)
 {
     if (player.GetModPlayer <AAPlayer>(mod).ZoneVoid)
     {
         if (NPC.AnyNPCs(mod.NPCType("Zero")))
         {
             if (player.whoAmI == Main.myPlayer)
             {
                 BaseUtility.Chat("ERR0R. ZER0 UNIT ALREADY ACTIVE. PLEASE TRY AGAIN LATER.", new Color(255, 0, 0), false);
             }
             return(false);
         }
         if (NPC.AnyNPCs(mod.NPCType("ZeroAwakened")))
         {
             if (player.whoAmI == Main.myPlayer)
             {
                 BaseUtility.Chat("ERR0R. ZER0 UNIT ALREADY ACTIVE. PLEASE TRY AGAIN LATER.", new Color(255, 0, 0), false);
             }
             return(false);
         }
         return(true);
     }
     if (player.whoAmI == Main.myPlayer)
     {
         BaseUtility.Chat("ERR0R. PLAYER.GETM0DPLAYER<AAPLAYER>(M0D).Z0NEV0ID == FALSE. PLEASE TRY AGAIN LATER.", new Color(255, 0, 0), false);
     }
     return(false);
 }
Exemplo n.º 9
0
 public override bool CanUseItem(Player player)
 {
     if (player.ZoneGlowshroom)
     {
         return(true);
     }
     if (!player.ZoneGlowshroom)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.ConfusingMushroomFalse1"), Color.SkyBlue, false);
             }
         }
         return(false);
     }
     if (NPC.AnyNPCs(ModContent.NPCType <NPCs.Bosses.FeudalFungus.FeudalFungus>()))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.ConfusingMushroomFalse2"), Color.SkyBlue, false);
             }
         }
         return(false);
     }
     return(false);
 }
Exemplo n.º 10
0
 public override bool UseItem(Player player)
 {
     if (Main.netMode == 0)
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.EquinoxWormawoken"), 175, 75, 255, false);
         }
     }
     else if (Main.netMode == 2)
     {
         if (Main.netMode == NetmodeID.SinglePlayer)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.EquinoxWormawoken"), 175, 75, 255, false);
             }
         }
         else if (Main.netMode == NetmodeID.Server)
         {
             NetMessage.BroadcastChatMessage(NetworkText.FromLiteral(Language.GetTextValue("Mods.AAMod.Common.EquinoxWormawoken")), new Color(175, 75, 255), -1);
         }
     }
     AAModGlobalNPC.SpawnBoss(player, mod.NPCType("DaybringerHead"), false, 0, 0);
     AAModGlobalNPC.SpawnBoss(player, mod.NPCType("NightcrawlerHead"), false, 0, 0);
     Main.PlaySound(SoundID.Roar, player.position, 0);
     return(true);
 }
Exemplo n.º 11
0
 public override bool CanUseItem(Player player)
 {
     if (!player.ZoneDesert)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.DjinnLampDesertFalse1"), Color.Goldenrod.R, Color.Goldenrod.G, Color.Goldenrod.B, false);
             }
         }
         return(false);
     }
     if (NPC.AnyNPCs(mod.NPCType("Djinn")))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.DjinnLampDesertFalse2"), Color.Goldenrod.R, Color.Goldenrod.G, Color.Goldenrod.B, false);
             }
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 12
0
        public static void SetVariable(string ProductName, string RoleName,
                                       string ModuleName, string VarName, object VarValue)
        {
            RoleVariable Var = new RoleVariable();

            Var.ProductName = ProductName;
            Var.RoleName    = RoleName;
            Var.ModuleName  = ModuleName;
            Var.VarName     = VarName;
            Var.VarValue    = string.Empty;
            if (VarValue == null)
            {
                Var.BinValue = null;
            }
            else
            {
                Type tp = VarValue.GetType();
                if (tp == typeof(Bitmap) ||
                    tp == typeof(Image))
                {
                    Helper.ConvertImageToByteArray((Image)VarValue);
                    Var.BinValue = Helper.ConvertImageToByteArray(
                        (Image)VarValue);
                }
                else if (tp == typeof(byte[]))
                {
                    Var.BinValue = (byte[])VarValue;
                }
                else
                {
                    Var.VarValue = BaseUtility.ConvertToString(VarValue);
                }
            }
            Var.Save();
        }
Exemplo n.º 13
0
 public override void PostUpdate()
 {
     if (item.lavaWet)
     {
         Player player = Main.player[Player.FindClosest(item.Center, item.width, item.height)];
         for (int i = 0; i < Main.maxPlayers; ++i)
         {
             if (player.active && !player.dead)
             {
                 int bunnyKills = NPC.killCount[Item.NPCtoBanner(NPCID.Bunny)];
                 if (bunnyKills % 100 == 0 && bunnyKills < 1000)
                 {
                     if (Main.netMode != 1)
                     {
                         BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.RoyalRabbitSummoned1"), 107, 137, 179);
                     }
                     Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Sounds/Rajah"), player.Center);
                     AAModGlobalNPC.SpawnRajah(player, true, new Vector2(player.Center.X, player.Center.Y - 2000), Language.GetTextValue("Mods.AAMod.Common.RajahRabbit"));
                 }
                 if (bunnyKills % 100 == 0 && bunnyKills >= 1000)
                 {
                     if (Main.netMode != 1)
                     {
                         BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.RoyalRabbitSummoned2") + player.name.ToUpper() + "!", 107, 137, 179);
                     }
                     Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Sounds/Rajah"), player.Center);
                     AAModGlobalNPC.SpawnRajah(player, true, new Vector2(player.Center.X, player.Center.Y - 2000), Language.GetTextValue("Mods.AAMod.Common.RajahRabbit"));
                 }
                 ;
             }
         }
         item.active = false;
     }
 }
Exemplo n.º 14
0
 public override void BossLoot(ref string name, ref int potionType)
 {
     if (Main.expertMode)
     {
         potionType = ItemID.SuperHealingPotion;
     }
     else
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA5"), new Color(146, 30, 68));
         }
     }
     if (!AAWorld.downedYamata)
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA2"), new Color(146, 30, 68));
         }
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA3"), Color.Indigo);
         }
     }
     else
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA4"), new Color(146, 30, 68));
         }
     }
 }
Exemplo n.º 15
0
        public override void NPCLoot()
        {
            if (Main.expertMode)
            {
                if (!AAWorld.downedZero)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        BaseUtility.Chat(AAMod.Lang.BossChat("ZeroAwakened1"), Color.PaleVioletRed);
                    }
                    Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("ZeroRune"));
                }

                AAWorld.downedZero = true;

                if (Main.rand.Next(10) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("ZeroTrophy"));
                }
                if (Main.rand.Next(7) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("ZeroMask"));
                }
                if (Main.rand.Next(50) == 0 && AAWorld.downedShen)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("EXSoul"));
                }
                for (int i = 0; i < 10; i++)
                {
                    npc.DropBossBags();
                }
                return;
            }
        }
Exemplo n.º 16
0
 public override bool UseItem(Player player)
 {
     AAWorld.spawnGrips = false;
     if (Main.netMode == 0)
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Grips.GripsofChaosAwoken"), 175, 75, 255, false);
         }
     }
     else if (Main.netMode == 2)
     {
         if (Main.netMode == NetmodeID.SinglePlayer)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Grips.GripsofChaosAwoken"), 175, 75, 255, false);
             }
         }
         else if (Main.netMode == NetmodeID.Server)
         {
             NetMessage.BroadcastChatMessage(NetworkText.FromLiteral(Language.GetTextValue("Mods.AAMod.Grips.GripsofChaosAwoken")), new Color(175, 75, 255), -1);
         }
     }
     AAModGlobalNPC.SpawnBoss(player, mod.NPCType("GripOfChaosBlue"), false, 1, 0);
     AAModGlobalNPC.SpawnBoss(player, mod.NPCType("GripOfChaosRed"), false, -1, 0);
     Main.PlaySound(SoundID.Roar, player.position, 0);
     return(true);
 }
Exemplo n.º 17
0
 public override bool CanUseItem(Player player)
 {
     if (NPC.AnyNPCs(ModContent.NPCType <GripOfChaosBlue>()) || NPC.AnyNPCs(ModContent.NPCType <GripOfChaosRed>()))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.InterestingClawFalse1"), Color.Indigo, false);
             }
         }
         return(false);
     }
     if (Main.dayTime)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.InterestingClawFalse2"), Color.Indigo, false);
             }
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 18
0
        public override bool NewRightClick(int i, int j)
        {
            Player player = Main.LocalPlayer;
            int    type   = ModContent.ItemType <Items.BossSummons.WormIdol>();
            bool   Worms  = NPC.AnyNPCs(ModContent.NPCType <WormSpawn>());

            if (BasePlayer.HasItem(player, type, 1) && !Worms)
            {
                if (AAWorld.StarActive && AAWorld.GravActive)
                {
                    for (int m = 0; m < 50; m++)
                    {
                        Item item = player.inventory[m];
                        if (item != null && item.type == type && item.stack >= 1)
                        {
                            item.stack--;
                            player.QuickSpawnItem(mod.ItemType("EquinoxWorm"));
                            if (!AAWorld.WormActive)
                            {
                                BaseUtility.Chat(Lang.TheEquinox("WormAltarOK"), new Color(75, 175, 255));
                                SpawnBoss(player, ModContent.NPCType <WormSpawn>(), false, player.Center);
                            }
                        }
                    }
                }
                else
                {
                    BaseUtility.Chat(Lang.TheEquinox("WormAltar"), new Color(75, 175, 255));
                }
            }
            return(true);
        }
Exemplo n.º 19
0
        public override bool PreDraw(SpriteBatch spritebatch, Color dColor)
        {
            Color color = BaseUtility.MultiLerpColor(Main.LocalPlayer.miscCounter % 100 / 100f, BaseDrawing.GetLightColor(npc.position), BaseDrawing.GetLightColor(npc.position), Color.LimeGreen, BaseDrawing.GetLightColor(npc.position), Color.LimeGreen, BaseDrawing.GetLightColor(npc.position));

            BaseDrawing.DrawTexture(spritebatch, Main.npcTexture[npc.type], 0, npc, npc.dontTakeDamage ? color : dColor);
            return(false);
        }
Exemplo n.º 20
0
 public override void SetDefaults()
 {
     npc.width    = 152;
     npc.height   = 114;
     npc.value    = BaseUtility.CalcValue(0, 10, 0, 0);
     npc.npcSlots = 1000;
     npc.aiStyle  = -1;
     npc.lifeMax  = 40000;
     npc.defense  = 20;
     npc.damage   = 90;
     if (NPC.downedMoonlord)
     {
         npc.damage  = 100;
         npc.defense = 45;
         npc.lifeMax = 80000;
     }
     npc.knockBackResist = 0f;
     npc.noGravity       = true;
     npc.HitSound        = SoundID.NPCHit1;
     npc.DeathSound      = SoundID.NPCDeath1;
     npc.boss            = true;
     music             = ModLoader.GetMod("AAMod").GetSoundSlot(SoundType.Music, "Sounds/Music/Athena");
     npc.alpha         = 255;
     npc.noTileCollide = true;
     bossBag           = ModLoader.GetMod("AAMod").ItemType("AthenaBag");
 }
Exemplo n.º 21
0
 public override bool CanUseItem(Player player)
 {
     if (!Main.dayTime)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.IntimidatingMushroomFalse1"), new Color(216, 110, 40), false);
             }
         }
         return(false);
     }
     if (NPC.AnyNPCs(ModContent.NPCType <MushroomMonarch>()))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.IntimidatingMushroomFalse2"), new Color(216, 110, 40), false);
             }
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 22
0
 public void SpawnBoss(Player player, string name, string displayName)
 {
     if (Main.netMode != 1)
     {
         int bossType = mod.NPCType(name);
         if (NPC.AnyNPCs(bossType))
         {
             return;
         }                                      //don't spawn if there's already a boss!
         int npcID = NPC.NewNPC((int)player.Center.X, (int)player.Center.Y, bossType, 0);
         Main.npc[npcID].Center     = player.Center - new Vector2(MathHelper.Lerp(-2000, 2000, (float)Main.rand.NextDouble()), 1200f);
         Main.npc[npcID].netUpdate2 = true;
         string npcName = !string.IsNullOrEmpty(Main.npc[npcID].GivenName) ? Main.npc[npcID].GivenName : displayName;
         if (Main.netMode == NetmodeID.SinglePlayer)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Announcement.HasAwoken", npcName), 175, 75, 255, false);
             }
         }
         else
         if (Main.netMode == NetmodeID.Server)
         {
             NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[]
             {
                 NetworkText.FromLiteral(npcName)
             }), new Color(175, 75, 255), -1);
         }
     }
 }
Exemplo n.º 23
0
        public override void NPCLoot()
        {
            int Ashe = NPC.CountNPCS(mod.NPCType("Ashe"));

            if (Ashe == 0)
            {
                NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("AHDeath"));
                if (Main.expertMode)
                {
                    for (int i = 0; i < 10; i++)
                    {
                        npc.DropBossBags();
                    }
                }
            }
            if (!Main.expertMode)
            {
                string[] lootTableH = { "HarukaKunai", "Masamune", "MizuArashi", "HarukaBox" };
                int      lootH      = Main.rand.Next(lootTableH.Length);
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType(lootTableH[lootH]));
            }
            if (Main.rand.Next(10) == 0)
            {
                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("HarukaTrophy"));
            }
            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                BaseUtility.Chat(AAMod.Lang.BossChat("HarukaDowned"), new Color(72, 78, 117));
            }
            NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("HarukaVanish"));
        }
Exemplo n.º 24
0
 public override bool CanUseItem(Player player)
 {
     if (!player.ZoneSnow)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.SubzeroCrystalSnowZoneFalse"), Color.Cyan.R, Color.Cyan.G, Color.Cyan.B, false);
             }
         }
         return(false);
     }
     if (NPC.AnyNPCs(mod.NPCType("SerpentHead")))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.SubzeroCrystalFalse"), Color.Cyan.R, Color.Cyan.G, Color.Cyan.B, false);
             }
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 25
0
        public override bool CanUseItem(Player player)
        {
            int   num  = 0;
            float num2 = Main.maxTilesX / 4200;
            int   num3 = (int)(400f * num2);

            for (int j = 5; j < Main.maxTilesX - 5; j++)
            {
                int num4 = 5;
                while (num4 < Main.worldSurface)
                {
                    if (Main.tile[j, num4].active() && Main.tile[j, num4].type == (ushort)ModContent.TileType <Tiles.CometOre>())
                    {
                        num++;
                        if (num > num3)
                        {
                            BaseUtility.Chat("Another comet exists in this world in some form or another already...", new Color(136, 151, 255), true);
                            return(false);
                        }
                    }
                    num4++;
                }
            }
            CWorld.DropMeteor();
            return(true);
        }
Exemplo n.º 26
0
 // We use the CanUseItem hook to prevent a player from using this item while the boss is present in the world.
 public override bool CanUseItem(Player player)
 {
     if (NPC.AnyNPCs(mod.NPCType <ShenDoragon>()))
     {
         if (player.whoAmI == Main.myPlayer)
         {
             BaseUtility.Chat("HAH! I WISH there were two of me to smash you into the ground!", Color.DarkMagenta.R, Color.DarkMagenta.G, Color.DarkMagenta.B, false);
         }
         return(false);
     }
     if (NPC.AnyNPCs(mod.NPCType <ShenA>()))
     {
         if (player.whoAmI == Main.myPlayer)
         {
             BaseUtility.Chat("HAH! I WISH there were two of me to smash you into the ground!", Color.DarkMagenta.R, Color.DarkMagenta.G, Color.DarkMagenta.B, false);
         }
         return(false);
     }
     for (int m = 0; m < Main.maxProjectiles; m++)
     {
         Projectile p = Main.projectile[m];
         if (p != null && p.active && p.type == mod.ProjectileType("ShenTransition"))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 27
0
        public override void NPCLoot()
        {
            int Haruka = NPC.CountNPCS(mod.NPCType("Haruka"));

            if (Haruka == 0)
            {
                NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AHDeath>());
                if (Main.expertMode)
                {
                    npc.DropBossBags();
                }
            }
            if (!Main.expertMode)
            {
                string[] lootTableA = { "AshRain", "FuryFlame", "FireSpiritStaff", "AsheSatchel" };
                int      lootA      = Main.rand.Next(lootTableA.Length);
                npc.DropLoot(mod.ItemType(lootTableA[lootA]));
            }
            if (Main.rand.Next(10) == 0)
            {
                Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("AsheTrophy"));
            }
            int DeathAnim = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AsheVanish>(), 0);

            Main.npc[DeathAnim].velocity = npc.velocity;
            if (Main.netMode != 1)
            {
                BaseUtility.Chat(Lang.BossChat("AsheDowned"), new Color(102, 20, 48));
            }
            npc.value = 0f;
            npc.boss  = false;
        }
Exemplo n.º 28
0
 public override bool CanUseItem(Player player)
 {
     if (!player.GetModPlayer <AAPlayer>().ZoneVoid)
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.LifescannerFalse"), new Color(216, 60, 0), false);
             }
         }
         return(false);
     }
     if (NPC.AnyNPCs(ModContent.NPCType <NPCs.Bosses.Sag.Sag>()))
     {
         if (player.whoAmI == Main.myPlayer && player.itemTime == 0 && player.controlUseItem && player.releaseUseItem)
         {
             if (Main.netMode != 1)
             {
                 BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.LifescannerFalse"), new Color(216, 60, 0), false);
             }
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 29
0
        public override bool UseItem(Player player)
        {
            if (!AAWorld.downedRajahsRevenge)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.DiamondCarrotRajahText1"), 107, 137, 179);
                }
            }
            else
            {
                string Name;
                if (Main.netMode != 0)
                {
                    Name = "Terrarians";
                }
                else
                {
                    Name = Main.LocalPlayer.name;
                }
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Language.GetTextValue("Mods.AAMod.Common.DiamondCarrotRajahText2") + Name + "!", 107, 137, 179);
                }
            }
            int overrideDirection = Main.rand.Next(2) == 0 ? -1 : 1;

            AAModGlobalNPC.SpawnBoss(player, mod.NPCType("SupremeRajah"), false, player.Center + new Vector2(MathHelper.Lerp(500f, 800f, (float)Main.rand.NextDouble()) * overrideDirection, -1200), Language.GetTextValue("Mods.AAMod.Common.SupremeRajah"));
            return(true);
        }
Exemplo n.º 30
0
        public override void NPCLoot()
        {
            if (Main.expertMode)
            {
                if (!AAWorld.downedZero)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("ZeroAwakened1"), Color.PaleVioletRed);
                    }
                    Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("ZeroRune"));
                }
                AAWorld.downedZero = true;

                if (Main.rand.Next(10) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZeroTrophy"));
                }
                if (Main.rand.Next(7) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZeroMask"));
                }
                if (Main.rand.Next(50) == 0 && AAWorld.downedAllAncients)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EXSoul"));
                }
                npc.DropBossBags();
                return;
            }
        }
Exemplo n.º 31
0
 private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
 {
     //utility = new ModbusUtility(ModbusType.Tcp, "192.168.3.247");
     //utility.AddressTranslator = new AddressTranslatorNA200H();
     //object[] getNum = utility.GetDatas(0x02, 0x00, "NW1", new KeyValuePair<Type, int>(typeof(ushort), 4));
     utility = new SimenseUtility(SimenseType.Tcp, "192.168.3.191", SimenseMachineModel.S7_200);
     utility.AddressTranslator = new AddressTranslatorSimense();
     object[] getNum = utility.GetDatas(0x02, 0x00, "V1", new KeyValuePair<Type, int>(typeof(ushort), 4));
     ushort[] getNumUshorts = ValueHelper.Instance.ObjectArrayToDestinationArray<ushort>(getNum);
     SetValue(getNumUshorts);
 }
Exemplo n.º 32
0
 public CrossLampController()
 {
     _utility = new SimenseUtility(SimenseType.Tcp, "192.168.3.241", SimenseMachineModel.S7_200);
     _utility.AddressTranslator = new AddressTranslatorSimense();
 }