Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Terraria;
- using Terraria.ID;
- using Terraria.ModLoader;
- namespace moddotjpg
- {
- public class CandySack : ModPlayer
- {
- public bool CandySackEffect;
- public override void ResetEffects()
- {
- CandySackEffect = false;
- }
- class MyGlobalNPC : GlobalNPC
- {
- public override void NPCLoot(NPC npc)
- {
- if (Main.rand.NextFloat() < 0.85f)
- {
- Item.NewItem(npc.getRect(), ItemID.GoodieBag, 1 + Main.rand.Next(2));
- }
- }
- }
- }
- namespace Items.Accessories
- {
- internal class CandySack : ModItem
- {
- public override void SetStaticDefaults()
- {
- DisplayName.SetDefault("Candy Sack");
- Tooltip.SetDefault("Enemies have a chance to drop goodie bags");
- }
- public override void SetDefaults()
- {
- item.width = 32;
- item.height = 32;
- item.accessory = true;
- item.value = 100000;
- item.rare = 7;
- }
- public override void UpdateAccessory(Player player, bool hideVisual)
- {
- player.GetModPlayer<SimpleModPlayer>().CandyBagEffect = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement