Terraria ModLoader  0.11.7.8
A mod to make and play Terraria mods
GlobalWall.cs
Go to the documentation of this file.
1 using Microsoft.Xna.Framework.Graphics;
2 
3 namespace Terraria.ModLoader
4 {
8  public class GlobalWall
9  {
13  public Mod mod {
14  get;
15  internal set;
16  }
17 
21  public string Name {
22  get;
23  internal set;
24  }
25 
29  public virtual bool Autoload(ref string name) {
30  return mod.Properties.Autoload;
31  }
32 
36  public virtual void SetDefaults() {
37  }
38 
42  public virtual bool KillSound(int i, int j, int type) {
43  return true;
44  }
45 
49  public virtual void NumDust(int i, int j, int type, bool fail, ref int num) {
50  }
51 
55  public virtual bool CreateDust(int i, int j, int type, ref int dustType) {
56  return true;
57  }
58 
62  public virtual bool Drop(int i, int j, int type, ref int dropType) {
63  return true;
64  }
65 
69  public virtual void KillWall(int i, int j, int type, ref bool fail) {
70  }
71 
75  public virtual bool CanExplode(int i, int j, int type) {
76  return true;
77  }
78 
82  public virtual void ModifyLight(int i, int j, int type, ref float r, ref float g, ref float b) {
83  }
84 
88  public virtual void RandomUpdate(int i, int j, int type) {
89  }
90 
94  public virtual bool PreDraw(int i, int j, int type, SpriteBatch spriteBatch) {
95  return true;
96  }
97 
101  public virtual void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) {
102  }
103 
107  public virtual void PlaceInWorld(int i, int j, int type, Item item) {
108  }
109  }
110 }
virtual void PlaceInWorld(int i, int j, int type, Item item)
Called after this wall type was placed in the world by way of the item provided.
Definition: GlobalWall.cs:107
virtual void PostDraw(int i, int j, int type, SpriteBatch spriteBatch)
Allows you to draw things in front of the wall at the given coordinates.
Definition: GlobalWall.cs:101
virtual bool CreateDust(int i, int j, int type, ref int dustType)
Allows you to modify the default type of dust created when the wall at the given coordinates is hit...
Definition: GlobalWall.cs:55
virtual void RandomUpdate(int i, int j, int type)
Called for every wall the world randomly decides to update in a given tick. Useful for things such as...
Definition: GlobalWall.cs:88
virtual void ModifyLight(int i, int j, int type, ref float r, ref float g, ref float b)
Allows you to determine how much light the wall emits. This can also let you light up the block in fr...
Definition: GlobalWall.cs:82
virtual bool PreDraw(int i, int j, int type, SpriteBatch spriteBatch)
Allows you to draw things behind the wall at the given coordinates. Return false to stop the game fro...
Definition: GlobalWall.cs:94
virtual void NumDust(int i, int j, int type, bool fail, ref int num)
Allows you to change how many dust particles are created when the wall at the given coordinates is hi...
Definition: GlobalWall.cs:49
virtual void KillWall(int i, int j, int type, ref bool fail)
Allows you to determine what happens when the wall at the given coordinates is killed or hit with a h...
Definition: GlobalWall.cs:69
This class allows you to modify the behavior of any wall in the game (although admittedly walls don't...
Definition: GlobalWall.cs:8
virtual bool CanExplode(int i, int j, int type)
Whether or not the wall at the given coordinates can be killed by an explosion (ie. bombs). Returns true by default; return false to stop an explosion from destroying it.
Definition: GlobalWall.cs:75
virtual void SetDefaults()
Allows you to modify the properties of any wall in the game. Most properties are stored as arrays thr...
Definition: GlobalWall.cs:36
virtual bool Autoload(ref string name)
Allows you to automatically load a GlobalWall instead of using Mod.AddGlobalWall. Return true to allo...
Definition: GlobalWall.cs:29
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
virtual bool KillSound(int i, int j, int type)
Allows you to customize which sound you want to play when the wall at the given coordinates is hit...
Definition: GlobalWall.cs:42
virtual bool Drop(int i, int j, int type, ref int dropType)
Allows you to customize which items the wall at the given coordinates drops. Return false to stop the...
Definition: GlobalWall.cs:62