vernal pass, other worldgen changes

-added vernal pass generation
-added new abyss treasure chests that open after skeletron (sprite is a placeholder)
-void wall islands dont have planty mush anymore
-removed shadow key tooltip
This commit is contained in:
Mortis3 committed 2023-02-11 22:48:21 -05:00
1 parent 6e4e1b68b7
commit 5118ed174f
20 files changed
+401 -101

No files matched your search

-4
View File
@@ -266,10 +266,6 @@ namespace CalamityMod.Items
EditTooltipByNum(0, (line) => line.Text = "Throws a mixture of slime and sparkling crystals"
+ "\nSlimed enemies take more damage from fire-based debuffs");
// Add a tooltip about location of Shadow Chests
if (item.type == ItemID.ShadowKey)
EditTooltipByNum(0, (line) => line.Text += "\nShadow Chests can be found in the Abyss, Brimstone Crag and Underworld");
// Flesh Knuckles giving extra max life.
if (item.type == ItemID.FleshKnuckles || item.type == ItemID.HeroShield || item.type == ItemID.BerserkerGlove)
EditTooltipByNum(0, (line) => line.Text += "\nMax life increased by 45");
@@ -0,0 +1,30 @@
using CalamityMod.Items.Materials;
using CalamityMod.Tiles.Abyss;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture
{
public class AbyssTreasureChest : ModItem
{
public override void SetStaticDefaults()
{
SacrificeTotal = 1;
}
public override void SetDefaults()
{
Item.width = 26;
Item.height = 22;
Item.maxStack = 99;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = 500;
Item.createTile = ModContent.TileType<Tiles.Abyss.AbyssTreasureChest>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

+1 -1
View File
@@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.Abyss
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return SpawnCondition.OceanMonster.Chance * 2.5f;
return SpawnCondition.CaveJellyfish.Chance * 2.5f;
}
return SpawnCondition.OceanMonster.Chance * 0.1f;
}
+1 -1
View File
@@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.Abyss
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return SpawnCondition.OceanMonster.Chance * 2.2f;
return SpawnCondition.CaveJellyfish.Chance * 2.2f;
}
return SpawnCondition.OceanMonster.Chance * 0.1f;
}
+1 -1
View File
@@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.Abyss
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 1.0f;
return SpawnCondition.CaveJellyfish.Chance * 2.0f;
}
return 0f;
}
+5
View File
@@ -60,6 +60,9 @@ namespace CalamityMod.Schematics
internal const string SurfaceShrineKey = "Surface Shrine";
internal const string SurfaceShrineFilename = "Schematics/Shrine_Surface.csch";
internal const string VernalKey = "Vernal Pass";
internal const string VernalFilename = "Schematics/VernalPass.csch";
internal const string AstralBeaconKey = "Astral Beacon";
@@ -116,6 +119,8 @@ namespace CalamityMod.Schematics
[MushroomShrineKey] = CalamitySchematicIO.LoadSchematic(MushroomShrineFilename),
[SurfaceShrineKey] = CalamitySchematicIO.LoadSchematic(SurfaceShrineFilename),
[VernalKey] = CalamitySchematicIO.LoadSchematic(VernalFilename),
// Astral world gen structures
[AstralBeaconKey] = CalamitySchematicIO.LoadSchematic(AstralBeaconFilename),
Binary file not shown.
+30 -19
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Systems
#region ModifyWorldGenTasks
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
// Evil Floating Island
//Evil Floating Island
int islandIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Floating Island Houses"));
if (islandIndex != -1)
{
@@ -40,14 +40,14 @@ namespace CalamityMod.Systems
}));
}
// Calamity's biome chests in the dungeon
//Calamity's biome chests in the dungeon
int DungeonChestIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Dungeon"));
if (DungeonChestIndex != -1)
{
tasks.Insert(DungeonChestIndex + 1, new PassLegacy("CalamityDungeonBiomeChests", MiscWorldgenRoutines.GenerateBiomeChests));
}
// Larger Jungle Temple
//Larger Jungle Temple
int JungleTempleIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Jungle Temple"));
tasks[JungleTempleIndex] = new PassLegacy("Jungle Temple", (progress, config) =>
{
@@ -55,7 +55,7 @@ namespace CalamityMod.Systems
CustomTemple.NewJungleTemple();
});
// Improved Golem arena
//Improved Golem arena
int JungleTempleIndex2 = tasks.FindIndex(genpass => genpass.Name.Equals("Temple"));
tasks[JungleTempleIndex2] = new PassLegacy("Temple", (progress, config) =>
{
@@ -66,7 +66,7 @@ namespace CalamityMod.Systems
Main.tileSolid[232] = false;
});
// Better Lihzahrd altar (consistency?)
//Better Lihzahrd altar (consistency?)
int LihzahrdAltarIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Lihzahrd Altars"));
tasks[LihzahrdAltarIndex] = new PassLegacy("Lihzahrd Altars", (progress, config) =>
{
@@ -74,7 +74,7 @@ namespace CalamityMod.Systems
CustomTemple.NewJungleTempleLihzahrdAltar();
});
// Giant beehive
//Giant beehive
int giantHiveIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Hives"));
if (giantHiveIndex != -1)
{
@@ -92,7 +92,18 @@ namespace CalamityMod.Systems
}));
}
// Sunken sea
//Vernal pass
int vernalIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Smooth World"));
if (vernalIndex != -1)
{
tasks.Insert(vernalIndex + 1, new PassLegacy("Vernal Pass", (progress, config) =>
{
progress.Message = "Generating vernal pass"; //placeholder until something more fancy is made
VernalPass.PlaceVernalPass(WorldGen.structures);
}));
}
//Sunken sea
int SunkenSeaIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Settle Liquids Again"));
if (SunkenSeaIndex != -1)
{
@@ -107,11 +118,11 @@ namespace CalamityMod.Systems
}));
}
// All further tasks occur after vanilla worldgen is completed
//All further tasks occur after vanilla worldgen is completed
int FinalIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Final Cleanup"));
if (FinalIndex != -1)
{
// Reallocate gems so rarity corresponds to depth
//Reallocate gems so rarity corresponds to depth
int currentFinalIndex = FinalIndex;
tasks.Insert(++currentFinalIndex, new PassLegacy("Gem Depth Adjustment", (progress, config) =>
{
@@ -119,17 +130,17 @@ namespace CalamityMod.Systems
MiscWorldgenRoutines.SmartGemGen();
}));
// Forsaken Archive structure in the Dungeon
//Forsaken Archive structure in the Dungeon
tasks.Insert(++currentFinalIndex, new PassLegacy("Forsaken Archive", (progress, config) =>
{
progress.Message = "Entombing occult literature";
DungeonArchive.PlaceArchive();
}));
// Planetoids
//Planetoids
tasks.Insert(++currentFinalIndex, new PassLegacy("Planetoids", Planetoid.GenerateAllBasePlanetoids));
// Sulphurous Sea (Step 1)
//Sulphurous Sea (Step 1)
int SulphurIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Micro Biomes"));
if (SulphurIndex != -1)
{
@@ -140,14 +151,14 @@ namespace CalamityMod.Systems
}));
}
// Brimstone Crags
//Brimstone Crags
tasks.Insert(++currentFinalIndex, new PassLegacy("Brimstone Crag", (progress, config) =>
{
progress.Message = "Incinerating Azafure";
BrimstoneCrag.GenAllCragsStuff();
}));
// Biome shrines
//Biome shrines
tasks.Insert(++currentFinalIndex, new PassLegacy("Special Shrines", (progress, config) =>
{
progress.Message = "Hiding forbidden shrines";
@@ -192,7 +203,7 @@ namespace CalamityMod.Systems
AerialiteOreGen.Generate(false);
}));
// Draedon Labs
//Draedon Labs
tasks.Insert(++currentFinalIndex, new PassLegacy("Draedon Structures", (progress, config) =>
{
progress.Message = "Rust and Dust";
@@ -240,21 +251,21 @@ namespace CalamityMod.Systems
}
}));
// Abyss
//Abyss
tasks.Insert(++currentFinalIndex, new PassLegacy("Abyss", (progress, config) =>
{
progress.Message = "Disposing of Silva's remains";
Abyss.PlaceAbyss();
}));
// Sulphurous Sea (Part 2, after Abyss)
//Sulphurous Sea (Part 2, after Abyss)
tasks.Insert(++currentFinalIndex, new PassLegacy("Sulphur Sea 2", (progress, config) =>
{
progress.Message = "Irradiating one of the oceans";
SulphurousSea.SulphurSeaGenerationAfterAbyss();
}));
// Roxcalibur
//Roxcalibur
tasks.Insert(++currentFinalIndex, new PassLegacy("Roxcalibur", (progress, config) =>
{
progress.Message = "I wanna rock";
@@ -263,7 +274,7 @@ namespace CalamityMod.Systems
}
}
// An Astral Meteor always falls at the beginning of Hardmode.
//An Astral Meteor always falls at the beginning of Hardmode.
public override void ModifyHardmodeTasks(List<GenPass> tasks)
{
int announceIndex = tasks.FindIndex(match => match.Name == "Hardmode Announcement");
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
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;
offsetY = -16;
height = 32;
}
+1 -1
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.Tiles.Abyss
up.HasTile = true;
up.TileFrameY = 0;
//7 different frames, choose a random one
//16 different frames, choose a random one
up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18);
WorldGen.SquareTileFrame(i, j - 1, true);
+211
View File
@@ -0,0 +1,211 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.Localization;
using Terraria.Audio;
using Terraria.GameContent.ObjectInteractions;
using Microsoft.Xna.Framework;
namespace CalamityMod.Tiles.Abyss
{
public class AbyssTreasureChest : ModTile
{
public override void SetStaticDefaults()
{
Main.tileSpelunker[Type] = true;
Main.tileContainer[Type] = true;
Main.tileShine2[Type] = true;
Main.tileShine[Type] = 1200;
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileOreFinderPriority[Type] = 500;
TileID.Sets.HasOutlines[Type] = true;
TileID.Sets.BasicChest[Type] = true;
TileID.Sets.DisableSmartCursor[Type] = true;
AdjTiles = new int[] { TileID.Containers };
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.newTile.Origin = new Point16(0, 1);
TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 };
TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(Chest.FindEmptyChest, -1, 0, true);
TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false);
TileObjectData.newTile.AnchorInvalidTiles = new int[] { TileID.MagicalIceBlock };
TileObjectData.newTile.StyleHorizontal = true;
TileObjectData.newTile.LavaDeath = false;
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
TileObjectData.addTile(Type);
ContainerName.SetDefault("Abyssal Chest");
ModTranslation name = CreateMapEntryName();
name.SetDefault("Abyssal Chest");
AddMapEntry(new Color(142, 101, 71), name);
DustType = 33;
HitSound = SoundID.Dig;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings)
{
return true;
}
public override bool IsLockedChest(int i, int j) => Main.tile[i, j].TileFrameX / 36 == 1;
public override bool UnlockChest(int i, int j, ref short frameXAdjustment, ref int dustType, ref bool manual)
{
return true;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = 1;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 32, ModContent.ItemType<Items.Placeables.Furniture.AbyssTreasureChest>());
Chest.DestroyChest(i, j);
}
public override bool RightClick(int i, int j)
{
Player player = Main.LocalPlayer;
Tile tile = Main.tile[i, j];
Main.mouseRightRelease = false;
int left = i;
int top = j;
if (tile.TileFrameX % 36 != 0)
{
left--;
}
if (tile.TileFrameY != 0)
{
top--;
}
if (player.sign >= 0)
{
SoundEngine.PlaySound(SoundID.MenuClose);
player.sign = -1;
Main.editSign = false;
Main.npcChatText = "";
}
if (Main.editChest)
{
SoundEngine.PlaySound(SoundID.MenuTick);
Main.editChest = false;
Main.npcChatText = "";
}
if (player.editedChestName)
{
NetMessage.SendData(MessageID.SyncPlayerChest, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f);
player.editedChestName = false;
}
bool isLocked = IsLockedChest(left, top);
if (Main.netMode == NetmodeID.MultiplayerClient && !isLocked)
{
if (left == player.chestX && top == player.chestY && player.chest >= 0)
{
player.chest = -1;
Recipe.FindRecipes();
SoundEngine.PlaySound(SoundID.MenuClose);
}
else
{
NetMessage.SendData(MessageID.RequestChestOpen, -1, -1, null, left, top);
Main.stackSplit = 600;
}
}
else
{
if (isLocked)
{
if (NPC.downedBoss3 && Chest.Unlock(left, top))
{
if (Main.netMode == NetmodeID.MultiplayerClient)
{
NetMessage.SendData(MessageID.Unlock, -1, -1, null, player.whoAmI, 1f, left, top);
}
}
}
else
{
int chest = Chest.FindChest(left, top);
if (chest >= 0)
{
Main.stackSplit = 600;
if (chest == player.chest)
{
player.chest = -1;
SoundEngine.PlaySound(SoundID.MenuClose);
}
else
{
player.chest = chest;
Main.playerInventory = true;
Main.recBigList = false;
player.chestX = left;
player.chestY = top;
SoundEngine.PlaySound(player.chest < 0 ? SoundID.MenuOpen : SoundID.MenuTick);
}
Recipe.FindRecipes();
}
}
}
return true;
}
public override void MouseOver(int i, int j)
{
Player player = Main.LocalPlayer;
Tile tile = Main.tile[i, j];
int left = i;
int top = j;
if (tile.TileFrameX % 36 != 0)
{
left--;
}
if (tile.TileFrameY != 0)
{
top--;
}
int chest = Chest.FindChest(left, top);
if (chest < 0)
{
player.cursorItemIconText = Language.GetTextValue("LegacyChestType.0");
}
else
{
player.cursorItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : "Abyssal Chest";
if (player.cursorItemIconText == "Abyssal Chest")
{
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.Furniture.AbyssTreasureChest>();
player.cursorItemIconText = "";
}
}
player.noThrow = 2;
player.cursorItemIconEnabled = true;
}
public override void MouseOverFar(int i, int j)
{
MouseOver(i, j);
Player player = Main.LocalPlayer;
if (player.cursorItemIconText == "")
{
player.cursorItemIconEnabled = false;
player.cursorItemIconID = 0;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

-23
View File
@@ -44,29 +44,6 @@ 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 && up2.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 bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AbyssGravel>(), false, false, false, false, resetFrame);
-24
View File
@@ -47,30 +47,6 @@ 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 && up2.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;
+1 -1
View File
@@ -62,7 +62,7 @@ namespace CalamityMod.Tiles.Ores
{
return;
}
if (closer && Main.rand.NextBool(300))
if (closer && Main.rand.NextBool(400))
{
int tileLocationY = j + 1;
if (Main.tile[i, tileLocationY] != null)
+20 -17
View File
@@ -57,8 +57,8 @@ namespace CalamityMod.World
if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0)
{
tile.LiquidType = LiquidID.Water;
tile.LiquidAmount = 255;
tile.Get<LiquidData>().LiquidType = LiquidID.Water;
tile.LiquidAmount = byte.MaxValue;
}
bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != ModContent.TileType<SulphurousSandstone>();
@@ -471,16 +471,16 @@ namespace CalamityMod.World
{
case 0:
//1 island, to the left
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, true, false);
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, false, false);
break;
case 1:
//1 island, to the right
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, true, false);
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, false, false);
break;
case 2:
//2 islands, left and right
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, true, false);
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, true, false);
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, false, false);
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(65, 78), voidIslandY, 65, 85, 35, 45, ModContent.TileType<Voidstone>(), false, false, false);
break;
}
@@ -529,8 +529,8 @@ namespace CalamityMod.World
if (!tile.HasTile && tile.WallType > 0)
{
//fill up any air pockets with water
tile.LiquidType = LiquidID.Water;
tile.LiquidAmount = 255;
tile.Get<LiquidData>().LiquidType = LiquidID.Water;
tile.LiquidAmount = byte.MaxValue;
}
//kill obsidian
@@ -555,9 +555,8 @@ namespace CalamityMod.World
//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(16) && tile.TileType == ModContent.TileType<AbyssGravel>() ||
WorldGen.genRand.NextBool(25) && tile.TileType == ModContent.TileType<PyreMantle>())
//giant kelp on abyss gravel
if (WorldGen.genRand.NextBool(15) && tile.TileType == ModContent.TileType<AbyssGravel>())
{
ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType<AbyssGiantKelp1>(), (ushort)ModContent.TileType<AbyssGiantKelp2>(),
(ushort)ModContent.TileType<AbyssGiantKelp3>(), (ushort)ModContent.TileType<AbyssGiantKelp4>() };
@@ -565,9 +564,8 @@ namespace CalamityMod.World
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps));
}
//thermal vents
if (WorldGen.genRand.NextBool(72) && tile.TileType == ModContent.TileType<AbyssGravel>() ||
WorldGen.genRand.NextBool(15) && tile.TileType == ModContent.TileType<PyreMantle>())
//thermal vents on pyre mantle
if (WorldGen.genRand.NextBool(15) && tile.TileType == ModContent.TileType<PyreMantle>())
{
ushort[] Vents = new ushort[] { (ushort)ModContent.TileType<ThermalVent1>(),
(ushort)ModContent.TileType<ThermalVent2>(), (ushort)ModContent.TileType<ThermalVent3>() };
@@ -822,7 +820,7 @@ namespace CalamityMod.World
//essentially places molten blocks if scoria is enabled
//if scoria is not enabled, then it places planty mush with a 1 in 5 chance, and otherwise place actual scoria
//very backwards logic of having scoria not place when enabled but it makes it place more often so whatever
num16 = hasScoria ? ModContent.TileType<PyreMantleMolten>() : WorldGen.genRand.Next(5) == 0 ? ModContent.TileType<PlantyMush>() : ModContent.TileType<ScoriaOre>();
num16 = hasScoria ? ModContent.TileType<PyreMantleMolten>() : WorldGen.genRand.Next(3) == 0 ? ModContent.TileType<PlantyMush>() : ModContent.TileType<ScoriaOre>();
}
}
@@ -839,7 +837,6 @@ namespace CalamityMod.World
Main.tile[n, num17].Get<TileWallWireStateData>().HasTile = true;
Main.tile[n, num17].TileType = (ushort)num16;
CalamityUtils.SafeSquareTileFrame(n, num17, true);
}
}
@@ -917,6 +914,7 @@ namespace CalamityMod.World
}
}
}
num23 += WorldGen.genRand.Next(num25, (int)(num25 * 1.5));
}
}
@@ -1001,7 +999,12 @@ namespace CalamityMod.World
}
//place the chest itself
WorldGen.AddBuriedChest(i, j - 1, itemChoice, false, 4);
//TODO: will create a proper loot pool to go in abyss chests along with the main item
int ChestIndex = WorldGen.PlaceChest(i, j - 2, (ushort)ModContent.TileType<Tiles.Abyss.AbyssTreasureChest>(), false, 1);
if (ChestIndex != -1)
{
Main.chest[ChestIndex].item[0].SetDefaults(itemChoice);
}
}
}
}
+12 -8
View File
@@ -249,21 +249,25 @@ namespace CalamityMod.World
//place crag ruins
bool place = true;
int house1Offset = WorldGen.genRand.Next(0, 55);
SchematicManager.PlaceSchematic<Action<Chest>>(SchematicManager.CragRuinKey3,
new Point(biomeStart + 150, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeStart + 150, Main.maxTilesY - 125);
new Point(biomeStart + 150 + house1Offset, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeStart + 150 + house1Offset, Main.maxTilesY - 125);
int house2Offset = WorldGen.genRand.Next(-55, 0);
SchematicManager.PlaceSchematic<Action<Chest>>(SchematicManager.CragRuinKey1,
new Point(biomeMiddle - 235, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeMiddle - 235, Main.maxTilesY - 125);
new Point(biomeMiddle - 235 + house2Offset, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeMiddle - 235 + house2Offset, Main.maxTilesY - 125);
int house3Offset = WorldGen.genRand.Next(0, 55);
SchematicManager.PlaceSchematic<Action<Chest>>(SchematicManager.CragRuinKey4,
new Point(biomeMiddle + 235, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeMiddle + 235, Main.maxTilesY - 125);
new Point(biomeMiddle + 235 + house3Offset, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeMiddle + 235 + house3Offset, Main.maxTilesY - 125);
int house4Offset = WorldGen.genRand.Next(-55, 0);
SchematicManager.PlaceSchematic<Action<Chest>>(SchematicManager.CragRuinKey2,
new Point(biomeEdge - 150, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeEdge - 150, Main.maxTilesY - 125);
new Point(biomeEdge - 150 + house4Offset, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place);
PlaceSquareForCragHouses(biomeEdge - 150 + house4Offset, Main.maxTilesY - 125);
//lava clean up again
for (int x = biomeStart; x <= biomeEdge; x++)
+87
View File
@@ -0,0 +1,87 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.SummonItems;
using CalamityMod.Tiles.DraedonStructures;
using CalamityMod.Tiles.SunkenSea;
using CalamityMod.Walls;
using CalamityMod.Schematics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.WorldBuilding;
using static CalamityMod.Schematics.SchematicManager;
namespace CalamityMod.World
{
public class VernalPass
{
public static bool ShouldAvoidLocation(Point placementPoint)
{
Tile tile = CalamityUtils.ParanoidTileRetrieval(placementPoint.X, placementPoint.Y);
//avoid hive and jungle temple blocks
if (tile.TileType == TileID.LihzahrdBrick || tile.WallType == WallID.LihzahrdBrickUnsafe ||
tile.TileType == TileID.Hive || tile.WallType == WallID.HiveUnsafe)
{
return true;
}
return false;
}
public static void PlaceVernalPass(StructureMap structures)
{
int tries = 0;
string mapKey = VernalKey;
do
{
int placementPositionX = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.1f), (int)(Main.maxTilesX * 0.9f));
int placementPositionY = WorldGen.genRand.Next((int)(Main.maxTilesY / 2), (int)((Main.maxTilesY - 300)));
Point placementPoint = new Point(placementPositionX, placementPositionY);
Vector2 schematicSize = new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1));
int jungleGrassInArea = 0;
bool canGenerateInLocation = true;
float totalTiles = schematicSize.X * schematicSize.Y;
for (int x = placementPoint.X; x < placementPoint.X + schematicSize.X; x++)
{
for (int y = placementPoint.Y; y < placementPoint.Y + schematicSize.Y; y++)
{
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
if (ShouldAvoidLocation(new Point(x, y)))
{
canGenerateInLocation = false;
}
if (tile.TileType == TileID.JungleGrass || tile.TileType == TileID.JunglePlants || tile.TileType == TileID.JungleVines)
{
jungleGrassInArea++;
}
}
}
if (!canGenerateInLocation || jungleGrassInArea < totalTiles * 0.1f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y)))
{
tries++;
}
else
{
bool place = true;
//TODO: this needs to have items placed in chests, will do that later
SchematicManager.PlaceSchematic<Action<Chest>>(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.Center, ref place);
structures.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4);
break;
}
} while (tries <= 20000);
}
}
}