1using Microsoft.Xna.Framework;
2using Microsoft.Xna.Framework.Graphics;
4using System.Collections.Generic;
5using Terraria.Localization;
38 internal string texture;
59 public void AddMapEntry(Color color, LocalizedText name =
null) {
60 if (!MapLoader.initialized) {
61 MapEntry entry =
new MapEntry(color, name);
62 if (!MapLoader.wallEntries.Keys.Contains(
Type)) {
63 MapLoader.wallEntries[
Type] =
new List<MapEntry>();
65 MapLoader.wallEntries[
Type].Add(entry);
75 if (
string.IsNullOrEmpty(key)) {
78 return mod.GetOrCreateTranslation(
string.Format(
"Mods.{0}.MapObject.{1}",
mod.
Name, key));
85 if (!MapLoader.initialized) {
86 MapEntry entry =
new MapEntry(color, name);
87 if (!MapLoader.wallEntries.Keys.Contains(
Type)) {
88 MapLoader.wallEntries[
Type] =
new List<MapEntry>();
90 MapLoader.wallEntries[
Type].Add(entry);
97 public void AddMapEntry(Color color, LocalizedText name, Func<string, int, int, string> nameFunc) {
98 if (!MapLoader.initialized) {
99 MapEntry entry =
new MapEntry(color, name, nameFunc);
100 if (!MapLoader.wallEntries.Keys.Contains(
Type)) {
101 MapLoader.wallEntries[
Type] =
new List<MapEntry>();
103 MapLoader.wallEntries[
Type].Add(entry);
111 if (!MapLoader.initialized) {
112 MapEntry entry =
new MapEntry(color, name, nameFunc);
113 if (!MapLoader.wallEntries.Keys.Contains(
Type)) {
114 MapLoader.wallEntries[
Type] =
new List<MapEntry>();
116 MapLoader.wallEntries[
Type].Add(entry);
123 public virtual bool Autoload(ref
string name, ref
string texture) {
143 public virtual void NumDust(
int i,
int j,
bool fail, ref
int num) {
157 public virtual bool Drop(
int i,
int j, ref
int type) {
165 public virtual void KillWall(
int i,
int j, ref
bool fail) {
185 public virtual void ModifyLight(
int i,
int j, ref
float r, ref
float g, ref
float b) {
197 public virtual void AnimateWall(ref
byte frame, ref
byte frameCounter) {
203 public virtual bool PreDraw(
int i,
int j, SpriteBatch spriteBatch) {
210 public virtual void PostDraw(
int i,
int j, SpriteBatch spriteBatch) {
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...
virtual string Name
Stores the name of the mod. This name serves as the mod's identification, and also helps with saving ...
This class represents a type of wall that can be added by a mod. Only one instance of this class will...
ModTranslation CreateMapEntryName(string key=null)
Creates a ModTranslation object that you can use in AddMapEntry.
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 hi...
int dustType
The default type of dust made when this wall is hit. Defaults to 0.
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 fro...
virtual bool CanExplode(int i, int j)
Whether or not the wall at the given coordinates can be killed by an explosion (ie....
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,...
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 bee...
virtual ushort GetMapOption(int i, int j)
Allows you to choose which minimap entry the wall at the given coordinates will use....
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 f...
int drop
The default type of item dropped when this wall is killed. Defaults to 0, which means no item.
virtual void RandomUpdate(int i, int j)
Called whenever the world randomly decides to update the tile containing this wall in a given tick....
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 h...
virtual void SetDefaults()
Allows you to set the properties of this wall. Many properties are stored as arrays throughout Terrar...
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 call...
int soundType
The default type of sound made when this wall is hit. Defaults to 0.
string Name
The name of this type of wall.
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....
virtual void PlaceInWorld(int i, int j, Item item)
Called after this wall is placed in the world by way of the item provided.
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....
ushort Type
The internal ID of this type of wall.
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....
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,...
int soundStyle
The default style of sound made when this wall is hit. Defaults to 1.
virtual void PostDraw(int i, int j, SpriteBatch spriteBatch)
Allows you to draw things in front of the wall at the given coordinates.
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...
Mod mod
The mod which has added this type of ModWall.
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 call...
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...