Ball and Chain and tiny tile entity fixes
This commit is contained in:
9 files changed
+213
-167
No files matched your search
@@ -121,7 +121,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool brimlashBusterBoost = false;
|
||||
public float animusBoost = 1f;
|
||||
public int potionTimer = 0;
|
||||
public bool cementShoes = false;
|
||||
public bool blockAllDashes = false;
|
||||
public bool resetHeightandWidth = false;
|
||||
#endregion
|
||||
|
||||
@@ -1478,7 +1478,7 @@ namespace CalamityMod.CalPlayer
|
||||
dsSetBonus = false;
|
||||
wearingRogueArmor = false;
|
||||
|
||||
cementShoes = false;
|
||||
blockAllDashes = false;
|
||||
|
||||
kingSlimeLore = false;
|
||||
desertScourgeLore = false;
|
||||
@@ -3737,7 +3737,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<GiantIbanRobotOfDoom>()] > 0)
|
||||
player.yoraiz0rEye = 0;
|
||||
|
||||
if (cementShoes || CalamityConfig.Instance.BossRushDashCurse && BossRushEvent.BossRushActive)
|
||||
if (blockAllDashes || CalamityConfig.Instance.BossRushDashCurse && BossRushEvent.BossRushActive)
|
||||
DisableAllDashes();
|
||||
}
|
||||
#endregion
|
||||
@@ -3763,7 +3763,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<GiantIbanRobotOfDoom>()] > 0)
|
||||
player.yoraiz0rEye = 0;
|
||||
|
||||
if (cementShoes || CalamityConfig.Instance.BossRushDashCurse && BossRushEvent.BossRushActive)
|
||||
if (blockAllDashes || CalamityConfig.Instance.BossRushDashCurse && BossRushEvent.BossRushActive)
|
||||
DisableAllDashes();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -4,11 +4,11 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Tools
|
||||
{
|
||||
public class CementShoes : ModItem
|
||||
public class BallAndChain : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Cement Shoes");
|
||||
DisplayName.SetDefault("Ball and Chain");
|
||||
Tooltip.SetDefault("So heavy...\n" +
|
||||
"Favorite this item to disable any dashes granted by equipment.");
|
||||
}
|
||||
@@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 32;
|
||||
item.height = 30;
|
||||
item.rare = 1;
|
||||
item.height = 50;
|
||||
item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player) => false;
|
||||
@@ -25,15 +25,15 @@ namespace CalamityMod.Items.Tools
|
||||
public override void UpdateInventory(Player player)
|
||||
{
|
||||
if (item.favorited)
|
||||
player.Calamity().cementShoes = true;
|
||||
player.Calamity().blockAllDashes = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddRecipeGroup("SiltGroup", 20);
|
||||
recipe.AddIngredient(ItemID.StoneBlock, 20);
|
||||
recipe.AddTile(TileID.Furnaces);
|
||||
recipe.AddIngredient(ItemID.IronBar, 10);
|
||||
recipe.AddIngredient(ItemID.Chain, 1);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
+147
-107
@@ -20,6 +20,7 @@ namespace CalamityMod.Schematics
|
||||
BottomLeft,
|
||||
BottomRight,
|
||||
}
|
||||
|
||||
internal static Tile SchematicTileConversion(Tile oldTile, Tile toReplaceWith, Color schematicColorAtPosition)
|
||||
{
|
||||
float opacity = schematicColorAtPosition.A / 255f;
|
||||
@@ -42,36 +43,57 @@ namespace CalamityMod.Schematics
|
||||
newTile = (Tile)toReplaceWith.Clone();
|
||||
return newTile;
|
||||
}
|
||||
|
||||
//
|
||||
// NOTE: These two seemingly copy-pasted functions are both necessary because the Action<> signature is different.
|
||||
// It is very difficult if not impossible to combine these into one function.
|
||||
//
|
||||
|
||||
public static void PlaceStructure(string mapKey, Point placementPosition, PlacementAnchorType placementAnchor, Action<Chest> chestInteraction = null)
|
||||
{
|
||||
LoadEverything(); // Just in case they weren't loaded properly beforehand.
|
||||
|
||||
// If no structure schematic matching that name was found, cancel.
|
||||
if (!TileMaps.ContainsKey(mapKey))
|
||||
return;
|
||||
PilePlacementMaps.TryGetValue(mapKey, out PilePlacementFunction pilePlacementFunction);
|
||||
ColorTileCombination[,] schematic = TileMaps[mapKey];
|
||||
Tile[,] oldTiles = new Tile[schematic.GetLength(0), schematic.GetLength(1)];
|
||||
|
||||
// Make an array for the tiles that used to be where this schematic will be pasted.
|
||||
int sWidth = schematic.GetLength(0);
|
||||
int sHeight = schematic.GetLength(1);
|
||||
Tile[,] oldTiles = new Tile[sWidth, sHeight];
|
||||
|
||||
int xOffset = placementPosition.X;
|
||||
int yOffset = placementPosition.Y;
|
||||
// Top-left is the default for terraria. There is no need to include it in this switch.
|
||||
|
||||
// TopLeft is the default because anchoring things at their top-left corner is the default Terraria behavior.
|
||||
// This is why it does nothing.
|
||||
switch (placementAnchor)
|
||||
{
|
||||
case PlacementAnchorType.TopRight:
|
||||
xOffset += schematic.GetLength(0);
|
||||
xOffset += sWidth;
|
||||
break;
|
||||
case PlacementAnchorType.Center:
|
||||
xOffset += schematic.GetLength(0) / 2;
|
||||
yOffset += schematic.GetLength(1) / 2;
|
||||
xOffset += sWidth / 2;
|
||||
yOffset += sHeight / 2;
|
||||
break;
|
||||
case PlacementAnchorType.BottomLeft:
|
||||
yOffset += schematic.GetLength(1);
|
||||
yOffset += sHeight;
|
||||
break;
|
||||
case PlacementAnchorType.BottomRight:
|
||||
xOffset += schematic.GetLength(0);
|
||||
yOffset += schematic.GetLength(1);
|
||||
xOffset += sWidth;
|
||||
yOffset += sHeight;
|
||||
break;
|
||||
case PlacementAnchorType.TopLeft:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (int x = 0; x < schematic.GetLength(0); x++)
|
||||
|
||||
// Fill the old tiles array while simultaneously destroying everything in the target rectangle.
|
||||
for (int x = 0; x < sWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < schematic.GetLength(1); y++)
|
||||
for (int y = 0; y < sHeight; y++)
|
||||
{
|
||||
oldTiles[x, y] = (Tile)Main.tile[x + xOffset, y + yOffset].Clone();
|
||||
|
||||
@@ -81,78 +103,97 @@ namespace CalamityMod.Schematics
|
||||
WorldGen.KillTile(x + xOffset, y + yOffset);
|
||||
}
|
||||
}
|
||||
for (int x = 0; x < schematic.GetLength(0); x++)
|
||||
|
||||
// Lay down the schematic. If the schematic calls for it, bring back tiles that are stored in the old tiles array.
|
||||
for (int x = 0; x < sWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < schematic.GetLength(1); y++)
|
||||
for (int y = 0; y < sHeight; y++)
|
||||
{
|
||||
if (WorldGen.InWorld(x + xOffset, y + yOffset))
|
||||
if (!WorldGen.InWorld(x + xOffset, y + yOffset))
|
||||
continue;
|
||||
|
||||
Tile tile = schematic[x, y].InternalTile;
|
||||
ModTile modTile = TileLoader.GetTile(tile.type);
|
||||
bool isChest = tile.type == TileID.Containers || (modTile != null && modTile.chest != "");
|
||||
|
||||
// If the determined tile type is a chest, define it appropriately.
|
||||
if (isChest)
|
||||
{
|
||||
Tile tile = schematic[x, y].InternalTile;
|
||||
ModTile modTile = TileLoader.GetTile(tile.type);
|
||||
bool isChest = tile.type == TileID.Containers || (modTile != null && modTile.chest != "");
|
||||
|
||||
// If the determined tile type is a chest, define it appropriately.
|
||||
if (isChest)
|
||||
if (tile.frameX % 36 == 0 && tile.frameY == 0)
|
||||
{
|
||||
if (tile.frameX % 36 == 0 && tile.frameY == 0)
|
||||
{
|
||||
Chest chest = PlaceChest(x + xOffset, y + yOffset, tile.type);
|
||||
chestInteraction?.Invoke(chest);
|
||||
}
|
||||
Chest chest = PlaceChest(x + xOffset, y + yOffset, tile.type);
|
||||
chestInteraction?.Invoke(chest);
|
||||
}
|
||||
if (tile.type == TileID.Trees || tile.type == TileID.PineTree || tile.type == TileID.Cactus)
|
||||
{
|
||||
ushort oldWall = oldTiles[x, y].wall;
|
||||
oldTiles[x, y] = new Tile
|
||||
{
|
||||
wall = oldWall
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[x + xOffset, y + yOffset] = (Tile)SchematicTileConversion(oldTiles[x, y], tile, schematic[x, y].InternalColor).Clone();
|
||||
|
||||
TryToPlaceTileEntities(x + xOffset, y + yOffset);
|
||||
}
|
||||
|
||||
Rectangle placeInArea = new Rectangle(x, y, schematic.GetLength(0), schematic.GetLength(1));
|
||||
|
||||
// Dictionary.TryGetValue returns null if the specified key is not present.
|
||||
pilePlacementFunction?.Invoke(x + xOffset, y + yOffset, placeInArea);
|
||||
}
|
||||
|
||||
// Trees and cacti get special treatment and are always imported back in to prevent world corruption.
|
||||
if (tile.type == TileID.Trees || tile.type == TileID.PineTree || tile.type == TileID.Cactus)
|
||||
{
|
||||
ushort oldWall = oldTiles[x, y].wall;
|
||||
oldTiles[x, y] = new Tile
|
||||
{
|
||||
wall = oldWall
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[x + xOffset, y + yOffset] = (Tile)SchematicTileConversion(oldTiles[x, y], tile, schematic[x, y].InternalColor).Clone();
|
||||
TryToPlaceTileEntities(x + xOffset, y + yOffset);
|
||||
}
|
||||
|
||||
Rectangle placeInArea = new Rectangle(x, y, sWidth, sHeight);
|
||||
pilePlacementFunction?.Invoke(x + xOffset, y + yOffset, placeInArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlaceStructure(string mapKey, Point placementPosition, PlacementAnchorType placementAnchor, ref bool specialCondition, Action<Chest, int, bool> chestInteraction = null)
|
||||
{
|
||||
LoadEverything(); // Just in case they weren't loaded properly beforehand.
|
||||
|
||||
// If no structure schematic matching that name was found, cancel.
|
||||
if (!TileMaps.ContainsKey(mapKey))
|
||||
return;
|
||||
|
||||
PilePlacementMaps.TryGetValue(mapKey, out PilePlacementFunction pilePlacementFunction);
|
||||
ColorTileCombination[,] schematic = TileMaps[mapKey];
|
||||
Tile[,] oldTiles = new Tile[schematic.GetLength(0), schematic.GetLength(1)];
|
||||
|
||||
// Make an array for the tiles that used to be where this schematic will be pasted.
|
||||
int sWidth = schematic.GetLength(0);
|
||||
int sHeight = schematic.GetLength(1);
|
||||
Tile[,] oldTiles = new Tile[sWidth, sHeight];
|
||||
|
||||
|
||||
int xOffset = placementPosition.X;
|
||||
int yOffset = placementPosition.Y;
|
||||
// Top-left is the default for terraria. There is no need to include it in this switch.
|
||||
|
||||
// TopLeft is the default because anchoring things at their top-left corner is the default Terraria behavior.
|
||||
// This is why it does nothing.
|
||||
switch (placementAnchor)
|
||||
{
|
||||
case PlacementAnchorType.TopRight:
|
||||
xOffset += schematic.GetLength(0);
|
||||
xOffset += sWidth;
|
||||
break;
|
||||
case PlacementAnchorType.Center:
|
||||
xOffset += schematic.GetLength(0) / 2;
|
||||
yOffset += schematic.GetLength(1) / 2;
|
||||
xOffset += sWidth / 2;
|
||||
yOffset += sHeight / 2;
|
||||
break;
|
||||
case PlacementAnchorType.BottomLeft:
|
||||
yOffset += schematic.GetLength(1);
|
||||
yOffset += sHeight;
|
||||
break;
|
||||
case PlacementAnchorType.BottomRight:
|
||||
xOffset += schematic.GetLength(0);
|
||||
yOffset += schematic.GetLength(1);
|
||||
xOffset += sWidth;
|
||||
yOffset += sHeight;
|
||||
break;
|
||||
case PlacementAnchorType.TopLeft:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (int x = 0; x < schematic.GetLength(0); x++)
|
||||
|
||||
// Fill the old tiles array while simultaneously destroying everything in the target rectangle.
|
||||
for (int x = 0; x < sWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < schematic.GetLength(1); y++)
|
||||
for (int y = 0; y < sHeight; y++)
|
||||
{
|
||||
oldTiles[x, y] = (Tile)CalamityUtils.ParanoidTileRetrieval(x + xOffset, y + yOffset).Clone();
|
||||
|
||||
@@ -162,77 +203,76 @@ namespace CalamityMod.Schematics
|
||||
WorldGen.KillTile(x + xOffset, y + yOffset);
|
||||
}
|
||||
}
|
||||
for (int x = 0; x < schematic.GetLength(0); x++)
|
||||
|
||||
// Lay down the schematic. If the schematic calls for it, bring back tiles that are stored in the old tiles array.
|
||||
for (int x = 0; x < sWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < schematic.GetLength(1); y++)
|
||||
for (int y = 0; y < sHeight; y++)
|
||||
{
|
||||
if (WorldGen.InWorld(x + xOffset, y + yOffset))
|
||||
if (!WorldGen.InWorld(x + xOffset, y + yOffset))
|
||||
continue;
|
||||
|
||||
Tile tile = schematic[x, y].InternalTile;
|
||||
ModTile modTile = TileLoader.GetTile(tile.type);
|
||||
bool isChest = tile.type == TileID.Containers || (modTile != null && modTile.chest != "");
|
||||
|
||||
// If the determined tile type is a chest, define it appropriately.
|
||||
if (isChest)
|
||||
{
|
||||
Tile tile = schematic[x, y].InternalTile;
|
||||
ModTile modTile = TileLoader.GetTile(tile.type);
|
||||
bool isChest = tile.type == TileID.Containers || (modTile != null && modTile.chest != "");
|
||||
// If the determined tile type is a chest, define it appropriately.
|
||||
if (isChest)
|
||||
if (tile.frameX % 36 == 0 && tile.frameY == 0)
|
||||
{
|
||||
if (tile.frameX % 36 == 0 && tile.frameY == 0)
|
||||
{
|
||||
Chest chest = PlaceChest(x + xOffset, y + yOffset, tile.type);
|
||||
chestInteraction?.Invoke(chest, tile.type, specialCondition);
|
||||
specialCondition = true;
|
||||
}
|
||||
Chest chest = PlaceChest(x + xOffset, y + yOffset, tile.type);
|
||||
chestInteraction?.Invoke(chest, tile.type, specialCondition);
|
||||
specialCondition = true;
|
||||
}
|
||||
if (tile.type == TileID.Trees || tile.type == TileID.PineTree || tile.type == TileID.Cactus)
|
||||
{
|
||||
ushort oldWall = oldTiles[x, y].wall;
|
||||
oldTiles[x, y] = new Tile
|
||||
{
|
||||
wall = oldWall
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[x + xOffset, y + yOffset] = (Tile)SchematicTileConversion(oldTiles[x, y], tile, schematic[x, y].InternalColor).Clone();
|
||||
|
||||
TryToPlaceTileEntities(x + xOffset, y + yOffset);
|
||||
}
|
||||
|
||||
Rectangle placeInArea = new Rectangle(x, y, schematic.GetLength(0), schematic.GetLength(1));
|
||||
|
||||
// Dictionary.TryGetValue returns null if the specified key is not present.
|
||||
pilePlacementFunction?.Invoke(x + xOffset, y + yOffset, placeInArea);
|
||||
}
|
||||
|
||||
// Trees and cacti get special treatment and are always imported back in to prevent world corruption.
|
||||
if (tile.type == TileID.Trees || tile.type == TileID.PineTree || tile.type == TileID.Cactus)
|
||||
{
|
||||
ushort oldWall = oldTiles[x, y].wall;
|
||||
oldTiles[x, y] = new Tile
|
||||
{
|
||||
wall = oldWall
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[x + xOffset, y + yOffset] = (Tile)SchematicTileConversion(oldTiles[x, y], tile, schematic[x, y].InternalColor).Clone();
|
||||
TryToPlaceTileEntities(x + xOffset, y + yOffset);
|
||||
}
|
||||
|
||||
Rectangle placeInArea = new Rectangle(x, y, sWidth, sHeight);
|
||||
pilePlacementFunction?.Invoke(x + xOffset, y + yOffset, placeInArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryToPlaceTileEntities(int x, int y)
|
||||
{
|
||||
Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
int tileType = tileAtPosition.type;
|
||||
private static void TryToPlaceTileEntities(int x, int y)
|
||||
{
|
||||
Tile t = CalamityUtils.ParanoidTileRetrieval(x, y);
|
||||
int tileType = t.type;
|
||||
|
||||
// A tile entity in an empty spot would make no sense.
|
||||
if (!tileAtPosition.active())
|
||||
return;
|
||||
// A tile entity in an empty spot would make no sense.
|
||||
if (!t.active())
|
||||
return;
|
||||
|
||||
// Ignore tiles that aren't at the top left of the tile.
|
||||
// Most tile entities won't even register the position as valid otherwise.
|
||||
// Not to mention the possibility of multiple tile entities appearing.
|
||||
if (tileAtPosition.frameX != 0 || tileAtPosition.frameY != 0)
|
||||
return;
|
||||
// Ignore tiles that aren't at the top left of the tile.
|
||||
// All of Calamity's worldgen-placed tile entities refuse to exist except at the top left corner of their host tile.
|
||||
if (t.frameX != 0 || t.frameY != 0)
|
||||
return;
|
||||
|
||||
// Runtime variables do not work with switches (such as ModContent calls).
|
||||
// Therefore, the only other solutions would be to use an else if or delegate dictionary.
|
||||
if (tileType == ModContent.TileType<DraedonLabTurret>())
|
||||
{
|
||||
TileEntity.PlaceEntityNet(x, y, ModContent.TileEntityType<TEDraedonLabTurret>());
|
||||
}
|
||||
// This cannot be a switch because switch cases must be compile time constants, which ModContent calls are not.
|
||||
// Therefore the only option is an if-else ladder.
|
||||
else if (tileType == ModContent.TileType<ChargingStation>())
|
||||
{
|
||||
TileEntity.PlaceEntityNet(x, y, ModContent.TileEntityType<TEChargingStation>());
|
||||
}
|
||||
else if (tileType == ModContent.TileType<DraedonLabTurret>())
|
||||
TileEntity.PlaceEntityNet(x, y, ModContent.TileEntityType<TEDraedonLabTurret>());
|
||||
else if (tileType == ModContent.TileType<LabHologramProjector>())
|
||||
TileEntity.PlaceEntityNet(x, y, ModContent.TileEntityType<TELabHologramProjector>());
|
||||
}
|
||||
|
||||
public static Chest PlaceChest(int x, int y, int chestType)
|
||||
public static Chest PlaceChest(int x, int y, int chestType)
|
||||
{
|
||||
int chestIndex = Chest.FindEmptyChest(x, y, chestType);
|
||||
Main.chest[chestIndex] = new Chest()
|
||||
|
||||
@@ -46,7 +46,15 @@ namespace CalamityMod.TileEntities
|
||||
SendSyncPacket();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Lab turrets specifically must be placed on the top left corner of their host tile.
|
||||
// This restriction is not shared by general turrets for flexibility reasons.
|
||||
public override bool ValidTile(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
return tile.active() && tile.type == TileType && tile.frameX == 0 && tile.frameY == 0;
|
||||
}
|
||||
|
||||
protected override Vector2 ChooseTarget(Vector2 targetingCenter)
|
||||
{
|
||||
// Store the value that will be set into PlayerTargetIndex here.
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.TileEntities
|
||||
public override bool ValidTile(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
return tile.active() && tile.type == ModContent.TileType<LabHologramProjector>();
|
||||
return tile.active() && tile.type == ModContent.TileType<LabHologramProjector>() && tile.frameX == 0 && tile.frameY == 0;
|
||||
}
|
||||
|
||||
// Check if the hologram should become visible.
|
||||
|
||||
@@ -91,6 +91,8 @@ namespace CalamityMod.UI
|
||||
ref Item playerHandItem = ref Main.mouseItem;
|
||||
if (mouseRect.Intersects(pluggedSlotRect))
|
||||
{
|
||||
p.mouseInterface = Main.blockMouse = true;
|
||||
|
||||
if (!pluggedItem.IsAir)
|
||||
Main.HoverItem = pluggedItem;
|
||||
|
||||
@@ -133,8 +135,6 @@ namespace CalamityMod.UI
|
||||
|
||||
// Since HoverItem is active, we don't need to input anything into this method.
|
||||
Main.instance.MouseTextHackZoom("");
|
||||
// Specifically do not block mouse input if holding a pickaxe, so that you can mine blocks behind the UI.
|
||||
Main.blockMouse = Main.LocalPlayer.ActiveItem().pick <= 0;
|
||||
}
|
||||
|
||||
// Otherwise if the player's cursor is over the power cell slot, they can interact with that UI element instead.
|
||||
|
||||
@@ -80,6 +80,8 @@ namespace CalamityMod.UI
|
||||
// If the player's cursor is over the slot and there are power cells, then interaction with the UI is possible.
|
||||
if (mouseRect.Intersects(powercellSlotRect) && powercell.stack > 0)
|
||||
{
|
||||
p.mouseInterface = Main.blockMouse = true;
|
||||
|
||||
if (!powercell.IsAir)
|
||||
Main.HoverItem = powercell;
|
||||
|
||||
@@ -117,9 +119,6 @@ namespace CalamityMod.UI
|
||||
|
||||
// Since HoverItem is active, we don't need to input anything into this method.
|
||||
Main.instance.MouseTextHackZoom("");
|
||||
|
||||
// Specifically do not block mouse input if holding a pickaxe, so that you can mine blocks behind the UI.
|
||||
Main.blockMouse = Main.LocalPlayer.ActiveItem().pick <= 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ using CalamityMod.Items.Fishing.SunkenSeaCatches;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -28,10 +27,10 @@ namespace CalamityMod
|
||||
public static void AddRecipes()
|
||||
{
|
||||
EditTerraBladeRecipe();
|
||||
EditFireGauntletRecipe();
|
||||
EditFireGauntletRecipe();
|
||||
AstralAlternatives();
|
||||
|
||||
AddPotionRecipes();
|
||||
AddPotionRecipes();
|
||||
AddCookedFood();
|
||||
AddToolRecipes();
|
||||
AddProgressionRecipes();
|
||||
@@ -126,46 +125,46 @@ namespace CalamityMod
|
||||
});
|
||||
}
|
||||
|
||||
// Change Fire Gauntlet's recipe to require 5 Chaotic Bars (forces the item to be post-Golem)
|
||||
private static void EditFireGauntletRecipe()
|
||||
{
|
||||
List<Recipe> rec = Main.recipe.ToList();
|
||||
rec.Where(x => x.createItem.type == ItemID.FireGauntlet).ToList().ForEach(s =>
|
||||
{
|
||||
for (int i = 0; i < s.requiredItem.Length; i++)
|
||||
{
|
||||
s.requiredItem[i] = new Item();
|
||||
}
|
||||
s.requiredItem[0].SetDefaults(ItemID.MagmaStone, false);
|
||||
s.requiredItem[0].stack = 1;
|
||||
s.requiredItem[1].SetDefaults(ItemID.MechanicalGlove, false);
|
||||
s.requiredItem[1].stack = 1;
|
||||
s.requiredItem[2].SetDefaults(ModContent.ItemType<CruptixBar>(), false);
|
||||
s.requiredItem[2].stack = 5;
|
||||
// Change Fire Gauntlet's recipe to require 5 Chaotic Bars (forces the item to be post-Golem)
|
||||
private static void EditFireGauntletRecipe()
|
||||
{
|
||||
List<Recipe> rec = Main.recipe.ToList();
|
||||
rec.Where(x => x.createItem.type == ItemID.FireGauntlet).ToList().ForEach(s =>
|
||||
{
|
||||
for (int i = 0; i < s.requiredItem.Length; i++)
|
||||
{
|
||||
s.requiredItem[i] = new Item();
|
||||
}
|
||||
s.requiredItem[0].SetDefaults(ItemID.MagmaStone, false);
|
||||
s.requiredItem[0].stack = 1;
|
||||
s.requiredItem[1].SetDefaults(ItemID.MechanicalGlove, false);
|
||||
s.requiredItem[1].stack = 1;
|
||||
s.requiredItem[2].SetDefaults(ModContent.ItemType<CruptixBar>(), false);
|
||||
s.requiredItem[2].stack = 5;
|
||||
|
||||
s.createItem.SetDefaults(ItemID.FireGauntlet, false);
|
||||
s.createItem.stack = 1;
|
||||
});
|
||||
}
|
||||
s.createItem.SetDefaults(ItemID.FireGauntlet, false);
|
||||
s.createItem.stack = 1;
|
||||
});
|
||||
}
|
||||
|
||||
#region Astral Alternatives
|
||||
private static void AstralAlternatives()
|
||||
{
|
||||
//Bowl
|
||||
//Bowl
|
||||
ModRecipe r = GetNewRecipe();
|
||||
r.AddIngredient(ModContent.ItemType<AstralClay>(), 2);
|
||||
r.AddTile(TileID.Furnaces);
|
||||
r.SetResult(ItemID.Bowl);
|
||||
r.AddRecipe();
|
||||
|
||||
//Clay Pot
|
||||
//Clay Pot
|
||||
r = GetNewRecipe();
|
||||
r.AddIngredient(ModContent.ItemType<AstralClay>(), 2);
|
||||
r.AddTile(TileID.Furnaces);
|
||||
r.SetResult(ItemID.ClayPot);
|
||||
r.AddRecipe();
|
||||
|
||||
//Pink Vase
|
||||
//Pink Vase
|
||||
r = GetNewRecipe();
|
||||
r.AddIngredient(ModContent.ItemType<AstralClay>(), 2);
|
||||
r.AddTile(TileID.Furnaces);
|
||||
@@ -174,9 +173,9 @@ namespace CalamityMod
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Potions
|
||||
// Equivalent Blood Orb recipes for almost all vanilla potions
|
||||
private static void AddPotionRecipes()
|
||||
#region Potions
|
||||
// Equivalent Blood Orb recipes for almost all vanilla potions
|
||||
private static void AddPotionRecipes()
|
||||
{
|
||||
short[] potions = new[]
|
||||
{
|
||||
@@ -478,7 +477,7 @@ namespace CalamityMod
|
||||
//Slime Staff
|
||||
r = GetNewRecipe();
|
||||
r.AddIngredient(ItemID.Wood, 6);
|
||||
r.anyWood = true;
|
||||
r.anyWood = true;
|
||||
r.AddIngredient(ItemID.Gel, 40);
|
||||
r.AddIngredient(ItemID.PinkGel, 10);
|
||||
r.AddTile(TileID.Anvils);
|
||||
@@ -698,8 +697,8 @@ namespace CalamityMod
|
||||
r.AddTile(TileID.Loom);
|
||||
r.SetResult(ItemID.EskimoPants);
|
||||
r.AddRecipe();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region AnkhShield
|
||||
// Every base component for the Ankh Shield
|
||||
@@ -869,7 +868,7 @@ namespace CalamityMod
|
||||
r.SetResult(ItemID.TerraBlade);
|
||||
r.AddRecipe();
|
||||
|
||||
// Turtle Shell with Giant Tortoise Shell
|
||||
// Turtle Shell with Giant Tortoise Shell
|
||||
r = GetNewRecipe();
|
||||
r.AddIngredient(ModContent.ItemType<GiantTortoiseShell>());
|
||||
r.SetResult(ItemID.TurtleShell);
|
||||
@@ -879,17 +878,17 @@ namespace CalamityMod
|
||||
|
||||
public static void AddRecipeGroups()
|
||||
{
|
||||
//Modify Vanilla Recipe Groups
|
||||
RecipeGroup firefly = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Fireflies"]];
|
||||
firefly.ValidItems.Add(ModContent.ItemType<TwinklerItem>());
|
||||
//Modify Vanilla Recipe Groups
|
||||
RecipeGroup firefly = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Fireflies"]];
|
||||
firefly.ValidItems.Add(ModContent.ItemType<TwinklerItem>());
|
||||
|
||||
RecipeGroup sand = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Sand"]];
|
||||
sand.ValidItems.Add(ModContent.ItemType<AstralSand>());
|
||||
RecipeGroup sand = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Sand"]];
|
||||
sand.ValidItems.Add(ModContent.ItemType<AstralSand>());
|
||||
|
||||
RecipeGroup wood = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Wood"]];
|
||||
wood.ValidItems.Add(ModContent.ItemType<Acidwood>()); //Astral Monolith was decidedly not wood-like enough
|
||||
RecipeGroup wood = RecipeGroup.recipeGroups[RecipeGroup.recipeGroupIDs["Wood"]];
|
||||
wood.ValidItems.Add(ModContent.ItemType<Acidwood>()); //Astral Monolith was decidedly not wood-like enough
|
||||
|
||||
//New Groups
|
||||
//New Groups
|
||||
RecipeGroup group = new RecipeGroup(() => "Any Copper Bar", new int[]
|
||||
{
|
||||
ItemID.CopperBar,
|
||||
|
||||
Reference in new issue
Block a user