Terraria ModLoader  0.11.7.8
A mod to make and play Terraria mods
GlobalBuff.cs
Go to the documentation of this file.
1 using Microsoft.Xna.Framework;
2 using Microsoft.Xna.Framework.Graphics;
3 using System.Collections.Generic;
4 
5 namespace Terraria.ModLoader
6 {
10  public class GlobalBuff
11  {
15  public Mod mod {
16  get;
17  internal set;
18  }
19 
23  public string Name {
24  get;
25  internal set;
26  }
27 
31  public virtual bool Autoload(ref string name) {
32  return mod.Properties.Autoload;
33  }
34 
38  public virtual void Update(int type, Player player, ref int buffIndex) {
39  }
40 
44  public virtual void Update(int type, NPC npc, ref int buffIndex) {
45  }
46 
50  public virtual bool ReApply(int type, Player player, int time, int buffIndex) {
51  return false;
52  }
53 
57  public virtual bool ReApply(int type, NPC npc, int time, int buffIndex) {
58  return false;
59  }
60 
64  public virtual void ModifyBuffTip(int type, ref string tip, ref int rare) {
65  }
66 
70  public virtual void CustomBuffTipSize(string buffTip, List<Vector2> sizes) {
71  }
72 
76  public virtual void DrawCustomBuffTip(string buffTip, SpriteBatch spriteBatch, int originX, int originY) {
77  }
78  }
79 }
virtual bool Autoload(ref string name)
Allows you to automatically load a GlobalBuff instead of using Mod.AddGlobalBuff. Return true to allo...
Definition: GlobalBuff.cs:31
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 locat...
Definition: GlobalBuff.cs:70
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 play...
Definition: GlobalBuff.cs:50
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...
Definition: GlobalBuff.cs:64
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 ...
Definition: GlobalBuff.cs:44
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 buf...
Definition: GlobalBuff.cs:38
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...
Definition: GlobalBuff.cs:76
Mod is an abstract class that you will override. It serves as a central place from which the mod&#39;s co...
Definition: Mod.cs:24
This class allows you to modify the behavior of any buff in the game.
Definition: GlobalBuff.cs:10
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 alrea...
Definition: GlobalBuff.cs:57