tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
This class serves as a place for you to define a new buff and how that buff behaves. More...
Public Member Functions | |
virtual bool | Autoload (ref string name, ref string texture) |
Allows you to automatically load a buff instead of using Mod.AddBuff. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name and texture is initialized to the namespace and overriding class name with periods replaced with slashes. Use this method to either force or stop an autoload, and to change the default display name and texture path. More... | |
virtual void | ModifyBuffTip (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 (NPC npc, int time, int buffIndex) |
Allows to you make special things happen when adding this buff to an NPC when the NPC already has this 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 (Player player, int time, int buffIndex) |
Allows to you make special things happen when adding this buff to a player when the player already has this 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 void | SetDefaults () |
This is where all buff related assignments go. For example:
| |
virtual void | Update (NPC npc, ref int buffIndex) |
Allows you to make this buff give certain effects to the given NPC. If you remove the buff from the NPC, make sure to decrement the buffIndex parameter by 1. More... | |
virtual void | Update (Player player, ref int buffIndex) |
Allows you to make this buff give certain effects to the given player. If you remove the buff from the player, make sure the decrement the buffIndex parameter by 1. More... | |
Public Attributes | |
bool | canBeCleared = true |
Whether or not it is always safe to call Player.DelBuff on this buff. Setting this to false will prevent the nurse from being able to remove this debuff. Defaults to true. More... | |
bool | longerExpertDebuff = false |
If this buff is a debuff, setting this to true will make this buff last twice as long on players in expert mode. Defaults to false. More... | |
Properties | |
ModTranslation | Description [get, set] |
The translations of this buff's description. More... | |
ModTranslation | DisplayName [get, set] |
The translations of this buff's display name. More... | |
Mod | mod [get, set] |
The mod that added this ModBuff. More... | |
string | Name [get, set] |
The internal name of this type of buff. More... | |
int | Type [get, set] |
The buff id of this buff. More... | |
This class serves as a place for you to define a new buff and how that buff behaves.
Definition at line 6 of file ModBuff.cs.
|
virtual |
Allows you to automatically load a buff instead of using Mod.AddBuff. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name and texture is initialized to the namespace and overriding class name with periods replaced with slashes. Use this method to either force or stop an autoload, and to change the default display name and texture path.
Definition at line 57 of file ModBuff.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModBuff.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadBuff().
|
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 104 of file ModBuff.cs.
Referenced by Terraria.ModLoader.BuffLoader.ModifyBuffTip().
|
virtual |
Allows to you make special things happen when adding this buff to an NPC when the NPC already has this 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 97 of file ModBuff.cs.
|
virtual |
Allows to you make special things happen when adding this buff to a player when the player already has this 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 90 of file ModBuff.cs.
Referenced by Terraria.ModLoader.BuffLoader.ReApply().
|
virtual |
This is where all buff related assignments go. For example:
Definition at line 72 of file ModBuff.cs.
|
virtual |
Allows you to make this buff give certain effects to the given NPC. If you remove the buff from the NPC, make sure to decrement the buffIndex parameter by 1.
Definition at line 84 of file ModBuff.cs.
|
virtual |
Allows you to make this buff give certain effects to the given player. If you remove the buff from the player, make sure the decrement the buffIndex parameter by 1.
Definition at line 78 of file ModBuff.cs.
Referenced by Terraria.ModLoader.BuffLoader.Update().
bool Terraria.ModLoader.ModBuff.canBeCleared = true |
Whether or not it is always safe to call Player.DelBuff on this buff. Setting this to false will prevent the nurse from being able to remove this debuff. Defaults to true.
Definition at line 52 of file ModBuff.cs.
Referenced by Terraria.ModLoader.BuffLoader.CanBeCleared().
bool Terraria.ModLoader.ModBuff.longerExpertDebuff = false |
If this buff is a debuff, setting this to true will make this buff last twice as long on players in expert mode. Defaults to false.
Definition at line 50 of file ModBuff.cs.
Referenced by Terraria.ModLoader.BuffLoader.LongerExpertDebuff().
|
getset |
The translations of this buff's description.
Definition at line 43 of file ModBuff.cs.
Referenced by Terraria.ModLoader.ModContent.RefreshModLanguage().
|
getset |
The translations of this buff's display name.
Definition at line 35 of file ModBuff.cs.
Referenced by Terraria.ModLoader.ModContent.RefreshModLanguage().
|
getset |
The mod that added this ModBuff.
Definition at line 11 of file ModBuff.cs.
Referenced by Terraria.ModLoader.ModBuff.Autoload().
|
getset |
The internal name of this type of buff.
Definition at line 19 of file ModBuff.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadBuff().
|
getset |
The buff id of this buff.
Definition at line 27 of file ModBuff.cs.
Referenced by Terraria.ModLoader.ModContent.RefreshModLanguage().