Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Assets/Masks/RingGlow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Masks/RingGlowInner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Masks/RingGlowInnerTwo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Assets/Misc/AuroraWater.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 18 additions & 16 deletions Content/Bosses/SquidBoss/Misc.AuroraWaterMetaballs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ internal class AuroraWaterMetaballs : MetaballActor
{
public override bool Active => Main.LocalPlayer.InModBiome(ModContent.GetInstance<Biomes.PermafrostTempleBiome>());

public override Color OutlineColor => new(255, 254, 255);
public override Color OutlineColor => new(255, 0, 0);

public override void DrawShapes(SpriteBatch spriteBatch)
{
Texture2D tex = Assets.Items.Misc.MagmaGunProj.Value;

for (int k = 0; k < Main.maxNPCs; k++)
{
NPC NPC = Main.npc[k];

if (NPC.active && NPC.ModNPC is ArenaActor)
(NPC.ModNPC as ArenaActor).DrawWater(Main.spriteBatch);
}
ArenaActor.latestActor?.DrawWater(Main.spriteBatch);

Effect borderNoise = ShaderLoader.GetShader("BorderNoise").Value;

Expand All @@ -41,7 +35,7 @@ public override void DrawShapes(SpriteBatch spriteBatch)
if (dust.active && (dust.type == ModContent.DustType<AuroraWater>() || dust.type == ModContent.DustType<AuroraWaterFast>()))
{
borderNoise.Parameters["offset"].SetValue((float)Main.time / 1000f + dust.rotation);
spriteBatch.Draw(tex, (dust.position - Main.screenPosition) / 2, null, new Color(0.4f, 1, 1), 0f, Vector2.One * 256f, dust.scale * 0.05f, SpriteEffects.None, 0);
spriteBatch.Draw(tex, (dust.position - Main.screenPosition) / 2, null, new Color(0, 255, 0), 0f, Vector2.One * 256f, dust.scale * 0.05f, SpriteEffects.None, 0);
}
}

Expand All @@ -50,7 +44,7 @@ public override void DrawShapes(SpriteBatch spriteBatch)
Texture2D tex2 = Assets.Bosses.SquidBoss.AuroraWaterSplash.Value;
var frame = new Rectangle(0, (int)(6 - proj.timeLeft / 40f * 6) * 106, 72, 106);

spriteBatch.Draw(tex2, (proj.Center - Main.screenPosition) / 2f, frame, new Color(0.4f, 1, 1), 0, new Vector2(36, 53), 0.5f, 0, 0);
spriteBatch.Draw(tex2, (proj.Center - Main.screenPosition) / 2f, frame, new Color(0, 255, 0), 0, new Vector2(36, 53), 0.5f, 0, 0);
}

spriteBatch.End();
Expand Down Expand Up @@ -87,21 +81,29 @@ public override bool PostDraw(SpriteBatch spriteBatch, Texture2D target)

if (effect != null)
{
Main.spriteBatch.End();
Main.graphics.GraphicsDevice.SetRenderTarget(Main.screenTargetSwap);

effect.Parameters["uTime"].SetValue((float)Main.timeForVisualEffects * 0.02f);
effect.Parameters["power"].SetValue(0.01f);
effect.Parameters["offset"].SetValue(new Vector2(Main.screenPosition.X / Main.screenWidth * -0.5f, Main.screenPosition.Y / Main.screenHeight * -0.5f));
effect.Parameters["sampleTexture"].SetValue(AuroraWaterSystem.auroraBackTarget.RenderTarget);
effect.Parameters["uImageSize1"].SetValue(new Vector2(Main.screenWidth, Main.screenHeight));
effect.Parameters["speed"].SetValue(50f);
effect.Parameters["lightTexture"].SetValue(LightingBuffer.screenLightingTarget.RenderTarget);
effect.Parameters["gameTexture"].SetValue(Main.screenTarget);
effect.Parameters["transform"].SetValue(Matrix.Invert(Main.GameViewMatrix.TransformationMatrix));

Main.spriteBatch.End();
Main.spriteBatch.Begin(default, default, SamplerState.PointClamp, default, Main.Rasterizer, effect, Main.GameViewMatrix.TransformationMatrix);
var inv = Matrix.Invert(Main.GameViewMatrix.TransformationMatrix);

Main.spriteBatch.Draw(target, Vector2.Zero, null, Color.Red * 0.4f, 0, Vector2.Zero, 2, 0, 0);
Main.spriteBatch.Begin(default, default, SamplerState.PointClamp, default, RasterizerState.CullNone, effect, Matrix.Identity);

Main.spriteBatch.Draw(target, Vector2.Zero, null, Color.White, 0, Vector2.Zero, 2, 0, 0);

Main.spriteBatch.End();
Main.spriteBatch.Begin(default, default, SamplerState.PointClamp, default, Main.Rasterizer, default, Main.GameViewMatrix.TransformationMatrix);

Main.graphics.GraphicsDevice.SetRenderTarget(Main.screenTarget);

Main.spriteBatch.Begin(default, default, SamplerState.PointClamp, default, RasterizerState.CullNone, default, Matrix.Identity);
Main.spriteBatch.Draw(Main.screenTargetSwap, Vector2.Zero, null, Color.White, 0, Vector2.Zero, 1, 0, 0);
}

return false;
Expand Down
6 changes: 5 additions & 1 deletion Content/Bosses/SquidBoss/NPCs.ArenaActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class ArenaActor : ModNPC
private static VertexPositionColorTexture[] verticies;
private static VertexBuffer buffer;

public static ArenaActor latestActor;

public ref float WaterLevel => ref NPC.ai[0];
public ref float VisualTimerA => ref NPC.ai[1];
public ref float VisualTimerB => ref NPC.ai[2];
Expand Down Expand Up @@ -106,6 +108,8 @@ private void DoParticleUpdates()

public override void AI()
{
latestActor = this;

VisualTimerA += 0.04f; //used as timers for visuals
VisualTimerB += 0.01f;

Expand Down Expand Up @@ -316,7 +320,7 @@ public void DrawWater(SpriteBatch spriteBatch)
Vector2 pos = NPC.Center + new Vector2(-840, 30 * 16) + new Vector2(0, -tex.Height) - Main.screenPosition;
var source = new Rectangle(0, tex.Height - (int)WaterLevel + 5 * 16, tex.Width, (int)WaterLevel - 5 * 16);

spriteBatch.Draw(tex, (pos + source.TopLeft()) * 0.5f, source, new Color(0.4f, 1, 1), 0, default, 0.5f, 0, 0);
spriteBatch.Draw(tex, (pos + source.TopLeft()) * 0.5f, source, new Color(0, 255, 0), 0, default, 0.5f, 0, 0);
DrawWaterfalls(spriteBatch);
}

Expand Down
2 changes: 1 addition & 1 deletion Content/Bosses/SquidBoss/NPCs.IcePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override void SafeAI()

if (Main.npc.Any(n => n.active && n.type == ModContent.NPCType<ArenaActor>()))
{
var actor = Main.npc.FirstOrDefault(n => n.active && n.type == ModContent.NPCType<ArenaActor>()).ModNPC as ArenaActor;
var actor = ArenaActor.latestActor;

if (NPC.position.Y >= HomeYPosition)
{
Expand Down
2 changes: 1 addition & 1 deletion Content/Bosses/SquidBoss/NPCs.SquidBoss.Attacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ private void TentacleSpike2()
{
RandomizeTarget();

tentacles[k].Center = new Vector2(Main.npc.FirstOrDefault(n => n.active && n.ModNPC is ArenaActor).Center.X + (k % 2 == 0 ? -500 : 500), NPC.Center.Y + Main.rand.Next(-200, 200));
tentacles[k].Center = new Vector2(ArenaActor.latestActor.NPC.Center.X + (k % 2 == 0 ? -500 : 500), NPC.Center.Y + Main.rand.Next(-200, 200));
tentacle.basePoint = tentacles[k].Center;
tentacle.movementTarget = Main.player[NPC.target].Center;

Expand Down
4 changes: 2 additions & 2 deletions Content/Bosses/SquidBoss/NPCs.SquidBoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public override void AI()
Animate(12, 0, 8);

if (arenaActor is null || !arenaActor.active)
arenaActor = Main.npc.FirstOrDefault(n => n.active && n.ModNPC is ArenaActor);
arenaActor = ArenaActor.latestActor.NPC;

if (Phase > (int)AIStates.SpawnAnimation)
FindEssentialNPCs();
Expand Down Expand Up @@ -840,7 +840,7 @@ public override void AI()
GlobalTimer++;

if (GlobalTimer % 6 == 0)
Main.npc.FirstOrDefault(n => n.active && n.ModNPC is ArenaActor).ai[0]++; //rising water
ArenaActor.latestActor.WaterLevel++; //rising water

AttackTimer++;

Expand Down
10 changes: 10 additions & 0 deletions Content/CustomHooks/Mechanics.PassiveLight.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using StarlightRiver.Content.Biomes;
using StarlightRiver.Content.Bosses.SquidBoss;
using StarlightRiver.Content.Events;
using System.Collections.Generic;
using Terraria.ID;
Expand Down Expand Up @@ -93,6 +94,15 @@ public override void PostUpdateEverything()
squidDomeRect.Y += 35;
squidDomeRect.Height = 76;
}

if (ArenaActor.latestActor?.WaterLevel > 1100)
{
squidDomeRect.Height = (int)(76 - (ArenaActor.latestActor.WaterLevel - 1100) / 16);
}
else
{
squidDomeRect.Height = 76;
}
}
}
}
6 changes: 3 additions & 3 deletions Content/CustomHooks/Visuals.DrawUnderCathedralWater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public static void DrawWater()
Main.spriteBatch.End();
Main.spriteBatch.Begin(default, default, SamplerState.PointClamp, default, Main.Rasterizer, default, Main.GameViewMatrix.TransformationMatrix);

NPC NPC = Main.npc.FirstOrDefault(n => n.active && n.ModNPC is ArenaActor);
NPC npc = ArenaActor.latestActor?.NPC;

if (NPC != null && NPC.active)
if (npc != null && npc.active)
{
if (ReflectionTarget.canUseTarget || !ModContent.GetInstance<GraphicsConfig>().ReflectionConfig.ReflectionsOn)
(NPC.ModNPC as ArenaActor).DrawBigWindow(Main.spriteBatch);
(npc.ModNPC as ArenaActor).DrawBigWindow(Main.spriteBatch);

int boss = -1;
var drawCache = new List<NPC>();
Expand Down
2 changes: 1 addition & 1 deletion Content/Items/Permafrost/Accessories.SquidFins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override void SafeUpdateEquip(Player player)
{
bool canSwim = player.grapCount <= 0 && player.wet && !player.mount.Active;
player.GetModPlayer<SwimPlayer>().ShouldSwim = canSwim;
player.GetModPlayer<SwimPlayer>().SwimSpeed = 1.33f + player.moveSpeed * 1.33f;
player.GetModPlayer<SwimPlayer>().SwimSpeed += 3f + player.moveSpeed * 1.33f;
}

private void DrawSquidFins(ref PlayerDrawSet drawInfo)
Expand Down
4 changes: 3 additions & 1 deletion Content/NPCs/Permafrost/WaterCube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public override void AI()
{
AuroraWaterSystem.visCounter = 30;
NPC.velocity.X = 1;

Lighting.AddLight(NPC.Center, new Vector3(0.4f, 0.8f, 1f));
}

public override bool CanHitPlayer(Player target, ref int cooldownSlot)
Expand All @@ -49,7 +51,7 @@ public void DrawToTarget(SpriteBatch spriteBatch)
Vector2 pos = (NPC.position - Main.screenPosition) / 2f;
var target = new Rectangle((int)pos.X, (int)pos.Y, NPC.width / 2, NPC.height / 2);

spriteBatch.Draw(tex, target, Color.Red);
spriteBatch.Draw(tex, target, Color.Lime);
}
}
}
Loading
Loading