tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.ModLoader.DamageClass Class Reference

Inherits Terraria.ModLoader.ModType.

Inherited by Terraria.ModLoader.VanillaDamageClass.

Public Member Functions

virtual bool GetEffectInheritance (DamageClass damageClass)
 This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of armor and accessory effects, such as Spectre armor's bolts on magic attacks, or Magma Stone's Hellfire debuff on melee attacks. Returns false in all cases by default, which does not let any other classes' effects trigger on this DamageClass. For a more in-depth explanation and demonstration, refer to ExampleMod/Content/DamageClasses/ExampleDamageClass. More...
 
virtual StatInheritanceData GetModifierInheritance (DamageClass damageClass)
 This lets you define the classes that this DamageClass will benefit from (other than itself) for the purposes of stat bonuses, such as damage and crit chance. This returns a struct called StatInheritanceData. This is used to allow extensive specifications for what your damage class can and can't benefit from in terms of other classes' stat bonuses. By default, this will return StatInheritanceData.Full for DamageClass.Generic, and StatInheritanceData.None for any other. Any given DamageClass will also never call this method for itself. For a more in-depth explanation and demonstration, refer to ExampleMod/Content/DamageClasses/ExampleDamageClass. More...
 
virtual void SetDefaultStats (Player player)
 This lets you define default stat modifiers for all items of this class (e.g. base crit chance). More...
 
sealed override void SetupContent ()
 If you make a new ModType, seal this override, and call SetStaticDefaults in it. More...
 
virtual bool ShowStatTooltipLine (Player player, string lineName)
 This lets you enable or disable standard statistical tooltip lines displaying on items associated with this DamageClass. The lines usable are "Damage", "CritChance", "Speed", and "Knockback". More...
 
- Public Member Functions inherited from Terraria.ModLoader.ModType
virtual bool IsLoadingEnabled (Mod mod)
 Allows you to stop Mod.AddContent from actually adding this content. Useful for items that can be disabled by a config. More...
 
virtual void Load ()
 Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated. More...
 
virtual void SetStaticDefaults ()
 Allows you to modify the properties after initial loading has completed. More...
 
virtual void Unload ()
 Allows you to safely unload things you added in Load. More...
 

Protected Member Functions

sealed override void Register ()
 If you make a new ModType, seal this override. More...
 

Properties

ModTranslation ClassName [get, set]
 This is the translation that is used behind DisplayName. The translation will show up when an item tooltip displays 'X [ClassName]'. This should include the 'damage' part. More...
 
static DamageClass Default = new DefaultDamageClass() [get]
 Default damage class for non-classed weapons and items, does not benefit from Generic bonuses More...
 
string DisplayName [get]
 This is the name that will show up when an item tooltip displays 'X [ClassName]'. This should include the 'damage' part. More...
 
virtual string DisplayNameInternal [get]
 
static DamageClass Generic = new GenericDamageClass() [get]
 Base damage class for all weapons. All vanilla damage classes inherit bonuses applied to this class. Accessories which benefit all classes provide bonuses via the Generic class More...
 
static DamageClass Magic = new MagicDamageClass() [get]
 
static DamageClass MagicSummonHybrid = new MagicSummonHybridDamageClass() [get]
 This is a damage class used solely by vanilla forbidden storm. It scales with both magic and summon damage modifiers. More...
 
static DamageClass Melee = new MeleeDamageClass() [get]
 
static DamageClass Ranged = new RangedDamageClass() [get]
 
static DamageClass Summon = new SummonDamageClass() [get]
 
static DamageClass SummonMeleeSpeed = new SummonMeleeSpeedDamageClass() [get]
 This is a damage class used solely by vanilla whips. It benefits from melee attackSpeed bonuses. More...
 
static DamageClass Throwing = new ThrowingDamageClass() [get]
 Class provided for modders who want to coordinate throwing accessories and items. Not used by any vanilla items. More...
 
int Type [get, set]
 This is the internal ID of this DamageClass. More...
 
virtual bool UseStandardCritCalcs [get]
 This lets you decide whether or not your damage class will use standard crit chance calculations. Setting this to false will also hide the critical strike chance line in the tooltip of any item that uses this DamageClass. More...
 
- Properties inherited from Terraria.ModLoader.ModType
string FullName [get]
 The internal name of this, including the mod it is from. More...
 
Mod Mod [get, set]
 The mod this belongs to. More...
 
virtual string Name [get]
 The internal name of this. More...
 
- Properties inherited from Terraria.ModLoader.IModType
string FullName [get]
 => $"{Mod.Name}/{Name}" More...
 
Mod Mod [get]
 The mod this belongs to. More...
 
string Name [get]
 The internal name of this instance. More...
 

Member Function Documentation

◆ GetEffectInheritance()

virtual bool Terraria.ModLoader.DamageClass.GetEffectInheritance ( DamageClass  damageClass)
virtual

This lets you define the classes that this DamageClass will count as (other than itself) for the purpose of armor and accessory effects, such as Spectre armor's bolts on magic attacks, or Magma Stone's Hellfire debuff on melee attacks. Returns false in all cases by default, which does not let any other classes' effects trigger on this DamageClass. For a more in-depth explanation and demonstration, refer to ExampleMod/Content/DamageClasses/ExampleDamageClass.

Parameters
damageClassThe DamageClass which you want this DamageClass to gain effects from.

◆ GetModifierInheritance()

virtual StatInheritanceData Terraria.ModLoader.DamageClass.GetModifierInheritance ( DamageClass  damageClass)
virtual

This lets you define the classes that this DamageClass will benefit from (other than itself) for the purposes of stat bonuses, such as damage and crit chance. This returns a struct called StatInheritanceData. This is used to allow extensive specifications for what your damage class can and can't benefit from in terms of other classes' stat bonuses. By default, this will return StatInheritanceData.Full for DamageClass.Generic, and StatInheritanceData.None for any other. Any given DamageClass will also never call this method for itself. For a more in-depth explanation and demonstration, refer to ExampleMod/Content/DamageClasses/ExampleDamageClass.

Parameters
damageClassThe DamageClass which you want this DamageClass to benefit from statistically.

Reimplemented in Terraria.ModLoader.MagicSummonHybridDamageClass, Terraria.ModLoader.SummonMeleeSpeedDamageClass, Terraria.ModLoader.GenericDamageClass, and Terraria.ModLoader.DefaultDamageClass.

◆ Register()

sealed override void Terraria.ModLoader.DamageClass.Register ( )
protectedvirtual

If you make a new ModType, seal this override.

Implements Terraria.ModLoader.ModType.

◆ SetDefaultStats()

virtual void Terraria.ModLoader.DamageClass.SetDefaultStats ( Player  player)
virtual

This lets you define default stat modifiers for all items of this class (e.g. base crit chance).

Reimplemented in Terraria.ModLoader.GenericDamageClass.

◆ SetupContent()

sealed override void Terraria.ModLoader.DamageClass.SetupContent ( )
virtual

If you make a new ModType, seal this override, and call SetStaticDefaults in it.

Reimplemented from Terraria.ModLoader.ModType.

◆ ShowStatTooltipLine()

virtual bool Terraria.ModLoader.DamageClass.ShowStatTooltipLine ( Player  player,
string  lineName 
)
virtual

This lets you enable or disable standard statistical tooltip lines displaying on items associated with this DamageClass. The lines usable are "Damage", "CritChance", "Speed", and "Knockback".

Reimplemented in Terraria.ModLoader.SummonMeleeSpeedDamageClass, and Terraria.ModLoader.SummonDamageClass.

Property Documentation

◆ ClassName

ModTranslation Terraria.ModLoader.DamageClass.ClassName
getset

This is the translation that is used behind DisplayName. The translation will show up when an item tooltip displays 'X [ClassName]'. This should include the 'damage' part.

◆ Default

DamageClass Terraria.ModLoader.DamageClass.Default = new DefaultDamageClass()
staticget

Default damage class for non-classed weapons and items, does not benefit from Generic bonuses

◆ DisplayName

string Terraria.ModLoader.DamageClass.DisplayName
get

This is the name that will show up when an item tooltip displays 'X [ClassName]'. This should include the 'damage' part.

◆ Generic

DamageClass Terraria.ModLoader.DamageClass.Generic = new GenericDamageClass()
staticget

Base damage class for all weapons. All vanilla damage classes inherit bonuses applied to this class. Accessories which benefit all classes provide bonuses via the Generic class

◆ MagicSummonHybrid

DamageClass Terraria.ModLoader.DamageClass.MagicSummonHybrid = new MagicSummonHybridDamageClass()
staticget

This is a damage class used solely by vanilla forbidden storm. It scales with both magic and summon damage modifiers.

◆ SummonMeleeSpeed

DamageClass Terraria.ModLoader.DamageClass.SummonMeleeSpeed = new SummonMeleeSpeedDamageClass()
staticget

This is a damage class used solely by vanilla whips. It benefits from melee attackSpeed bonuses.

◆ Throwing

DamageClass Terraria.ModLoader.DamageClass.Throwing = new ThrowingDamageClass()
staticget

Class provided for modders who want to coordinate throwing accessories and items. Not used by any vanilla items.

◆ Type

int Terraria.ModLoader.DamageClass.Type
getset

This is the internal ID of this DamageClass.

◆ UseStandardCritCalcs

virtual bool Terraria.ModLoader.DamageClass.UseStandardCritCalcs
get

This lets you decide whether or not your damage class will use standard crit chance calculations. Setting this to false will also hide the critical strike chance line in the tooltip of any item that uses this DamageClass.