Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
added npc shop stuffs etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsukino-uwu committed Jun 8, 2020
1 parent fff135c commit 2bc27e6
Show file tree
Hide file tree
Showing 14 changed files with 249 additions and 15 deletions.
Binary file modified .vs/NekoTweakMod/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file modified .vs/NekoTweakMod/v16/.suo
Binary file not shown.
14 changes: 9 additions & 5 deletions Items/Fishing/AddItemToCrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class AddItemToCrate : GlobalItem
public bool RandomBool; // still no idea how either string or bool works here, but got errors without using InstancePerEntity & code works fine

public override bool InstancePerEntity => true;
// Need to use InstancePerEntity when bool is not static, something something~

public override GlobalItem Clone(Item item, Item itemClone)
{
Expand All @@ -25,11 +26,14 @@ public override void OpenVanillaBag(string context, Player player, int arg)
// Context has to be one of these examples: "present", "bossBag", "crate", "lockBox", "herbBag", or "goodieBag"
// arg specifies the present/bag/crate itemid
{
// Each item here will roll individually, but it is possible to get multiple of them at once
if (Main.rand.NextBool(33)) player.QuickSpawnItem(ItemID.WoodenSword); // number/100 or "100% if its at 1" chance/rng & also Specifies the item to add to the present/bag/crate
// if (Main.rand.NextBool(25)) player.QuickSpawnItem(ItemID.Meowmere);
// if (Main.rand.NextBool(50)) player.QuickSpawnItem(ItemID.PlanteraBossBag);
// if (Main.rand.NextBool(75)) player.QuickSpawnItem(ItemID.HotlineFishingHook);
// Each item here will roll individually, so its possible for several of them to drop together with each other
// They will also not share any specific present/bag/crate loot pool with any other items
// This means they will always get a chance to roll 100% of the time when a present/bag/crate is used
// number/100 or "1 = 100%" chance/rng & Specifies the item to give
//if (Main.rand.NextBool(33)) player.QuickSpawnItem(ItemID.WoodenSword);
// if (Main.rand.NextBool(25)) player.QuickSpawnItem(ItemID.Meowmere);
// if (Main.rand.NextBool(50)) player.QuickSpawnItem(ItemID.PlanteraBossBag);
// if (Main.rand.NextBool(75)) player.QuickSpawnItem(ItemID.HotlineFishingHook);

}
}
Expand Down
2 changes: 1 addition & 1 deletion Items/Fishing/FishingRods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Terraria;
using Terraria.ModLoader;

namespace NekoTweakMod.Items
namespace NekoTweakMod.Items.Fishing
{
public class FishingRods : GlobalItem // class name & vanilla hook
{
Expand Down
2 changes: 1 addition & 1 deletion Items/ModifyAccessories.cs → Items/ModifyAccessorie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace NekoTweakMod.Items
{
public class ModifyAccessories : GlobalItem
public class ModifyAccessorie : GlobalItem
{
public override void UpdateAccessory(Item item, Player player, bool hideVisual)
{
Expand Down
17 changes: 17 additions & 0 deletions Items/ModifyEffect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;

namespace NekoTweakMod.Items
{
public class ModifyEffect : GlobalItem
{
public override void UpdateEquip(Item item, Player player)
{
if(item.type == ItemID.SpiderMask) // Also changes the tooltip in Modifytooltip.cs for this item
{
player.maxMinions -= 1; // reduces the max minion cap by 1
}
}
}
}
4 changes: 2 additions & 2 deletions Items/ModifyEquipment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public override void SetDefaults(Item item) // SetDefaults allows you to set/cha
}
if (item.type == ItemID.WormScarf) item.defense = 2; // Single line if statement as we are only changing 1 property
if (item.type == ItemID.Muramasa) item.damage = 26;
if (item.type == ItemID.MiningShirt) item.shopCustomPrice = 40000; // changes the sale value
if (item.type == ItemID.MiningPants) item.shopCustomPrice = 40000;
if (item.type == ItemID.MiningShirt) item.value = Item.buyPrice(0, 4, 0, 0); // changes the sale value
if (item.type == ItemID.MiningPants) item.value = Item.buyPrice(0, 4, 0, 0); // (0, 0, 0, 0); plat,gold,silver,copper
{
if (item.type == ItemID.ReaverShark)
{
Expand Down
10 changes: 7 additions & 3 deletions Items/ModifyTooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public override void ModifyTooltips(Item item, List<TooltipLine> tooltips) // Al
{
if (item.type == ItemID.FeralClaws) // Specifies what item to change, If its this specific item the code below will be used
{
// Optional code to remove a tooltips
// tooltips.RemoveAll(x => x.Name == "Tooltip0" && x.mod == "Terraria");

TooltipLine line = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria");
// Grabs Name(name of the tooltip) from the tooltip "tooltip0" from a mod with the name "Terraria"
// In this case from vanilla Terraria, and not from a mod
Expand All @@ -35,6 +32,13 @@ public override void ModifyTooltips(Item item, List<TooltipLine> tooltips) // Al
if (line2 != null) line2.text = "12% increased melee damage and speed";
}
}
{
if (item.type == ItemID.SpiderMask)
{
TooltipLine line3 = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria");
if (line3 != null) line3.text = ""; // Removes the tooltip from the item
}
}
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions Items/SummonerItemSound.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;

namespace NekoTweakMod.Items
{
public class SummonerItemSound : GlobalItem // class name & vanilla hook
{
public override void SetDefaults(Item item) // SetDefaults allows you to set/change properties of items
{ // Single line "if" statements as we are only changing 1 property
// if (item.type == ItemID.BabyBird) item.UseSound = SoundID.Item44; v1.4
// if (item.type == ItemID.bladestaff) item.UseSound = SoundID.Item77;
// if (item.type == ItemID.Sanguinestaff) item.UseSound = SoundID.Item83;
// if (item.type == ItemID.Deserttigerstaff) item.UseSound = SoundID.Item77;
if (item.type == ItemID.TempestStaff) item.UseSound = SoundID.Item77;
if (item.type == ItemID.XenoStaff) item.UseSound = SoundID.Item82;
if (item.type == ItemID.StardustCellStaff) item.UseSound = SoundID.Item113;
if (item.type == ItemID.StardustDragonStaff) item.UseSound = SoundID.Item113;
}
}
}
182 changes: 181 additions & 1 deletion NPCs/NPCshops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,188 @@ public override void SetupShop(int type, Chest shop, ref int nextSlot) // Allows
shop.item[nextSlot].shopCustomPrice = 40000; // sets the purchase cost, 40000 = 4 gold
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.MiningPants);
shop.item[nextSlot].shopCustomPrice = 40000;
shop.item[nextSlot].shopCustomPrice = 40000;
nextSlot++;
// 1000000=1plat 10000=1gold, 100=1silver 1=1copper
}
{
if(type == NPCID.Dryad) // adds corruption/crimson items all the time
{
shop.item[nextSlot].SetDefaults(ItemID.VilePowder);
shop.item[nextSlot].shopCustomPrice = 1000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.ViciousPowder);
shop.item[nextSlot].shopCustomPrice = 1000;
nextSlot++;
/*shop.item[nextSlot].SetDefaults(ItemID.CrimsonGrassEcho); v1.4
shop.item[nextSlot].shopCustomPrice = 10;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.CorruptGrassEcho);
shop.item[nextSlot].shopCustomPrice = 10;
nextSlot++; */
shop.item[nextSlot].SetDefaults(ItemID.PygmyNecklace);
shop.item[nextSlot].shopCustomPrice = 150000;
nextSlot++;
}
}
{
if(type == NPCID.Steampunker) // adds corruption/crimson/hallow items all the time
{
shop.item[nextSlot].SetDefaults(ItemID.SteampunkGoggles);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.PurpleSolution);
shop.item[nextSlot].shopCustomPrice = 2500;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.RedSolution);
shop.item[nextSlot].shopCustomPrice = 2500;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.BlueSolution);
shop.item[nextSlot].shopCustomPrice = 2500;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.FleshCloningVaat);
shop.item[nextSlot].shopCustomPrice = 100000;
nextSlot++;
//shop.item[nextSlot].SetDefaults(ItemID.LesionStation); v1.4
//shop.item[nextSlot].shopCustomPrice = 100000;
// nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.MechanicsRod);
shop.item[nextSlot].shopCustomPrice = 400000;
nextSlot++;
}
}
{
if (type == NPCID.DyeTrader)
{
shop.item[nextSlot].SetDefaults(ItemID.DyeTraderTurban);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.DyeTraderRobe);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
}
}
{
if (type == NPCID.Painter)
{
shop.item[nextSlot].SetDefaults(ItemID.DeadlandComesAlive);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.LightlessChasms);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.PaintingTheSeason);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.PaintingSnowfellas);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.PaintingCursedSaint);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.PaintingColdSnap);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.PaintingAcorns);
shop.item[nextSlot].shopCustomPrice = 10000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.ChristmasTreeWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.CandyCaneWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.StarsWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.SnowflakeWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.BluegreenWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.OrnamentWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.FestiveWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.SquigglesWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.KrampusHornWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.GrinchFingerWallpaper);
shop.item[nextSlot].shopCustomPrice = 100;
nextSlot++;
}
}
{
if (type == NPCID.ArmsDealer)
{
shop.item[nextSlot].SetDefaults(ItemID.NurseHat); // 3 gold each
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.NurseShirt);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.NursePants);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
}
}
{
if (type == NPCID.DD2Bartender)
{
shop.item[nextSlot].SetDefaults(ItemID.DefenderMedal);
shop.item[nextSlot].shopCustomPrice = 1000000; // 1plat
nextSlot++;
}
}
{
if (type == NPCID.WitchDoctor)
{
shop.item[nextSlot].SetDefaults(ItemID.Cauldron);
shop.item[nextSlot].shopCustomPrice = 15000;
nextSlot++;
}
}
{
if (type == NPCID.Clothier)
{
shop.item[nextSlot].SetDefaults(ItemID.GuyFawkesMask);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.ClothierJacket);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.ClothierPants);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
}
}
{
if (type == NPCID.Wizard)
{
shop.item[nextSlot].SetDefaults(ItemID.WizardsHat);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
}
}
{
if (type == NPCID.Cyborg)
{
shop.item[nextSlot].SetDefaults(ItemID.CyborgHelmet);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.CyborgShirt);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
shop.item[nextSlot].SetDefaults(ItemID.CyborgPants);
shop.item[nextSlot].shopCustomPrice = 30000;
nextSlot++;
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

- A more linear fishing rod progression with buffs/nerfs to all rods, better early rods

- Steampunker will always sell the mechanic's fishing rod

- Adds corruption/crimson/hallow Items all the time for Dryad & Steampunker

- Spider Mask now only give minion damage & Dryad now sells pygmy necklace pre hardmode

- Living Tree & Pyramid chest loot from fishing crates *still WIP*
(Finch staff & Sandstorm in a Bottle etc)

Expand All @@ -40,6 +46,8 @@
- Worm Scarf now has 2 defense along with the 17% damage reduction
(Due to BoC 2.0 being a thing)

- Some summoner weapon sound changes so they fit their weapons better

- Finch Staff knockback changed from 4 to 0, damage changed from 7 to 9
(Won't knock enemies into you anymore & bit more damage so it can be useful for more than killing slimes)
^this one is disabled until tmod updates to v1.4
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
displayName = Neko's Tweak Mod
author = Neko
version = 0.1.2.0
version = 0.1.2.1
homepage = https://forums.terraria.org/index.php?threads/nekos-tweak-mod.93711/
buildIgnore = obj\*, bin\*, *.csproj, .git\*, .gitattributes, .gitignore, .psd, .sln, ..vs\*, LICENSE
2 changes: 1 addition & 1 deletion description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Few example features:

- Placed buff items like bewitching table,ammo box etc now work similar to campfires giving you the buff while nearby & also for 10minutes after

- Muramasa has been buffed
- Adds corruption/crimson/event items all the time for NPCs

- Living Tree & Pyramid chest loot from fishing crates *still WIP*
(Finch staff & Sandstorm in a Bottle etc)
Expand Down
Binary file modified obj/Debug/net45/NekoTweakMod.csprojAssemblyReference.cache
Binary file not shown.

0 comments on commit 2bc27e6

Please sign in to comment.