tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.GlobalWall Class Reference

This class allows you to modify the behavior of any wall in the game (although admittedly walls don't have much behavior). Create an instance of an overriding class then call Mod.AddGlobalWall to use this. More...

Public Member Functions

virtual bool Autoload (ref string name)
 Allows you to automatically load a GlobalWall instead of using Mod.AddGlobalWall. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name. More...
 
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. More...
 
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. Return false to stop the default dust (the dustType parameter) from being created. Returns true by default. More...
 
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 game from dropping the wall's default item (the dropType parameter). Returns true by default. More...
 
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. Return false to stop the game from playing its default sound for the wall. Returns true by default. More...
 
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 hammer. Fail determines whether the wall is mined (whether it is killed). More...
 
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 front of the wall. More...
 
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 hit. More...
 
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. More...
 
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. More...
 
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 from drawing the wall normally. Returns true by default. More...
 
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 growing or spreading. More...
 
virtual void SetDefaults ()
 Allows you to modify the properties of any wall in the game. Most properties are stored as arrays throughout the Terraria code. More...
 

Properties

Mod mod [get, set]
 The mod to which this GlobalWall belongs. More...
 
string Name [get, set]
 The name of this GlobalWall instance. More...
 

Detailed Description

This class allows you to modify the behavior of any wall in the game (although admittedly walls don't have much behavior). Create an instance of an overriding class then call Mod.AddGlobalWall to use this.

Definition at line 8 of file GlobalWall.cs.

Member Function Documentation

◆ Autoload()

virtual bool Terraria.ModLoader.GlobalWall.Autoload ( ref string  name)
virtual

Allows you to automatically load a GlobalWall instead of using Mod.AddGlobalWall. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name.

Definition at line 29 of file GlobalWall.cs.

29 {
30 return mod.Properties.Autoload;
31 }
Mod mod
The mod to which this GlobalWall belongs.
Definition: GlobalWall.cs:13
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...

References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.GlobalWall.mod, and Terraria.ModLoader.Mod.Properties.

Referenced by Terraria.ModLoader.Mod.AutoloadGlobalWall().

+ Here is the caller graph for this function:

◆ CanExplode()

virtual bool Terraria.ModLoader.GlobalWall.CanExplode ( int  i,
int  j,
int  type 
)
virtual

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 at line 75 of file GlobalWall.cs.

75 {
76 return true;
77 }

◆ CreateDust()

virtual bool Terraria.ModLoader.GlobalWall.CreateDust ( int  i,
int  j,
int  type,
ref int  dustType 
)
virtual

Allows you to modify the default type of dust created when the wall at the given coordinates is hit. Return false to stop the default dust (the dustType parameter) from being created. Returns true by default.

Definition at line 55 of file GlobalWall.cs.

55 {
56 return true;
57 }

◆ Drop()

virtual bool Terraria.ModLoader.GlobalWall.Drop ( int  i,
int  j,
int  type,
ref int  dropType 
)
virtual

Allows you to customize which items the wall at the given coordinates drops. Return false to stop the game from dropping the wall's default item (the dropType parameter). Returns true by default.

Definition at line 62 of file GlobalWall.cs.

62 {
63 return true;
64 }

◆ KillSound()

virtual bool Terraria.ModLoader.GlobalWall.KillSound ( int  i,
int  j,
int  type 
)
virtual

Allows you to customize which sound you want to play when the wall at the given coordinates is hit. Return false to stop the game from playing its default sound for the wall. Returns true by default.

Definition at line 42 of file GlobalWall.cs.

42 {
43 return true;
44 }

◆ KillWall()

virtual void Terraria.ModLoader.GlobalWall.KillWall ( int  i,
int  j,
int  type,
ref bool  fail 
)
virtual

Allows you to determine what happens when the wall at the given coordinates is killed or hit with a hammer. Fail determines whether the wall is mined (whether it is killed).

Definition at line 69 of file GlobalWall.cs.

69 {
70 }

◆ ModifyLight()

virtual void Terraria.ModLoader.GlobalWall.ModifyLight ( int  i,
int  j,
int  type,
ref float  r,
ref float  g,
ref float  b 
)
virtual

Allows you to determine how much light the wall emits. This can also let you light up the block in front of the wall.

Definition at line 82 of file GlobalWall.cs.

82 {
83 }

◆ NumDust()

virtual void Terraria.ModLoader.GlobalWall.NumDust ( int  i,
int  j,
int  type,
bool  fail,
ref int  num 
)
virtual

Allows you to change how many dust particles are created when the wall at the given coordinates is hit.

Definition at line 49 of file GlobalWall.cs.

49 {
50 }

◆ PlaceInWorld()

virtual void Terraria.ModLoader.GlobalWall.PlaceInWorld ( int  i,
int  j,
int  type,
Item  item 
)
virtual

Called after this wall type was placed in the world by way of the item provided.

Definition at line 107 of file GlobalWall.cs.

107 {
108 }

◆ PostDraw()

virtual void Terraria.ModLoader.GlobalWall.PostDraw ( int  i,
int  j,
int  type,
SpriteBatch  spriteBatch 
)
virtual

Allows you to draw things in front of the wall at the given coordinates.

Definition at line 101 of file GlobalWall.cs.

101 {
102 }

◆ PreDraw()

virtual bool Terraria.ModLoader.GlobalWall.PreDraw ( int  i,
int  j,
int  type,
SpriteBatch  spriteBatch 
)
virtual

Allows you to draw things behind the wall at the given coordinates. Return false to stop the game from drawing the wall normally. Returns true by default.

Definition at line 94 of file GlobalWall.cs.

94 {
95 return true;
96 }

◆ RandomUpdate()

virtual void Terraria.ModLoader.GlobalWall.RandomUpdate ( int  i,
int  j,
int  type 
)
virtual

Called for every wall the world randomly decides to update in a given tick. Useful for things such as growing or spreading.

Definition at line 88 of file GlobalWall.cs.

88 {
89 }

◆ SetDefaults()

virtual void Terraria.ModLoader.GlobalWall.SetDefaults ( )
virtual

Allows you to modify the properties of any wall in the game. Most properties are stored as arrays throughout the Terraria code.

Definition at line 36 of file GlobalWall.cs.

36 {
37 }

Property Documentation

◆ mod

Mod Terraria.ModLoader.GlobalWall.mod
getset

The mod to which this GlobalWall belongs.

Definition at line 13 of file GlobalWall.cs.

13 {
14 get;
15 internal set;
16 }

Referenced by Terraria.ModLoader.GlobalWall.Autoload().

◆ Name

string Terraria.ModLoader.GlobalWall.Name
getset

The name of this GlobalWall instance.

Definition at line 21 of file GlobalWall.cs.

21 {
22 get;
23 internal set;
24 }

Referenced by Terraria.ModLoader.Mod.AutoloadGlobalWall().