This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xhuis
committed
Jul 13, 2018
1 parent
9a87373
commit 3b1c1c1
Showing
5 changed files
with
112 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace Thaumaturgy.Items | ||
{ | ||
public class TerranBore : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Massive Terran Bore"); | ||
Tooltip.SetDefault("An impressive technological feat that tunnels through earth\nUse to start it up, causing it to dig downwards until extreme heat destroys it\nThe bore shoves aside the earth into walls, and leaves a rope for safe descent\nDon't use if there's anything important below you"); | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.width = 20; | ||
item.height = 30; | ||
item.useTime = 20; | ||
item.useAnimation = 20; | ||
item.useStyle = 4; | ||
item.value = Item.sellPrice(0, 5, 0, 0); | ||
item.rare = 4; | ||
item.UseSound = SoundID.NPCDeath56; | ||
item.maxStack = 3; | ||
item.consumable = true; | ||
item.noMelee = true; | ||
} | ||
|
||
public override bool UseItem(Player player) //HERE BE DRAGONS | ||
{ | ||
Main.NewText("The terran bore howls with energy and rockets into the earth!", 0, 255, 0); | ||
int x = (int)(player.position.X / 16f); | ||
int y = (int)(player.position.Y / 16f); | ||
int prog_x = 0; | ||
int prog_y = 1; | ||
for (int i = x - 3; i < x + 4; i++) | ||
{ | ||
prog_y = 0; | ||
for (int v = y; v < y + 4000; v++) //this should be more than enough for even the largest worlds | ||
{ | ||
if(Main.tile[i, v].type != null) | ||
{ | ||
if(Main.tile[i, v].type == TileID.Ash || Main.tile[i, v].type == TileID.ObsidianBrick || Main.tile[i, v].type == TileID.HellstoneBrick) //once we're at the Underworld, stop digging | ||
{ | ||
break; | ||
} | ||
WorldGen.KillTile(i, v, false, false, false); //destroy each tile as we go down | ||
if(Main.tile[i, v].liquid > 0) //and clear out liquids | ||
{ | ||
Main.tile[i, v].lava(false); | ||
Main.tile[i, v].liquid = 0; | ||
WorldGen.SquareTileFrame(i, v, true); | ||
} | ||
if(prog_x == 0 || prog_x == 6) //on the borders, we'll put down walls; iridescent brick is made from ash - balance can't be broken by uncrafting mods, and you have to have reached the underworld first | ||
{ | ||
WorldGen.PlaceTile(i, v, TileID.IridescentBrick, false, false, -1, 0); | ||
} | ||
if(prog_x == 3) //in the center, run a rope down the length | ||
{ | ||
WorldGen.PlaceTile(i, v, TileID.SilkRope, false, false, -1, 0); | ||
} | ||
if(prog_x > 0 && prog_x < 6) //while not in the borders, smash walls and replace them | ||
{ | ||
WorldGen.KillWall(i, v, false); | ||
if(prog_y != 0) | ||
{ | ||
if(prog_x == 3 && prog_y % 20 == 0) | ||
{ | ||
WorldGen.PlaceWall(i, v, WallID.DiamondGemspark, false); //every 20 tiles, use a diamond gemspark block for lighting and aesthetic | ||
} | ||
else | ||
{ | ||
WorldGen.PlaceWall(i, v, WallID.IridescentBrick, false); | ||
} | ||
} | ||
} | ||
if(prog_y == 5) //place platforms near the top to catch the player and provide a safety net | ||
{ | ||
WorldGen.PlaceTile(i, v, TileID.Platforms, false, false, -1, 0); | ||
} | ||
} | ||
prog_y++; | ||
} | ||
prog_x++; | ||
} | ||
return true; | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.IridescentBrick, 300); | ||
recipe.AddIngredient(ItemID.SilkRopeCoil, 100); | ||
recipe.AddIngredient(ItemID.DiamondGemsparkBlock, 30); | ||
recipe.AddIngredient(ItemID.MeteoriteBar, 30); | ||
recipe.AddIngredient(mod.ItemType("AuricCore"), 10); | ||
recipe.AddTile(mod.TileType("Thaumatrestle")); | ||
recipe.AddTile(mod.TileType("SynthesisFocus")); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
author = Xhuis | ||
|
||
version = 1.0.11.1 | ||
version = 1.0.12.0 | ||
displayName = Thaumaturgy | ||
homepage = https://github.com/Xhuis/Thaumaturgy |