public override bool CheckDead() { if (Phase == (int)AIStates.Dying && GlobalTimer >= 659) { foreach (NPC npc in Main.npc.Where(n => n.modNPC is VitricBackdropLeft || n.modNPC is VitricBossPlatformUp)) { npc.active = false; //reset arena } StarlightWorld.Flag(WorldFlags.GlassBossDowned); return(true); } ChangePhase(AIStates.Dying, true); npc.dontTakeDamage = true; npc.friendly = true; npc.life = 1; foreach (Player player in Main.player.Where(n => n.Hitbox.Intersects(arena))) { player.GetModPlayer <StarlightPlayer>().ScreenMoveTarget = homePos; player.GetModPlayer <StarlightPlayer>().ScreenMoveTime = 720; player.immuneTime = 720; player.immune = true; } if (Phase == (int)AIStates.Dying && GlobalTimer >= 659) { return(true); } else { return(false); } }
public override bool NewRightClick(int i, int j) { Tile tile = (Tile)Framing.GetTileSafely(i, j).Clone(); Player player = Main.LocalPlayer; if (tile.frameX >= 90 && player.ConsumeItem(ItemType <Items.Vitric.GlassIdol>())) { (Dummy.modProjectile as VitricBossAltarDummy).SpawnBoss(); return(true); } else { for (int x = 0; x < 5; x++) { for (int y = 0; y < 7; y++) { int realX = x + i - (tile.frameX - 90) / 18; int realY = y + j - (tile.frameY) / 18; Framing.GetTileSafely(realX, realY).frameX -= 90; } } StarlightWorld.FlipFlag(WorldFlags.GlassBossOpen); } return(false); }
private void PostDrawPlayer(On.Terraria.Main.orig_DrawPlayer orig, Main self, Player drawPlayer, Vector2 Position, float rotation, Vector2 rotationOrigin, float shadow) //TODO: Generalize this for later use, and possibly optimize it also { orig(self, drawPlayer, Position, rotation, rotationOrigin, shadow); if (Main.gameMenu) { return; } for (int i = (int)Main.screenPosition.X / 16; i < (int)Main.screenPosition.X / 16 + Main.screenWidth / 16; i++) { for (int j = (int)Main.screenPosition.Y / 16; j < (int)Main.screenPosition.Y / 16 + Main.screenWidth / 16; j++) { if (i > 0 && j > 0 && i < Main.maxTilesX && j < Main.maxTilesY && Main.tile[i, j] != null && Main.tile[i, j].type == TileType <GrassOvergrow>()) { GrassOvergrow.CustomDraw(i, j, Main.spriteBatch); } } } //Temple shroud, TODO: move this somewhere more sane later. Im crunched for time rn. if (Helper.OnScreen(BiomeHandler.GlassTempleZone) && (!StarlightWorld.HasFlag(WorldFlags.DesertOpen) || !drawPlayer.GetModPlayer <BiomeHandler>().ZoneGlassTemple)) { //Main.spriteBatch.Draw(GetTexture("StarlightRiver/Assets/TempleBlock"), (BiomeHandler.GlassTempleZone.TopLeft() + new Vector2(1, 8)) * 16 - Main.screenPosition, Color.Black); } }
public override void NearbyEffects(int i, int j, bool closer) { if (!StarlightWorld.HasFlag(WorldFlags.SquidBossOpen) && !Main.projectile.Any(n => n.active && n.type == ProjectileType <DoorBomb>())) { Projectile.NewProjectile(new Vector2(i + 1, j + 0.5f) * 16, new Vector2(1, 0), ProjectileType <DoorBomb>(), 0, 0); } }
public override void AI() { /* AI fields: * 0: timer * 1: activation state, im too lazy to create an enum for this so: (0 = hidden, 1 = rising, 2 = still, 3 = scrolling, 4 = resetting) * 2: scrolling timer * 3: */ if (StarlightWorld.HasFlag(WorldFlags.GlassBossOpen) && npc.ai[1] == 0) { npc.ai[1] = 1; //when the altar is hit, make the BG rise out of the ground } if (npc.ai[1] == 1) { SpawnPlatforms(); if (npc.ai[0] == Risetime - 1) //hitting the top { Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += 18; Main.PlaySound(SoundID.NPCDeath9); } if (npc.ai[0]++ > Risetime) { npc.ai[1] = 2; } if (npc.ai[0] % 10 == 0) { Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += npc.ai[0] < 100 ? 5 : 3; } for (int k = 0; k < 18; k++) { Dust.NewDust(npc.position, 560, 1, DustType <Dusts.Sand>(), 0, Main.rand.NextFloat(-5f, -1f), Main.rand.Next(255), default, Main.rand.NextFloat(1.5f)); //spawns dust
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { if (!StarlightWorld.HasFlag(WorldFlags.DesertOpen) || !Main.LocalPlayer.GetModPlayer <BiomeHandler>().ZoneGlassTemple) { return; } Lighting.AddLight(new Vector2(i * 16, j * 16), new Vector3(125, 162, 158) * 0.003f); }
public override void NearbyEffects(int i, int j, bool closer) { Tile tile = Framing.GetTileSafely(i, j); if (StarlightWorld.HasFlag(WorldFlags.DesertOpen) && tile.frameX == 0 && !Main.npc.Any(n => n.active && n.type == NPCType <Boulder>())) { NPC.NewNPC(i * 16 + 48, j * 16, NPCType <Boulder>(), 0, j * 16); } }
public override bool CheckDead() { NPC.NewNPC((StarlightWorld.VitricBiome.X - 10) * 16, (StarlightWorld.VitricBiome.Center.Y + 12) * 16, NPCType <GlassweaverTown>()); StarlightWorld.Flag(WorldFlags.DesertOpen); Main.NewText("The temple doors slide open...", new Color(200, 170, 80)); return(true); }
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (!StarlightWorld.HasFlag(WorldFlags.DesertOpen) || !Main.LocalPlayer.GetModPlayer <BiomeHandler>().ZoneGlassTemple) { return; } r = 125 * 0.003f; g = 162 * 0.003f; b = 158 * 0.003f; }
public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { if (!StarlightWorld.HasFlag(WorldFlags.SquidBossOpen)) { Vector2 pos = (new Vector2(i, j) + Helper.TileAdj) * 16 - Main.screenPosition + new Vector2(18, -42); Utils.DrawBorderString(spriteBatch, "Place blocks on", pos, Color.White, 0.7f); Utils.DrawBorderString(spriteBatch, "BLUE", pos + new Vector2(90, 0), Color.DeepSkyBlue, 0.7f); Utils.DrawBorderString(spriteBatch, "squares", pos + new Vector2(130, 0), Color.White, 0.7f); } }
public override bool UseItem(Player player) { //NPC.NewNPC((StarlightWorld.VitricBiome.X - 10) * 16, (StarlightWorld.VitricBiome.Center.Y + 12) * 16, NPCType<NPCs.Miniboss.Glassweaver.GlassweaverWaiting>()); //StarlightWorld.knownRecipies.Clear(); //StarlightWorld.AshHellGen(new Terraria.World.Generation.GenerationProgress()); StarlightWorld.FlipFlag(WorldFlags.SquidBossDowned); return(true); }
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { if (Main.tile[i, j].frameX == 0 && Main.tile[i, j].frameY == 0) { Texture2D tex = Main.tileTexture[Type]; Vector2 basepos = (new Vector2(i, j) + Helper.TileAdj) * 16 - Main.screenPosition; int off = StarlightWorld.HasFlag(WorldFlags.DesertOpen) ? 46 : 0; spriteBatch.Draw(tex, basepos + new Vector2(-off, 0), tex.Frame(), drawColor, 0, Vector2.Zero, 1, 0, 0); spriteBatch.Draw(tex, basepos + new Vector2(tex.Width + off, 0), tex.Frame(), drawColor, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0); } }
public override void NearbyEffects(int i, int j, bool closer) { if (StarlightWorld.HasFlag(WorldFlags.DesertOpen) && !Main.npc.Any(n => n.type == NPCType <Bosses.GlassBoss.VitricBoss>() && n.active)) { Main.tileSolid[Type] = false; } else { Main.tileSolid[Type] = true; } }
public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { if (!StarlightWorld.HasFlag(WorldFlags.DesertOpen) || !Main.LocalPlayer.GetModPlayer <BiomeHandler>().ZoneGlassTemple) { return; } Texture2D tex = GetTexture(AssetDirectory.RiftCrafting + "Glow0"); Texture2D tex2 = GetTexture(AssetDirectory.RiftCrafting + "Glow1"); spriteBatch.End(); spriteBatch.Begin(default, BlendState.Additive);
public override void NearbyEffects(int i, int j, bool closer) { Tile tile = Framing.GetTileSafely(i, j); if (StarlightWorld.HasFlag(WorldFlags.DesertOpen)) { tile.inActive(true); } else { tile.inActive(false); } }
public override void AI() { if (!StarlightWorld.HasFlag(WorldFlags.OvergrowBossOpen)) { npc.dontTakeDamage = true; } else { npc.dontTakeDamage = false; } NPC boss = Main.npc.FirstOrDefault(n => n.active && n.type == NPCType <OvergrowBoss>()); if (boss == null) { return; } if (npc.immortal) { npc.ai[0]++; } if (npc.ai[0] >= 30) { npc.active = false; } if (npc.ai[0] > 0) { Vector2 pos = Vector2.Lerp(npc.Center, boss.Center + Vector2.Normalize(npc.Center - boss.Center) * 80, npc.ai[0] / 30f); for (int k = 0; k < 5; k++) { Dust.NewDustPerfect(pos, DustType <Dusts.Stamina>(), Vector2.One.RotatedByRandom(6.28f)); if (Main.rand.Next(2) == 0) { Dust.NewDustPerfect(pos, DustType <Dusts.Stone>(), Vector2.One.RotatedByRandom(6.28f)); } } if (npc.ai[0] % 3 == 0) { Gore.NewGore(pos, new Vector2(0, 1), mod.GetGoreSlot("Gores/ChainGore")); } if (npc.ai[0] % 8 == 0) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/ChainHit").WithPitchVariance(0.4f), pos); } } if (npc.ai[0] == 1) { } }
public override void NPCLoot() { for (int k = 0; k < Main.maxPlayers; k++) { Player player = Main.player[k]; if (player.active && StarlightWorld.SquidBossArena.Contains((player.Center / 16).ToPoint())) { player.GetModPlayer <MedalPlayer>().ProbeMedal("Auroracle"); } } StarlightWorld.Flag(WorldFlags.SquidBossDowned); }
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) { if (Main.tile[i, j].frameX == 0 && Main.tile[i, j].frameY == 0) { Vector2 Seal = new Vector2((i + 12) * 16, (j + 12) * 16); if (!StarlightWorld.HasFlag(WorldFlags.SealOpen)) { spriteBatch.Draw(GetTexture("StarlightRiver/Tiles/Void/SealClosed"), Seal - Main.screenPosition, drawColor); } else { spriteBatch.Draw(GetTexture("StarlightRiver/Tiles/Void/SealOpen"), Seal - Main.screenPosition, drawColor); } } }
public override bool NewRightClick(int i, int j) { Tile tile = (Tile)Framing.GetTileSafely(i, j).Clone(); Player player = Main.LocalPlayer; if (StarlightWorld.HasFlag(WorldFlags.VitricBossOpen) && tile.frameX >= 90 && !NPC.AnyNPCs(NPCType <VitricBoss>()) && (player.ConsumeItem(ItemType <Items.Vitric.GlassIdol>()) || player.HasItem(ItemType <Items.Vitric.GlassIdolPremiumEdition>()))) { int x = i - (tile.frameX - 90) / 18; int y = j - tile.frameY / 18; SpawnBoss(x, y); return(true); } return(false); }
public override void NearbyEffects(int i, int j, bool closer) { if (Main.tile[i, j].frameX == 0 && Main.tile[i, j].frameY == 0 && !Main.projectile.Any (proj => proj.type == ProjectileType <Projectiles.Dummies.SealDummy>() && proj.Center == new Vector2(i + 5.5f, j) * 16 && proj.active)) { Projectile.NewProjectile(new Vector2(i + 5.5f, j) * 16, Vector2.Zero, ProjectileType <Projectiles.Dummies.SealDummy>(), 0, 0); } if (StarlightWorld.HasFlag(WorldFlags.SealOpen)) { Main.tileSolid[Type] = false; Main.tileSolidTop[Type] = true; } else { Main.tileSolid[Type] = true; } }
public override void AI() { foreach (Player player in Main.player) { if (AbilityHelper.CheckSmash(player, projectile.Hitbox)) { if (!StarlightWorld.HasFlag(WorldFlags.SealOpen)) { StarlightWorld.Flag(WorldFlags.SealOpen); player.GetHandler().ActiveAbility?.Deactivate(); player.GetModPlayer <StarlightPlayer>().Shake = 80; Main.PlaySound(SoundID.NPCDeath59); Main.PlaySound(SoundID.Item123); for (float k = 0; k <= 3.14f; k += 0.02f) { Dust.NewDustPerfect(projectile.Center, DustID.Stone, new Vector2(-1, 0).RotatedBy(k) * Main.rand.Next(0, 150) * 0.1f, 0, default, 2.5f);
public override void AI() { /* AI fields: * 0: timer * 1: activation state, im too lazy to create an enum for this so: (0 = hidden, 1 = rising, 2 = still, 3 = scrolling, 4 = resetting) * 2: scrolling timer * 3: scroll acceleration */ if (StarlightWorld.HasFlag(WorldFlags.VitricBossOpen) && State == 0) { State = 1; //when the altar is hit, make the BG rise out of the ground } if (State == 1) { Timer++; if (Main.netMode != NetmodeID.MultiplayerClient) { SpawnPlatforms(); } ScrollDelay = 20; //initial acceleration delay if (Timer == Risetime - 1) //hitting the top { Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += 18; Helper.PlayPitched("ArenaHit", 0.2f, 0, npc.Center); } if (Timer > Risetime) { State = 2; } if (Timer % 10 == 0) { Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += Timer < 100 ? 3 : 2; } for (int k = 0; k < 18; k++) { Dust.NewDust(npc.position, 560, 1, DustType <Dusts.Sand>(), 0, Main.rand.NextFloat(-5f, -1f), Main.rand.Next(255), default, Main.rand.NextFloat(1.5f)); //spawns dust
public override void Update(Player player, ref int buffIndex) { if (!StarlightWorld.HasFlag(WorldFlags.SquidBossDowned)) { player.lifeRegen -= 60; player.slow = true; player.wet = true; if (player == Main.LocalPlayer && Main.netMode != Terraria.ID.NetmodeID.Server) { Main.musicFade[Main.curMusic] = 0.05f; } } else { player.wet = true; player.breath--; } }
public override bool NewRightClick(int i, int j) { if (Keys.Key.Use <Keys.OvergrowKey>()) { for (int x = i - 2; x < i + 2; x++) { for (int y = j - 7; y < j + 7; y++) { if (Main.tile[x, y].type == Type) { Main.tile[x, y].frameX += 36; } } } CombatText.NewText(new Rectangle(i * 16, j * 16, 1, 1), new Color(255, 255, 200), Main.tile[i, j].frameX / 36 + "/3"); if (Main.tile[i, j].frameX > 100) { StarlightWorld.Flag(WorldFlags.OvergrowBossOpen); } } return(true); }
public override void Update() { if (StarlightWorld.HasFlag(WorldFlags.SquidBossDowned) && projectile.ai[0] < 120) { projectile.ai[0]++; } if (!StarlightWorld.HasFlag(WorldFlags.SquidBossDowned) && projectile.ai[0] > 0) { projectile.ai[0]--; } if (projectile.ai[0] > 0 && projectile.ai[0] < 120) { Dust.NewDustPerfect(projectile.position + Vector2.UnitY * Main.rand.NextFloat(projectile.height), DustType <Dusts.Stone>()); Dust.NewDustPerfect(projectile.position + new Vector2(projectile.width, Main.rand.NextFloat(projectile.height)), DustType <Dusts.Stone>()); } if (projectile.ai[0] == 119) { Main.PlaySound(SoundID.Tink, (int)projectile.Center.X, (int)projectile.Center.Y, 0, 1, -2); Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += 7; } }
public override void GoodEffects() => StarlightWorld.Flag(WorldFlags.SquidBossOpen);
private bool AluminumMeteor(On.Terraria.WorldGen.orig_meteor orig, int i, int j) { Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += 80; Main.PlaySound(SoundID.DD2_ExplosiveTrapExplode); if (StarlightWorld.HasFlag(WorldFlags.AluminumMeteors)) { Point16 target = new Point16(); while (!CheckAroundMeteor(target)) { int x = Main.rand.Next(Main.maxTilesX); for (int y = 0; y < Main.maxTilesY; y++) { if (Framing.GetTileSafely(x, y).active()) { target = new Point16(x, y); break; } } } for (int x = -35; x < 35; x++) { for (int y = -35; y < 35; y++) { if (WorldGen.InWorld(target.X + x, target.Y + y) && Framing.GetTileSafely(target.X + x, target.Y + y).collisionType == 1) { float dist = new Vector2(x, y).Length(); if (dist < 8) { WorldGen.KillTile(target.X + x, target.Y + y); } if (dist > 8 && dist < 15) { WorldGen.PlaceTile(target.X + x, target.Y + y, ModContent.TileType <Tiles.OreAluminum>(), true, true); WorldGen.SlopeTile(target.X + x, target.Y + y, 0); } if (dist > 15 && dist < 30 && Main.rand.Next((int)dist - 15) == 0) { WorldGen.PlaceTile(target.X + x, target.Y + y, ModContent.TileType <Tiles.OreAluminum>(), true, true); WorldGen.SlopeTile(target.X + x, target.Y + y, 0); } } } } if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText("An asteroid has landed!", new Color(107, 233, 231)); } else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromLiteral("An asteroid has landed!"), new Color(107, 233, 231)); } return(true); } else { return(orig(i, j)); } }
public override void KillMultiTile(int i, int j, int frameX, int frameY) { StarlightWorld.LearnRecipie("Aurora Disc"); Item.NewItem(new Vector2(i, j) * 16, ItemType <AuroraDisc>()); }
public override void NearbyEffects(int i, int j, bool closer) => Main.tile[i, j].inActive(StarlightWorld.HasFlag(WorldFlags.SquidBossOpen));
public static void CallBossChecklist() { Mod bcl = ModLoader.GetMod("BossChecklist"); if (bcl is null) { return; } List <int> SquidBossCollection = new List <int>(); List <int> SquidBossLoot = new List <int>(); string SquidBossInfo = "Drop Auroracle Bait into the prismatic waters of the permafrost shrine."; bcl.Call("AddBoss", 2.6f, ModContent.NPCType <Content.Bosses.SquidBoss.SquidBoss>(), StarlightRiver.Instance, "Auroracle", (Func <bool>)(() => StarlightWorld.HasFlag(WorldFlags.SquidBossDowned)), ModContent.ItemType <SquidBossSpawn>(), SquidBossCollection, SquidBossLoot, SquidBossInfo, null, "StarlightRiver/Assets/BossChecklist/SquidBoss"); List <int> vitricMiniBossCollection = new List <int>(); List <int> vitricMiniBossLoot = new List <int>(); string vitricMiniBossInfo = "Talk to the glassweaver in the vitric desert."; bcl.Call("AddMiniBoss", 4.1f, ModContent.NPCType <Content.Bosses.GlassMiniboss.GlassMiniboss>(), StarlightRiver.Instance, "Glassweaver", (Func <bool>)(() => StarlightWorld.HasFlag(WorldFlags.DesertOpen)), null, vitricMiniBossCollection, vitricMiniBossLoot, vitricMiniBossInfo); List <int> vitricBossCollection = new List <int>() { ModContent.ItemType <Content.Tiles.Trophies.CeirosTrophyItem>(), StarlightRiver.Instance.ItemType("VitricBoss1Item") }; List <int> vitricBossLoot = new List <int>() { ModContent.ItemType <Content.Items.Vitric.VitricBossBag>(), ModContent.ItemType <Content.Items.Vitric.BossSpear>(), ModContent.ItemType <Content.Items.Vitric.RefractiveBlade>(), ModContent.ItemType <Content.Items.Vitric.VitricBossBow>(), ModContent.ItemType <Content.Items.Vitric.Needler>(), ModContent.ItemType <Content.Items.Misc.StaminaUp>(), ModContent.ItemType <Content.Items.Vitric.CeirosExpert>() }; string vitricBossInfo = "Use a Glass Idol at cerios' atop the vitric temple, after breaking the crystal covering it."; bcl.Call("AddBoss", 4.9f, ModContent.NPCType <Content.Bosses.VitricBoss.VitricBoss>(), StarlightRiver.Instance, "Ceiros", (Func <bool>)(() => StarlightWorld.HasFlag(WorldFlags.VitricBossDowned)), ModContent.ItemType <Content.Items.Vitric.GlassIdol>(), vitricBossCollection, vitricBossLoot, vitricBossInfo, null, "StarlightRiver/Assets/BossChecklist/VitricBoss"); }