diff --git a/.vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 b/.vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 index a73ab14..1d4965b 100644 Binary files a/.vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 and b/.vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/NekoTweakMod/v16/.suo b/.vs/NekoTweakMod/v16/.suo index c766584..58fe12c 100644 Binary files a/.vs/NekoTweakMod/v16/.suo and b/.vs/NekoTweakMod/v16/.suo differ diff --git a/Items/Fishing/AddItemToCrate.cs b/Fishing/AddItemToCrate.cs similarity index 99% rename from Items/Fishing/AddItemToCrate.cs rename to Fishing/AddItemToCrate.cs index 203b2c9..8dc2fa7 100644 --- a/Items/Fishing/AddItemToCrate.cs +++ b/Fishing/AddItemToCrate.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ModLoader; -namespace NekoTweakMod.Items.Fishing +namespace NekoTweakMod.Fishing { public class AddItemToCrate : GlobalItem { diff --git a/Fishing/AddModdedCrateToForest.cs b/Fishing/AddModdedCrateToForest.cs new file mode 100644 index 0000000..30a9a96 --- /dev/null +++ b/Fishing/AddModdedCrateToForest.cs @@ -0,0 +1,46 @@ +using Terraria; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; +namespace NekoTweakMod.Fishing + +{ + public class AddModdedCrateToForest : ModPlayer + { + public static bool PlayerIsInForest(Player player) // Technically, the Forest biome doesn't have an ID. It's the default biome when no other biomes are present. + { + return !player.ZoneJungle + && !player.ZoneDungeon + && !player.ZoneCorrupt + && !player.ZoneCrimson + && !player.ZoneHoly + && !player.ZoneSnow + && !player.ZoneUndergroundDesert + && !player.ZoneGlowshroom + && !player.ZoneMeteor + && !player.ZoneBeach + && player.ZoneOverworldHeight; + + } + public override void CatchFish(Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk) + { + if (liquidType == 2 && Main.rand.Next(1) == 0) // if hardmode + // Liquid types, 0 is water, 1 is lava, 2 is honey + // Main.rand.Next(1) == 0) is the catch % chance to catch the Crate + // n/100 chance or 1 = 100% + { + caughtType = ItemType(); + } + { + if (liquidType == 2 && Main.rand.Next(1) == 0) // if prehardmode + { + caughtType = ItemType(); + } + } + } + } +} +/* +Main.rand.Next(1) == 0) +Main.rand.NextBool(97) +^^how do these even work~ +*/ \ No newline at end of file diff --git a/Items/Fishing/FishingRods.cs b/Fishing/FishingRods.cs similarity index 96% rename from Items/Fishing/FishingRods.cs rename to Fishing/FishingRods.cs index bd0b70f..cf6bc78 100644 --- a/Items/Fishing/FishingRods.cs +++ b/Fishing/FishingRods.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ModLoader; -namespace NekoTweakMod.Items.Fishing +namespace NekoTweakMod.Fishing { public class FishingRods : GlobalItem // class name & vanilla hook { diff --git a/Fishing/ForestCrate.cs b/Fishing/ForestCrate.cs new file mode 100644 index 0000000..0ed81c1 --- /dev/null +++ b/Fishing/ForestCrate.cs @@ -0,0 +1,58 @@ +using Terraria.ModLoader; +using Terraria.ID; +using static Terraria.ModLoader.ModContent; +using Terraria; + +namespace NekoTweakMod.Fishing // where this file is located in the mods folders +{ + public class ForestCrate : ModItem // Here we are setting up the crate as an item while in the players inventory, and making it so it creates a tile when placed + { + public override void SetStaticDefaults() // Allows us to set/change a modded items name/translations + { + DisplayName.SetDefault("Forest Crate"); // Changes the item name + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); // Changes items tooltip + } + public override void SetDefaults() + { + item.width = 12; + item.height = 12; // 16 = default, if no value is set + item.maxStack = 99; // how many of the item the player can have in 1 slot in their inventory + item.useTurn = true; // Whether the player can turn around while the using animation is happening. + item.useAnimation = 15; // how fast the animation happens + item.useTime = 15; // how long the animation takes + item.useStyle = ItemUseStyleID.SwingThrow; // how the animation will look + item.autoReuse = true; // will keep on swinging the item when trying to place it + item.consumable = true; // if doing something with the item consumes/removes it + item.value = Item.sellPrice(0, 1, 0, 0); ; // sets the sale/purchase value of the item ( plat,gold,silver,copper) + item.rare = ItemRarityID.Green; // sets the rarity of the item + item.createTile = TileType(); // where the class is located in the namespace, where file is located in the mod folders~ + // for NekoTweakMod this is located in the Tiles folder + } + public override bool CanRightClick() + { + return true; + } + public override void RightClick(Player player) + { + int choice = Main.rand.Next(7); + if (choice == 0) + { + player.QuickSpawnItem(ItemID.Bunny); + } + else if (choice == 1) + { + player.QuickSpawnItem(ItemID.Swordfish); + } + if (choice != 1) + { + player.QuickSpawnItem(ItemID.Meowmere); + } + player.QuickSpawnItem(ItemID.IronBar); + } + } +} + +// if (Main.hardMode) +// ItemID.Sets.IsFishingCrateHardmode +// public static bool[] IsFishingCrate = ItemID.Sets.Factory.CreateBoolSet(2334, 2335, 2336, 3203, 3204, 3205, 3206, 3207, 3208, 4405, 4407, 4877, 5002, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 4406, 4408, 4878, 5003); +// public static bool[] IsFishingCrateHardmode = ItemID.Sets.Factory.CreateBoolSet(3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 4406, 4408, 4878, 5003); \ No newline at end of file diff --git a/Items/Fishing/ExampleCrate.png b/Fishing/ForestCrate.png similarity index 100% rename from Items/Fishing/ExampleCrate.png rename to Fishing/ForestCrate.png diff --git a/Items/Fishing/ModdedCrate.cs b/Fishing/ForestCratePlaced.cs similarity index 60% rename from Items/Fishing/ModdedCrate.cs rename to Fishing/ForestCratePlaced.cs index 2f80c2b..1219bee 100644 --- a/Items/Fishing/ModdedCrate.cs +++ b/Fishing/ForestCratePlaced.cs @@ -1,17 +1,13 @@ -/* using Terraria.ObjectData; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; using Terraria.ID; using static Terraria.ModLoader.ModContent; -namespace NekoTweakMod.Items.Fishing -// In this .cs file we are making a modded item,tile,placeable item & adding it to a fishing spot in a specific biome -// if you want/need something specific from here just check where the classes start/end +namespace NekoTweakMod.Fishing // // where this file is located in the mods folders { - public class ModdedCrate : ModTile // Here we are setting up everything for the tile + public class ForestCratePlaced : ModTile // Here we are setting up everything for the tile while the item is placed { public override void SetDefaults() { @@ -20,11 +16,11 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; // if the tile counts as a table inside for a npc house Main.tileLavaDeath[Type] = true; // if the tile will break when it comes in contact with lava - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); // copies data for how wide/tall the tile will - TileObjectData.newTile.CoordinateHeights = new[] { 18 }; // sets how high up the tile will appear + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); // 2wide x 2tall + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; // absoluteAquarian: each number is how tall each "ROW OF TILES" in the "SPRITESHEET" is TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); // creates a "name" for the modded tile - name.SetDefault("ExampleCrate"); // Sets the name to "ExampleCrate" + name.SetDefault("Forest Crate"); // Sets the item name to "Forest Crate" // AddMapEntry(new Color(200, 200, 200), name); // adds a new color with the rbg values 0-255,0-255,0-255 to the tile with the "name" // dustType = DustType(); // mehh fk dust for now~ @@ -33,17 +29,7 @@ public override void SetDefaults() } public override void KillMultiTile(int i, int j, int frameX, int frameY) // makes it possible to set/change what happens when a tile break { - //Item.NewItem(i * 16, j * 16, 32, 16, ItemType()); - } - } - public class PlaceableModdedCrate : ModItem - { - public override void SetStaticDefaults() // Allows us to set/change a modded items name/translations - { - Tooltip.SetDefault("ExampleCrate"); + Item.NewItem(i * 16, j * 16, 32, 16, ItemType()); // where the class is located in the namespace, where file is located in the mod folders~ } } } - -// WIP CODE -*/ \ No newline at end of file diff --git a/Fishing/ForestCratePlaced.png b/Fishing/ForestCratePlaced.png new file mode 100644 index 0000000..23e3b8d Binary files /dev/null and b/Fishing/ForestCratePlaced.png differ diff --git a/README.md b/README.md index 8dc3fd6..3c6f650 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,8 @@ might do a modded "forest" crate as well **Item/crafting related:** +- Hellforge,Adamantite Forge & Titanium Forge now also work like demon/crimson altars for crafting + - Cell phone now makes a portal like "potion of return" when you go back home (Recall & Return potions still have a faster "use time" to keep them useful) (On/off toggle in game QoL) diff --git a/obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache b/obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache index b59dca2..548e28d 100644 Binary files a/obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache and b/obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache differ