Terraria ModLoader  0.10.1.5
A framework for Terraria mods
Terraria.ModLoader.ModGore Class Reference

This class allows you to customize the behavior of a custom gore. Create a new instance of this and pass it as a parameter to Mod.AddGore to customize the gore you are adding. If you are autoloading gore, then give it the same name as the gore texture. More...

+ Collaboration diagram for Terraria.ModLoader.ModGore:

Public Member Functions

virtual bool DrawBehind (Gore gore)
 Allows you to determine whether or not this gore will draw behind tiles, etc. Returns false by default. More...
 
virtual Color GetAlpha (Gore gore, Color lightColor)
 Allows you to override the color this gore will draw in. Return null to draw it in the normal light color; returns null by default. More...
 
virtual void OnSpawn (Gore gore)
 Allows you to modify a gore's fields when it is created. More...
 
virtual bool Update (Gore gore)
 Allows you to customize how you want this type of gore to behave. Return true to allow for vanilla gore updating to also take place; returns true by default. More...
 

Static Public Member Functions

static int GetGoreSlot (string texture)
 Gets the type of the custom gore corresponding to the given texture. Returns 0 if the texture does not represent a gore. More...
 

Public Attributes

int updateType = -1
 Allows you to copy the Update behavior of a different type of gore. This defaults to 0, which means no behavior is copied. More...
 

Static Private Attributes

static int nextGore = GoreID.Count
 

Detailed Description

This class allows you to customize the behavior of a custom gore. Create a new instance of this and pass it as a parameter to Mod.AddGore to customize the gore you are adding. If you are autoloading gore, then give it the same name as the gore texture.

Definition at line 12 of file ModGore.cs.

Member Function Documentation

virtual bool Terraria.ModLoader.ModGore.DrawBehind ( Gore  gore)
virtual

Allows you to determine whether or not this gore will draw behind tiles, etc. Returns false by default.

Definition at line 126 of file ModGore.cs.

126  {
127  return false;
128  }
virtual Color Terraria.ModLoader.ModGore.GetAlpha ( Gore  gore,
Color  lightColor 
)
virtual

Allows you to override the color this gore will draw in. Return null to draw it in the normal light color; returns null by default.

Returns

Definition at line 119 of file ModGore.cs.

119  {
120  return null;
121  }
static int Terraria.ModLoader.ModGore.GetGoreSlot ( string  texture)
static

Gets the type of the custom gore corresponding to the given texture. Returns 0 if the texture does not represent a gore.

Definition at line 30 of file ModGore.cs.

References Terraria.ModLoader.ModContent.GetTexture().

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

30  {
31  if (gores.ContainsKey(texture)) {
32  return gores[texture];
33  }
34  else {
35  return 0;
36  }
37  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void Terraria.ModLoader.ModGore.OnSpawn ( Gore  gore)
virtual

Allows you to modify a gore's fields when it is created.

Definition at line 100 of file ModGore.cs.

100  {
101  }
virtual bool Terraria.ModLoader.ModGore.Update ( Gore  gore)
virtual

Allows you to customize how you want this type of gore to behave. Return true to allow for vanilla gore updating to also take place; returns true by default.

Definition at line 108 of file ModGore.cs.

108  {
109  return true;
110  }

Member Data Documentation

int Terraria.ModLoader.ModGore.nextGore = GoreID.Count
staticprivate

Definition at line 14 of file ModGore.cs.

int Terraria.ModLoader.ModGore.updateType = -1

Allows you to copy the Update behavior of a different type of gore. This defaults to 0, which means no behavior is copied.

Definition at line 19 of file ModGore.cs.