This commit is contained in:
mountaindrew10 committed 2023-02-08 22:16:01 -06:00
commit ffd2694127
27 files changed
+514 -51

No files matched your search

+9 -6
View File
@@ -920,13 +920,16 @@ namespace CalamityMod.CalPlayer
}
}
// The Camper regen boost activates while moving so it can stack with Shiny Stone like effects
if (camper && Player.statLife < actualMaxLife && !Player.StandingStill())
// The Camper counteracts the regen loss while moving horizontally
if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0))
{
float camperRegenMult = areThereAnyDamnBosses ? 1.25f : 2f;
int camperRegenCount = areThereAnyDamnBosses ? 1 : 4;
Player.lifeRegen = (int)(Player.lifeRegen * camperRegenMult);
Player.lifeRegenCount += camperRegenCount;
// Vanilla base regen rate which gets boosted when resting
// The first 6 boosts increment every 300 frames, up to 6 at 1800
// Then, the last 3 boosts increment every 600 frames, up to 9 at 3600 which is the cap
int baseRegenRate = Math.Clamp(Player.lifeRegenTime / 300, 0, 6) + Math.Clamp((Player.lifeRegenTime - 1800) / 600, 0, 3);
// Normally 1.25 while resting and 0.5 while not
Player.lifeRegen += (int)(baseRegenRate * 0.75f);
if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2))
{
int regen = Dust.NewDust(Player.position, Player.width, Player.height, 12, 0f, 0f, 200, Color.OrangeRed, 1f);
+6 -2
View File
@@ -1,5 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Armor;
using CalamityMod.Items.Armor.Victide;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -32,7 +32,11 @@ namespace CalamityMod.Items.Accessories
{
player.statDefense += 5;
}
if (player.Calamity().victideSet)
// Accessory update comes before set bonus for some reason, so this has to be done
if ((player.armor[0].type == ModContent.ItemType<VictideHeadMagic>() || player.armor[0].type == ModContent.ItemType<VictideHeadSummon>() ||
player.armor[0].type == ModContent.ItemType<VictideHeadMelee>() || player.armor[0].type == ModContent.ItemType<VictideHeadRanged>() ||
player.armor[0].type == ModContent.ItemType<VictideHeadRogue>()) &&
player.armor[1].type == ModContent.ItemType<VictideBreastplate>() && player.armor[2].type == ModContent.ItemType<VictideGreaves>())
{
player.moveSpeed += 0.1f;
player.lifeRegen += 2;
+18 -3
View File
@@ -40,9 +40,24 @@ namespace CalamityMod.Items.Accessories
var source = player.GetSource_Accessory(Item);
CalamityPlayer modPlayer = player.Calamity();
modPlayer.camper = true;
player.AddBuff(BuffID.HeartLamp, 60, true);
player.AddBuff(BuffID.Campfire, 60, true);
player.AddBuff(BuffID.WellFed3, 60, true);
player.AddBuff(BuffID.HeartLamp, 60);
Main.SceneMetrics.HasHeartLantern = true;
player.AddBuff(BuffID.Campfire, 60);
Main.SceneMetrics.HasCampfire = true;
// Only hand out the buff if the player is not already fully fed. This prevents the player from being robbed of food.
if (!player.HasBuff(BuffID.WellFed3))
player.AddBuff(BuffID.WellFed3, 80);
else
{
// Prevent it from flickering
for (int l = 0; l < Player.MaxBuffs; l++)
{
if (player.buffType[l] == BuffID.WellFed3 && player.buffTime[l] < 80)
player.buffTime[l] = 80;
}
}
Lighting.AddLight(player.Center, 0.825f, 0.66f, 0f);
if (Main.myPlayer == player.whoAmI)
{
+69
View File
@@ -0,0 +1,69 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture
{
public class GloomTorch : ModItem
{
public override void SetStaticDefaults()
{
SacrificeTotal = 100;
ItemID.Sets.Torches[Item.type] = true;
}
public override void SetDefaults()
{
Item.width = 14;
Item.height = 18;
Item.maxStack = 99;
Item.holdStyle = 1;
Item.noWet = true;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.Crags.GloomTorch>();
Item.flame = true;
Item.value = 500;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
// Vanilla usually matches sorting methods with the right type of item, but sometimes, like with torches, it doesn't. Make sure to set whichever items manually if need be.
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Torches;
}
public override void HoldItem(Player player)
{
Vector2 position = player.RotatedRelativePoint(new Vector2(player.itemLocation.X + 12f * player.direction + player.velocity.X, player.itemLocation.Y - 14f + player.velocity.Y), true);
if (!Item.wet)
Lighting.AddLight(position, 0.9f, 1.2f, 0.3f);
}
public override void PostUpdate()
{
Lighting.AddLight((int)((Item.position.X + Item.width / 2) / 16f), (int)((Item.position.Y + Item.height / 2) / 16f), 0.5f, 0.75f, 1.2f);
}
// This function doesn't even work....
public override void AutoLightSelect(ref bool dryTorch, ref bool wetTorch, ref bool glowstick)
{
dryTorch = true;
wetTorch = false;
glowstick = false;
}
public override void AddRecipes()
{
CreateRecipe(3).
AddIngredient(ItemID.Torch, 3).
AddIngredient(ModContent.ItemType<Items.Placeables.ScorchedBone>()).
Register();
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1010 B

After

Width:  |  Height:  |  Size: 610 B

+1 -5
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Abyss
NPC.Calamity().VulnerableToSickness = true;
NPC.Calamity().VulnerableToElectricity = true;
NPC.Calamity().VulnerableToWater = false;
SpawnModBiomes = new int[3] { ModContent.GetInstance<AbyssLayer1Biome>().Type, ModContent.GetInstance<AbyssLayer2Biome>().Type, ModContent.GetInstance<AbyssLayer3Biome>().Type };
SpawnModBiomes = new int[2] { ModContent.GetInstance<AbyssLayer2Biome>().Type, ModContent.GetInstance<AbyssLayer3Biome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -363,10 +363,6 @@ namespace CalamityMod.NPCs.Abyss
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.6f;
+1 -5
View File
@@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Abyss
NPC.Calamity().VulnerableToSickness = true;
NPC.Calamity().VulnerableToElectricity = true;
NPC.Calamity().VulnerableToWater = false;
SpawnModBiomes = new int[2] { ModContent.GetInstance<AbyssLayer1Biome>().Type, ModContent.GetInstance<AbyssLayer2Biome>().Type };
SpawnModBiomes = new int[1] { ModContent.GetInstance<AbyssLayer2Biome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -300,10 +300,6 @@ namespace CalamityMod.NPCs.Abyss
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.225f;
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
+1 -5
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.Abyss
NPC.Calamity().VulnerableToSickness = true;
NPC.Calamity().VulnerableToElectricity = true;
NPC.Calamity().VulnerableToWater = false;
SpawnModBiomes = new int[2] { ModContent.GetInstance<AbyssLayer1Biome>().Type, ModContent.GetInstance<AbyssLayer2Biome>().Type };
SpawnModBiomes = new int[1] { ModContent.GetInstance<AbyssLayer2Biome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -296,10 +296,6 @@ namespace CalamityMod.NPCs.Abyss
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.225f;
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
+1 -5
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.Abyss
NPC.Calamity().VulnerableToSickness = true;
NPC.Calamity().VulnerableToElectricity = true;
NPC.Calamity().VulnerableToWater = false;
SpawnModBiomes = new int[3] { ModContent.GetInstance<AbyssLayer1Biome>().Type, ModContent.GetInstance<AbyssLayer2Biome>().Type, ModContent.GetInstance<AbyssLayer3Biome>().Type };
SpawnModBiomes = new int[2] { ModContent.GetInstance<AbyssLayer2Biome>().Type, ModContent.GetInstance<AbyssLayer3Biome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -135,10 +135,6 @@ namespace CalamityMod.NPCs.Abyss
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 0.6f;
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water)
{
return SpawnCondition.CaveJellyfish.Chance * 1.2f;
+1 -1
View File
@@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.NormalNPCs
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water)
{
return 0.05f;
return 0.1f;
}
return 0f;
}
+3 -2
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.SulphurousSea
NPC.Calamity().VulnerableToSickness = false;
NPC.Calamity().VulnerableToElectricity = true;
NPC.Calamity().VulnerableToWater = false;
SpawnModBiomes = new int[1] { ModContent.GetInstance<SulphurousSeaBiome>().Type };
SpawnModBiomes = new int[2] { ModContent.GetInstance<SulphurousSeaBiome>().Type, ModContent.GetInstance<AbyssLayer1Biome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -137,7 +137,8 @@ namespace CalamityMod.NPCs.SulphurousSea
{
return 0f;
}
if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType<AquaticUrchin>()) < 12)
if ((spawnInfo.Player.Calamity().ZoneSulphur || spawnInfo.Player.Calamity().ZoneAbyssLayer1) &&
spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType<AquaticUrchin>()) < 12)
{
return 1.1f;
}
+5 -1
View File
@@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.SulphurousSea
NPC.Calamity().VulnerableToSickness = false;
NPC.Calamity().VulnerableToElectricity = true;
NPC.Calamity().VulnerableToWater = false;
SpawnModBiomes = new int[1] { ModContent.GetInstance<SulphurousSeaBiome>().Type };
SpawnModBiomes = new int[2] { ModContent.GetInstance<SulphurousSeaBiome>().Type, ModContent.GetInstance<AbyssLayer1Biome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
@@ -140,6 +140,10 @@ namespace CalamityMod.NPCs.SulphurousSea
{
return 0.2f;
}
if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water)
{
return 0.35f;
}
return 0f;
}
+49
View File
@@ -0,0 +1,49 @@
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 ShalePile1 : ModTile
{
public override void SetStaticDefaults()
{
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
TileObjectData.newTile.Width = 3;
TileObjectData.newTile.Height = 2;
TileObjectData.newTile.Origin = new Point16(1, 1);
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 };
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(47, 30, 63));
DustType = 33;
base.SetStaticDefaults();
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 2;
}
}
public class ShalePile2 : ShalePile1
{
}
public class ShalePile3 : ShalePile1
{
}
}
@@ -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 SulphurPireCoral1 : 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(64, 36, 39));
DustType = 32;
base.SetStaticDefaults();
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 230f / 500f;
g = 255f / 500f;
b = 0f;
}
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/SulphurPireCoral1Glow").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 SulphurPireCoral2 : SulphurPireCoral1
{
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/SulphurPireCoral2Glow").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 SulphurPireCoral3 : SulphurPireCoral1
{
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/SulphurPireCoral3Glow").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);
}
}
}
@@ -0,0 +1,41 @@
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 SulphurTubeCoral : 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(64, 36, 39));
DustType = 32;
base.SetStaticDefaults();
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 2;
}
}
}
+91
View File
@@ -30,6 +30,7 @@ namespace CalamityMod.Tiles.Abyss
MineResist = 1f;
HitSound = MineSound;
}
int animationFrameWidth = 288;
public override void NumDust(int i, int j, bool fail, ref int num)
{
@@ -47,6 +48,96 @@ namespace CalamityMod.Tiles.Abyss
}
}
}
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
{
int uniqueAnimationFrameX = 0;
int xPos = i % 4;
int yPos = j % 4;
switch (xPos)
{
case 0:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 0;
break;
case 1:
uniqueAnimationFrameX = 0;
break;
case 2:
uniqueAnimationFrameX = 1;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
case 1:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 1;
break;
case 1:
uniqueAnimationFrameX = 0;
break;
case 2:
uniqueAnimationFrameX = 1;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
case 2:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 1;
break;
case 1:
uniqueAnimationFrameX = 0;
break;
case 2:
uniqueAnimationFrameX = 0;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
case 3:
switch (yPos)
{
case 0:
uniqueAnimationFrameX = 0;
break;
case 1:
uniqueAnimationFrameX = 1;
break;
case 2:
uniqueAnimationFrameX = 0;
break;
case 3:
uniqueAnimationFrameX = 1;
break;
default:
uniqueAnimationFrameX = 0;
break;
}
break;
}
frameXOffset = uniqueAnimationFrameX * animationFrameWidth;
}
public override void RandomUpdate(int i, int j)
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Tiles.Abyss
{
public class Voidstone : ModTile
{
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3);
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f };
internal static Texture2D GlowTexture;
public override void SetStaticDefaults()
{
+92
View File
@@ -0,0 +1,92 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Tiles.Crags
{
public class GloomTorch : ModTile
{
public override void SetStaticDefaults()
{
this.SetUpTorch(false, false);
ModTranslation name = CreateMapEntryName();
name.SetDefault("Torch");
AddMapEntry(new Color(253, 221, 3), name);
TileID.Sets.DisableSmartCursor[Type] = true;
ItemDrop = ModContent.ItemType<Items.Placeables.Furniture.GloomTorch>();
AdjTiles = new int[] { TileID.Torches };
TileID.Sets.Torch[Type] = true;
Main.tileWaterDeath[Type] = true;
TileID.Sets.FramesOnKillWall[Type] = true;
}
public override bool CreateDust(int i, int j, ref int type)
{
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(190, 255, 60), 1f);
return false;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void MouseOver(int i, int j)
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.Furniture.GloomTorch>();
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
Tile tile = Main.tile[i, j];
if (tile.TileFrameX < 66)
{
r = 0.5f;
g = 0.75f;
b = 1.2f;
}
}
public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY)
{
offsetY = 0;
if (WorldGen.SolidTile(i, j - 1))
{
offsetY = 2;
if (WorldGen.SolidTile(i - 1, j + 1) || WorldGen.SolidTile(i + 1, j + 1))
{
offsetY = 4;
}
}
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/GloomTorchFlame").Value, i, j, 2);
}
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
{
if (Main.tile[i, j].TileFrameX < 66)
CalamityUtils.DrawFlameSparks(Main.rand.NextBool() ? 61 : 64, 5, i, j);
}
public override bool RightClick(int i, int j)
{
CalamityUtils.RightClickBreak(i, j);
return true;
}
public override float GetTorchLuck(Player player)
{
// Note: Total Torch luck never goes below zero
return player.Calamity().ZoneCalamity ? 1f : -1f;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

+27 -9
View File
@@ -301,27 +301,24 @@ namespace CalamityMod.World
{
if (WorldGen.genRand.NextBool(2))
{
int randomIsland = WorldGen.genRand.Next(4);
int randomIsland = WorldGen.genRand.Next(3);
switch (randomIsland)
{
case 0:
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(-40, 40), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
break;
case 1:
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
break;
case 2:
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(10, 20), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
break;
case 3:
case 2:
AbyssIsland(abyssChasmX - WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
AbyssIsland(abyssChasmX + WorldGen.genRand.Next(10, 20), sulphurIslandY, 55, 75, 35, 45, false, false, false, true);
break;
}
//increase y value so islands cant be spammed on top of each other
sulphurIslandY += 12;
sulphurIslandY += 15;
}
}
@@ -495,7 +492,28 @@ namespace CalamityMod.World
//sulphur shale stuff
if (tile.TileType == ModContent.TileType<SulphurousShale>())
{
if (WorldGen.genRand.NextBool(8))
if (WorldGen.genRand.NextBool(25))
{
WorldGen.PlaceObject(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<SulphurTubeCoral>());
}
if (WorldGen.genRand.NextBool(18))
{
ushort[] ShalePiles = new ushort[] { (ushort)ModContent.TileType<ShalePile1>(),
(ushort)ModContent.TileType<ShalePile2>(), (ushort)ModContent.TileType<ShalePile3>() };
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(ShalePiles));
}
if (WorldGen.genRand.NextBool(15))
{
ushort[] PireCorals = new ushort[] { (ushort)ModContent.TileType<SulphurPireCoral1>(),
(ushort)ModContent.TileType<SulphurPireCoral2>(), (ushort)ModContent.TileType<SulphurPireCoral3>() };
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(PireCorals));
}
if (WorldGen.genRand.NextBool(10))
{
ushort[] SulphuricFossils = new ushort[] { (ushort)ModContent.TileType<SulphuricFossil1>(),
(ushort)ModContent.TileType<SulphuricFossil2>(), (ushort)ModContent.TileType<SulphuricFossil3>() };
@@ -503,7 +521,7 @@ namespace CalamityMod.World
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(SulphuricFossils));
}
if (WorldGen.genRand.NextBool(6))
if (WorldGen.genRand.NextBool(10))
{
ushort[] Ribs = new ushort[] { (ushort)ModContent.TileType<SulphurousRib1>(),
(ushort)ModContent.TileType<SulphurousRib2>(), (ushort)ModContent.TileType<SulphurousRib3>(),
+14
View File
@@ -30,10 +30,24 @@ namespace CalamityMod.World
if (WorldGen.genRand.Next(365) == 0 && tile.TileType == TileID.Cloud && tile.HasTile)
{
ShapeData circle = new ShapeData();
ShapeData biggerCircle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
int outerRadius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f));
//big cloud circle
WorldUtils.Gen(new Point(x, y), new Shapes.Circle(outerRadius + 3), Actions.Chain(new GenAction[]
{
blotchMod.Output(biggerCircle)
}));
WorldUtils.Gen(new Point(x, y), new ModShapes.All(biggerCircle), Actions.Chain(new GenAction[]
{
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)TileID.Cloud)
}));
//circle of ore
WorldUtils.Gen(new Point(x, y), new Shapes.Circle(outerRadius), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
+3 -6
View File
@@ -1031,13 +1031,10 @@ namespace CalamityMod.World
int type = WorldGen.genRand.Next(6);
type++;
int height = heightFromType(type);
if ((Main.tile[x, y + dy + 1].TileType == ModContent.TileType<HardenedSulphurousSandstone>() ||
Main.tile[x, y + dy + 1].TileType == ModContent.TileType<SulphurousSandstone>()) &&
!Main.tile[x, y + dy + 1].LeftSlope && !Main.tile[x, y + dy + 1].RightSlope && !Main.tile[x, y + dy + 1].IsHalfBlock)
{
PlaceStalactite(x, y, height, CalamityMod.Instance.Find<ModTile>($"SulphurousStalactite{type}").Type);
if (WorldGen.SolidTile(x, y + dy + 1))
PlaceStalacmite(x, y + dy, height, CalamityMod.Instance.Find<ModTile>($"SulphurousStalacmite{type}").Type);
}
}
}
}