public override void UpdateInventory(Player player) { if (ModSupport.GetMod("CalamityMod") == null) { item.TurnToAir(); } }
public override void OpenBossBag(Player player) { if (Main.rand.Next(7) == 0) { player.QuickSpawnItem(mod.ItemType("RajahMask")); } if (Main.rand.Next(10) == 0) { AAPlayer modPlayer = player.GetModPlayer <AAPlayer>(); modPlayer.PMLDevArmor(); } player.QuickSpawnItem(Terraria.ModLoader.ModContent.ItemType <RajahPelt>(), Main.rand.Next(15, 31)); player.QuickSpawnItem(mod.ItemType("RajahPelt"), Main.rand.Next(20, 25)); player.QuickSpawnItem(mod.ItemType("RajahSash")); string[] lootTable = { "BaneOfTheBunny", "Bunzooka", "Punisher", "RabbitcopterEars", "RoyalScepter" }; int loot = Main.rand.Next(lootTable.Length); if (Main.rand.Next(6) == 1 && ModSupport.GetMod("ThoriumMod") != null) { player.QuickSpawnItem(mod.ItemType("CarrotFarmer")); } else { player.QuickSpawnItem(mod.ItemType(lootTable[loot])); } }
public override void UpdateInventory(Player player) { if (ModSupport.GetMod("ThoriumMod") != null) { item.TurnToAir(); } }
public override void AddRecipes() { if (ModSupport.GetMod("ThoriumMod") == null) { return; } ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "IncineriteBar", 8); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); }
public override void NPCLoot() { if (Main.netMode != 1) { for (int m = 0; m < 8; m++) { BaseAI.FireProjectile(npc.Center + new Vector2(velocitiesX[m], velocitiesY[m]), npc.Center, mod.ProjType("BugAcidShot"), 0, 0f, 5f); } } BaseAI.DropItem(npc, mod.ItemType("AcidSac"), 1 + Main.rand.Next(2) + (Main.expertMode ? 2 : 0), 2, 65, true); if (ModSupport.GetMod("CalamityMod") != null) { BaseAI.DropItem(npc, ModSupport.GetModItem("CalamityMod", "BeetleJuice").item.type, 1, 1, 65, true); BaseAI.DropItem(npc, ModSupport.GetModItem("CalamityMod", "EssenceofCinder").item.type, 1, 1, Main.expertMode ? 20 : 15, true); } }
public override void AddRecipes() { if (ModSupport.GetMod("ThoriumMod") == null) { return; } ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(1306); recipe.AddIngredient(ItemID.AdamantiteBar, 8); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(1306); recipe.AddIngredient(ItemID.TitaniumBar, 8); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); }
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (ModSupport.GetMod("CalamityMod") != null) { int num = Projectile.NewProjectile(position, new Vector2(speedX, speedY), mod.ProjectileType("Noodle"), damage, knockBack, player.whoAmI, 0f, 1f); Main.projectile[num].GetGlobalProjectile <RogueProj>().rogue = true; if (player.GetModPlayer <RoguePlayer>().StealthStrikeAvailable) //Stealth Strike { float scaleFactor = 15f; int num5 = 25; Projectile.NewProjectile(player.position, new Vector2(1f, 0f) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, new Vector2(0f, 1f) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, new Vector2(-1f, 0f) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, new Vector2(0f, -1f) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, Vector2.Normalize(new Vector2(1f, 1f)) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, Vector2.Normalize(new Vector2(1f, -1f)) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, Vector2.Normalize(new Vector2(-1f, -1f)) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); Projectile.NewProjectile(player.position, Vector2.Normalize(new Vector2(-1f, 1f)) * scaleFactor, mod.ProjectileType("Noodle"), num5, 2f, player.whoAmI, 0f, 0f); } return(false); } return(true); }
public override void AI() { if (Main.expertMode) { damage = npc.damage / 4; } else { damage = npc.damage / 2; } AAModGlobalNPC.Rajah = npc.whoAmI; WeaponPos = new Vector2(npc.Center.X + (npc.direction == 1 ? -78 : 78), npc.Center.Y - 9); StaffPos = new Vector2(npc.Center.X + (npc.direction == 1 ? 78 : -78), npc.Center.Y - 9); if (Roaring) { roarTimer--; } if (Main.netMode != 1 && npc.type == ModContent.NPCType <SupremeRajah>() && isSupreme == false) { isSupreme = true; npc.netUpdate = true; } if (isSupreme) { if (npc.ai[3] != 0 && !DefenseLine && !AAWorld.downedRajahsRevenge && Main.netMode != 1) { DefenseLine = true; BaseUtility.Chat("Rajah glows with furious energy as he attacks, strengthening his defenses", Color.MediumPurple); } if (npc.life <= npc.lifeMax / 7 && !SayLine && Main.netMode != 1) { SayLine = true; string Name; int bunnyKills = NPC.killCount[Item.NPCtoBanner(NPCID.Bunny)]; if (bunnyKills >= 100 && !AAWorld.downedRajahsRevenge) { Name = "MUDERER"; } else { if (Main.netMode != 0) { Name = "Terrarians"; } else if (!AAWorld.downedRajahsRevenge) { Name = "Terrarian"; } else { Name = Main.LocalPlayer.name; } } if (Main.netMode != 1) { BaseUtility.Chat(Lang.BossChat("Rajah5") + Name.ToUpper() + Lang.BossChat("Rajah6"), 107, 137, 179); } music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/LastStand"); } } Player player = Main.player[npc.target]; if (npc.target >= 0 && Main.player[npc.target].dead) { npc.TargetClosest(true); if (Main.player[npc.target].dead) { if (isSupreme) { if (Main.netMode != 1) { BaseUtility.Chat(Lang.BossChat("Rajah7"), 107, 137, 179); } if (Main.netMode != 1) { Projectile.NewProjectile(npc.position, npc.velocity, ModContent.ProjectileType <SupremeRajahBookIt>(), damage, 0, Main.myPlayer); } } else { if (Main.netMode != 1) { BaseUtility.Chat(Lang.BossChat("Rajah2"), 107, 137, 179); } if (Main.netMode != 1) { Projectile.NewProjectile(npc.position, npc.velocity, ModContent.ProjectileType <RajahBookIt>(), damage, 0, Main.myPlayer); } } npc.active = false; npc.noTileCollide = true; npc.netUpdate = true; return; } } if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) + Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > 10000) { npc.TargetClosest(true); if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) + Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > 10000) { if (Main.netMode != 1) { BaseUtility.Chat(Lang.BossChat("Rajah3"), 107, 137, 179); } if (Main.netMode != 1) { if (isSupreme) { Projectile.NewProjectile(npc.position, npc.velocity, ModContent.ProjectileType <SupremeRajahBookIt>(), damage, 0, Main.myPlayer); //Originally 100 damage } else { Projectile.NewProjectile(npc.position, npc.velocity, ModContent.ProjectileType <RajahBookIt>(), damage, 0, Main.myPlayer); } } npc.active = false; npc.noTileCollide = true; npc.netUpdate = true; return; } } if (player.Center.X < npc.Center.X) { npc.direction = 1; } else { npc.direction = -1; } if (player.Center.Y < npc.position.Y - 30f || TileBelowEmpty() || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) + Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > 2000 || isDashing) { npc.noGravity = true; FlyAI(); } else { npc.noTileCollide = false; npc.noGravity = false; isDashing = false; JumpAI(); } if (npc.target <= 0 || npc.target == 255 || Main.player[npc.target].dead) { npc.TargetClosest(true); } if (Main.netMode != 1) { npc.ai[2]++; internalAI[3]++; } if (npc.ai[2] >= 500) { internalAI[3] = 0; npc.ai[2] = 0; npc.ai[3] = 0; npc.netUpdate = true; } else if (npc.ai[3] == 0 && npc.ai[2] >= ChangeRate()) { if (Main.rand.Next(5) == 0) { Roar(roarTimerMax); } if (Main.netMode != 1) { internalAI[3] = 0; npc.ai[2] = 0; if (ModSupport.GetMod("ThoriumMod") != null && Main.rand.Next(7) == 0) { npc.ai[3] = 7; } else { if (isSupreme) { npc.ai[3] = Main.rand.Next(7); } else { npc.ai[3] = Main.rand.Next(4); } } } npc.netUpdate = true; } if (Main.netMode != 1) { if (npc.ai[3] == 0) //Minion Phase { if (internalAI[3] >= 80) { internalAI[3] = 0; if (internalAI[1] == 0) { if (NPC.CountNPCS(ModContent.NPCType <RabbitcopterSoldier>()) + AAGlobalProjectile.CountProjectiles(ModContent.ProjectileType <BunnySummon1>()) < 5) { Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon1>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 200, (int)npc.Center.X + 200), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon1>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 200, (int)npc.Center.X + 200), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon1>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 200, (int)npc.Center.X + 200), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); } npc.netUpdate = true; } else { if (npc.ai[1] > 2) { npc.ai[1] = 0; } if (npc.ai[1] == 0) { if (NPC.CountNPCS(ModContent.NPCType <RabbitcopterSoldier>()) + AAGlobalProjectile.CountProjectiles(ModContent.ProjectileType <BunnySummon1>()) < 5) { Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon1>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon1>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon1>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); } } else if (npc.ai[1] == 1) { if (NPC.CountNPCS(ModContent.NPCType <BunnyBrawler>()) + AAGlobalProjectile.CountProjectiles(ModContent.ProjectileType <BunnySummon2>()) < 5) { Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon2>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon2>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); } } else if (npc.ai[1] == 2) { if (NPC.CountNPCS(ModContent.NPCType <BunnyBattler>()) + AAGlobalProjectile.CountProjectiles(ModContent.ProjectileType <BunnySummon3>()) < 8) { Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon3>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon3>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon3>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); Projectile.NewProjectile(StaffPos, Vector2.Zero, ModContent.ProjectileType <BunnySummon3>(), 0, 0, Main.myPlayer, Main.rand.Next((int)npc.Center.X - 500, (int)npc.Center.X + 500), Main.rand.Next((int)npc.Center.Y - 200, (int)npc.Center.Y - 50)); } } npc.ai[1] += 1; npc.netUpdate = true; } } } else if (npc.ai[3] == 1) //Bunzooka { if (internalAI[3] > 40) { internalAI[3] = 0; int Rocket = isSupreme ? ModContent.ProjectileType <RajahRocketEXR>() : ModContent.ProjectileType <RajahRocket>(); Vector2 dir = Vector2.Normalize(player.Center - WeaponPos); dir *= ProjSpeed(); Projectile.NewProjectile(WeaponPos.X, WeaponPos.Y, dir.X, dir.Y, Rocket, damage, 5, Main.myPlayer); npc.netUpdate = true; } } else if (npc.ai[3] == 2) //Royal Scepter { int carrots = isSupreme ? 5 : 3; int carrotType = isSupreme ? mod.ProjectileType("CarrotEXR") : mod.ProjectileType("CarrotHostile"); float spread = 45f * 0.0174f; Vector2 dir = Vector2.Normalize(player.Center - WeaponPos); dir *= ProjSpeed(); float baseSpeed = (float)Math.Sqrt((dir.X * dir.X) + (dir.Y * dir.Y)); double startAngle = Math.Atan2(dir.X, dir.Y) - .1d; double deltaAngle = spread / carrots * 2; if (internalAI[3] > 40) { internalAI[3] = 0; for (int i = 0; i < carrots; i++) { double offsetAngle = startAngle + (deltaAngle * i); Projectile.NewProjectile(WeaponPos.X, WeaponPos.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), carrotType, damage, 5, Main.myPlayer, 0); } npc.netUpdate = true; } } else if (npc.ai[3] == 3) //Javelin { int Javelin = isSupreme ? ModContent.ProjectileType <BaneTEXR>() : ModContent.ProjectileType <BaneR>(); if (internalAI[3] == (isSupreme ? 40 : 60)) { Vector2 dir = Vector2.Normalize(player.position - WeaponPos); dir *= ProjSpeed(); Projectile.NewProjectile(WeaponPos.X, WeaponPos.Y, dir.X, dir.Y, Javelin, damage, 5, Main.myPlayer); } if (internalAI[3] > (isSupreme ? 60 : 90)) { internalAI[3] = 0; } npc.netUpdate = true; } else if (npc.ai[3] == 4) //Excalihare { if (internalAI[3] > 40) { internalAI[3] = 0; Vector2 dir = Vector2.Normalize(player.Center - WeaponPos); dir *= ProjSpeed(); Projectile.NewProjectile(WeaponPos.X, WeaponPos.Y, dir.X, dir.Y, ModContent.ProjectileType <ExcalihareR>(), damage, 5, Main.myPlayer); npc.netUpdate = true; } } else if (npc.ai[3] == 5) //Fluffy Fury { int Arrows = Main.rand.Next(2, 4); float spread = 45f * 0.0174f; Vector2 dir = Vector2.Normalize(player.Center - WeaponPos); dir *= ProjSpeed(); float baseSpeed = (float)Math.Sqrt((dir.X * dir.X) + (dir.Y * dir.Y)); double startAngle = Math.Atan2(dir.X, dir.Y) - .1d; double deltaAngle = spread / (Arrows * 2); if (internalAI[3] > 50) { internalAI[3] = 0; for (int i = 0; i < Arrows; i++) { double offsetAngle = startAngle + (deltaAngle * i); Projectile.NewProjectile(WeaponPos.X, WeaponPos.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), mod.ProjectileType("CarrowR"), damage, 5, Main.myPlayer); } npc.netUpdate = true; } } else if (npc.ai[3] == 6) //Rabbits Wrath { if (internalAI[3] > 5) { internalAI[3] = 0; Vector2 vector12 = new Vector2(player.Center.X, player.Center.Y); float num75 = 14f; for (int num120 = 0; num120 < 3; num120++) { Vector2 vector2 = player.Center + new Vector2(-(float)Main.rand.Next(0, 401) * player.direction, -600f); vector2.Y -= 120 * num120; Vector2 vector13 = vector12 - vector2; if (vector13.Y < 0f) { vector13.Y *= -1f; } if (vector13.Y < 20f) { vector13.Y = 20f; } vector13.Normalize(); vector13 *= num75; float num82 = vector13.X; float num83 = vector13.Y; float speedX5 = num82; float speedY6 = num83 + Main.rand.Next(-40, 41) * 0.02f; int p = Projectile.NewProjectile(vector2.X, vector2.Y, speedX5, speedY6, ModContent.ProjectileType <CarrotEXR>(), damage, 6, Main.myPlayer, 0, 0); Main.projectile[p].tileCollide = false; } npc.netUpdate = true; } } else if (npc.ai[3] == 7) //Carrot Farmer { if (!AAGlobalProjectile.AnyProjectiles(ModContent.ProjectileType <CarrotFarmerR>())) { Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType <CarrotFarmerR>(), damage, 3f, Main.myPlayer, npc.whoAmI); npc.netUpdate = true; } } } if (Main.expertMode) { if (npc.life < (npc.lifeMax * .85f)) //The lower the health, the more damage is done { npc.damage = (int)(npc.defDamage * 1.1f); } if (npc.life < (npc.lifeMax * .7f)) { npc.damage = (int)(npc.defDamage * 1.3f); } if (npc.life < (npc.lifeMax * .65f)) { npc.damage = (int)(npc.defDamage * 1.5f); } if (npc.life < (npc.lifeMax * .4f)) { npc.damage = (int)(npc.defDamage * 1.7f); } if (npc.life < (npc.lifeMax * .25f)) { npc.damage = (int)(npc.defDamage * 1.9f); } if (npc.life < (npc.lifeMax / 7)) { npc.damage = (int)(npc.defDamage * 2.2f); } } else { if (npc.life == npc.lifeMax / 7) { npc.damage = (int)(npc.defDamage * 1.5f); } } npc.rotation = 0; }