tModLoader I need some help with armor/accessories stat bonuses

huntermangus70

Terrarian
Hi I'm a starting up mod developer and I want some help with adding stat bonuses to armor and accessories. I know most of the basics. Below are the ones I'm interested in.


  • adding increases health regeneration
  • adding increased mana regeneration
  • adding a dash ability (like the tabi)
  • adding more max minions than 1 (I already know the ++player.maxMinions; but that only adds one)

Any help is appreciated!
 
Life Regen:
Code:
namespace <mod>
{
    public class <item> : ModItem
    {
        public override void SetDefaults()
        {
            item.lifeRegen = <x>;
        }
    }
}
Replace <x> with a number.

Mana Regen:
Code:
namespace <mod>
{
    public class <item>: ModItem
    {
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.manaRegen = <x>;
        }
    }
}
Replace <x> with a number.

Dash:
Code:
namespace <mod>
{
    public class <item> : ModItem
    {
        public override void UpdateEquip(Player player)
        {
            player.dash = 1;
        }
    }
}

Max Minions:
Code:
namespace <mod>
{
    public class  <item> : ModItem
    {
        public override void UpdateEquip(Player player)
        {
            player.maxMinions += <x>;
        }
    }
}
Replace <x> with a number.

Keep in mind, all of these are bare-bones things I found in other mods' code, so don't count on them always working; I might've messed up for some.
 
Also while we're here, do you happen to any of the accessory types. In the
Code:
[AutoloadEquip(EquipType.Shield)]
section what are the different things I can replace for the "Shield" part
 
I don't know exactly, but I can look into it later when I have the chance.
Alright, here are the entries I've found:
  • Head (Armor on the head)
  • Body (Armor on the body)
  • Legs (Armor on the legs)
  • Shield (A shield)
  • Neck (Necklaces)
  • HandsOn (Right Hand?)
  • HandsOff (Left Hand?)
  • Face (Think Diving Gear)
  • Wings (Self-explanatory)
 
Hey does anyone know how to make an accessory or item that prevents death, then heals you, like the Devil's Carapace or Phylactery from Thorium?
 
so what does the "spider = true;" do because i want to know whether it is spider pet or spider summon but i can't get it to do anything
 
Back
Top Bottom