Terraria ModLoader  0.11.5
A framework for Terraria mods
ModBuff.cs
Go to the documentation of this file.
1 namespace 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 
35  public ModTranslation DisplayName {
36  get;
37  internal set;
38  }
39 
43  public ModTranslation Description {
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 }
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
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
virtual void SetDefaults()
This is where all buff related assignments go. For example: Main.buffName[Type] = "Display Name"; Mai...
Definition: ModBuff.cs:72
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
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
This class serves as a place for you to define a new buff and how that buff behaves.
Definition: ModBuff.cs:6
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
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 is an abstract class that you will override. It serves as a central place from which the mod's co...
Definition: Mod.cs:24