|
virtual void | Apply (Item item) |
| Applies the custom data stats set in SetStats to the given item. More...
|
|
virtual void | AutoDefaults () |
|
virtual bool | Autoload (ref string name) |
|
virtual bool | CanRoll (Item item) |
| Returns if your ModPrefix can roll on the given item By default returns RollChance(item) > 0 More...
|
|
virtual void | ModifyValue (ref float valueMult) |
| Allows you to modify the sell price of the item based on the prefix or changes in custom data stats. This also influences the item's rarity. More...
|
|
virtual float | RollChance (Item item) |
| The roll chance of your prefix relative to a vanilla prefix, 1f by default. More...
|
|
virtual void | SetDefaults () |
| Allows you to set the prefix's name/translations and to set its category. More...
|
|
virtual void | SetStats (ref float damageMult, ref float knockbackMult, ref float useTimeMult, ref float scaleMult, ref float shootSpeedMult, ref float manaMult, ref int critBonus) |
| Sets the stat changes for this prefix. If data is not already pre-stored, it is best to store custom data changes to some static variables. More...
|
|
virtual void | ValidateItem (Item item, ref bool invalid) |
| Validates whether this prefix with the custom data stats set from SetStats is allowed on the given item. It is not allowed if one of the stat changes do not cause any change (eg. percentage being too small to make a difference). More...
|
|
Definition at line 10 of file ModPrefix.cs.
◆ ModPrefix()
static Terraria.ModLoader.ModPrefix.ModPrefix |
( |
| ) |
|
|
staticprivate |
Definition at line 18 of file ModPrefix.cs.
18 {
19 categoryPrefixes = new Dictionary<PrefixCategory, IList<ModPrefix>>();
21 categoryPrefixes[category] = new List<ModPrefix>();
22 }
23 }
◆ Apply()
virtual void Terraria.ModLoader.ModPrefix.Apply |
( |
Item |
item | ) |
|
|
virtual |
Applies the custom data stats set in SetStats to the given item.
- Parameters
-
Definition at line 159 of file ModPrefix.cs.
◆ AutoDefaults()
virtual void Terraria.ModLoader.ModPrefix.AutoDefaults |
( |
| ) |
|
|
virtual |
◆ Autoload()
virtual bool Terraria.ModLoader.ModPrefix.Autoload |
( |
ref string |
name | ) |
|
|
virtual |
◆ CanRoll()
virtual bool Terraria.ModLoader.ModPrefix.CanRoll |
( |
Item |
item | ) |
|
|
virtual |
Returns if your ModPrefix can roll on the given item By default returns RollChance(item) > 0
- Parameters
-
- Returns
Definition at line 117 of file ModPrefix.cs.
117 {
119 }
virtual float RollChance(Item item)
The roll chance of your prefix relative to a vanilla prefix, 1f by default.
References Terraria.ModLoader.ModPrefix.RollChance().
◆ GetPrefix()
static ModPrefix Terraria.ModLoader.ModPrefix.GetPrefix |
( |
byte |
type | ) |
|
|
static |
◆ GetPrefixesInCategory()
Returns a list of all modded prefixes of a certain category.
- Parameters
-
- Returns
Definition at line 49 of file ModPrefix.cs.
49 {
50 return new List<ModPrefix>(categoryPrefixes[category]);
51 }
◆ ModifyValue()
virtual void Terraria.ModLoader.ModPrefix.ModifyValue |
( |
ref float |
valueMult | ) |
|
|
virtual |
Allows you to modify the sell price of the item based on the prefix or changes in custom data stats. This also influences the item's rarity.
Definition at line 165 of file ModPrefix.cs.
◆ RollChance()
virtual float Terraria.ModLoader.ModPrefix.RollChance |
( |
Item |
item | ) |
|
|
virtual |
◆ SetDefaults()
virtual void Terraria.ModLoader.ModPrefix.SetDefaults |
( |
| ) |
|
|
virtual |
Allows you to set the prefix's name/translations and to set its category.
Definition at line 138 of file ModPrefix.cs.
◆ SetStats()
virtual void Terraria.ModLoader.ModPrefix.SetStats |
( |
ref float |
damageMult, |
|
|
ref float |
knockbackMult, |
|
|
ref float |
useTimeMult, |
|
|
ref float |
scaleMult, |
|
|
ref float |
shootSpeedMult, |
|
|
ref float |
manaMult, |
|
|
ref int |
critBonus |
|
) |
| |
|
virtual |
Sets the stat changes for this prefix. If data is not already pre-stored, it is best to store custom data changes to some static variables.
Definition at line 144 of file ModPrefix.cs.
◆ ValidateItem()
virtual void Terraria.ModLoader.ModPrefix.ValidateItem |
( |
Item |
item, |
|
|
ref bool |
invalid |
|
) |
| |
|
virtual |
Validates whether this prefix with the custom data stats set from SetStats is allowed on the given item. It is not allowed if one of the stat changes do not cause any change (eg. percentage being too small to make a difference).
Definition at line 152 of file ModPrefix.cs.
◆ nextPrefix
byte Terraria.ModLoader.ModPrefix.nextPrefix = PrefixID.Count |
|
staticprivate |
◆ Category
◆ DisplayName
◆ mod
Mod Terraria.ModLoader.ModPrefix.mod |
|
getset |
◆ Name
string Terraria.ModLoader.ModPrefix.Name |
|
getset |
◆ PrefixCount
byte Terraria.ModLoader.ModPrefix.PrefixCount |
|
staticget |
◆ Type
byte Terraria.ModLoader.ModPrefix.Type |
|
getset |