mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-12 05:56:56 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4495fd9cc3 |
@@ -12,8 +12,13 @@ public class NpcLoot : GlobalNPC
|
|||||||
{
|
{
|
||||||
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) {
|
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) {
|
||||||
int id = npc.type;
|
int id = npc.type;
|
||||||
|
|
||||||
if (NPCID.Sets.CountsAsCritter[id]) {
|
if (NPCID.Sets.CountsAsCritter[id]) {
|
||||||
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<MithrilPebbleOfPigSmiting>(), 400, 1, 1));
|
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<MithrilPebbleOfPigSmiting>(), 400, 1, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NPCID.Plantera == id) {
|
||||||
|
npcLoot.Add(ItemDropRule.Common(ItemID.ChlorophyteOre, 1, 60, 80));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
|
|
||||||
using Microsoft.Xna.Framework;
|
|
||||||
using Terraria;
|
|
||||||
using Terraria.Chat;
|
|
||||||
using Terraria.ID;
|
|
||||||
using Terraria.Localization;
|
|
||||||
using Terraria.ModLoader;
|
|
||||||
using YHTMod.Items;
|
|
||||||
|
|
||||||
namespace YHTMod.Changes;
|
|
||||||
|
|
||||||
public class TheKeyBehavior : GlobalTile {
|
|
||||||
|
|
||||||
public override void RightClick(int i, int j, int type) {
|
|
||||||
|
|
||||||
if (type != TileID.Containers) {
|
|
||||||
base.RightClick(i, j, type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool foundKey = false;
|
|
||||||
foreach (Item item in Main.LocalPlayer.inventory) {
|
|
||||||
if (item.type.Equals(ModContent.ItemType<TheKey>())) {
|
|
||||||
foundKey = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ChatHelper.BroadcastChatMessage(NetworkText.FromLiteral(foundKey.ToString()), Color.White);
|
|
||||||
|
|
||||||
if (!foundKey) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ChatHelper.BroadcastChatMessage(NetworkText.FromLiteral("Found key!"), Color.White);
|
|
||||||
|
|
||||||
if (!Chest.IsLocked(i, j)) {
|
|
||||||
base.RightClick(i, j, type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Chest.Unlock(i, j);
|
|
||||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
|
||||||
NetMessage.SendData(MessageID.Unlock, number: 1, number2: 1f, number3: i, number4: j);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using Terraria.GameContent.Creative;
|
|
||||||
using Terraria.ModLoader;
|
|
||||||
|
|
||||||
namespace YHTMod.Items;
|
|
||||||
|
|
||||||
public class TheKey : ModItem {
|
|
||||||
|
|
||||||
public override void SetStaticDefaults() {
|
|
||||||
DisplayName.SetDefault("The Key");
|
|
||||||
Tooltip.SetDefault("Opens all locks.");
|
|
||||||
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user