Merge branch '1.4' into internal-scoria-ore-tile-rename

This commit is contained in:
Cameron Ewell authored and GitHub committed 2023-02-09 10:46:44 -05:00
commit 415aee23cc
31 files changed
+222 -68

No files matched your search

+15
View File
@@ -63,6 +63,7 @@ using Terraria.ID;
using Terraria.ModLoader;
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Tiles.Abyss.AbyssAmbient;
namespace CalamityMod.CalPlayer
{
@@ -493,6 +494,7 @@ namespace CalamityMod.CalPlayer
int astralOreID = ModContent.TileType<AstralOre>();
int auricOreID = ModContent.TileType<AuricOre>();
int scoriaOreID = ModContent.TileType<ScoriaOre>();
int abyssKelpID = ModContent.TileType<AbyssKelp>();
int auricRejectionDamage = 300;
float auricRejectionKB = Player.noKnockback ? 20f : 40f;
@@ -503,6 +505,19 @@ namespace CalamityMod.CalPlayer
if (!tile.HasTile || !tile.HasUnactuatedTile)
continue;
if (tile.TileType == abyssKelpID)
{
if (Player.velocity.Length() == 0)
{ return; }
Dust dust;
dust = Main.dust[Dust.NewDust(Player.Center, 16, 16, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
// Ores below here
// Astral Ore inflicts Astral Infection briefly on contact
if (tile.TileType == astralOreID)
Player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 2);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 150 B

+6 -7
View File
@@ -1544,8 +1544,8 @@ namespace CalamityMod.NPCs
SetShopItem(ref shop, ref nextSlot, ItemID.JourneymanBait, NPC.downedBoss3);
SetShopItem(ref shop, ref nextSlot, ItemID.MasterBait, NPC.downedPlantBoss);
SetShopItem(ref shop, ref nextSlot, ItemID.AngelStatue, NPC.FindFirstNPC(NPCType<THIEF>()) != -1, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Burger, happy, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Hotdog, happy, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Burger, happy && NPC.downedBoss3, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Hotdog, happy && Main.hardMode, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.CoffeeCup, happy, Item.buyPrice(0, 2));
}
@@ -1606,14 +1606,14 @@ namespace CalamityMod.NPCs
SetShopItem(ref shop, ref nextSlot, ItemID.JungleRose, price: Item.buyPrice(0, 2));
SetShopItem(ref shop, ref nextSlot, ItemID.NaturesGift, price: Item.buyPrice(0, 10));
SetShopItem(ref shop, ref nextSlot, ItemType<RomajedaOrchid>());
SetShopItem(ref shop, ref nextSlot, ItemID.Grapes, happy, Item.buyPrice(0, 2, 50));
SetShopItem(ref shop, ref nextSlot, ItemID.Grapes, happy && NPC.downedBoss3, Item.buyPrice(0, 2, 50));
}
if (type == NPCID.GoblinTinkerer)
{
SetShopItem(ref shop, ref nextSlot, ItemID.StinkPotion, CalamityConfig.Instance.PotionSelling, Item.buyPrice(0, 1, 0, 0));
SetShopItem(ref shop, ref nextSlot, ItemType<StatMeter>());
SetShopItem(ref shop, ref nextSlot, ItemID.Spaghetti, happy, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Spaghetti, happy && NPC.downedBoss3, Item.buyPrice(0, 5));
}
if (type == NPCID.Mechanic)
@@ -1687,7 +1687,7 @@ namespace CalamityMod.NPCs
if (type == NPCID.PartyGirl)
{
SetShopItem(ref shop, ref nextSlot, ItemID.GenderChangePotion, CalamityConfig.Instance.PotionSelling, Item.buyPrice(0, 1, 0, 0));
SetShopItem(ref shop, ref nextSlot, ItemID.Pizza, happy, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Pizza, happy && NPC.downedBoss3, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.CreamSoda, happy, Item.buyPrice(0, 2, 50));
}
@@ -1697,7 +1697,6 @@ namespace CalamityMod.NPCs
SetShopItem(ref shop, ref nextSlot, ItemType<LanternCenter>());
SetShopItem(ref shop, ref nextSlot, ItemID.AppleJuice, NPC.FindFirstNPC(NPCType<FAP>()) != -1);
SetShopItem(ref shop, ref nextSlot, ItemID.FruitJuice, NPC.FindFirstNPC(NPCType<FAP>()) != -1);
SetShopItem(ref shop, ref nextSlot, ItemID.GrapeJuice, NPC.FindFirstNPC(NPCType<FAP>()) != -1);
SetShopItem(ref shop, ref nextSlot, ItemID.Lemonade, NPC.FindFirstNPC(NPCType<FAP>()) != -1);
SetShopItem(ref shop, ref nextSlot, ItemID.PrismaticPunch, NPC.FindFirstNPC(NPCType<FAP>()) != -1);
SetShopItem(ref shop, ref nextSlot, ItemID.SmoothieofDarkness, NPC.FindFirstNPC(NPCType<FAP>()) != -1);
@@ -1718,7 +1717,7 @@ namespace CalamityMod.NPCs
if (type == NPCID.BestiaryGirl)
{
SetShopItem(ref shop, ref nextSlot, ItemID.Steak, happy, Item.buyPrice(0, 5));
SetShopItem(ref shop, ref nextSlot, ItemID.Steak, happy && Main.hardMode, Item.buyPrice(0, 5));
}
}
@@ -97,6 +97,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
writer.Write(NPC.localAI[0]);
writer.Write(NPC.localAI[1]);
writer.Write(NPC.localAI[2]);
writer.Write(NPC.localAI[3]);
}
public override void ReceiveExtraAI(BinaryReader reader)
@@ -108,6 +109,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
NPC.localAI[0] = reader.ReadSingle();
NPC.localAI[1] = reader.ReadSingle();
NPC.localAI[2] = reader.ReadSingle();
NPC.localAI[3] = reader.ReadSingle();
}
public override void FindFrame(int frameHeight)
@@ -122,6 +124,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
{
CalamityGlobalNPC.doughnutBoss = NPC.whoAmI;
CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity();
Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1.1f, 0.9f, 0f);
// Projectile and dust spawn location variables
@@ -229,7 +233,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
healTimer = 0;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int healAmt = NPC.lifeMax / 20;
int healAmt = NPC.lifeMax / 10;
if (healAmt > NPC.lifeMax - NPC.life)
healAmt = NPC.lifeMax - NPC.life;
@@ -332,6 +336,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
// Charge variables
float moveToOtherSideInPhase1GateValue = 900f;
float timeBeforeMoveToOtherSideInPhase1Reset = moveToOtherSideInPhase1GateValue * 2f;
float totalGoLowDuration = 240f;
float goLowDuration = totalGoLowDuration * 0.5f;
float goLowDistance = 480f;
float chargeVelocityMult = 0.25f;
float maxChargeVelocity = (bossRush || biomeEnraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f;
if (Main.getGoodWorld)
@@ -351,6 +360,27 @@ namespace CalamityMod.NPCs.ProfanedGuardians
if (NPC.ai[0] == 0f)
{
// Dictates when the commander and defender will swap to the other side in phase 1
if (healerAlive)
NPC.localAI[3] += 1f;
else
NPC.localAI[3] = 0f;
// Go low just before moving to the other side to avoid bullshit hits
bool goLow = (NPC.localAI[3] > moveToOtherSideInPhase1GateValue - goLowDuration && NPC.localAI[3] <= moveToOtherSideInPhase1GateValue + goLowDuration) ||
NPC.localAI[3] > timeBeforeMoveToOtherSideInPhase1Reset - goLowDuration || NPC.localAI[3] < 0f;
// Swap from side to side over time
if (NPC.localAI[3] > moveToOtherSideInPhase1GateValue)
{
if (NPC.localAI[3] > timeBeforeMoveToOtherSideInPhase1Reset)
NPC.localAI[3] = -goLowDuration;
calamityGlobalNPC.newAI[0] = -1f;
}
else
calamityGlobalNPC.newAI[0] = 1f;
// Face the target
if (Math.Abs(NPC.Center.X - player.Center.X) > 10f)
{
@@ -371,8 +401,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
inertia *= 0.5f;
velocity *= 1.5f;
}
if (goLow)
{
inertia *= 0.75f;
velocity *= 1.25f;
}
Vector2 destination = player.Center + Vector2.UnitX * distanceToStayAwayFromTarget * -NPC.direction * calamityGlobalNPC.newAI[0];
if (goLow)
destination.Y += goLowDistance;
Vector2 destination = player.Center + Vector2.UnitX * distanceToStayAwayFromTarget * -NPC.direction;
Vector2 targetVector = destination - NPC.Center;
Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity;
float phaseGateValue = (bossRush || biomeEnraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f;
@@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
healTimer = 0;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int healAmt = NPC.lifeMax / 20;
int healAmt = NPC.lifeMax / 10;
if (healAmt > NPC.lifeMax - NPC.life)
healAmt = NPC.lifeMax - NPC.life;
+6 -3
View File
@@ -413,9 +413,12 @@ namespace CalamityMod.NPCs.TownNPCs
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 50, 0);
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.Fries);
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0);
nextSlot++;
if (NPC.downedBoss1)
{
shop.item[nextSlot].SetDefaults(ItemID.Fries);
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0);
nextSlot++;
}
}
}
}
+12 -1
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -34,6 +34,17 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
base.SetStaticDefaults();
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (closer && Main.rand.NextBool(100) && j > Main.worldSurface)
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
+12 -1
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -45,6 +45,17 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
b = 30f / 255f;
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (closer && Main.rand.NextBool(100) && j > Main.worldSurface)
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
+12 -1
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -45,6 +45,17 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
b = 30f / 255f;
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (closer && Main.rand.NextBool(100) && j > Main.worldSurface)
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
+2 -3
View File
@@ -155,11 +155,10 @@ namespace CalamityMod.Tiles.Abyss
frameXOffset = uniqueAnimationFrameX * animationFrameWidth;
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt);
TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt, false, false, false);
return false;
}
}
}
}
+11
View File
@@ -58,6 +58,17 @@ namespace CalamityMod.Tiles.Abyss
}
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
if (closer && Main.rand.NextBool(200) && j > Main.worldSurface)
{
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 274, 279, 304, 0.23255825f, 10f, 0, new Color(22, 255, 0), 1.5116279f)];
dust.noGravity = true;
dust.noLight = true;
dust.fadeIn = 2.5813954f;
}
}
// Ozzatron 01JUL2022: heavily refactored this code to not suck. also, sulphurous vines won't grow in honey anymore.
private const int MaxVineHeight = 10;
+2 -2
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
@@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Astral
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>(), false, false, false);
return false;
}
+2 -2
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Tiles.Astral
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt);
TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt, false, false, false);
return false;
}
@@ -46,7 +46,7 @@ namespace CalamityMod.Tiles.Astral
Tile down = 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 && (up.TileType == ModContent.TileType<AstralGrass>() || down.TileType == ModContent.TileType<AstralGrass>() || left.TileType == ModContent.TileType<AstralGrass>() || right.TileType == ModContent.TileType<AstralGrass>()))
if (WorldGen.genRand.NextBool(3) && (up.TileType == ModContent.TileType<AstralGrass>() || down.TileType == ModContent.TileType<AstralGrass>() || left.TileType == ModContent.TileType<AstralGrass>() || right.TileType == ModContent.TileType<AstralGrass>()))
{
WorldGen.SpreadGrass(i, j, Type, ModContent.TileType<AstralGrass>(), false);
}
+2 -2
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
@@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>(), false, false, false);
return false;
}
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Tiles.Astral
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>(), false, false, false);
return false;
}
+2 -2
View File
@@ -54,13 +54,13 @@ namespace CalamityMod.Tiles.AstralDesert
}
}
// CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>(), false, false, false);
return false;
}
public override bool HasWalkDust()
{
return Main.rand.Next(3) == 0;
return Main.rand.NextBool(3);
}
public override void WalkDust(ref int dustType, ref bool makeDust, ref Color color)
+2 -2
View File
@@ -1,4 +1,4 @@
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
@@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.AstralDesert
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
// CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<HardenedAstralSand>(), false, false, false, false, resetFrame);
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<HardenedAstralSand>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<HardenedAstralSand>(), false, false, false);
return false;
}
+2 -2
View File
@@ -1,4 +1,4 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.AstralDesert
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
// CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralSand>(), false, false, false, false, resetFrame);
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralSand>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralSand>(), false, false, false);
return false;
}
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.AstralSnow
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
// CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>(), false, false, false, false, resetFrame);
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<AstralDirt>(), false, false, false);
return false;
}
}
+1 -1
View File
@@ -158,7 +158,7 @@ namespace CalamityMod.Tiles
if (WorldGen.IsTileALeafyTreeTop(treeX, treeY) && !Collision.SolidTiles(treeX - 2, treeX + 2, treeY - 2, treeY + 2))
{
int randomAmt = WorldGen.genRand.Next(2, 4);
int randomAmt = WorldGen.genRand.Next(1, 3);
for (int z = 0; z < randomAmt; z++)
{
int treeDropItemType = 0;
@@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.DraedonStructures
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<RustedPipes>());
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<RustedPipes>(), false, false, false);
return false;
}
}
+1 -1
View File
@@ -59,7 +59,7 @@ namespace CalamityMod.Tiles.Ores
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, TileID.Cloud);
TileFraming.CustomMergeFrame(i, j, Type, TileID.Cloud, false, false, false);
return false;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
+1 -1
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.Tiles.Ores
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, TileID.Cloud);
TileFraming.CustomMergeFrame(i, j, Type, TileID.Cloud, false, false, false);
return false;
}
public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset)
+17 -8
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Tiles.Astral;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -40,6 +41,22 @@ namespace CalamityMod.Tiles.Ores
TileID.Sets.ChecksForMerge[Type] = true;
TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true;
}
public override void NearbyEffects(int i, int j, bool closer)
{
Tile tile = Main.tile[i, j];
Tile up = Main.tile[i, j - 1];
Tile up2 = Main.tile[i, j - 2];
if (closer && Main.rand.NextBool(60) && !up.HasTile && !up2.HasTile && j < Main.worldSurface)
{
//Cyan Cinders below
Dust dust;
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 16, 16, ModContent.DustType<AstralBlue>(), -0.4651165f, 0f, 17, new Color(0, 255, 244), 1.5f)];
//Orange Cinders below
dust = Main.dust[Dust.NewDust(new Vector2(i * 16f, j * 16f), 16, 16, ModContent.DustType<AstralOrange>(), -0.4651165f, 0f, 17, new Color(255, 255, 255), 1.5f)];
}
}
public override bool CanKillTile(int i, int j, ref bool blockDamaged)
{
@@ -56,14 +73,6 @@ namespace CalamityMod.Tiles.Ores
num = fail ? 1 : 3;
}
public override void RandomUpdate(int i, int j)
{
if (Main.rand.Next(7) <= 2)
{
Dust.NewDust(new Vector2(i * 16f, j * 16f), 16, 16, 156, Main.rand.NextFloat(-0.05f, 0.05f), Main.rand.NextFloat(-0.05f, -0.001f));
}
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
float brightness = 0.7f;
+1 -1
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Ores
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, TileID.SnowBlock);
TileFraming.CustomMergeFrame(i, j, Type, TileID.SnowBlock, false, false, false);
return false;
}
+1 -1
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Tiles.Ores
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
TileFraming.CustomMergeFrame(i, j, Type, TileID.Pearlstone);
TileFraming.CustomMergeFrame(i, j, Type, TileID.Pearlstone, false, false, false);
return false;
}
+4 -1
View File
@@ -36,7 +36,10 @@ namespace CalamityMod.Tiles.SunkenSea
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFraming.BrimstoneFraming(i, j, resetFrame);
TileFraming.CustomMergeFrame(i, j, Type, TileID.Sandstone, true, false, false);
return false;
//return TileFraming.BrimstoneFraming(i, j, resetFrame);
}
}
}
+5 -2
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.SunkenSea
CalamityUtils.MergeWithGeneral(Type);
CalamityUtils.MergeWithDesert(Type);
CalamityUtils.SetMerge(Type, ModContent.TileType<EutrophicSand>());
//CalamityUtils.SetMerge(Type, ModContent.TileType<EutrophicSand>());
TileID.Sets.ChecksForMerge[Type] = true;
DustType = 96;
@@ -33,7 +33,10 @@ namespace CalamityMod.Tiles.SunkenSea
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFraming.BrimstoneFraming(i, j, resetFrame);
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<EutrophicSand>(), true, true, false);
return false;
//return TileFraming.BrimstoneFraming(i, j, resetFrame);
}
}
}
+4 -1
View File
@@ -45,7 +45,10 @@ namespace CalamityMod.Tiles.SunkenSea
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFraming.BrimstoneFraming(i, j, resetFrame);
TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType<Navystone>(), true, true, false);
return false;
//return TileFraming.BrimstoneFraming(i, j, resetFrame);
}
}
}
+3 -3
View File
@@ -1132,7 +1132,7 @@ namespace CalamityMod
r = Recipe.Create(ItemID.Bacon);
r.AddIngredient(ModContent.ItemType<PiggyItem>());
r.AddTile(TileID.CookingPots);
r.AddTile(TileID.Hellforge);
r.Register();
r = Recipe.Create(ItemID.BowlofSoup);
@@ -1143,7 +1143,7 @@ namespace CalamityMod
r = Recipe.Create(ItemID.ApplePie);
r.AddIngredient(ItemID.Apple, 3);
r.AddTile(TileID.Furnaces);
r.AddTile(TileID.Hellforge);
r.Register();
r = Recipe.Create(ItemID.BananaSplit);
@@ -1156,7 +1156,7 @@ namespace CalamityMod
r = Recipe.Create(ItemID.BBQRibs);
r.AddIngredient(ItemID.FleshBlock, 6);
r.AddIngredient(ItemID.Bone, 6);
r.AddTile(TileID.Furnaces);
r.AddTile(TileID.Hellforge);
r.Register();
r = Recipe.Create(ItemID.MilkCarton);
+52 -14
View File
@@ -1,5 +1,4 @@
using CalamityMod.Tiles.Abyss;
using CalamityMod.Tiles.Abyss.AbyssAmbient;
using CalamityMod.Tiles.Astral;
using CalamityMod.Tiles.AstralDesert;
using CalamityMod.Tiles.AstralSnow;
@@ -63,7 +62,6 @@ 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>
{
@@ -566,7 +564,9 @@ namespace CalamityMod
return true;
}
internal static bool BrimstoneFraming(int x, int y, bool resetFrame)
// BRIMSTONE COMPATIBILITY IMPLEMENTATION
// Added parameters to force a merge in a direction for use in the merge frame function
internal static bool BrimstoneFraming(int x, int y, bool resetFrame, bool forceSameDown = false, bool forceSameUp = false, bool forceSameRight = false, bool forceSameLeft = false)
{
if (x < 0 || x >= Main.maxTilesX)
return false;
@@ -581,6 +581,12 @@ namespace CalamityMod
GetAdjacentTiles(x, y, out bool up, out bool down, out bool left, out bool right, out bool upLeft, out bool upRight, out bool downLeft, out bool downRight);
// Implement forced connections
up = forceSameUp || up;
down = forceSameDown || down;
left = forceSameLeft || left;
right = forceSameRight || right;
// Reset the tile's random frame style if the frame is being reset.
int randomFrame;
if (resetFrame)
@@ -1166,9 +1172,14 @@ namespace CalamityMod
#endregion
#region Generic Custom Framing Code
// New Variables (rename as fitting):
// myTypeBrimFrame - Whether the tile that this function is framing should use brimstone framing
// overrideBrimStates - Used in a situation where a brimstone state and a merge state could each be used, setting this to true will use the merge state, and setting this to false will use the brimstone state
internal static void CustomMergeFrameExplicit(int x, int y, int myType, int mergeType, out bool mergedUp,
out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false,
bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true)
bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true, bool myTypeBrimFrame = false, bool overrideBrimStates = false)
{
if (x < 0 || x >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY)
{
@@ -1176,6 +1187,20 @@ namespace CalamityMod
return;
}
// BRIMSTONE COMPATIBILITY IMPLEMENTATION
// Used when set to prioritize brimstone states over blend states
// This will try to preserve the brimstone tile's own tiling, though it might produce some strange blending with the tile it merges with
if (myTypeBrimFrame && !overrideBrimStates)
{
// BrimstoneFraming returns false if the tile uses a custom tile state, and true if it should use default tile framing
bool usedBrimstoneFrame = BrimstoneFraming(x, y, resetFrame, forceSameDown, forceSameUp, forceSameRight, forceSameLeft);
if (!usedBrimstoneFrame)
{
mergedUp = mergedLeft = mergedRight = mergedDown = false;
return;
}
}
// Disable vanilla trying to merge these tiles automtaically.
Main.tileMerge[myType][mergeType] = false;
@@ -1712,13 +1737,26 @@ namespace CalamityMod
SetFrameAt(x, y, 216, 18 * randomFrame);
return;
#endregion
// BRIMSTONE COMPATIBILITY IMPLEMENTATION
// Used when set to prioritize blend states over brimstone states.
// This will create smoother blending with other tiles, though it will most likely result in unpleasant tiling between blend and non-blend states. Test to see if it looks good
// The tile frame checks are to see whether the tile that frame that has been picked out is a blend state (in which case a brimstone state isn't used) or a 'default' state (in which case a brimstone state might be used instead)
if (myTypeBrimFrame && overrideBrimStates && (Main.tile[x, y].TileFrameX < 234 && Main.tile[x, y].TileFrameY < 90))
{
BrimstoneFraming(x, y, resetFrame, forceSameDown, forceSameUp, forceSameRight, forceSameLeft);
}
}
internal static void CustomMergeFrame(int x, int y, int myType, int mergeType, bool forceSameDown = false,
bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true)
=> CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame);
internal static void CustomMergeFrame(int x, int y, int myType, int mergeType)
// New Variables (rename as fitting):
// myTypeBrimFrame - Whether the tile that this function is framing uses brimstone framing
// mergeTypeBrimFrame - Whether the tile that this tile merges with uses brimstone framing
// overrideBrimStates - Used in a situation where a brimstone state and a merge state could each be used, setting this to true will use the merge state, and setting this to false will use the brimstone state
internal static void CustomMergeFrame(int x, int y, int myType, int mergeType, bool myTypeBrimFrame = false, bool mergeTypeBrimFrame = false, bool overrideBrimStates = false)
{
if (x < 0 || x >= Main.maxTilesX)
return;
@@ -1741,8 +1779,8 @@ namespace CalamityMod
CalamityUtils.SetMerge(myType, north.TileType, false);
TileID.Sets.ChecksForMerge[myType] = true;
// Properly frame the tile given this constraint.
CustomMergeFrameExplicit(x, y - 1, north.TileType, myType, out _, out _, out _, out forceSameUp, false, false, false, false, false);
// Properly frame the adjacent tile given this constraint.
CustomMergeFrameExplicit(x, y - 1, north.TileType, myType, out _, out _, out _, out forceSameUp, false, false, false, false, false, mergeTypeBrimFrame, false);
}
if (west != null && west.HasTile && tileMergeTypes[myType][west.TileType])
{
@@ -1750,8 +1788,8 @@ namespace CalamityMod
CalamityUtils.SetMerge(myType, west.TileType, false);
TileID.Sets.ChecksForMerge[myType] = true;
// Properly frame the tile given this constraint.
CustomMergeFrameExplicit(x - 1, y, west.TileType, myType, out _, out _, out forceSameLeft, out _, false, false, false, false, false);
// Properly frame the adjacent tile given this constraint.
CustomMergeFrameExplicit(x - 1, y, west.TileType, myType, out _, out _, out forceSameLeft, out _, false, false, false, false, false, mergeTypeBrimFrame, false);
}
if (east != null && east.HasTile && tileMergeTypes[myType][east.TileType])
{
@@ -1759,8 +1797,8 @@ namespace CalamityMod
CalamityUtils.SetMerge(myType, east.TileType, false);
TileID.Sets.ChecksForMerge[myType] = true;
// Properly frame the tile given this constraint.
CustomMergeFrameExplicit(x + 1, y, east.TileType, myType, out _, out forceSameRight , out _, out _, false, false, false, false, false);
// Properly frame the adjacent tile given this constraint.
CustomMergeFrameExplicit(x + 1, y, east.TileType, myType, out _, out forceSameRight , out _, out _, false, false, false, false, false, mergeTypeBrimFrame, false);
}
if (south != null && south.HasTile && tileMergeTypes[myType][south.TileType])
{
@@ -1768,12 +1806,12 @@ namespace CalamityMod
CalamityUtils.SetMerge(myType, south.TileType, false);
TileID.Sets.ChecksForMerge[myType] = true;
// Properly frame the tile given this constraint.
CustomMergeFrameExplicit(x, y + 1, south.TileType, myType, out forceSameDown, out _, out _, out _, false, false, false, false, false);
// Properly frame the adjacent tile given this constraint.
CustomMergeFrameExplicit(x, y + 1, south.TileType, myType, out forceSameDown, out _, out _, out _, false, false, false, false, false, mergeTypeBrimFrame, false);
}
// With all constraints determined, properly frame the tile a final time.
CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, true);
CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, true, myTypeBrimFrame, overrideBrimStates);
}
#endregion
}