tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
This class allows you to modify the behavior of any buff in the game. More...
Public Member Functions | |
virtual bool | Autoload (ref string name) |
Allows you to automatically load a GlobalBuff instead of using Mod.AddGlobalBuff. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name. More... | |
virtual void | CustomBuffTipSize (string buffTip, List< Vector2 > sizes) |
If you are using the DrawCustomBuffTip hook, then you must use this hook as well. Calculate the location (relative to the origin) of the bottom-right corner of everything you will draw, and add that location to the sizes parameter. More... | |
virtual void | DrawCustomBuffTip (string buffTip, SpriteBatch spriteBatch, int originX, int originY) |
Allows you to draw whatever you want when a buff tooltip is drawn. The originX and originY parameters are the top-left corner of everything that's drawn; you should add these to the position argument passed to SpriteBatch.Draw. More... | |
virtual void | ModifyBuffTip (int type, ref string tip, ref int rare) |
Allows you to modify the tooltip that displays when the mouse hovers over the buff icon, as well as the color the buff's name is drawn in. More... | |
virtual bool | ReApply (int type, NPC npc, int time, int buffIndex) |
Allows to you make special things happen when adding the given buff type to an NPC when the NPC already has that buff. Return true to block the vanilla re-apply code from being called; returns false by default. The vanilla re-apply code sets the buff time to the "time" argument if that argument is larger than the current buff time. More... | |
virtual bool | ReApply (int type, Player player, int time, int buffIndex) |
Allows to you make special things happen when adding the given type of buff to a player when the player already has that buff. Return true to block the vanilla re-apply code from being called; returns false by default. The vanilla re-apply code sets the buff time to the "time" argument if that argument is larger than the current buff time. (For Mana Sickness, the vanilla re-apply code adds the "time" argument to the current buff time.) More... | |
virtual void | Update (int type, NPC npc, ref int buffIndex) |
Allows you to make the buff with the given ID give certain effects to an NPC. If you remove the buff from the NPC, make sure to decrement the buffIndex parameter by 1. More... | |
virtual void | Update (int type, Player player, ref int buffIndex) |
Allows you to make the buff with the given ID give certain effects to a player. If you remove the buff from the player, make sure the decrement the buffIndex parameter by 1. More... | |
Properties | |
Mod | mod [get, set] |
The mod to which this GlobalBuff belongs. More... | |
string | Name [get, set] |
The internal name of this GlobalBuff instance. More... | |
This class allows you to modify the behavior of any buff in the game.
Definition at line 10 of file GlobalBuff.cs.
|
virtual |
Allows you to automatically load a GlobalBuff instead of using Mod.AddGlobalBuff. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name.
Definition at line 31 of file GlobalBuff.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.GlobalBuff.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalBuff().
|
virtual |
If you are using the DrawCustomBuffTip hook, then you must use this hook as well. Calculate the location (relative to the origin) of the bottom-right corner of everything you will draw, and add that location to the sizes parameter.
Definition at line 70 of file GlobalBuff.cs.
|
virtual |
Allows you to draw whatever you want when a buff tooltip is drawn. The originX and originY parameters are the top-left corner of everything that's drawn; you should add these to the position argument passed to SpriteBatch.Draw.
Definition at line 76 of file GlobalBuff.cs.
|
virtual |
Allows you to modify the tooltip that displays when the mouse hovers over the buff icon, as well as the color the buff's name is drawn in.
Definition at line 64 of file GlobalBuff.cs.
|
virtual |
Allows to you make special things happen when adding the given buff type to an NPC when the NPC already has that buff. Return true to block the vanilla re-apply code from being called; returns false by default. The vanilla re-apply code sets the buff time to the "time" argument if that argument is larger than the current buff time.
Definition at line 57 of file GlobalBuff.cs.
|
virtual |
Allows to you make special things happen when adding the given type of buff to a player when the player already has that buff. Return true to block the vanilla re-apply code from being called; returns false by default. The vanilla re-apply code sets the buff time to the "time" argument if that argument is larger than the current buff time. (For Mana Sickness, the vanilla re-apply code adds the "time" argument to the current buff time.)
Definition at line 50 of file GlobalBuff.cs.
|
virtual |
Allows you to make the buff with the given ID give certain effects to an NPC. If you remove the buff from the NPC, make sure to decrement the buffIndex parameter by 1.
Definition at line 44 of file GlobalBuff.cs.
|
virtual |
Allows you to make the buff with the given ID give certain effects to a player. If you remove the buff from the player, make sure the decrement the buffIndex parameter by 1.
Definition at line 38 of file GlobalBuff.cs.
|
getset |
The mod to which this GlobalBuff belongs.
Definition at line 15 of file GlobalBuff.cs.
Referenced by Terraria.ModLoader.GlobalBuff.Autoload().
|
getset |
The internal name of this GlobalBuff instance.
Definition at line 23 of file GlobalBuff.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadGlobalBuff().