tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
This class represents a type of wall that can be added by a mod. Only one instance of this class will ever exist for each type of wall that is added. Any hooks that are called will be called by the instance corresponding to the wall type. More...
Public Member Functions | |
void | AddMapEntry (Color color, LocalizedText name, Func< string, int, int, string > nameFunc) |
Adds an entry to the minimap for this wall with the given color, default display name, and display name function. The parameters for the function are the default display name, x-coordinate, and y-coordinate. This should be called in SetDefaults. More... | |
void | AddMapEntry (Color color, LocalizedText name=null) |
Adds an entry to the minimap for this wall with the given color and display name. This should be called in SetDefaults. More... | |
void | AddMapEntry (Color color, ModTranslation name) |
Adds an entry to the minimap for this wall with the given color and display name. This should be called in SetDefaults. More... | |
void | AddMapEntry (Color color, ModTranslation name, Func< string, int, int, string > nameFunc) |
Adds an entry to the minimap for this wall with the given color, default display name, and display name function. The parameters for the function are the default display name, x-coordinate, and y-coordinate. This should be called in SetDefaults. More... | |
virtual void | AnimateWall (ref byte frame, ref byte frameCounter) |
Allows you to animate your wall. Use frameCounter to keep track of how long the current frame has been active, and use frame to change the current frame. More... | |
virtual bool | Autoload (ref string name, ref string texture) |
Allows you to modify the name and texture path of this wall when it is autoloaded. Return true to autoload this wall. When a wall is autoloaded, that means you do not need to manually call Mod.AddWall. By default returns the mod's autoload property. More... | |
virtual bool | CanExplode (int i, int j) |
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, ref int type) |
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 type parameter) from being created. Returns true by default. More... | |
ModTranslation | CreateMapEntryName (string key=null) |
Creates a ModTranslation object that you can use in AddMapEntry. More... | |
virtual bool | Drop (int i, int j, ref int type) |
Allows you to customize which items the wall at the given coordinates drops. Return false to stop the game from dropping the tile's default item (the type parameter). Returns true by default. More... | |
virtual ushort | GetMapOption (int i, int j) |
Allows you to choose which minimap entry the wall at the given coordinates will use. 0 is the first entry added by AddMapEntry, 1 is the second entry, etc. Returns 0 by default. More... | |
virtual bool | KillSound (int i, int j) |
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, ref bool fail) |
Allows you to determine what happens when the tile at the given coordinates is killed or hit with a hammer. Fail determines whether the tile is mined (whether it is killed). More... | |
virtual void | ModifyLight (int i, int j, ref float r, ref float g, ref float b) |
Allows you to determine how much light this wall emits. This can also let you light up the block in front of this wall. More... | |
virtual void | NumDust (int i, int j, 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, Item item) |
Called after this wall is placed in the world by way of the item provided. More... | |
virtual void | PostDraw (int i, int j, SpriteBatch spriteBatch) |
Allows you to draw things in front of the wall at the given coordinates. More... | |
virtual bool | PreDraw (int i, int j, 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) |
Called whenever the world randomly decides to update the tile containing this wall in a given tick. Useful for things such as growing or spreading. More... | |
virtual void | SetDefaults () |
Allows you to set the properties of this wall. Many properties are stored as arrays throughout Terraria's code. More... | |
Public Attributes | |
int | drop = 0 |
The default type of item dropped when this wall is killed. Defaults to 0, which means no item. More... | |
int | dustType = 0 |
The default type of dust made when this wall is hit. Defaults to 0. More... | |
int | soundStyle = 1 |
The default style of sound made when this wall is hit. Defaults to 1. More... | |
int | soundType = 0 |
The default type of sound made when this wall is hit. Defaults to 0. More... | |
Properties | |
Mod | mod [get, set] |
The mod which has added this type of ModWall. More... | |
string | Name [get, set] |
The name of this type of wall. More... | |
ushort | Type [get, set] |
The internal ID of this type of wall. More... | |
This class represents a type of wall that can be added by a mod. Only one instance of this class will ever exist for each type of wall that is added. Any hooks that are called will be called by the instance corresponding to the wall type.
Definition at line 12 of file ModWall.cs.
void Terraria.ModLoader.ModWall.AddMapEntry | ( | Color | color, |
LocalizedText | name, | ||
Func< string, int, int, string > | nameFunc | ||
) |
Adds an entry to the minimap for this wall with the given color, default display name, and display name function. The parameters for the function are the default display name, x-coordinate, and y-coordinate. This should be called in SetDefaults.
Definition at line 97 of file ModWall.cs.
References Terraria.ModLoader.ModWall.Type.
void Terraria.ModLoader.ModWall.AddMapEntry | ( | Color | color, |
LocalizedText | name = null |
||
) |
Adds an entry to the minimap for this wall with the given color and display name. This should be called in SetDefaults.
Definition at line 59 of file ModWall.cs.
References Terraria.ModLoader.ModWall.Type.
void Terraria.ModLoader.ModWall.AddMapEntry | ( | Color | color, |
ModTranslation | name | ||
) |
Adds an entry to the minimap for this wall with the given color and display name. This should be called in SetDefaults.
Definition at line 84 of file ModWall.cs.
References Terraria.ModLoader.ModWall.Type.
void Terraria.ModLoader.ModWall.AddMapEntry | ( | Color | color, |
ModTranslation | name, | ||
Func< string, int, int, string > | nameFunc | ||
) |
Adds an entry to the minimap for this wall with the given color, default display name, and display name function. The parameters for the function are the default display name, x-coordinate, and y-coordinate. This should be called in SetDefaults.
Definition at line 110 of file ModWall.cs.
References Terraria.ModLoader.ModWall.Type.
|
virtual |
Allows you to animate your wall. Use frameCounter to keep track of how long the current frame has been active, and use frame to change the current frame.
Definition at line 197 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.AnimateWalls().
|
virtual |
Allows you to modify the name and texture path of this wall when it is autoloaded. Return true to autoload this wall. When a wall is autoloaded, that means you do not need to manually call Mod.AddWall. By default returns the mod's autoload property.
Definition at line 123 of file ModWall.cs.
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModWall.mod, and Terraria.ModLoader.Mod.Properties.
Referenced by Terraria.ModLoader.Mod.AutoloadWall().
|
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 171 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.CanExplode().
|
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 type parameter) from being created. Returns true by default.
Definition at line 149 of file ModWall.cs.
References Terraria.ModLoader.ModWall.dustType.
Referenced by Terraria.ModLoader.WallLoader.CreateDust().
ModTranslation Terraria.ModLoader.ModWall.CreateMapEntryName | ( | string | key = null | ) |
Creates a ModTranslation object that you can use in AddMapEntry.
key | The key for the ModTranslation. The full key will be MapObject.ModName.key |
Definition at line 74 of file ModWall.cs.
References Terraria.ModLoader.ModWall.mod, Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ModWall.Name.
|
virtual |
Allows you to customize which items the wall at the given coordinates drops. Return false to stop the game from dropping the tile's default item (the type parameter). Returns true by default.
Definition at line 157 of file ModWall.cs.
References Terraria.ModLoader.ModWall.drop.
Referenced by Terraria.ModLoader.WallLoader.Drop().
|
virtual |
Allows you to choose which minimap entry the wall at the given coordinates will use. 0 is the first entry added by AddMapEntry, 1 is the second entry, etc. Returns 0 by default.
Definition at line 178 of file ModWall.cs.
|
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 136 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.KillSound().
|
virtual |
Allows you to determine what happens when the tile at the given coordinates is killed or hit with a hammer. Fail determines whether the tile is mined (whether it is killed).
Definition at line 165 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.KillWall().
|
virtual |
Allows you to determine how much light this wall emits. This can also let you light up the block in front of this wall.
Definition at line 185 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.ModifyLight().
|
virtual |
Allows you to change how many dust particles are created when the wall at the given coordinates is hit.
Definition at line 143 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.NumDust().
|
virtual |
Called after this wall is placed in the world by way of the item provided.
Definition at line 216 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.PlaceInWorld().
|
virtual |
Allows you to draw things in front of the wall at the given coordinates.
Definition at line 210 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.PostDraw().
|
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 203 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.PreDraw().
|
virtual |
Called whenever the world randomly decides to update the tile containing this wall in a given tick. Useful for things such as growing or spreading.
Definition at line 191 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.RandomUpdate().
|
virtual |
Allows you to set the properties of this wall. Many properties are stored as arrays throughout Terraria's code.
Definition at line 130 of file ModWall.cs.
int Terraria.ModLoader.ModWall.drop = 0 |
The default type of item dropped when this wall is killed. Defaults to 0, which means no item.
Definition at line 54 of file ModWall.cs.
Referenced by Terraria.ModLoader.ModWall.Drop().
int Terraria.ModLoader.ModWall.dustType = 0 |
The default type of dust made when this wall is hit. Defaults to 0.
Definition at line 50 of file ModWall.cs.
Referenced by Terraria.ModLoader.ModWall.CreateDust().
int Terraria.ModLoader.ModWall.soundStyle = 1 |
The default style of sound made when this wall is hit. Defaults to 1.
Definition at line 46 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.KillSound().
int Terraria.ModLoader.ModWall.soundType = 0 |
The default type of sound made when this wall is hit. Defaults to 0.
Definition at line 42 of file ModWall.cs.
Referenced by Terraria.ModLoader.WallLoader.KillSound().
|
getset |
The mod which has added this type of ModWall.
Definition at line 17 of file ModWall.cs.
Referenced by Terraria.ModLoader.ModWall.Autoload(), and Terraria.ModLoader.ModWall.CreateMapEntryName().
|
getset |
The name of this type of wall.
Definition at line 25 of file ModWall.cs.
Referenced by Terraria.ModLoader.Mod.AutoloadWall(), and Terraria.ModLoader.ModWall.CreateMapEntryName().
|
getset |
The internal ID of this type of wall.
Definition at line 33 of file ModWall.cs.
Referenced by Terraria.ModLoader.ModWall.AddMapEntry(), and Terraria.ModLoader.WallLoader.AnimateWalls().