Merge branch 'SunkenSeaTileOddities' of https://github.com/CalamityTeam/CalamityMod into SunkenSeaTileOddities
This commit is contained in:
commit
4563bf200b
7 files changed
+68
-6
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -63,7 +64,16 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Vector3 lightCol = new(85f / 255f, 151f / 255f, 196f / 255f);
|
||||
float brightness = 0.7f;
|
||||
float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f;
|
||||
brightness *= (float)MathF.Sin(8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
|
||||
brightness += 0.4f;
|
||||
brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f);
|
||||
lightCol *= brightness;
|
||||
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
|
||||
Lighting.AddLight(Projectile.position, lightCol);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -66,7 +67,16 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Vector3 lightCol = new(85f / 255f, 151f / 255f, 196f / 255f);
|
||||
float brightness = 0.7f;
|
||||
float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f;
|
||||
brightness *= (float)MathF.Sin(8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
|
||||
brightness += 0.4f;
|
||||
brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f);
|
||||
lightCol *= brightness;
|
||||
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
|
||||
Lighting.AddLight(Projectile.position, lightCol);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,18 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
|
||||
if (Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 && Main.tile[i, tileLocationY - 2].LiquidAmount == 255)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 16, tileLocationY * 16 + 16, 0f, -0.1f, ModContent.ProjectileType<CoralBubble>(), 0, 0f, Main.myPlayer);
|
||||
for (int t = 0; t < 5; t++)
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.BlueTorch, 0, 0, 1, default, 1.5f);
|
||||
dust.velocity *= 0.2f;
|
||||
dust.noGravity = true;
|
||||
dust.noLight = true;
|
||||
dust.noLightEmittence = true;
|
||||
}
|
||||
Dust dust2 = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.MagicMirror, 0, 0, 1, Color.LightSkyBlue, 0.5f);
|
||||
dust2.velocity *= 0.2f;
|
||||
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 16, tileLocationY * 16 + 16, 0f, -0.1f, ModContent.ProjectileType<CoralBubble>(), 0, 1f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
|
||||
float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f;
|
||||
brightness *= (float)MathF.Sin(-j / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i);
|
||||
brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j);
|
||||
brightness += 0.7f;
|
||||
brightness += 0.4f;
|
||||
brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f);
|
||||
r = 187f / 255f;
|
||||
g = 43f / 255f;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
@@ -10,6 +11,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
AnimationFrameHeight = 36;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoAttach[Type] = true;
|
||||
@@ -26,6 +28,21 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
float brightness = 0.7f;
|
||||
float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f;
|
||||
brightness *= (float)MathF.Sin(-j / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i);
|
||||
brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j);
|
||||
brightness += 0.4f;
|
||||
brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f);
|
||||
r = 85f / 255f;
|
||||
b = 151f / 255f;
|
||||
g = 196f / 255f;
|
||||
r *= brightness;
|
||||
g *= brightness;
|
||||
b *= brightness;
|
||||
}
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
frameCounter++;
|
||||
|
||||
@@ -46,7 +46,21 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient
|
||||
if (Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 && Main.tile[i, tileLocationY - 2].LiquidAmount == 255)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
for (int t = 0; t < 5; t++)
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.BlueTorch, 0, 0, 1, default, 1.5f);
|
||||
dust.velocity *= 0.2f;
|
||||
dust.noGravity = true;
|
||||
dust.noLight = true;
|
||||
dust.noLightEmittence = true;
|
||||
}
|
||||
Dust dust2 = Dust.NewDustDirect(new Vector2(i, j + 0.5f) * 16, 16, 16, DustID.MagicMirror, 0, 0, 1, Color.LightSkyBlue, 0.5f);
|
||||
dust2.velocity *= 0.2f;
|
||||
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), i * 16 + 16, tileLocationY * 16 + 16, 0f, -0.1f, ModContent.ProjectileType<CoralBubbleSmall>(), 0, 1f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color blue = new Color(162, 216, 218);
|
||||
Color darkviolet = new Color(18, 67, 116);
|
||||
Color darkviolet = new Color(18, 78, 96);
|
||||
Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 800f;
|
||||
|
||||
Reference in new issue
Block a user