Merge branch '1.4' of https://github.com/CalamityTeam/CalamityMod into 1.4
No files matched your search
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater");
|
||||
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.Temple;
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// Placeholder until we get a dedicated Sunken Sea background
|
||||
|
||||
|
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 126 B |
@@ -28,10 +28,9 @@ namespace CalamityMod.Items.Placeables
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(25).
|
||||
AddIngredient(ModContent.ItemType<BrimstoneSlab>()).
|
||||
AddTile(TileID.HeavyWorkBench).
|
||||
Register();
|
||||
AddIngredient(ModContent.ItemType<BrimstoneSlag>()).
|
||||
AddTile(TileID.HeavyWorkBench).
|
||||
Register();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneAbyssLayer4 && spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType<Bloatfish>()) < 3)
|
||||
{
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.5f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
if (spawnInfo.Player.Calamity().ZoneAbyssLayer4 && spawnInfo.Water)
|
||||
{
|
||||
if (CalamityGlobalNPC.bobbitWormBottom.Contains(-1))
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.85f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace CalamityMod.Systems
|
||||
if (tileType == ModContent.TileType<LumenylCrystals>() && !DownedBossSystem.downedCalamitasClone)
|
||||
return false;
|
||||
|
||||
int minDistanceFromOtherTiles = 6;
|
||||
int minDistanceFromOtherTiles = 10;
|
||||
int sameTilesNearby = 0;
|
||||
for (int i = x - minDistanceFromOtherTiles; i < x + minDistanceFromOtherTiles; i++)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss.AbyssAmbient
|
||||
{
|
||||
public class AbyssGiantKelp1 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.Width = 2;
|
||||
TileObjectData.newTile.Height = 5;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 4);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16, 16 };
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(76, 72, 35));
|
||||
DustType = DustID.Grass;
|
||||
HitSound = SoundID.Grass;
|
||||
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.TileFrameY <= 36)
|
||||
{
|
||||
r = 233f / 255f;
|
||||
g = 144f / 255f;
|
||||
b = 30f / 255f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 2;
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
|
||||
//just clone the first one its literally the same size
|
||||
public class AbyssGiantKelp2 : AbyssGiantKelp1
|
||||
{
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 879 B |
|
After Width: | Height: | Size: 489 B |
|
After Width: | Height: | Size: 861 B |
|
After Width: | Height: | Size: 510 B |
@@ -0,0 +1,63 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss.AbyssAmbient
|
||||
{
|
||||
public class AbyssGiantKelp3 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.Width = 2;
|
||||
TileObjectData.newTile.Height = 4;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 3);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 };
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(76, 72, 35));
|
||||
DustType = DustID.Grass;
|
||||
HitSound = SoundID.Grass;
|
||||
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.TileFrameY <= 36)
|
||||
{
|
||||
r = 233f / 255f;
|
||||
g = 144f / 255f;
|
||||
b = 30f / 255f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 2;
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 795 B |
|
After Width: | Height: | Size: 483 B |
@@ -0,0 +1,63 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss.AbyssAmbient
|
||||
{
|
||||
public class AbyssGiantKelp4 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.Width = 2;
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 2);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(76, 72, 35));
|
||||
DustType = DustID.Grass;
|
||||
HitSound = SoundID.Grass;
|
||||
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.TileFrameY <= 36)
|
||||
{
|
||||
r = 233f / 255f;
|
||||
g = 144f / 255f;
|
||||
b = 30f / 255f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 2;
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 663 B |
|
After Width: | Height: | Size: 447 B |
@@ -0,0 +1,55 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Metadata;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss.AbyssAmbient
|
||||
{
|
||||
public class AbyssKelp : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileCut[Type] = true;
|
||||
Main.tileSolid[Type] = false;
|
||||
Main.tileNoAttach[Type] = true;
|
||||
Main.tileNoFail[Type] = true;
|
||||
Main.tileLavaDeath[Type] = true;
|
||||
Main.tileWaterDeath[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileID.Sets.ReplaceTileBreakUp[Type] = true;
|
||||
TileID.Sets.SwaysInWindBasic[Type] = true;
|
||||
TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]);
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2);
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(76, 72, 35));
|
||||
DustType = DustID.Grass;
|
||||
HitSound = SoundID.Grass;
|
||||
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
|
||||
{
|
||||
offsetY = -12;
|
||||
height = 32;
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.TileFrameX >= 72)
|
||||
{
|
||||
r = 233f / 350f;
|
||||
g = 144f / 350f;
|
||||
b = 30f / 350f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,81 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss.AbyssAmbient
|
||||
{
|
||||
public class BulbTree1 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
TileObjectData.newTile.Width = 3;
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(1, 2);
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.UsesCustomCanPlace = true;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.WaterDeath = false;
|
||||
TileObjectData.newTile.LavaDeath = true;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(52, 124, 153));
|
||||
DustType = 33;
|
||||
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
r = 49f / 255f;
|
||||
g = 159f / 255f;
|
||||
b = 242f / 255f;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 2;
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
|
||||
public class BulbTree2 : BulbTree1
|
||||
{
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree2Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
|
||||
public class BulbTree3 : BulbTree1
|
||||
{
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 780 B |
|
After Width: | Height: | Size: 381 B |
|
After Width: | Height: | Size: 714 B |
|
After Width: | Height: | Size: 396 B |
|
After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 363 B |
@@ -11,9 +11,8 @@ namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileLavaDeath[Type] = true;
|
||||
Main.tileLavaDeath[Type] = false;
|
||||
Main.tileWaterDeath[Type] = false;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -38,6 +39,30 @@ namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Tile up = Main.tile[i, j - 1];
|
||||
Tile up2 = Main.tile[i, j - 2];
|
||||
|
||||
//place kelp
|
||||
if (WorldGen.genRand.Next(8) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
{
|
||||
up.TileType = (ushort)ModContent.TileType<AbyssKelp>();
|
||||
up.HasTile = true;
|
||||
up.TileFrameY = 0;
|
||||
|
||||
//7 different frames, choose a random one
|
||||
up.TileFrameX = (short)(WorldGen.genRand.Next(7) * 18);
|
||||
WorldGen.SquareTileFrame(i, j - 1, true);
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
|
||||
@@ -44,9 +44,9 @@ namespace CalamityMod.Tiles.Abyss
|
||||
Tile leftTile = Main.tile[i - 1, j];
|
||||
|
||||
if ((belowTile.Slope == SlopeType.Solid && !belowTile.IsHalfBlock && belowTile.HasTile && belowTile.IsTileSolid()) ||
|
||||
(aboveTile.Slope == SlopeType.Solid && !aboveTile.IsHalfBlock && aboveTile.HasTile && aboveTile.IsTileSolid()) ||
|
||||
(rightTile.Slope == SlopeType.Solid && !rightTile.IsHalfBlock && rightTile.HasTile && rightTile.IsTileSolid()) ||
|
||||
(leftTile.Slope == SlopeType.Solid && !leftTile.IsHalfBlock && leftTile.HasTile && leftTile.IsTileSolid()))
|
||||
(aboveTile.Slope == SlopeType.Solid && !aboveTile.IsHalfBlock && aboveTile.HasTile && aboveTile.IsTileSolid()) ||
|
||||
(rightTile.Slope == SlopeType.Solid && !rightTile.IsHalfBlock && rightTile.HasTile && rightTile.IsTileSolid()) ||
|
||||
(leftTile.Slope == SlopeType.Solid && !leftTile.IsHalfBlock && leftTile.HasTile && leftTile.IsTileSolid()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -75,6 +75,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
Main.tile[i, j].TileFrameY = 54;
|
||||
}
|
||||
|
||||
Main.tile[i, j].TileFrameX = (short)(WorldGen.genRand.Next(18) * 18);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Walls;
|
||||
using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using CalamityMod.Walls;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -49,6 +50,27 @@ namespace CalamityMod.Tiles.Abyss
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Tile up = Main.tile[i, j - 1];
|
||||
Tile up2 = Main.tile[i, j - 2];
|
||||
|
||||
//place kelp
|
||||
if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
{
|
||||
up.TileType = (ushort)ModContent.TileType<AbyssKelp>();
|
||||
up.HasTile = true;
|
||||
up.TileFrameY = 0;
|
||||
|
||||
//7 different frames, choose a random one
|
||||
up.TileFrameX = (short)(WorldGen.genRand.Next(7) * 18);
|
||||
WorldGen.SquareTileFrame(i, j - 1, true);
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None);
|
||||
}
|
||||
}
|
||||
|
||||
int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143));
|
||||
if (Main.tile[i, j + 1] != null)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
@@ -43,6 +44,30 @@ namespace CalamityMod.Tiles.Abyss
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Tile up = Main.tile[i, j - 1];
|
||||
Tile up2 = Main.tile[i, j - 2];
|
||||
|
||||
//place kelp
|
||||
if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
{
|
||||
up.TileType = (ushort)ModContent.TileType<AbyssKelp>();
|
||||
up.HasTile = true;
|
||||
up.TileFrameY = 0;
|
||||
|
||||
//7 different frames, choose a random one
|
||||
up.TileFrameX = (short)(WorldGen.genRand.Next(7) * 18);
|
||||
WorldGen.SquareTileFrame(i, j - 1, true);
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
|
||||
{
|
||||
int uniqueAnimationFrameX = 0;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using CalamityMod.Tiles.Astral;
|
||||
using CalamityMod.Tiles.AstralDesert;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
@@ -46,7 +47,8 @@ namespace CalamityMod.Tiles
|
||||
TileID.CrimsonPlants,
|
||||
(ushort)ModContent.TileType<AstralShortPlants>(),
|
||||
(ushort)ModContent.TileType<AstralTallPlants>(),
|
||||
(ushort)ModContent.TileType<CinderBlossomTallPlants>()
|
||||
(ushort)ModContent.TileType<CinderBlossomTallPlants>(),
|
||||
(ushort)ModContent.TileType<AbyssKelp>()
|
||||
};
|
||||
|
||||
public static List<int> GrowthTiles = new List<int>()
|
||||
|
||||
@@ -30,10 +30,12 @@ namespace CalamityMod.Tiles.Crags
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
Tile up = Main.tile[i, j - 1];
|
||||
Tile left = Main.tile[i - 1, j];
|
||||
Tile right = Main.tile[i + 1, j];
|
||||
|
||||
if (WorldGen.genRand.Next(3) == 0 && (left.TileType == ModContent.TileType<ScorchedRemainsGrass>() || right.TileType == ModContent.TileType<ScorchedRemainsGrass>()))
|
||||
if (WorldGen.genRand.Next(3) == 0 && !up.HasTile && (left.TileType == ModContent.TileType<ScorchedRemainsGrass>() ||
|
||||
right.TileType == ModContent.TileType<ScorchedRemainsGrass>()))
|
||||
{
|
||||
Main.tile[i, j].TileType = (ushort)ModContent.TileType<ScorchedRemainsGrass>();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Items.Mounts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Enums;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -13,18 +14,21 @@ namespace CalamityMod.Tiles.DraedonStructures
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoAttach[Type] = true;
|
||||
Main.tileSpelunker[Type] = true;
|
||||
Main.tileSolid[Type] = false;
|
||||
Main.tileLavaDeath[Type] = false;
|
||||
Main.tileWaterDeath[Type] = false;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
|
||||
TileObjectData.newTile.Width = 8;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 };
|
||||
TileObjectData.addTile(Type);
|
||||
TileObjectData.newTile.Width = 8;
|
||||
TileObjectData.newTile.Height = 4;
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 };
|
||||
TileObjectData.newTile.StyleWrapLimit = 36;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.DrawYOffset = 2;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Onyx Excavator");
|
||||
AddMapEntry(new Color(128, 0, 128), name);
|
||||
TileID.Sets.DisableSmartCursor[Type] = true;
|
||||
}
|
||||
|
||||
public override void KillMultiTile(int i, int j, int frameX, int frameY)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using CalamityMod.Tiles.Astral;
|
||||
using CalamityMod.Tiles.AstralDesert;
|
||||
using CalamityMod.Tiles.AstralSnow;
|
||||
@@ -62,6 +63,7 @@ namespace CalamityMod
|
||||
PlantCheckAgainst[ModContent.TileType<AstralShortPlants>()] = new int[1] { ModContent.TileType<AstralGrass>() };
|
||||
PlantCheckAgainst[ModContent.TileType<AstralTallPlants>()] = new int[1] { ModContent.TileType<AstralGrass>() };
|
||||
PlantCheckAgainst[ModContent.TileType<CinderBlossomTallPlants>()] = new int[1] { ModContent.TileType<ScorchedRemainsGrass>() };
|
||||
PlantCheckAgainst[ModContent.TileType<AbyssKelp>()] = new int[2] { ModContent.TileType<AbyssGravel>(), ModContent.TileType<Voidstone>() };
|
||||
|
||||
VineToGrass = new Dictionary<ushort, ushort>
|
||||
{
|
||||
|
||||
@@ -41,30 +41,6 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
|
||||
//place a circular clump of tiles
|
||||
public static void NaturalCircle(int i, int j, int size, int tileType, bool hasRandomness = false)
|
||||
{
|
||||
int BaseRadius = size;
|
||||
int radius = BaseRadius;
|
||||
|
||||
for (int y = j - radius; y <= j + radius; y++)
|
||||
{
|
||||
for (int x = i - radius; x <= i + radius + 1; x++)
|
||||
{
|
||||
if ((int)Vector2.Distance(new Vector2(x, y), new Vector2(i, j)) <= radius && WorldGen.InWorld(x, y))
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
|
||||
WorldGen.KillTile(x, y);
|
||||
WorldGen.PlaceTile(x, y, tileType);
|
||||
tile.Slope = 0;
|
||||
}
|
||||
}
|
||||
|
||||
radius = BaseRadius - (hasRandomness ? WorldGen.genRand.Next(-1, 2) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Settles all liquids in the world.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,13 +7,17 @@ using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using CalamityMod.Tiles.Abyss.AbyssAmbient;
|
||||
using CalamityMod.Tiles.FurnitureVoid;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.Walls;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.IO;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.World
|
||||
@@ -65,37 +69,35 @@ namespace CalamityMod.World
|
||||
|
||||
if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30))
|
||||
{
|
||||
//dithering on the edge of the abyss
|
||||
if (abyssIndex > abyssChasmX + 75)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(4))
|
||||
{
|
||||
if (canConvert)
|
||||
{
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
}
|
||||
else if (!tile.HasTile)
|
||||
{
|
||||
tile.Get<TileWallWireStateData>().HasTile = true;
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (abyssIndex > abyssChasmX + 70)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
if (canConvert)
|
||||
WorldGen.KillTile(abyssIndex, abyssIndex2);
|
||||
|
||||
if (abyssIndex2 > (rockLayer + y * 0.262))
|
||||
{
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<Voidstone>());
|
||||
}
|
||||
else if (!tile.HasTile)
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
tile.Get<TileWallWireStateData>().HasTile = true;
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<Voidstone>());
|
||||
}
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.145))
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<Voidstone>());
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<AbyssGravel>());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<AbyssGravel>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,37 +189,35 @@ namespace CalamityMod.World
|
||||
|
||||
if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30))
|
||||
{
|
||||
//dithering on the edge of the abyss
|
||||
if (abyssIndex < abyssChasmX - 75)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(4))
|
||||
{
|
||||
if (canConvert)
|
||||
{
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
}
|
||||
else if (!tile.HasTile)
|
||||
{
|
||||
tile.Get<TileWallWireStateData>().HasTile = true;
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (abyssIndex < abyssChasmX - 70)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
if (canConvert)
|
||||
WorldGen.KillTile(abyssIndex, abyssIndex2);
|
||||
|
||||
if (abyssIndex2 > (rockLayer + y * 0.262))
|
||||
{
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<Voidstone>());
|
||||
}
|
||||
else if (!tile.HasTile)
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
tile.Get<TileWallWireStateData>().HasTile = true;
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<Voidstone>());
|
||||
}
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.145))
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<Voidstone>());
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<AbyssGravel>());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<AbyssGravel>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,7 @@ namespace CalamityMod.World
|
||||
}
|
||||
|
||||
//increase y value so islands cant be spammed on top of each other
|
||||
voidIslandY += WorldGen.genRand.Next(10, 20);
|
||||
voidIslandY += WorldGen.genRand.Next(20, 32);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,15 +525,98 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
|
||||
//clear lava and glowing moss away from the side of the abyss because it ruins immersion
|
||||
if (AtLeftSideOfWorld)
|
||||
{
|
||||
for (int abyssIndex = 0; abyssIndex < abyssChasmX + 155; abyssIndex++)
|
||||
{
|
||||
for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++)
|
||||
{
|
||||
Tile tile = Main.tile[abyssIndex, abyssIndex2];
|
||||
|
||||
if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0)
|
||||
{
|
||||
tile.LiquidAmount = 0;
|
||||
}
|
||||
|
||||
int[] Mosses = { 381, 534, 536, 539, 625, 627 };
|
||||
|
||||
if (Mosses.Contains(tile.TileType))
|
||||
{
|
||||
tile.TileType = TileID.Stone;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int abyssIndex = abyssChasmX - 155; abyssIndex < x; abyssIndex++)
|
||||
{
|
||||
for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++)
|
||||
{
|
||||
Tile tile = Main.tile[abyssIndex, abyssIndex2];
|
||||
|
||||
if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0)
|
||||
{
|
||||
tile.LiquidAmount = 0;
|
||||
}
|
||||
|
||||
int[] Mosses = { 381, 534, 536, 539, 625, 627 };
|
||||
|
||||
if (Mosses.Contains(tile.TileType))
|
||||
{
|
||||
tile.TileType = TileID.Stone;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//ambient tiles and pots
|
||||
if (AtLeftSideOfWorld)
|
||||
{
|
||||
for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235
|
||||
{
|
||||
for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++)
|
||||
{
|
||||
//pots
|
||||
if (!Main.tile[abyssIndex, abyssIndex2].HasTile)
|
||||
{
|
||||
//above the 4th layer
|
||||
if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1))
|
||||
{
|
||||
//giant kelp, more often in upper layers
|
||||
if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<AbyssGravel>()) ||
|
||||
(WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<Voidstone>()))
|
||||
{
|
||||
ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType<AbyssGiantKelp1>(), (ushort)ModContent.TileType<AbyssGiantKelp2>(),
|
||||
(ushort)ModContent.TileType<AbyssGiantKelp3>(), (ushort)ModContent.TileType<AbyssGiantKelp4>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps));
|
||||
}
|
||||
|
||||
//bulb trees on voidstone
|
||||
if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<Voidstone>())
|
||||
{
|
||||
ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType<BulbTree1>(),
|
||||
(ushort)ModContent.TileType<BulbTree2>(), (ushort)ModContent.TileType<BulbTree3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees));
|
||||
}
|
||||
}
|
||||
|
||||
//below 4th layer
|
||||
if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1))
|
||||
{
|
||||
//bulb trees on voidstone
|
||||
if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<Voidstone>())
|
||||
{
|
||||
ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType<BulbTree1>(),
|
||||
(ushort)ModContent.TileType<BulbTree2>(), (ushort)ModContent.TileType<BulbTree3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees));
|
||||
}
|
||||
}
|
||||
|
||||
//pots
|
||||
if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(5))
|
||||
@@ -542,6 +625,7 @@ namespace CalamityMod.World
|
||||
CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true);
|
||||
}
|
||||
}
|
||||
//sulphur pots
|
||||
else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(3))
|
||||
@@ -560,9 +644,45 @@ namespace CalamityMod.World
|
||||
{
|
||||
for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++)
|
||||
{
|
||||
//pots
|
||||
if (!Main.tile[abyssIndex, abyssIndex2].HasTile)
|
||||
{
|
||||
//above the 4th layer
|
||||
if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1))
|
||||
{
|
||||
//giant kelp, more often in upper layers
|
||||
if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<AbyssGravel>()) ||
|
||||
(WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<Voidstone>()))
|
||||
{
|
||||
ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType<AbyssGiantKelp1>(), (ushort)ModContent.TileType<AbyssGiantKelp2>(),
|
||||
(ushort)ModContent.TileType<AbyssGiantKelp3>(), (ushort)ModContent.TileType<AbyssGiantKelp4>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps));
|
||||
}
|
||||
|
||||
//bulb trees on voidstone
|
||||
if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<Voidstone>())
|
||||
{
|
||||
ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType<BulbTree1>(),
|
||||
(ushort)ModContent.TileType<BulbTree2>(), (ushort)ModContent.TileType<BulbTree3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees));
|
||||
}
|
||||
}
|
||||
|
||||
//below 4th layer
|
||||
if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1))
|
||||
{
|
||||
//bulb trees on voidstone
|
||||
if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType<Voidstone>())
|
||||
{
|
||||
ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType<BulbTree1>(),
|
||||
(ushort)ModContent.TileType<BulbTree2>(), (ushort)ModContent.TileType<BulbTree3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees));
|
||||
}
|
||||
}
|
||||
|
||||
//pots
|
||||
if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(5))
|
||||
@@ -571,6 +691,7 @@ namespace CalamityMod.World
|
||||
CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true);
|
||||
}
|
||||
}
|
||||
//sulphur pots
|
||||
else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(3))
|
||||
@@ -1027,4 +1148,4 @@ namespace CalamityMod.World
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,9 @@ namespace CalamityMod.World
|
||||
{
|
||||
if (!Convert)
|
||||
{
|
||||
if (WorldGen.genRand.Next(365) == 0 && Main.tile[x, y].TileType == TileID.Cloud && Main.tile[x, y].HasTile)
|
||||
Tile tile = Main.tile[x, y];
|
||||
|
||||
if (WorldGen.genRand.Next(365) == 0 && tile.TileType == TileID.Cloud && tile.HasTile)
|
||||
{
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
|
||||
@@ -26,14 +26,15 @@ namespace CalamityMod.World
|
||||
|
||||
static int lavaLakePlaceDelay = 0;
|
||||
static int lavaLakeBigPlaceDelay = 0;
|
||||
static int numLavaLakes = 0;
|
||||
|
||||
static int TreeDelay = 0;
|
||||
|
||||
//basic terrain (sorry for the excessive amount of loops lmao)
|
||||
//all the main crags terrain generation
|
||||
private static void GenCrags()
|
||||
{
|
||||
//set this here so it can properly scale to the worldsize and whatever
|
||||
//the 25's are there to offset it from the exact edge of the world so no "out of bounds" crashing occurs
|
||||
//set StartX here so it can properly scale with worldsize (just to be safe)
|
||||
//the 25's are there to offset it from the exact edge of the world so that no "out of bounds" crashing occurs
|
||||
StartX = WorldGen.dungeonX < Main.maxTilesX / 2 ? 25 : (Main.maxTilesX - (Main.maxTilesX / 5)) - 25;
|
||||
|
||||
//set these to be able to easily place things in certain locations, like structures
|
||||
@@ -41,7 +42,7 @@ namespace CalamityMod.World
|
||||
int biomeEdge = biomeStart + (Main.maxTilesX / 5);
|
||||
int biomeMiddle = (biomeStart + biomeEdge) / 2;
|
||||
|
||||
//clear all blocks and lava in the area
|
||||
//clear literally everything in the area the biome will generate in
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 200; y < Main.maxTilesY - 2; y++)
|
||||
@@ -77,7 +78,19 @@ namespace CalamityMod.World
|
||||
tileDown.TileType != ModContent.TileType<BrimstoneSlag>() || tileLeft.TileType != ModContent.TileType<BrimstoneSlag>() ||
|
||||
tileRight.TileType != ModContent.TileType<BrimstoneSlag>()))
|
||||
{
|
||||
CalamityUtils.NaturalCircle(x, y, WorldGen.genRand.Next(5, 22), ModContent.TileType<BrimstoneSlag>(), true);
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
int radius = WorldGen.genRand.Next(5, 22);
|
||||
WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
|
||||
{
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
|
||||
WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.ClearTile(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<BrimstoneSlag>())
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,14 +104,26 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
|
||||
//place ceiling across the top of the biome
|
||||
//place ceiling of slag across the top of the biome
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 200; y <= Main.maxTilesY - 192; y++)
|
||||
{
|
||||
if (WorldGen.genRand.Next(25) == 0)
|
||||
{
|
||||
CalamityUtils.NaturalCircle(x, y, WorldGen.genRand.Next(5, 15), ModContent.TileType<BrimstoneSlag>(), true);
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
int radius = WorldGen.genRand.Next(3, 7);
|
||||
WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
|
||||
{
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
|
||||
WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.ClearTile(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<BrimstoneSlag>())
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,15 +191,19 @@ namespace CalamityMod.World
|
||||
lavaLakeBigPlaceDelay--;
|
||||
}
|
||||
|
||||
//surface lava lakes and pits
|
||||
//the reason theres three different runners being used is so that a shallow lava pit is placed above each lava pit
|
||||
//surface lava pits
|
||||
if (lavaLakeBigPlaceDelay == 0)
|
||||
{
|
||||
LavaTileRunner runner3 = new LavaTileRunner(new Vector2(x, Main.maxTilesY - 165), new Vector2(0, 5), new Point16(-500, 500),
|
||||
new Point16(250, 1000), 15f, WorldGen.genRand.Next(300, 1000), 0, true, true);
|
||||
runner3.Start();
|
||||
//do not place lava in the general middle area of the biome because it keeps flooding the crag bridge
|
||||
if (numLavaLakes != 2 && numLavaLakes != 3)
|
||||
{
|
||||
LavaTileRunner runner3 = new LavaTileRunner(new Vector2(x, Main.maxTilesY - 165), new Vector2(0, 5), new Point16(-500, 500),
|
||||
new Point16(250, 1000), 15f, WorldGen.genRand.Next(300, 1000), 0, true, true);
|
||||
runner3.Start();
|
||||
}
|
||||
|
||||
lavaLakeBigPlaceDelay = 240; //set lava lake delay so it cant just spam lava lakes everywhere
|
||||
numLavaLakes++;
|
||||
lavaLakeBigPlaceDelay = 200; //set lava lake delay so it cant just spam lava lakes everywhere
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +214,8 @@ namespace CalamityMod.World
|
||||
{
|
||||
if (WorldGen.genRand.Next(1200) == 0)
|
||||
{
|
||||
LavaTileRunner runner = new LavaTileRunner(new Vector2(x, y), new Vector2(0, 5), new Point16(-20000, 20000),
|
||||
new Point16(-12, 12), 15f, WorldGen.genRand.Next(12, 25), 0, true, true);
|
||||
LavaTileRunner runner = new LavaTileRunner(new Vector2(x, y), new Vector2(0, 5), new Point16(0, 5),
|
||||
new Point16(-12, 12), 15f, WorldGen.genRand.Next(-12, 25), 0, true, true);
|
||||
runner.Start();
|
||||
}
|
||||
}
|
||||
@@ -209,7 +238,7 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
|
||||
//charred ore
|
||||
//place clumps of charred ore
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 150; y <= Main.maxTilesY - 45; y++)
|
||||
@@ -249,7 +278,7 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
|
||||
//clean up any lava above a certain threshold to prevent the biome's surface from being flooded
|
||||
//clean up any lava in the biomes surface to prevent it from being obnoxiously flooded
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 150; y <= Main.maxTilesY - 122; y++)
|
||||
@@ -276,7 +305,7 @@ namespace CalamityMod.World
|
||||
//stalactites and stalagmites
|
||||
if (tile.TileType == ModContent.TileType<BrimstoneSlag>())
|
||||
{
|
||||
if (WorldGen.genRand.Next(32) == 0)
|
||||
if (WorldGen.genRand.Next(20) == 0)
|
||||
{
|
||||
ushort[] Stalactites = new ushort[] { (ushort)ModContent.TileType<CragStalactiteGiant1>(),
|
||||
(ushort)ModContent.TileType<CragStalactiteGiant2>(), (ushort)ModContent.TileType<CragStalactiteGiant3>() };
|
||||
@@ -284,7 +313,7 @@ namespace CalamityMod.World
|
||||
WorldGen.PlaceObject(x, y + 2, WorldGen.genRand.Next(Stalactites));
|
||||
}
|
||||
|
||||
if (WorldGen.genRand.Next(10) == 0)
|
||||
if (WorldGen.genRand.Next(8) == 0)
|
||||
{
|
||||
ushort[] Stalactites = new ushort[] { (ushort)ModContent.TileType<CragStalactiteLarge1>(),
|
||||
(ushort)ModContent.TileType<CragStalactiteLarge2>(), (ushort)ModContent.TileType<CragStalactiteLarge3>(),
|
||||
@@ -312,17 +341,16 @@ namespace CalamityMod.World
|
||||
WorldGen.PlaceObject(x, y - 1, WorldGen.genRand.Next(Stalagmites));
|
||||
}
|
||||
|
||||
//decrease tree delay
|
||||
if (TreeDelay > 0)
|
||||
{
|
||||
TreeDelay--;
|
||||
}
|
||||
|
||||
//grow spine tree
|
||||
if (WorldGen.genRand.Next(12) == 0 && TreeDelay == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
if (WorldGen.genRand.Next(3) == 0 && TreeDelay == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
{
|
||||
SpineTree.Spawn(x, y - 1, 22, 28, false, -1, false);
|
||||
TreeDelay = 15;
|
||||
TreeDelay = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,95 +19,92 @@ namespace CalamityMod.World
|
||||
{
|
||||
public static void PlaceArchive()
|
||||
{
|
||||
int archiveX = 0;
|
||||
int archiveY = 0;
|
||||
int worldThird = Main.maxTilesX / 3;
|
||||
|
||||
bool placedArchive = false;
|
||||
bool foundValidPosition = false;
|
||||
bool shouldPlaceTheDamnThing = false;
|
||||
int dungeonArchiveColor = 0; //0 = blue, 1 = green, 2 = pink
|
||||
|
||||
int heightLimit = (Main.maxTilesY / 2) + (Main.maxTilesY / 8);
|
||||
|
||||
for (int x = WorldGen.dungeonX - 100; x <= WorldGen.dungeonX + 100; x++)
|
||||
//start much higher above the top of hell so it doesnt get nuked by the crags generation, and so it wont generate too low
|
||||
for (int j = Main.maxTilesY - 380; j > 0; j--)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 200; y >= heightLimit; y--)
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
Tile tileUp = Main.tile[x, y - 1];
|
||||
Tile tileUp2 = Main.tile[x, y - 2];
|
||||
Tile tileUp3 = Main.tile[x, y - 3];
|
||||
Tile tileDown = Main.tile[x, y + 1];
|
||||
int i = 100;
|
||||
if (WorldGen.dungeonSide == 1)
|
||||
{
|
||||
i = Main.maxTilesX - 100;
|
||||
}
|
||||
|
||||
if ((tile.TileType == 41 || tile.TileType == 43 || tile.TileType == 44 || tile.TileType == 48) && !tileUp.HasTile)
|
||||
bool shouldContinue = true;
|
||||
bool placedArchive = false;
|
||||
int color = 0;
|
||||
|
||||
while (shouldContinue)
|
||||
{
|
||||
if (WorldGen.dungeonSide == 1)
|
||||
{
|
||||
//blue brick walls
|
||||
if ((tileUp.WallType == 7 || tileUp.WallType == 94 || tileUp.WallType == 95) &&
|
||||
(tileUp2.WallType == 7 || tileUp2.WallType == 94 || tileUp2.WallType == 95) &&
|
||||
(tileUp3.WallType == 7 || tileUp3.WallType == 94 || tileUp3.WallType == 95))
|
||||
i--;
|
||||
if (i < Main.maxTilesX - worldThird)
|
||||
{
|
||||
shouldContinue = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
if (i > worldThird)
|
||||
{
|
||||
shouldContinue = false;
|
||||
}
|
||||
}
|
||||
|
||||
Tile tile = Main.tile[i, j];
|
||||
Tile tileUp1 = Main.tile[i, j - 1];
|
||||
Tile tileUp2 = Main.tile[i, j - 2];
|
||||
Tile tileUp3 = Main.tile[i, j - 3];
|
||||
Tile tileUp4 = Main.tile[i, j - 4];
|
||||
Tile tileUp5 = Main.tile[i, j - 5];
|
||||
|
||||
int[] DungeonWalls = { 7, 94, 95, 8, 98, 99, 9, 96, 97 };
|
||||
//if (Main.tileDungeon[tile.TileType] && DungeonWalls.Contains(tileUp.WallType) && !tileUp.HasTile)
|
||||
|
||||
if (Main.tileDungeon[tile.TileType] && !tileUp1.HasTile && !tileUp2.HasTile && !tileUp3.HasTile && !tileUp4.HasTile && !tileUp5.HasTile)
|
||||
{
|
||||
//i += WorldGen.dungeonSide * -16;
|
||||
|
||||
//determine the archive brick color
|
||||
if (tile.TileType == TileID.BlueDungeonBrick)
|
||||
dungeonArchiveColor = 0;
|
||||
archiveX = x;
|
||||
archiveY = y;
|
||||
|
||||
foundValidPosition = true;
|
||||
}
|
||||
//green brick walls
|
||||
if ((tileUp.WallType == 8 || tileUp.WallType == 98 || tileUp.WallType == 99) &&
|
||||
(tileUp2.WallType == 8 || tileUp2.WallType == 98 || tileUp2.WallType == 99) &&
|
||||
(tileUp3.WallType == 8 || tileUp3.WallType == 98 || tileUp3.WallType == 99))
|
||||
{
|
||||
else if (tile.TileType == TileID.GreenDungeonBrick)
|
||||
dungeonArchiveColor = 1;
|
||||
archiveX = x;
|
||||
archiveY = y;
|
||||
|
||||
foundValidPosition = true;
|
||||
}
|
||||
//pink brick walls
|
||||
if ((tileUp.WallType == 9 || tileUp.WallType == 96 || tileUp.WallType == 97) &&
|
||||
(tileUp2.WallType == 9 || tileUp2.WallType == 96 || tileUp2.WallType == 97) &&
|
||||
(tileUp3.WallType == 9 || tileUp3.WallType == 96 || tileUp3.WallType == 97))
|
||||
{
|
||||
else if (tile.TileType == TileID.PinkDungeonBrick)
|
||||
dungeonArchiveColor = 2;
|
||||
archiveX = x;
|
||||
archiveY = y;
|
||||
|
||||
placedArchive = true;
|
||||
|
||||
foundValidPosition = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//in order to make sure the archive places at the very bottom of the dungeon
|
||||
//loop upward a certain amount, and if it doesnt place reset everything and increase the maximum check height before the loop ends
|
||||
//this way it will keep checking upward so it places nicely and doesnt destroy other parts of the dungeon (or at least not as much)
|
||||
if (x >= (WorldGen.dungeonX + 100) - 5 && y <= heightLimit + 5 && !foundValidPosition)
|
||||
if (placedArchive)
|
||||
{
|
||||
bool firstItem = false;
|
||||
|
||||
if (dungeonArchiveColor == 0)
|
||||
{
|
||||
x = WorldGen.dungeonX - 100;
|
||||
heightLimit -= 1;
|
||||
SchematicManager.PlaceSchematic(SchematicManager.BlueArchiveKey, new Point(i, j), SchematicAnchor.TopCenter,
|
||||
ref firstItem, new Action<Chest, int, bool>(FillArchiveChests));
|
||||
}
|
||||
if (dungeonArchiveColor == 1)
|
||||
{
|
||||
SchematicManager.PlaceSchematic(SchematicManager.GreenArchiveKey, new Point(i, j), SchematicAnchor.TopCenter,
|
||||
ref firstItem, new Action<Chest, int, bool>(FillArchiveChests));
|
||||
}
|
||||
if (dungeonArchiveColor == 2)
|
||||
{
|
||||
SchematicManager.PlaceSchematic(SchematicManager.PinkArchiveKey, new Point(i, j), SchematicAnchor.TopCenter,
|
||||
ref firstItem, new Action<Chest, int, bool>(FillArchiveChests));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundValidPosition && !placedArchive)
|
||||
{
|
||||
bool firstItem = false;
|
||||
|
||||
if (dungeonArchiveColor == 0)
|
||||
{
|
||||
SchematicManager.PlaceSchematic(SchematicManager.BlueArchiveKey, new Point(archiveX - 10, archiveY), SchematicAnchor.TopCenter,
|
||||
ref firstItem, new Action<Chest, int, bool>(FillArchiveChests));
|
||||
break;
|
||||
}
|
||||
if (dungeonArchiveColor == 1)
|
||||
{
|
||||
SchematicManager.PlaceSchematic(SchematicManager.GreenArchiveKey, new Point(archiveX - 10, archiveY), SchematicAnchor.TopCenter,
|
||||
ref firstItem, new Action<Chest, int, bool>(FillArchiveChests));
|
||||
}
|
||||
if (dungeonArchiveColor == 2)
|
||||
{
|
||||
SchematicManager.PlaceSchematic(SchematicManager.PinkArchiveKey, new Point(archiveX - 10, archiveY), SchematicAnchor.TopCenter,
|
||||
ref firstItem, new Action<Chest, int, bool>(FillArchiveChests));
|
||||
}
|
||||
|
||||
placedArchive = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace CalamityMod.World
|
||||
iceTilesInArea++;
|
||||
}
|
||||
}
|
||||
if (!canGenerateInLocation || iceTilesInArea < totalTiles * 0.2f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y)))
|
||||
if (!canGenerateInLocation || iceTilesInArea < totalTiles * 0.35f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y)))
|
||||
{
|
||||
tries++;
|
||||
}
|
||||
|
||||