public override void OnCraft(Item item)
        {
            NPC n = SoulOfNPC.getNPCfromNPCTag(npcType);

            ((VendingMachineItem)(item.modItem)).setNPCType(n);
            npcType = null;
        }
 public override void Load(TagCompound tag)
 {
     if (tag.ContainsKey("npc"))
     {
         setNPCType(SoulOfNPC.getNPCfromNPCTag((string)tag["npc"]));
         hasShop = false;
     }
 }
 public override void SetDefaults()
 {
     base.SetDefaults();
     item.maxStack   = 99;
     item.createTile = ModContent.TileType <ReforgeMachineTile>();
     hasShop         = true;
     npcType         = SoulOfNPC.ItemToTag(item);
 }
Exemple #4
0
 public void setNPCType(NPC npc)
 {
     npcType = SoulOfNPC.NPCToTag(npc);
     if (npc.type == NPCID.SkeletonMerchant)
     {
         item.SetNameOverride("Soul of the Skeleton Merchant");
         Tooltip.SetDefault("The essence of the Skeleton Merchant");
     }
     else
     {
         item.SetNameOverride("Soul of the " + Lang.GetNPCNameValue(npc.netID));
         Tooltip.SetDefault("The essence of the " + Lang.GetNPCNameValue(npc.netID));
     }
 }
 public void setNPCType(NPC npc)
 {
     npcType = SoulOfNPC.NPCToTag(npc);
     hasShop = false;
     if (npc == null || npc.type == 0)
     {
         item.SetNameOverride("Vending Machine (Empty)");
         Tooltip.SetDefault("Sells no items.");
     }
     else if (npc.type == NPCID.SkeletonMerchant)
     {
         item.SetNameOverride("Vending Machine (Skeleton Merchant)");
         Tooltip.SetDefault("Sells the items the Skeleton Merchant would sell.");
     }
     else
     {
         item.SetNameOverride("Vending Machine (" + Lang.GetNPCNameValue(npc.netID) + ")");
         Tooltip.SetDefault("Sells the items " + Lang.GetNPCNameValue(npc.netID) + " would sell.");
     }
 }