requested changes

This commit is contained in:
doze-zoze authored and Cameron Ewell committed 2025-10-31 17:32:26 -04:00
1 parent 86669ced6d
commit cf35837176
2 files changed
+19 -33

No files matched your search

+3 -22
View File
@@ -211,25 +211,6 @@ namespace CalamityMod.NPCs.Deconstructors
MainTimer++;
UpdateSegments();
}
public static List<int> OreTypes => new()
{
TileID.Copper, TileID.Tin,
TileID.Iron, TileID.Lead,
TileID.Silver, TileID.Tungsten,
TileID.Gold, TileID.Platinum,
TileID.Demonite,TileID.Crimtane,
ModContent.TileType<AerialiteOre>(),
TileID.Cobalt, TileID.Palladium,
TileID.Mythril,TileID.Orichalcum,
TileID.Adamantite,TileID.Titanium,
ModContent.TileType<CryonicOre>(),
ModContent.TileType<PerennialOre>(),
ModContent.TileType<HallowedOre>(),
ModContent.TileType<AuricOre>(),
ModContent.TileType<AstralOre>(),
ModContent.TileType<UelibloomOre>()
};
public List<List<Point>> FindOreVeins()
{
List<List<Point>> oreVeins = new();
@@ -255,7 +236,7 @@ namespace CalamityMod.NPCs.Deconstructors
var tile = Main.tile[start];
//This uses a flood fill to check for the ore vein
if (tile.HasTile && OreTypes.Contains(tile.TileType))
if (tile.HasTile && TileID.Sets.Ore[tile.TileType])
{
List<Point> vein = new();
Queue<Point> queue = new();
@@ -274,7 +255,7 @@ namespace CalamityMod.NPCs.Deconstructors
continue;
var neighborTile = Main.tile[neighbor];
if (neighborTile.HasTile && OreTypes.Contains(neighborTile.TileType))
if (neighborTile.HasTile && TileID.Sets.Ore[neighborTile.TileType])
{
queue.Enqueue(neighbor);
visited.Add(neighbor);
@@ -545,7 +526,7 @@ namespace CalamityMod.NPCs.Deconstructors
npcLoot.Add(ItemID.SilverOre, 3, 6, 32);
npcLoot.Add(ItemID.TungstenOre, 3, 6, 32);
npcLoot.Add(ItemID.GoldOre, 4, 6, 32);
npcLoot.Add(ItemID.PlatinumOre, 4, 6, 23);
npcLoot.Add(ItemID.PlatinumOre, 4, 6, 32);
npcLoot.Add(ItemID.DemoniteOre, 5, 6, 32);
npcLoot.Add(ItemID.CrimtaneOre, 5, 6, 32);
+16 -11
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using CalamityMod.Effects;
using CalamityMod.Graphics.Metaballs;
using CalamityMod.Items.Tools;
using CalamityMod.NPCs.Deconstructors;
using Microsoft.Xna.Framework;
@@ -130,10 +131,10 @@ namespace CalamityMod.Systems
if (tileLight.B < 200 * brightness) tileLight.B = (byte)(200 * brightness);
returnColor = tileLight;
} else
if (effect is zBurrowerPingTileEffect b && effect.Active && effect.ShouldRegisterTile(i, j))
if (effect is BurrowerPingTileEffect b && effect.Active && effect.ShouldRegisterTile(i, j))
{
float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - zBurrowerPingTileEffect.PingCenter).Length();
float currentExpansion = MathHelper.Clamp(zBurrowerPingTileEffect.PingProgress * zBurrowerPingTileEffect.MaxPingLife / (float)zBurrowerPingTileEffect.MaxPingTravelTime, 0f, 1f) * zBurrowerPingTileEffect.MaxPingRadius;
float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - BurrowerPingTileEffect.PingCenter).Length();
float currentExpansion = MathHelper.Clamp(BurrowerPingTileEffect.PingProgress * BurrowerPingTileEffect.MaxPingLife / (float)BurrowerPingTileEffect.MaxPingTravelTime, 0f, 1f) * BurrowerPingTileEffect.MaxPingRadius;
if (distanceFromCenter - 8 > currentExpansion)
return returnColor;
@@ -149,7 +150,7 @@ namespace CalamityMod.Systems
brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f;
//Fade away with the effect
brightness *= 1 - Math.Max(zBurrowerPingTileEffect.PingProgress - 0.9f, 0) / (0.1f);
brightness *= 1 - Math.Max(BurrowerPingTileEffect.PingProgress - 0.9f, 0) / (0.1f);
if (tileLight.R < 200 * brightness) tileLight.R = (byte)(200 * brightness);
if (tileLight.G < 200 * brightness) tileLight.G = (byte)(200 * brightness);
@@ -434,8 +435,14 @@ namespace CalamityMod.Systems
}
public class zBurrowerPingTileEffect : IPingedTileEffect, ILoadable
public class BurrowerPingTileEffect : ModType, IPingedTileEffect
{
protected override void Register()
{
ModTypeLookup<BurrowerPingTileEffect>.Register(this);
}
internal static Texture2D emptyFrame;
public const int MaxPingLife = 60;
public const int MaxPingTravelTime = 10;
@@ -445,7 +452,7 @@ namespace CalamityMod.Systems
public static Vector2 PingCenter = Vector2.Zero;
public static int PingTimer = 0;
public static float PingProgress => (MaxPingLife - PingTimer) / (float)MaxPingLife;
public bool Active => PingTimer > 0;
public BlendState BlendState => BlendState.Additive;
@@ -512,13 +519,13 @@ namespace CalamityMod.Systems
effect.Parameters["tilePosition"].SetValue(pos.ToVector2() * 16f);
}
public static bool Connected(Point pos, int displaceX, int displaceY) => Main.IsTileSpelunkable(pos.X + displaceX, pos.Y + displaceY) && Main.tile[pos].TileType == Main.tile[pos.X + displaceX, pos.Y + displaceY].TileType;
public static bool Connected(Point pos, int displaceX, int displaceY) => TileID.Sets.Ore[Main.tile[pos.X + displaceX, pos.Y + displaceY].TileType] && Main.tile[pos].TileType == Main.tile[pos.X + displaceX, pos.Y + displaceY].TileType;
public bool ShouldRegisterTile(int x, int y)
{
if (!Main.tile[x, y].HasTile)
return false;
return Burrower.OreTypes.Contains(Main.tile[x, y].TileType);
return TileID.Sets.Ore[Main.tile[x, y].TileType];
}
public void DrawTile(Point pos)
@@ -534,14 +541,12 @@ namespace CalamityMod.Systems
}
}
public void Load(Mod mod)
public override void SetupContent()
{
if (Main.dedServ)
return;
TilePingerSystem.tileEffects.Add("BurrowerPing", this);
}
public void Unload() { }
}
}