Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Glacier ice wall can now only spread to other ice or snow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Sep 12, 2017
1 parent fa535d3 commit 9a0024e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
1 change: 1 addition & 0 deletions Changelogs/v1.3.2.4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Thanks to Eldrazi for many contributions for this patch.
- Implemented actual crit chance and knockback for alchemical weapons. Increases to alchemical crit is no longer just visual in the tooltip but actually takes effect (Knockback for alchemical weapons is implemented, but no items give it yet, leave your suggestions)
- Improved certain tooltips for alchemist class related items (please note I still probably missed many)
- Fixed certain alchemist class items not granting the right amount of increased damage or critical strike chance
- Glacier ice wall can now only spread to other ice or snow
11 changes: 6 additions & 5 deletions Ice/IceBlock.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tremor.Ice
Expand All @@ -20,11 +21,11 @@ public override void SetDefaults()
Main.tileMerge[Type][mod.TileType("IceOre")] = true;
Main.tileMerge[Type][mod.TileType("VeryVeryIce")] = true;
Main.tileMerge[Type][mod.TileType("DungeonBlock")] = true;
Main.tileMerge[Type][161] = true;
Main.tileMerge[Type][162] = true;
Main.tileMerge[Type][163] = true;
Main.tileMerge[Type][164] = true;
Main.tileMerge[Type][147] = true;
Main.tileMerge[Type][TileID.IceBlock] = true;
Main.tileMerge[Type][TileID.BreakableIce] = true;
Main.tileMerge[Type][TileID.CorruptIce] = true;
Main.tileMerge[Type][TileID.HallowedIce] = true;
Main.tileMerge[Type][TileID.SnowBlock] = true;
}

public bool CanGrow(int i, int j)
Expand Down
14 changes: 13 additions & 1 deletion Ice/IceWall.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Linq;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tremor.Ice
Expand Down Expand Up @@ -38,13 +40,23 @@ public override void RandomUpdate(int i, int j)
}
}

// Ice is allowed to spreado on these tiles
private readonly ushort[] _allowedSpreadTiles = new ushort[]
{
TileID.IceBlock,
TileID.CorruptIce,
TileID.HallowedIce,
TileID.SnowBlock
};

public bool CanGrow(int i, int j)
{
bool flag = false;
for (int x = 0; x < 3; x++)
for (int y = 0; y < 3; y++)
{
if (!Main.tile[i - 1 + x, j - 1 + y].active())
Tile tile = Main.tile[i - 1 + x, j - 1 + y];
if (!tile.active() && _allowedSpreadTiles.Contains(tile.type))
flag = true;
}
return flag;
Expand Down
2 changes: 1 addition & 1 deletion Ice/IceWallW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public override void SetDefaults()
item.useStyle = 1;
item.consumable = true;
item.createWall = mod.WallType("IceWall");
ItemID.Sets.ExtractinatorMode[item.type] = item.type;
}

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Everfrost Wall");
Tooltip.SetDefault("");
ItemID.Sets.ExtractinatorMode[item.type] = item.type;
}

}
Expand Down
11 changes: 6 additions & 5 deletions Ice/Items/GlacierWoodTile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tremor.Ice.Items
Expand All @@ -16,11 +17,11 @@ public override void SetDefaults()
AddMapEntry(new Color(0, 191, 255));
drop = mod.ItemType("GlacierWood");
Main.tileMerge[Type][mod.TileType("IceBlock")] = true;
Main.tileMerge[Type][161] = true;
Main.tileMerge[Type][162] = true;
Main.tileMerge[Type][163] = true;
Main.tileMerge[Type][164] = true;
Main.tileMerge[Type][147] = true;
Main.tileMerge[Type][TileID.IceBlock] = true; // normal ice
Main.tileMerge[Type][TileID.BreakableIce] = true; // thin ice
Main.tileMerge[Type][TileID.CorruptIce] = true; // purple ice
Main.tileMerge[Type][TileID.HallowedIce] = true; // pink ice
Main.tileMerge[Type][TileID.SnowBlock] = true; // snow
}

}
Expand Down
2 changes: 0 additions & 2 deletions Ice/Items/GlacierWoodWall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public class GlacierWoodWall : ModItem
{
public override void SetDefaults()
{

item.width = 12;
item.height = 12;
item.maxStack = 999;
Expand All @@ -25,7 +24,6 @@ public override void SetStaticDefaults()
Tooltip.SetDefault("");
}


public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
Expand Down
1 change: 0 additions & 1 deletion Ice/Items/GlacierWoodWallWall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ public override void SetDefaults()
drop = mod.ItemType("GlacierWoodWall");
AddMapEntry(new Color(36, 43, 102));
}

}
}

0 comments on commit 9a0024e

Please sign in to comment.