tModLoader v0.11.8.9
A mod to make and play Terraria mods
ModBuff.cs
Go to the documentation of this file.
1namespace Terraria.ModLoader
2{
6 public class ModBuff
7 {
11 public Mod mod {
12 get;
13 internal set;
14 }
15
19 public string Name {
20 get;
21 internal set;
22 }
23
27 public int Type {
28 get;
29 internal set;
30 }
31
36 get;
37 internal set;
38 }
39
44 get;
45 internal set;
46 }
47
48 internal string texture;
50 public bool longerExpertDebuff = false;
52 public bool canBeCleared = true;
53
57 public virtual bool Autoload(ref string name, ref string texture) {
58 return mod.Properties.Autoload;
59 }
60
72 public virtual void SetDefaults() {
73 }
74
78 public virtual void Update(Player player, ref int buffIndex) {
79 }
80
84 public virtual void Update(NPC npc, ref int buffIndex) {
85 }
86
90 public virtual bool ReApply(Player player, int time, int buffIndex) {
91 return false;
92 }
93
97 public virtual bool ReApply(NPC npc, int time, int buffIndex) {
98 return false;
99 }
100
104 public virtual void ModifyBuffTip(ref string tip, ref int rare) {
105 }
106 }
107}
This class serves as a place for you to define a new buff and how that buff behaves.
Definition: ModBuff.cs:7
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 autoloadin...
Definition: ModBuff.cs:57
bool canBeCleared
Whether or not it is always safe to call Player.DelBuff on this buff. Setting this to false will prev...
Definition: ModBuff.cs:52
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 N...
Definition: ModBuff.cs:84
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,...
Definition: ModBuff.cs:104
Mod mod
The mod that added this ModBuff.
Definition: ModBuff.cs:11
int Type
The buff id of this buff.
Definition: ModBuff.cs:27
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 ha...
Definition: ModBuff.cs:90
ModTranslation Description
The translations of this buff's description.
Definition: ModBuff.cs:43
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 thi...
Definition: ModBuff.cs:97
string Name
The internal name of this type of buff.
Definition: ModBuff.cs:19
bool longerExpertDebuff
If this buff is a debuff, setting this to true will make this buff last twice as long on players in e...
Definition: ModBuff.cs:50
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 th...
Definition: ModBuff.cs:78
ModTranslation DisplayName
The translations of this buff's display name.
Definition: ModBuff.cs:35
virtual void SetDefaults()
This is where all buff related assignments go. For example: Main.buffName[Type] = "Display Name"; Mai...
Definition: ModBuff.cs:72
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...
Definition: Mod.cs:25
ModProperties Properties
Definition: Mod.cs:52
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...