1.4 port
This commit is contained in:
1 parent
7b42f800fd
commit
198aa69fdc
24 files changed
+216
-195
No files matched your search
@@ -1,12 +1,9 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
public class FloralParadiseBGStyle : ModUgBgStyle
|
||||
public class FloralParadiseBGStyle : ModUndergroundBackgroundStyle
|
||||
{
|
||||
public override bool ChooseBgStyle() => Main.LocalPlayer.InFloralParadise();
|
||||
|
||||
public override void FillTextureArray(int[] textureSlots)
|
||||
{
|
||||
// Corresponds to underground jungle backgrounds. Something custom could probably be made, but for what it is it works sufficiently for the minibiome.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using CalamityMod.Systems;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class FloralParadiseBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/FloralParadiseWater");
|
||||
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/FloralParadiseBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Floral Paradise");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return BiomeTileCounterSystem.FloralParadiseTiles >= 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1021,7 +1021,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool ZoneAbyssLayer2 => Player.InModBiome(ModContent.GetInstance<AbyssLayer2Biome>());
|
||||
public bool ZoneAbyssLayer3 => Player.InModBiome(ModContent.GetInstance<AbyssLayer3Biome>());
|
||||
public bool ZoneAbyssLayer4 => Player.InModBiome(ModContent.GetInstance<AbyssLayer4Biome>());
|
||||
public bool ZoneFloralParadise = false;
|
||||
public bool ZoneFloralParadise => Player.InModBiome(ModContent.GetInstance<FloralParadiseBiome>());
|
||||
|
||||
public bool abyssDeath = false;
|
||||
public int abyssBreathCD;
|
||||
public float caveDarkness = 0f;
|
||||
|
||||
@@ -12,6 +12,7 @@ float uDirection;
|
||||
float3 uLightSource;
|
||||
float2 uImageSize0;
|
||||
float2 uImageSize1;
|
||||
float4 uShaderSpecificData;
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -14,6 +14,7 @@ float3 uLightSource;
|
||||
float2 uImageSize0;
|
||||
float2 uImageSize1;
|
||||
matrix uWorldViewProjection;
|
||||
float4 uShaderSpecificData;
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -700,8 +700,8 @@ namespace CalamityMod.ILEditing
|
||||
cursor.GotoNext(MoveType.Before, i => i.MatchCallOrCallvirt<Main>("DrawInfernoRings"));
|
||||
cursor.EmitDelegate<Action>(() =>
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server && CalamityWorld.FloralParadiseTiles > 0)
|
||||
DrawFog(Utils.InverseLerp(0f, 250f, CalamityWorld.FloralParadiseTiles, true));
|
||||
if (Main.netMode != NetmodeID.Server && BiomeTileCounterSystem.FloralParadiseTiles > 0)
|
||||
DrawFog(Utils.GetLerpValue(0f, 250f, BiomeTileCounterSystem.FloralParadiseTiles, true));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -710,11 +710,11 @@ namespace CalamityMod.ILEditing
|
||||
Main.spriteBatch.EnterShaderRegion();
|
||||
WaterfallRenderer.DrawWaterfalls();
|
||||
|
||||
Texture2D fogTexture = ModContent.GetTexture("Terraria/Misc/Perlin");
|
||||
Texture2D fogTexture = ModContent.Request<Texture2D>("Terraria/Images/Misc/Perlin").Value;
|
||||
Vector2 scale = new Vector2(Main.screenWidth, Main.screenHeight) / fogTexture.Size();
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
GameShaders.Misc["CalamityMod:Fog"].UseOpacity(intensity * 0.67f);
|
||||
GameShaders.Misc["CalamityMod:Fog"].UseColor(Color.Lerp(Color.Lime, Color.Black, 0.85f));
|
||||
GameShaders.Misc["CalamityMod:Fog"].Apply();
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Particles
|
||||
// Spawning the particle directly will result in the particle list collection being modified prematurely within the update loop.
|
||||
// Doing it the next frame results in a single-frame buffer, but that shouldn't really be a problem and it ensures that the loop is
|
||||
// not interrupted in unanticipated ways.
|
||||
GeneralParticleHandler.QueueParticleForNextFrame(new MediumMistParticle(Position, foamVelocity, Color.LightCyan, Color.White, 0.2f, 255f, 0.03f));
|
||||
GeneralParticleHandler.QueueParticleForNextFrame(new MediumMistParticle(Position, foamVelocity, Color.LightCyan * 0.6f, Color.White * 0.6f, 0.2f, 255f, 0.03f));
|
||||
HasCreatedFoam = true;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace CalamityMod.Particles
|
||||
public override void CustomDraw(SpriteBatch spriteBatch)
|
||||
{
|
||||
float brightness = (float)Math.Pow(Lighting.Brightness((int)(Position.X / 16f), (int)(Position.Y / 16f)), 0.15);
|
||||
Texture2D texture = ModContent.GetTexture(Texture);
|
||||
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
|
||||
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color * brightness, Rotation, texture.Size() * 0.5f, Scale, 0, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -7,57 +7,57 @@ namespace CalamityMod.Projectiles.Environment
|
||||
{
|
||||
public class WaterAlgae : ModProjectile
|
||||
{
|
||||
public ref float Direction => ref projectile.ai[0];
|
||||
public ref float Direction => ref Projectile.ai[0];
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Algae");
|
||||
Main.projFrames[projectile.type] = 3;
|
||||
ProjectileID.Sets.CanDistortWater[projectile.type] = false;
|
||||
Main.projFrames[Projectile.type] = 3;
|
||||
ProjectileID.Sets.CanDistortWater[Projectile.type] = false;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 720;
|
||||
projectile.penetrate = 1;
|
||||
projectile.scale = Main.rand?.NextFloat(0.4f, 0.75f) ?? 1f;
|
||||
projectile.hide = true;
|
||||
Projectile.width = 12;
|
||||
Projectile.height = 12;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.timeLeft = 720;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.scale = Main.rand?.NextFloat(0.4f, 0.75f) ?? 1f;
|
||||
Projectile.hide = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.Opacity = Utils.InverseLerp(0f, 120f, projectile.timeLeft, true) * Utils.InverseLerp(720f, 660f, projectile.timeLeft, true);
|
||||
projectile.hide = projectile.Opacity < 0.2f;
|
||||
if (projectile.localAI[0] == 0f)
|
||||
Projectile.Opacity = Utils.GetLerpValue(0f, 120f, Projectile.timeLeft, true) * Utils.GetLerpValue(720f, 660f, Projectile.timeLeft, true);
|
||||
Projectile.hide = Projectile.Opacity < 0.2f;
|
||||
if (Projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.frame = Main.rand.Next(Main.projFrames[projectile.type]);
|
||||
projectile.localAI[0] = 1f;
|
||||
Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]);
|
||||
Projectile.localAI[0] = 1f;
|
||||
}
|
||||
|
||||
if (Collision.WetCollision(projectile.position, projectile.width, projectile.height))
|
||||
if (Collision.WetCollision(Projectile.position, Projectile.width, Projectile.height))
|
||||
{
|
||||
if (Direction == 0f)
|
||||
Direction = projectile.identity % 2;
|
||||
if (Collision.SolidCollision(projectile.Center + Vector2.UnitX * Direction * 100f, 1, 1))
|
||||
Direction = Projectile.identity % 2;
|
||||
if (Collision.SolidCollision(Projectile.Center + Vector2.UnitX * Direction * 100f, 1, 1))
|
||||
Direction *= -1f;
|
||||
|
||||
projectile.velocity.X = MathHelper.Lerp(projectile.velocity.X, Direction * MathHelper.Lerp(0.3f, 0.7f, projectile.identity % 9f / 9f), 0.025f);
|
||||
projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y - 0.008f, -0.4f, 0.4f);
|
||||
Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, Direction * MathHelper.Lerp(0.3f, 0.7f, Projectile.identity % 9f / 9f), 0.025f);
|
||||
Projectile.velocity.Y = MathHelper.Clamp(Projectile.velocity.Y - 0.008f, -0.4f, 0.4f);
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X *= 0.985f;
|
||||
projectile.velocity.Y = MathHelper.Clamp(projectile.velocity.Y + 0.1f, -1f, 5f);
|
||||
Projectile.velocity.X *= 0.985f;
|
||||
Projectile.velocity.Y = MathHelper.Clamp(Projectile.velocity.Y + 0.1f, -1f, 5f);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
projectile.velocity.X *= 0.5f;
|
||||
if (projectile.timeLeft > 210)
|
||||
projectile.timeLeft = 210;
|
||||
Projectile.velocity.X *= 0.5f;
|
||||
if (Projectile.timeLeft > 210)
|
||||
Projectile.timeLeft = 210;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Tiles.Astral;
|
||||
using CalamityMod.Tiles.AstralDesert;
|
||||
using CalamityMod.Tiles.AstralSnow;
|
||||
using CalamityMod.Tiles.Crags;
|
||||
using CalamityMod.Tiles.FloralParadise;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.Tiles.SunkenSea;
|
||||
@@ -16,10 +17,11 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
public static int BrimstoneCragTiles = 0;
|
||||
public static int SulphurTiles = 0;
|
||||
public static int AbyssTiles = 0;
|
||||
public static int AstralTiles = 0;
|
||||
public static int SunkenSeaTiles = 0;
|
||||
public static int ArsenalLabTiles = 0;
|
||||
public static int AbyssTiles = 0;
|
||||
public static int FloralParadiseTiles = 0;
|
||||
|
||||
public static int Layer1Tiles = 0;
|
||||
public static int Layer2Tiles = 0;
|
||||
@@ -29,9 +31,9 @@ namespace CalamityMod.Systems
|
||||
public override void ResetNearbyTileEffects()
|
||||
{
|
||||
BrimstoneCragTiles = 0;
|
||||
SulphurTiles = 0;
|
||||
AstralTiles = 0;
|
||||
SunkenSeaTiles = 0;
|
||||
SulphurTiles = 0;
|
||||
AbyssTiles = 0;
|
||||
ArsenalLabTiles = 0;
|
||||
|
||||
@@ -39,6 +41,7 @@ namespace CalamityMod.Systems
|
||||
Layer2Tiles = 0;
|
||||
Layer3Tiles = 0;
|
||||
Layer4Tiles = 0;
|
||||
FloralParadiseTiles = 0;
|
||||
}
|
||||
|
||||
public override void TileCountsAvailable(ReadOnlySpan<int> tileCounts)
|
||||
@@ -48,6 +51,7 @@ namespace CalamityMod.Systems
|
||||
AbyssTiles = tileCounts[ModContent.TileType<AbyssGravel>()] + tileCounts[ModContent.TileType<Voidstone>()];
|
||||
SulphurTiles = tileCounts[ModContent.TileType<SulphurousSand>()] + tileCounts[ModContent.TileType<SulphurousSandstone>()] + tileCounts[ModContent.TileType<HardenedSulphurousSandstone>()];
|
||||
ArsenalLabTiles = tileCounts[ModContent.TileType<LaboratoryPanels>()] + tileCounts[ModContent.TileType<LaboratoryPlating>()] + tileCounts[ModContent.TileType<HazardChevronPanels>()];
|
||||
FloralParadiseTiles = tileCounts[ModContent.TileType<FloralStone>()] + tileCounts[ModContent.TileType<FloralGrass>()] + tileCounts[ModContent.TileType<PeatMoss>()];
|
||||
|
||||
Layer1Tiles = tileCounts[ModContent.TileType<SulphurousShale>()];
|
||||
Layer2Tiles = tileCounts[ModContent.TileType<AbyssGravel>()] + tileCounts[ModContent.TileType<PlantyMush>()];
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.World;
|
||||
using CalamityMod.World.Minibiomes;
|
||||
using CalamityMod.World.Planets;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -55,7 +56,12 @@ namespace CalamityMod.Systems
|
||||
CustomTemple.NewJungleTemple();
|
||||
});
|
||||
|
||||
//Improved Golem arena
|
||||
tasks.Insert(JungleTempleIndex + 1, new PassLegacy("FloralParadise", (progress, config) =>
|
||||
{
|
||||
progress.Message = "Growing a floral paradise underground";
|
||||
FloralParadiseMinibiome.GenerateInstances();
|
||||
}));
|
||||
|
||||
int JungleTempleIndex2 = tasks.FindIndex(genpass => genpass.Name.Equals("Temple"));
|
||||
tasks[JungleTempleIndex2] = new PassLegacy("Temple", (progress, config) =>
|
||||
{
|
||||
@@ -74,12 +80,7 @@ namespace CalamityMod.Systems
|
||||
CustomTemple.NewJungleTempleLihzahrdAltar();
|
||||
});
|
||||
|
||||
// Floral Paradise
|
||||
tasks.Insert(JungleTempleIndex + 1, new PassLegacy("FloralParadise", progress =>
|
||||
{
|
||||
progress.Message = "Growing a floral paradise underground";
|
||||
FloralParadiseMinibiome.GenerateInstances();
|
||||
}));
|
||||
// TODO -- Most of the below worldgen should be spaced out at better points of generation instead of all crammed at the end
|
||||
|
||||
//Giant beehive
|
||||
int giantHiveIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Hives"));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Items.PermanentBoosters;
|
||||
using CalamityMod.Items.PermanentBoosters;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
@@ -8,7 +9,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class BloodOrangePlant : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoFail[Type] = true;
|
||||
@@ -17,19 +18,17 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
dustType = 6;
|
||||
DustType = 6;
|
||||
|
||||
AddMapEntry(new Color(250, 142, 4));
|
||||
|
||||
base.SetDefaults();
|
||||
}
|
||||
|
||||
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
||||
{
|
||||
Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType<BloodOrange>());
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType<BloodOrange>());
|
||||
}
|
||||
|
||||
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height)
|
||||
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
|
||||
{
|
||||
offsetY = 2;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Projectiles.Environment;
|
||||
using CalamityMod.Projectiles.Environment;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -8,7 +9,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class FloralGrass : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
@@ -23,11 +24,10 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
CalamityUtils.SetMerge(Type, TileID.Grass);
|
||||
CalamityUtils.SetMerge(Type, TileID.CorruptGrass);
|
||||
CalamityUtils.SetMerge(Type, TileID.HallowedGrass);
|
||||
CalamityUtils.SetMerge(Type, TileID.FleshGrass);
|
||||
CalamityUtils.SetMerge(Type, TileID.CrimsonGrass);
|
||||
CalamityUtils.MergeWithFloralParadise(Type);
|
||||
|
||||
dustType = 39;
|
||||
drop = ItemID.DirtBlock;
|
||||
DustType = 39;
|
||||
|
||||
AddMapEntry(new Color(65, 142, 101));
|
||||
}
|
||||
@@ -40,15 +40,15 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
|
||||
{
|
||||
if (fail && !effectOnly)
|
||||
Main.tile[i, j].type = (ushort)ModContent.TileType<PeatMoss>();
|
||||
Main.tile[i, j].TileType = (ushort)ModContent.TileType<PeatMoss>();
|
||||
}
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(60) && !Main.gamePaused && CalamityUtils.ParanoidTileRetrieval(i, j - 1).liquid >= 200)
|
||||
if (WorldGen.genRand.NextBool(60) && !Main.gamePaused && CalamityUtils.ParanoidTileRetrieval(i, j - 1).LiquidAmount >= 200)
|
||||
{
|
||||
Vector2 algaeVelocity = -Vector2.UnitY.RotatedByRandom(0.91f) * Main.rand.NextFloat(0.85f, 1.6f);
|
||||
Projectile.NewProjectile(new Vector2(i + 0.5f, j - 0.5f) * 16f, algaeVelocity, ModContent.ProjectileType<WaterAlgae>(), 0, 0f);
|
||||
Projectile.NewProjectile(new EntitySource_WorldEvent(), new Vector2(i + 0.5f, j - 0.5f) * 16f, algaeVelocity, ModContent.ProjectileType<WaterAlgae>(), 0, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
if (WorldGen.InWorld(x, y))
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y).active() &&
|
||||
CalamityUtils.ParanoidTileRetrieval(x, y).type == (ushort)ModContent.TileType<SmallVines>())
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile &&
|
||||
CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType<SmallVines>())
|
||||
{
|
||||
nearbyVineCount++;
|
||||
}
|
||||
@@ -72,20 +72,20 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
}
|
||||
if (Main.tile[i, j + 1] != null && nearbyVineCount < 5)
|
||||
{
|
||||
if (!Main.tile[i, j + 1].active() && Main.tile[i, j + 1].type != (ushort)ModContent.TileType<SmallVines>())
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType<SmallVines>())
|
||||
{
|
||||
if (Main.tile[i, j + 1].liquid == 255 &&
|
||||
!Main.tile[i, j + 1].lava())
|
||||
if (Main.tile[i, j + 1].LiquidAmount == 255 &&
|
||||
Main.tile[i, j + 1].LiquidType == LiquidID.Water)
|
||||
{
|
||||
bool flag13 = false;
|
||||
for (int y = num8; y > num8 - 10; y--)
|
||||
{
|
||||
if (Main.tile[i, y].bottomSlope())
|
||||
if (Main.tile[i, y].BottomSlope)
|
||||
{
|
||||
flag13 = false;
|
||||
break;
|
||||
}
|
||||
if (Main.tile[i, y].active() && !Main.tile[i, y].bottomSlope())
|
||||
if (Main.tile[i, y].HasTile && !Main.tile[i, y].BottomSlope)
|
||||
{
|
||||
flag13 = true;
|
||||
break;
|
||||
@@ -95,16 +95,16 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
int num53 = i;
|
||||
int num54 = j + 1;
|
||||
Main.tile[num53, num54].type = (ushort)ModContent.TileType<SmallVines>();
|
||||
Main.tile[num53, num54].active(true);
|
||||
Main.tile[num53, num54].TileType = (ushort)ModContent.TileType<SmallVines>();
|
||||
Main.tile[num53, num54].Get<TileWallWireStateData>().HasTile = true;
|
||||
WorldGen.SquareTileFrame(num53, num54, true);
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None);
|
||||
}
|
||||
}
|
||||
Main.tile[i, j].slope(0);
|
||||
Main.tile[i, j].halfBrick(false);
|
||||
Main.tile[i, j].Get<TileWallWireStateData>().Slope = SlopeType.Solid;
|
||||
Main.tile[i, j].Get<TileWallWireStateData>().IsHalfBlock = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class FloralPlants : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoFail[Type] = true;
|
||||
@@ -17,14 +17,12 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
soundType = SoundID.Grass;
|
||||
dustType = 2;
|
||||
SoundType = SoundID.Grass;
|
||||
DustType = 2;
|
||||
AddMapEntry(new Color(28, 216, 94));
|
||||
|
||||
base.SetDefaults();
|
||||
}
|
||||
|
||||
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height)
|
||||
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
|
||||
{
|
||||
offsetY = 2;
|
||||
}
|
||||
@@ -36,7 +34,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
|
||||
public override void NearbyEffects(int i, int j, bool closer)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(i, j).liquid > 64)
|
||||
if (CalamityUtils.ParanoidTileRetrieval(i, j).LiquidAmount > 64)
|
||||
WorldGen.KillTile(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class FloralStone : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
@@ -20,10 +20,10 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
CalamityUtils.MergeWithOres(Type);
|
||||
CalamityUtils.MergeWithFloralParadise(Type);
|
||||
|
||||
dustType = 78;
|
||||
DustType = 78;
|
||||
// drop = ModContent.ItemType<FloralStoneItem>();
|
||||
|
||||
soundType = SoundID.Tink;
|
||||
SoundType = SoundID.Tink;
|
||||
|
||||
AddMapEntry(new Color(33, 56, 27));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class PeatMoss : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
@@ -20,10 +20,10 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
CalamityUtils.MergeWithOres(Type);
|
||||
CalamityUtils.MergeWithFloralParadise(Type);
|
||||
|
||||
dustType = 78;
|
||||
DustType = 78;
|
||||
// drop = ModContent.ItemType<PeatMossItem>();
|
||||
|
||||
soundType = SoundID.Tink;
|
||||
SoundType = SoundID.Tink;
|
||||
|
||||
AddMapEntry(new Color(72, 91, 47));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -7,7 +8,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class SmallVines : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileCut[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
@@ -16,8 +17,8 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Vines");
|
||||
AddMapEntry(new Color(100, 151, 31), name);
|
||||
soundType = SoundID.Grass;
|
||||
dustType = 2;
|
||||
SoundType = SoundID.Grass;
|
||||
DustType = 2;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
@@ -28,18 +29,18 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2) && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage)
|
||||
Item.NewItem(new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope);
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope);
|
||||
|
||||
if (Main.tile[i, j + 1] != null)
|
||||
{
|
||||
if (Main.tile[i, j + 1].active())
|
||||
if (Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
if (Main.tile[i, j + 1].type == ModContent.TileType<SmallVines>())
|
||||
if (Main.tile[i, j + 1].TileType == ModContent.TileType<SmallVines>())
|
||||
{
|
||||
WorldGen.KillTile(i, j + 1, false, false, false);
|
||||
if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer)
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.netMode != NetmodeID.SinglePlayer)
|
||||
{
|
||||
NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0);
|
||||
NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,19 +51,19 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
if (Main.tile[i, j + 1] != null)
|
||||
{
|
||||
if (!Main.tile[i, j + 1].active() && Main.tile[i, j + 1].type != (ushort)ModContent.TileType<SmallVines>())
|
||||
if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType<SmallVines>())
|
||||
{
|
||||
if (Main.tile[i, j + 1].liquid >= 128 && !Main.tile[i, j + 1].lava())
|
||||
if (Main.tile[i, j + 1].LiquidAmount >= 128 && Main.tile[i, j + 1].LiquidType == LiquidID.Water)
|
||||
{
|
||||
bool flag13 = false;
|
||||
for (int num52 = j; num52 > j - 10; j--)
|
||||
{
|
||||
if (Main.tile[i, num52].bottomSlope())
|
||||
if (Main.tile[i, num52].BottomSlope)
|
||||
{
|
||||
flag13 = false;
|
||||
break;
|
||||
}
|
||||
if (Main.tile[i, num52].active() && !Main.tile[i, num52].bottomSlope())
|
||||
if (Main.tile[i, num52].HasTile && !Main.tile[i, num52].BottomSlope)
|
||||
{
|
||||
flag13 = true;
|
||||
break;
|
||||
@@ -72,12 +73,12 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
int num53 = i;
|
||||
int num54 = j + 1;
|
||||
Main.tile[num53, num54].type = (ushort)ModContent.TileType<SmallVines>();
|
||||
Main.tile[num53, num54].frameX = (short)(WorldGen.genRand.Next(8) * 18);
|
||||
Main.tile[num53, num54].frameY = (short)(4 * 18);
|
||||
Main.tile[num53, num54 - 1].frameX = (short)(WorldGen.genRand.Next(12) * 18);
|
||||
Main.tile[num53, num54 - 1].frameY = (short)(WorldGen.genRand.Next(4) * 18);
|
||||
Main.tile[num53, num54].active(true);
|
||||
Main.tile[num53, num54].TileType = (ushort)ModContent.TileType<SmallVines>();
|
||||
Main.tile[num53, num54].TileFrameX = (short)(WorldGen.genRand.Next(8) * 18);
|
||||
Main.tile[num53, num54].TileFrameY = (short)(4 * 18);
|
||||
Main.tile[num53, num54 - 1].TileFrameX = (short)(WorldGen.genRand.Next(12) * 18);
|
||||
Main.tile[num53, num54 - 1].TileFrameY = (short)(WorldGen.genRand.Next(4) * 18);
|
||||
Main.tile[num53, num54].Get<TileWallWireStateData>().HasTile = true;
|
||||
WorldGen.SquareTileFrame(num53, num54, true);
|
||||
WorldGen.SquareTileFrame(num53, num54 - 1, true);
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
@@ -11,7 +12,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class VigorousVines : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileCut[Type] = true;
|
||||
Main.tileLavaDeath[Type] = true;
|
||||
@@ -35,8 +36,8 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
TileObjectData.newTile.RandomStyleRange = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
|
||||
soundType = SoundID.Grass;
|
||||
dustType = 2;
|
||||
SoundType = SoundID.Grass;
|
||||
DustType = 2;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
@@ -47,33 +48,33 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
|
||||
{
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j);
|
||||
if (tile.frameX % 36 != 0 || tile.frameY % 36 != 0)
|
||||
if (tile.TileFrameX % 36 != 0 || tile.TileFrameY % 36 != 0)
|
||||
{
|
||||
WorldGen.KillTile(i - tile.frameX % 36 / 18, j - tile.frameY % 36 / 18);
|
||||
WorldGen.KillTile(i - tile.TileFrameX % 36 / 18, j - tile.TileFrameY % 36 / 18);
|
||||
|
||||
if (CalamityUtils.ParanoidTileRetrieval(i - tile.frameX % 36 / 18, j - tile.frameY % 36 / 18 - 1).type == Type)
|
||||
WorldGen.KillTile(i - tile.frameX % 36 / 18, j - tile.frameY % 36 / 18 - 1);
|
||||
if (CalamityUtils.ParanoidTileRetrieval(i - tile.TileFrameX % 36 / 18, j - tile.TileFrameY % 36 / 18 - 1).TileType == Type)
|
||||
WorldGen.KillTile(i - tile.TileFrameX % 36 / 18, j - tile.TileFrameY % 36 / 18 - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
else if (WorldGen.genRand.NextBool(2) && Main.player[Player.FindClosest(new Vector2(i, j) * 16f, 16, 16)].cordage)
|
||||
{
|
||||
Item.NewItem(new Vector2(i * 16 + 24f, j * 16 + 24f), ItemID.VineRope);
|
||||
Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i * 16 + 24f, j * 16 + 24f), ItemID.VineRope);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile t = Main.tile[i, j];
|
||||
int frameX = t.frameX;
|
||||
int frameY = t.frameY;
|
||||
Texture2D tex = Main.tileTexture[Type];
|
||||
int frameX = t.TileFrameX;
|
||||
int frameY = t.TileFrameY;
|
||||
Texture2D tex = TextureAssets.Tile[Type].Value;
|
||||
Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
|
||||
Color drawColor = Lighting.GetColor(i, j);
|
||||
if (!t.halfBrick() && t.slope() == 0)
|
||||
if (!t.IsHalfBlock && t.Slope == SlopeType.Solid)
|
||||
spriteBatch.Draw(tex, drawPosition, new Rectangle(frameX, frameY, 18, 18), drawColor, 0f, Vector2.Zero, 1f, 0, 0f);
|
||||
else if (t.halfBrick())
|
||||
else if (t.IsHalfBlock)
|
||||
spriteBatch.Draw(tex, drawPosition + new Vector2(0f, 8f), new Rectangle(frameX, frameY, 18, 8), drawColor, 0f, Vector2.Zero, 1f, 0, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public class WaterfallCreator : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = false;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
CalamityUtils.MergeWithOres(Type);
|
||||
CalamityUtils.MergeWithFloralParadise(Type);
|
||||
|
||||
soundType = SoundID.Tink;
|
||||
SoundType = SoundID.Tink;
|
||||
|
||||
AddMapEntry(new Color(33, 56, 27));
|
||||
}
|
||||
|
||||
@@ -461,15 +461,15 @@ namespace CalamityMod
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Makes the tile merge with all the tile types that generate within various types of floral paradise tiles.
|
||||
/// </summary>
|
||||
/// <param name="type">The tile whose merging properties will be set.</param>
|
||||
public static void MergeWithFloralParadise(int type) => MergeWithSet(type, new int[] {
|
||||
TileType<FloralGrass>(),
|
||||
TileType<PeatMoss>(),
|
||||
TileType<FloralStone>(),
|
||||
TileType<PerennialOre>(),
|
||||
});
|
||||
/// Makes the tile merge with all the tile types that generate within various types of floral paradise tiles.
|
||||
/// </summary>
|
||||
/// <param name="type">The tile whose merging properties will be set.</param>
|
||||
public static void MergeWithFloralParadise(int type) => MergeWithSet(type, new int[] {
|
||||
TileType<FloralGrass>(),
|
||||
TileType<PeatMoss>(),
|
||||
TileType<FloralStone>(),
|
||||
TileType<PerennialOre>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Makes the tile merge with all the tile types that generate within various types of astral tiles
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Tiles.FloralParadise;
|
||||
using CalamityMod.Tiles.FloralParadise;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
@@ -30,19 +31,19 @@ namespace CalamityMod.Waterfalls
|
||||
|
||||
internal static float PrimitiveWidthFunction(float completionRatio)
|
||||
{
|
||||
float baseWidth = MathHelper.Lerp(16f, 6f, Utils.InverseLerp(36f, 216f, currentWaterfallHeight, true));
|
||||
float baseWidth = MathHelper.Lerp(16f, 6f, Utils.GetLerpValue(36f, 216f, currentWaterfallHeight, true));
|
||||
float positionOffset = currentWaterfallPosition.X * 0.17f % 300f + currentWaterfallPosition.Y * 0.33f % 300f;
|
||||
float x1Offset = (float)(Math.Sin(-Main.GlobalTime * 3f + completionRatio * 9f + positionOffset) * 0.5f + 0.5f) * baseWidth * 0.2f;
|
||||
float x2Offset = (float)(Math.Sin(-Main.GlobalTime * 6f + completionRatio * 6f + positionOffset) * 0.5f + 0.5f) * baseWidth * 0.25f;
|
||||
float x1Offset = (float)(Math.Sin(-Main.GlobalTimeWrappedHourly * 3f + completionRatio * 9f + positionOffset) * 0.5f + 0.5f) * baseWidth * 0.2f;
|
||||
float x2Offset = (float)(Math.Sin(-Main.GlobalTimeWrappedHourly * 6f + completionRatio * 6f + positionOffset) * 0.5f + 0.5f) * baseWidth * 0.25f;
|
||||
|
||||
if (completionRatio < 0.2f)
|
||||
return MathHelper.SmoothStep(1f, baseWidth + x2Offset - x1Offset, Utils.InverseLerp(0f, 0.2f, completionRatio, true));
|
||||
return baseWidth + x2Offset + MathHelper.SmoothStep(0f, baseWidth * 0.85f, Utils.InverseLerp(0.84f, 0.96f, completionRatio, true)) - x1Offset;
|
||||
return MathHelper.SmoothStep(1f, baseWidth + x2Offset - x1Offset, Utils.GetLerpValue(0f, 0.2f, completionRatio, true));
|
||||
return baseWidth + x2Offset + MathHelper.SmoothStep(0f, baseWidth * 0.85f, Utils.GetLerpValue(0.84f, 0.96f, completionRatio, true)) - x1Offset;
|
||||
}
|
||||
|
||||
internal static Color PrimitiveColorFunction(float completionRatio)
|
||||
{
|
||||
Color c = Color.Lerp(Color.Cyan, new Color(1f, 1f, 1f, 0f), (float)Math.Pow(Utils.InverseLerp(0.75f, 1f, completionRatio, true), 0.68));
|
||||
Color c = Color.Lerp(Color.Cyan, new Color(1f, 1f, 1f, 0f), (float)Math.Pow(Utils.GetLerpValue(0.75f, 1f, completionRatio, true), 0.68));
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -55,7 +56,7 @@ namespace CalamityMod.Waterfalls
|
||||
for (int j = -Main.screenHeight / 16 - 10; j < Main.screenHeight / 16 + 10; j++)
|
||||
{
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(center.X + i, center.Y + j);
|
||||
if (tile.type != waterfallGeneratorID || !tile.active())
|
||||
if (tile.TileType != waterfallGeneratorID || !tile.HasTile)
|
||||
continue;
|
||||
|
||||
yield return new Vector2(center.X + i, center.Y + j);
|
||||
@@ -71,13 +72,14 @@ namespace CalamityMod.Waterfalls
|
||||
Vector2 bottom = drawPosition;
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval((int)drawTilePosition.X, (int)drawTilePosition.Y + i).liquid > 0)
|
||||
if (CalamityUtils.ParanoidTileRetrieval((int)drawTilePosition.X, (int)drawTilePosition.Y + i).LiquidAmount > 0)
|
||||
{
|
||||
bottom.Y += i * 16f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bottom.Y += 4f;
|
||||
currentWaterfallHeight = MathHelper.Distance(bottom.Y, drawPosition.Y);
|
||||
currentWaterfallBrightness = Lighting.Brightness((int)(drawPosition.X / 16f), (int)(drawPosition.Y / 16f));
|
||||
currentWaterfallPosition = drawPosition + Vector2.One * 8f;
|
||||
@@ -99,10 +101,10 @@ namespace CalamityMod.Waterfalls
|
||||
{
|
||||
Main.ambientWaterfallX = drawPosition.X + 8f;
|
||||
Main.ambientWaterfallY = drawPosition.Y + 8f;
|
||||
Main.ambientWaterfallStrength = MathHelper.Max(Main.ambientWaterfallStrength, Utils.InverseLerp(740f, 300f, distanceFromWaterfall, true));
|
||||
Main.ambientWaterfallStrength = MathHelper.Max(Main.ambientWaterfallStrength, Utils.GetLerpValue(740f, 300f, distanceFromWaterfall, true));
|
||||
}
|
||||
|
||||
GameShaders.Misc["CalamityMod:Waterfall"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/WorleyNoise"));
|
||||
GameShaders.Misc["CalamityMod:Waterfall"].SetShaderTexture(ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/WorleyNoise"));
|
||||
GameShaders.Misc["CalamityMod:Waterfall"].UseOpacity((float)Math.Pow(currentWaterfallBrightness, 0.62));
|
||||
Renderer.Draw(drawPoints, Vector2.One * 8f - Main.screenPosition, 80);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class FloralParadiseWater : ModWaterStyle
|
||||
{
|
||||
public override bool ChooseWaterStyle()
|
||||
{
|
||||
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
|
||||
return modPlayer.ZoneFloralParadise;
|
||||
}
|
||||
|
||||
public override int ChooseWaterfallStyle()
|
||||
{
|
||||
return mod.GetWaterfallStyleSlot("FloralParadiseWaterflow");
|
||||
return ModContent.Find<ModWaterfallStyle>("CalamityMod/FloralParadiseWaterflow").Slot;
|
||||
}
|
||||
|
||||
public override int GetSplashDust()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Tiles.FloralParadise;
|
||||
using CalamityMod.Tiles.SunkenSea;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -102,7 +102,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
if (!needsToTryAgain)
|
||||
{
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy);
|
||||
needsToTryAgain = tile.active() && BlacklistedNearbyTiles.Contains(tile.type);
|
||||
needsToTryAgain = tile.HasTile && BlacklistedNearbyTiles.Contains(tile.TileType);
|
||||
}
|
||||
else
|
||||
break;
|
||||
@@ -146,7 +146,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
int x = placementArea.X + WorldGen.genRand.Next(24, placementArea.Width - 24);
|
||||
int y = placementArea.Y + WorldGen.genRand.Next(18, placementArea.Height - 18);
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
if (!WorldGen.SolidTile(x, y + 1) || !WorldGen.SolidTile(x + 1, y + 1) || tile.active() || tile.liquid > 0)
|
||||
if (!WorldGen.SolidTile(x, y + 1) || !WorldGen.SolidTile(x + 1, y + 1) || tile.HasTile || tile.LiquidAmount > 0)
|
||||
{
|
||||
i--;
|
||||
continue;
|
||||
@@ -156,10 +156,10 @@ namespace CalamityMod.World.Minibiomes
|
||||
{
|
||||
for (int dy = 0; dy < 3; dy++)
|
||||
{
|
||||
Main.tile[x + dx, y + dy].type = (ushort)ModContent.TileType<BloodOrangePlant>();
|
||||
Main.tile[x + dx, y + dy].frameX = (short)(dx * 18);
|
||||
Main.tile[x + dx, y + dy].frameY = (short)(dy * 18);
|
||||
Main.tile[x + dx, y + dy].active(true);
|
||||
Main.tile[x + dx, y + dy].TileType = (ushort)ModContent.TileType<BloodOrangePlant>();
|
||||
Main.tile[x + dx, y + dy].TileFrameX = (short)(dx * 18);
|
||||
Main.tile[x + dx, y + dy].TileFrameY = (short)(dy * 18);
|
||||
Main.tile[x + dx, y + dy].Get<TileWallWireStateData>().HasTile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,18 +205,18 @@ namespace CalamityMod.World.Minibiomes
|
||||
if (distanceFromCenter > 1f)
|
||||
distanceFromCenter = 1f;
|
||||
|
||||
float ditherChance = Utils.InverseLerp(0.97f, 0.72f, distanceFromCenter, true);
|
||||
float ditherChance = Utils.GetLerpValue(0.97f, 0.72f, distanceFromCenter, true);
|
||||
|
||||
Main.tile[x, y].wall = WallID.None;
|
||||
Main.tile[x, y].WallType = WallID.None;
|
||||
if (WorldGen.genRand.NextFloat() < ditherChance)
|
||||
{
|
||||
if (!caveState[arrayRelativeX, arrayRelativeY] && distanceFromCenter < 0.7f)
|
||||
Main.tile[x, y] = new Tile();
|
||||
Main.tile[x, y].ClearEverything();
|
||||
else
|
||||
{
|
||||
bool useGrass = CalamityUtils.CountCellsAtPosition(caveState, arrayRelativeX, arrayRelativeY, false) >= 1 && distanceFromCenter < 0.72f;
|
||||
grassDirtMap[arrayRelativeX, arrayRelativeY] = useGrass;
|
||||
Main.tile[x, y] = new Tile();
|
||||
Main.tile[x, y].ClearEverything();
|
||||
Main.tile[x, y].ResetToType(useGrass ? grassID : stoneID);
|
||||
WorldGen.SquareTileFrame(x, y);
|
||||
}
|
||||
@@ -255,8 +255,8 @@ namespace CalamityMod.World.Minibiomes
|
||||
// This makes the dirt feel more natural and connected to the underlying rock.
|
||||
bool canPerformPlacement = i == 0 || WorldGen.genRand.NextFloat() < SecondaryPassDirtCreationChance;
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
if (canPerformPlacement && tile.active() && tile.type == stoneID && nearbyGrassOrDirt)
|
||||
Main.tile[x, y].type = dirtID;
|
||||
if (canPerformPlacement && tile.HasTile && tile.TileType == stoneID && nearbyGrassOrDirt)
|
||||
Main.tile[x, y].TileType = dirtID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
int arrayRelativeX = x - placementArea.X;
|
||||
int arrayRelativeY = y - placementArea.Y;
|
||||
grassDirtMap[arrayRelativeX, arrayRelativeY] = tile.type == grassID || tile.type == dirtID;
|
||||
grassDirtMap[arrayRelativeX, arrayRelativeY] = tile.TileType == grassID || tile.TileType == dirtID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -286,7 +286,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
{
|
||||
float noise = CalamityUtils.PerlinNoise2D(x / 160f, y / 160f, 3, seed) * 0.5f + 0.5f;
|
||||
if (MathHelper.Distance(noise, 0.555f) < WallOpennessFactor)
|
||||
Main.tile[x, y].wall = WorldGen.genRand.NextBool(4) ? WallID.GrassUnsafe : WallID.FlowerUnsafe;
|
||||
Main.tile[x, y].WallType = WorldGen.genRand.NextBool(4) ? WallID.GrassUnsafe : WallID.FlowerUnsafe;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -319,7 +319,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
|
||||
// Ensure that the initial tile is empty and that there's a solid tile above for the vine to hang from.
|
||||
// If these conditions are not met, try again.
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y).active() || !WorldGen.SolidTile(x, y - 1))
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile || !WorldGen.SolidTile(x, y - 1))
|
||||
{
|
||||
i--;
|
||||
continue;
|
||||
@@ -331,7 +331,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
bool neeedsToTryAgain = false;
|
||||
for (int dy = 0; dy < vineLength; dy++)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y + dy).active())
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y + dy).HasTile)
|
||||
{
|
||||
neeedsToTryAgain = true;
|
||||
break;
|
||||
@@ -347,18 +347,18 @@ namespace CalamityMod.World.Minibiomes
|
||||
// Perform placement.
|
||||
for (int dy = 0; dy < vineLength; dy++)
|
||||
{
|
||||
Main.tile[x, y + dy].type = (ushort)ModContent.TileType<SmallVines>();
|
||||
Main.tile[x, y + dy].TileType = (ushort)ModContent.TileType<SmallVines>();
|
||||
if (dy == vineLength - 1)
|
||||
{
|
||||
Main.tile[x, y + dy].frameX = (short)(WorldGen.genRand.Next(8) * 18);
|
||||
Main.tile[x, y + dy].frameY = 72;
|
||||
Main.tile[x, y + dy].TileFrameX = (short)(WorldGen.genRand.Next(8) * 18);
|
||||
Main.tile[x, y + dy].TileFrameY = 72;
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[x, y + dy].frameX = (short)(WorldGen.genRand.Next(12) * 18);
|
||||
Main.tile[x, y + dy].frameY = (short)(WorldGen.genRand.Next(4) * 18);
|
||||
Main.tile[x, y + dy].TileFrameX = (short)(WorldGen.genRand.Next(12) * 18);
|
||||
Main.tile[x, y + dy].TileFrameY = (short)(WorldGen.genRand.Next(4) * 18);
|
||||
}
|
||||
Main.tile[x, y + dy].active(true);
|
||||
Main.tile[x, y + dy].Get<TileWallWireStateData>().HasTile = true;
|
||||
WorldGen.SquareTileFrame(x, y, true);
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
int x = placementArea.X + WorldGen.genRand.Next(24, placementArea.Width - 24);
|
||||
int y = placementArea.Y + WorldGen.genRand.Next(24, placementArea.Height - 24);
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
if (tile.active() || tile.liquid > 0)
|
||||
if (tile.HasTile || tile.LiquidAmount > 0)
|
||||
{
|
||||
i--;
|
||||
continue;
|
||||
@@ -381,7 +381,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
Point waterSpawnPoint = new Point(x, y);
|
||||
for (int dy = 0; dy < 100; dy++)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y - dy).active())
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y - dy).HasTile)
|
||||
{
|
||||
waterSpawnPoint.Y -= dy - 1;
|
||||
break;
|
||||
@@ -404,10 +404,10 @@ namespace CalamityMod.World.Minibiomes
|
||||
|
||||
for (int dy = 0; dy < 50; dy++)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y + dy).liquid > 0)
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x, y + dy).LiquidAmount > 0)
|
||||
{
|
||||
Main.tile[x, y + dy - 8].active(true);
|
||||
Main.tile[x, y + dy - 8].type = (ushort)ModContent.TileType<WaterfallCreator>();
|
||||
Main.tile[x, y + dy - 8].Get<TileWallWireStateData>().HasTile = true;
|
||||
Main.tile[x, y + dy - 8].TileType = (ushort)ModContent.TileType<WaterfallCreator>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -421,17 +421,17 @@ namespace CalamityMod.World.Minibiomes
|
||||
int x = placementArea.X + WorldGen.genRand.Next(16, placementArea.Width - 16);
|
||||
int y = placementArea.Y + WorldGen.genRand.Next(12, placementArea.Height - 12);
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
if (tile.active() || tile.liquid > 0 || !WorldGen.SolidTile(x, y + 1))
|
||||
if (tile.HasTile || tile.LiquidAmount > 0 || !WorldGen.SolidTile(x, y + 1))
|
||||
{
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
Main.tile[x, y].type = (ushort)ModContent.TileType<FloralPlants>();
|
||||
Main.tile[x, y].frameX = (short)(Utils.SelectRandom(WorldGen.genRand, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 27, 28, 29,
|
||||
Main.tile[x, y].TileType = (ushort)ModContent.TileType<FloralPlants>();
|
||||
Main.tile[x, y].TileFrameX = (short)(Utils.SelectRandom(WorldGen.genRand, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 27, 28, 29,
|
||||
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44) * 18);
|
||||
Main.tile[x, y].frameY = 0;
|
||||
Main.tile[x, y].active(true);
|
||||
Main.tile[x, y].TileFrameY = 0;
|
||||
Main.tile[x, y].Get<TileWallWireStateData>().HasTile = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ namespace CalamityMod.World.Minibiomes
|
||||
{
|
||||
for (int dy = 0; dy < length * 2; dy++)
|
||||
{
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).active())
|
||||
if (CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).HasTile)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -463,10 +463,10 @@ namespace CalamityMod.World.Minibiomes
|
||||
if (dx == 0 && dy % 2 == 0)
|
||||
xFrame = WorldGen.genRand.NextBool(yFrame > 0 ? 2 : 5) ? 36 : 0;
|
||||
|
||||
Main.tile[x + dx, y + dy].active(true);
|
||||
Main.tile[x + dx, y + dy].frameX = (short)(xFrame + dx * 18);
|
||||
Main.tile[x + dx, y + dy].frameY = (short)(yFrame + dy % 2 * 18);
|
||||
Main.tile[x + dx, y + dy].type = vineID;
|
||||
Main.tile[x + dx, y + dy].Get<TileWallWireStateData>().HasTile = true;
|
||||
Main.tile[x + dx, y + dy].TileFrameX = (short)(xFrame + dx * 18);
|
||||
Main.tile[x + dx, y + dy].TileFrameY = (short)(yFrame + dy % 2 * 18);
|
||||
Main.tile[x + dx, y + dy].TileType = vineID;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -475,14 +475,14 @@ namespace CalamityMod.World.Minibiomes
|
||||
public static void RecursivelyFillAreaWithWater(int x, int y, int limit, ref int increment)
|
||||
{
|
||||
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
if (tile.active() || tile.liquid > 127)
|
||||
if (tile.HasTile || tile.LiquidAmount > 127)
|
||||
return;
|
||||
|
||||
increment++;
|
||||
if (increment >= limit)
|
||||
return;
|
||||
|
||||
Main.tile[x, y].liquid = 255;
|
||||
Main.tile[x, y].LiquidAmount = 255;
|
||||
RecursivelyFillAreaWithWater(x + 1, y, limit, ref increment);
|
||||
RecursivelyFillAreaWithWater(x - 1, y, limit, ref increment);
|
||||
RecursivelyFillAreaWithWater(x, y + 1, limit, ref increment);
|
||||
|
||||
Reference in new issue
Block a user