TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ PrefixChance()

static ? bool Terraria.ModLoader.ItemLoader.PrefixChance ( Item item,
int pre,
UnifiedRandom rand )
inlinestatic

Allows for blocking, forcing and altering chance of prefix rolling. False (block) takes precedence over True (force). Null gives vanilla behavior.

Definition at line 550 of file ItemLoader.cs.

551 {
552 bool? result = null;
553 EntityGlobalsEnumerator<GlobalItem> enumerator = HookPrefixChance.Enumerate(item).GetEnumerator();
554 while (enumerator.MoveNext())
555 {
556 bool? r2 = enumerator.Current.PrefixChance(item, pre, rand);
557 if (r2.HasValue)
558 {
559 result = r2.Value && (result ?? true);
560 }
561 }
562 if (item.ModItem != null)
563 {
564 bool? r = item.ModItem.PrefixChance(pre, rand);
565 if (r.HasValue)
566 {
567 result = r.Value && (result ?? true);
568 }
569 }
570 return result;
571 }
static GlobalHookList< GlobalItem > HookPrefixChance

References Terraria.ModLoader.ItemLoader.HookPrefixChance, and Terraria.Item.ModItem.

Referenced by Terraria.Item.Prefix().

+ Here is the caller graph for this function: