Terraria ModLoader  0.11.5
A framework for Terraria mods
Terraria.ModLoader.ItemLoader Class Reference

This serves as the central class from which item-related functions are carried out. It also stores a list of mod items by ID. More...

+ Collaboration diagram for Terraria.ModLoader.ItemLoader:

Classes

class  HookList
 

Static Public Member Functions

static bool AllowPrefix (Item item, int pre)
 
static bool AltFunctionUse (Item item, Player player)
 Calls ModItem.AltFunctionUse, then all GlobalItem.AltFunctionUse hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static string AnglerChat (int type)
 
static void ArmorArmGlowMask (int slot, Player drawPlayer, float shadow, ref int glowMask, ref Color color)
 Calls the item's body equipment texture's ArmorArmGlowMask hook, then all GlobalItem.ArmorArmGlowMask hooks. More...
 
static void ArmorSetShadows (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's ArmorSetShadows. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.ArmorSetShadows, using player.head, player.body, and player.legs. More...
 
static void AutoLightSelect (Item item, ref bool dryTorch, ref bool wetTorch, ref bool glowstick)
 
static bool CanBurnInLava (Item item)
 Calls ModItem.CanBurnInLava. More...
 
static bool CanEquipAccessory (Item item, int slot)
 
static bool CanHitNPC (Item item, Player player, NPC target)
 Gathers the results of ModItem.CanHitNPC and all GlobalItem.CanHitNPC hooks. If any of them returns false, this returns false. Otherwise, if any of them returns true then this returns true. If all of them return null, this returns null. More...
 
static bool CanHitPvp (Item item, Player player, Player target)
 Calls all GlobalItem.CanHitPvp hooks, then ModItem.CanHitPvp, until one of them returns false. If all of them return true, this returns true. More...
 
static bool CanPickup (Item item, Player player)
 
static bool CanRightClick (Item item)
 Calls ModItem.CanRightClick, then all GlobalItem.CanRightClick hooks, until one of the returns true. If one of the returns true, returns Main.mouseRight. Otherwise, returns false. More...
 
static bool CanUseItem (Item item, Player player)
 Returns the "and" operation on the results of ModItem.CanUseItem and all GlobalItem.CanUseItem hooks. Does not fail fast (every hook is called). More...
 
static void CaughtFishStack (Item item)
 
static bool CheckProjOnSwing (Player player, Item item)
 If the item is a modded item, ModItem.checkProjOnSwing is true, and the player is not at the beginning of the item's use animation, sets canShoot to false. More...
 
static int ChoosePrefix (Item item, UnifiedRandom rand)
 
static bool ConsumeAmmo (Item item, Item ammo, Player player)
 Calls ModItem.ConsumeAmmo for the weapon, ModItem.ConsumeAmmo for the ammo, then each GlobalItem.ConsumeAmmo hook for the weapon and ammo, until one of them returns false. If all of them return true, returns true. More...
 
static bool ConsumeItem (Item item, Player player)
 If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to false. More...
 
static void DrawArmorColor (EquipType type, int slot, Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
 Calls the item's equipment texture's DrawArmorColor hook, then all GlobalItem.DrawArmorColor hooks. More...
 
static bool DrawBody (Player player)
 Calls the item's body equipment texture's DrawBody hook, then all GlobalItem.DrawBody hooks, until one of them returns false. Returns true if none of them return false. More...
 
static void DrawHair (Player player, ref bool drawHair, ref bool drawAltHair)
 Calls the item's head equipment texture's DrawHair hook, then all GlobalItem.DrawHair hooks. More...
 
static void DrawHands (Player player, ref bool drawHands, ref bool drawArms)
 Calls the item's body equipment texture's DrawHands hook, then all GlobalItem.DrawHands hooks. More...
 
static bool DrawHead (Player player)
 Calls the item's head equipment texture's DrawHead hook, then all GlobalItem.DrawHead hooks, until one of them returns false. Returns true if none of them return false. More...
 
static bool DrawLegs (Player player)
 Calls the item's leg equipment texture's DrawLegs hook, then the item's shoe equipment texture's DrawLegs hook, then all GlobalItem.DrawLegs hooks, until one of them returns false. Returns true if none of them return false. More...
 
static void ExtractinatorUse (ref int resultType, ref int resultStack, int extractType)
 
static Color GetAlpha (Item item, Color lightColor)
 Calls all GlobalItem.GetAlpha hooks then ModItem.GetAlpha, until one of them returns a color, and returns that color. Returns null if all of the hooks return null. More...
 
static void GetHealLife (Item item, Player player, bool quickHeal, ref int healValue)
 Calls ModItem.GetHealLife, then all GlobalItem.GetHealLife hooks. More...
 
static void GetHealMana (Item item, Player player, bool quickHeal, ref int healValue)
 Calls ModItem.GetHealMana, then all GlobalItem.GetHealMana hooks. More...
 
static ModItem GetItem (int type)
 Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the given type. More...
 
static void GetWeaponCrit (Item item, Player player, ref int crit)
 Calls ModItem.GetWeaponCrit, then all GlobalItem.GetWeaponCrit hooks. More...
 
static void GetWeaponDamage (Item item, Player player, ref int damage)
 Calls ModItem.GetWeaponDamage, then all GlobalItem.GetWeaponDamage hooks. More...
 
static void GetWeaponKnockback (Item item, Player player, ref float knockback)
 Calls ModItem.GetWeaponKnockback, then all GlobalItem.GetWeaponKnockback hooks. More...
 
static Item GetWing (Player player)
 s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified, so no equipped wing can be found to match what the player is using, this creates a new Item object to return. More...
 
static void GrabRange (Item item, Player player, ref int grabRange)
 Calls ModItem.GrabRange, then all GlobalItem.GrabRange hooks. More...
 
static bool GrabStyle (Item item, Player player)
 Calls all GlobalItem.GrabStyle hooks then ModItem.GrabStyle, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void HoldItem (Item item, Player player)
 Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks. More...
 
static bool HoldItemFrame (Item item, Player player)
 Calls ModItem.HoldItemFrame, then all GlobalItem.HoldItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void HoldoutOffset (float gravDir, int type, ref Vector2 offset)
 
static void HoldoutOrigin (Player player, ref Vector2 origin)
 
static void HoldStyle (Item item, Player player)
 If the player is not holding onto a rope and is not in the middle of using an item, calls ModItem.HoldStyle and all GlobalItem.HoldStyle hooks. More...
 
static void HorizontalWingSpeeds (Player player)
 If the player is using wings, this uses the result of GetWing, and calls ModItem.HorizontalWingSpeeds then all GlobalItem.HorizontalWingSpeeds hooks. More...
 
static void IsAnglerQuestAvailable (int itemID, ref bool notAvailable)
 
static bool IsModBossBag (Item item)
 Returns whether ModItem.bossBagNPC is greater than 0. Returns false if item is not a modded item. More...
 
static bool ItemSpace (Item item, Player player)
 
static void MeleeEffects (Item item, Player player, Rectangle hitbox)
 Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks. More...
 
static float MeleeSpeedMultiplier (Item item, Player player)
 
static void ModifyHitNPC (Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
 Calls ModItem.ModifyHitNPC, then all GlobalItem.ModifyHitNPC hooks. More...
 
static void ModifyHitPvp (Item item, Player player, Player target, ref int damage, ref bool crit)
 Calls ModItem.ModifyHitPvp, then all GlobalItem.ModifyHitPvp hooks. More...
 
static void ModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 Calls ModItem.ModifyManaCost, then all GlobalItem.ModifyManaCost hooks. More...
 
static List< TooltipLineModifyTooltips (Item item, ref int numTooltips, string[] names, ref string[] text, ref bool[] modifier, ref bool[] badModifier, ref int oneDropLogo, out Color?[] overrideColor)
 
static void ModifyWeaponDamage (Item item, Player player, ref float add, ref float mult, ref float flat)
 Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks. More...
 
static bool NeedsModSaving (Item item)
 
static void OnConsumeAmmo (Item item, Item ammo, Player player)
 Calls ModItem.OnConsumeAmmo for the weapon, ModItem.OnConsumeAmmo for the ammo, then each GlobalItem.OnConsumeAmmo hook for the weapon and ammo. More...
 
static void OnConsumeItem (Item item, Player player)
 Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks. More...
 
static void OnConsumeMana (Item item, Player player, int manaConsumed)
 Calls ModItem.OnConsumeMana, then all GlobalItem.OnConsumeMana hooks. More...
 
static void OnCraft (Item item, Recipe recipe)
 
static void OnHitNPC (Item item, Player player, NPC target, int damage, float knockBack, bool crit)
 Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks. More...
 
static void OnHitPvp (Item item, Player player, Player target, int damage, bool crit)
 Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks. More...
 
static void OnMissingMana (Item item, Player player, int neededMana)
 Calls ModItem.OnMissingMana, then all GlobalItem.OnMissingMana hooks. More...
 
static bool OnPickup (Item item, Player player)
 Calls all GlobalItem.OnPickup hooks then ModItem.OnPickup, until one of the returns false. Returns true if all of the hooks return true. More...
 
static void OpenBossBag (int type, Player player, ref int npc)
 If the item is a modded item and ModItem.bossBagNPC is greater than 0, calls ModItem.OpenBossBag and sets npc to ModItem.bossBagNPC. More...
 
static void OpenVanillaBag (string context, Player player, int arg)
 Calls all GlobalItem.OpenVanillaBag hooks. More...
 
static void PickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks. More...
 
static void PostDrawInInventory (Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 Calls ModItem.PostDrawInInventory, then all GlobalItem.PostDrawInInventory hooks. More...
 
static void PostDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
 Calls ModItem.PostDrawInWorld, then all GlobalItem.PostDrawInWorld hooks. More...
 
static void PostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
static void PostDrawTooltipLine (Item item, DrawableTooltipLine line)
 
static void PostReforge (Item item)
 Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks. More...
 
static void PostUpdate (Item item)
 Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks. More...
 
static bool PreDrawInInventory (Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 Returns the "and" operator on the results of all GlobalItem.PreDrawInInventory hooks and ModItem.PreDrawInInventory. More...
 
static bool PreDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 Returns the "and" operator on the results of ModItem.PreDrawInWorld and all GlobalItem.PreDrawInWorld hooks. More...
 
static bool PreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
static bool PreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
static bool PrefixChance (Item item, int pre, UnifiedRandom rand)
 Allows for blocking, forcing and altering chance of prefix rolling. False (block) takes precedence over True (force). Null gives vanilla behaviour More...
 
static bool PreOpenVanillaBag (string context, Player player, int arg)
 Calls each GlobalItem.PreOpenVanillaBag hook until one of them returns false. Returns true if all of them returned true. More...
 
static bool PreReforge (Item item)
 Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks. More...
 
static void PreUpdateVanitySet (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's PreUpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.PreUpdateVanitySet, using player.head, player.body, and player.legs. More...
 
static bool ReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks. More...
 
static void RightClick (Item item, Player player)
 If Main.mouseRightRelease is true, the following steps are taken: More...
 
static void SetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks. More...
 
static bool Shoot (Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 Calls each GlobalItem.Shoot hook, then ModItem.Shoot, until one of them returns false. If all of them return true, returns true. More...
 
static void Update (Item item, ref float gravity, ref float maxFallSpeed)
 Calls ModItem.Update, then all GlobalItem.Update hooks. More...
 
static void UpdateAccessory (Item item, Player player, bool hideVisual)
 Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks. More...
 
static void UpdateArmorSet (Player player, Item head, Item body, Item legs)
 If the head's ModItem.IsArmorSet returns true, calls the head's ModItem.UpdateArmorSet. This is then repeated for the body, then the legs. Then for each GlobalItem, if GlobalItem.IsArmorSet returns a non-empty string, calls GlobalItem.UpdateArmorSet with that string. More...
 
static void UpdateEquip (Item item, Player player)
 Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks. More...
 
static void UpdateInventory (Item item, Player player)
 Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks. More...
 
static void UpdateVanity (Player player)
 Calls each of the item's equipment texture's UpdateVanity hook. More...
 
static void UpdateVanitySet (Player player)
 If the player's head texture's IsVanitySet returns true, calls the equipment texture's UpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.UpdateVanitySet, using player.head, player.body, and player.legs. More...
 
static bool UseItem (Item item, Player player)
 Returns true if any of ModItem.UseItem or GlobalItem.UseItem return true Does not fail fast (calls every hook) More...
 
static bool UseItemFrame (Item item, Player player)
 Calls ModItem.UseItemFrame, then all GlobalItem.UseItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true. More...
 
static void UseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks. More...
 
static void UseStyle (Item item, Player player)
 Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks. More...
 
static float UseTimeMultiplier (Item item, Player player)
 
static void VerticalWingSpeeds (Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 If the player is using wings, this uses the result of GetWing, and calls ModItem.VerticalWingSpeeds then all GlobalItem.VerticalWingSpeeds hooks. More...
 
static bool WingUpdate (Player player, bool inUse)
 If wings can be seen on the player, calls the player's wing's equipment texture's WingUpdate and all GlobalItem.WingUpdate hooks. More...
 

Static Public Attributes

static int ItemCount => nextItem
 

Private Member Functions

delegate void DelegateAnglerChat (int type, ref string chat, ref string catchLocation)
 
delegate void DelegateArmorArmGlowMask (int slot, Player drawPlayer, float shadow, ref int glowMask, ref Color color)
 
delegate void DelegateCaughtFishStack (int type, ref int stack)
 
delegate void DelegateDrawArmorColor (EquipType type, int slot, Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
 
delegate void DelegateDrawHair (int body, ref bool drawHair, ref bool drawAltHair)
 
delegate void DelegateDrawHands (int body, ref bool drawHands, ref bool drawArms)
 
delegate void DelegateExtractinatorUse (int extractType, ref int resultType, ref int resultStack)
 
delegate void DelegateGetHealLife (Item item, Player player, bool quickHeal, ref int healValue)
 
delegate void DelegateGetHealMana (Item item, Player player, bool quickHeal, ref int healValue)
 
delegate void DelegateGetWeaponCrit (Item item, Player player, ref int crit)
 
delegate void DelegateGetWeaponDamage (Item item, Player player, ref int damage)
 
delegate void DelegateGetWeaponKnockback (Item item, Player player, ref float knockback)
 
delegate void DelegateGrabRange (Item item, Player player, ref int grabRange)
 
delegate void DelegateHorizontalWingSpeeds (Item item, Player player, ref float speed, ref float acceleration)
 
delegate void DelegateModifyHitNPC (Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
 
delegate void DelegateModifyHitPvp (Item item, Player player, Player target, ref int damage, ref bool crit)
 
delegate void DelegateModifyManaCost (Item item, Player player, ref float reduce, ref float mult)
 
delegate void DelegateModifyWeaponDamage (Item item, Player player, ref float add, ref float mult, ref float flat)
 
delegate void DelegateModifyWeaponDamageOld (Item item, Player player, ref float add, ref float mult)
 
delegate void DelegateOldPickAmmo (Item item, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 
delegate void DelegatePickAmmo (Item weapon, Item ammo, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
 
delegate void DelegatePostDrawTooltip (Item item, ReadOnlyCollection< DrawableTooltipLine > lines)
 
delegate void DelegatePostDrawTooltipLine (Item item, DrawableTooltipLine line)
 
delegate bool DelegatePreDrawInWorld (Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 
delegate bool DelegatePreDrawTooltip (Item item, ReadOnlyCollection< TooltipLine > lines, ref int x, ref int y)
 
delegate bool DelegatePreDrawTooltipLine (Item item, DrawableTooltipLine line, ref int yOffset)
 
delegate bool DelegateReforgePrice (Item item, ref int reforgePrice, ref bool canApplyDiscount)
 
delegate void DelegateSetMatch (int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
 
delegate bool DelegateShoot (Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 
delegate void DelegateUpdate (Item item, ref float gravity, ref float maxFallSpeed)
 
delegate void DelegateUseItemHitbox (Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
 
delegate void DelegateVerticalWingSpeeds (Item item, Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 

Static Private Member Functions

static HookList AddHook< F > (Expression< Func< GlobalItem, F >> func)
 
static Rectangle AnimatedItemFrame (Item item)
 
static void FindVanillaWings ()
 
static bool GeneralPrefix (Item item)
 
static bool HasMethod (Type t, string method, params Type[] args)
 

Static Private Attributes

static HookList HookAllowPrefix = AddHook<Func<Item, int, bool>>(g => g.AllowPrefix)
 
static HookList HookAltFunctionUse = AddHook<Func<Item, Player, bool>>(g => g.AltFunctionUse)
 
static HookList HookAnglerChat = AddHook<DelegateAnglerChat>(g => g.AnglerChat)
 
static HookList HookArmorArmGlowMask = AddHook<DelegateArmorArmGlowMask>(g => g.ArmorArmGlowMask)
 
static HookList HookArmorSetShadows = AddHook<Action<Player, string>>(g => g.ArmorSetShadows)
 
static HookList HookCanBurnInLava = AddHook<Func<Item, bool>>(g => g.CanBurnInLava)
 
static HookList HookCanEquipAccessory = AddHook<Func<Item, Player, int, bool>>(g => g.CanEquipAccessory)
 
static HookList HookCanHitNPC = AddHook<Func<Item, Player, NPC, bool?>>(g => g.CanHitNPC)
 
static HookList HookCanHitPvp = AddHook<Func<Item, Player, Player, bool>>(g => g.CanHitPvp)
 
static HookList HookCanPickup = AddHook<Func<Item, Player, bool>>(g => g.CanPickup)
 
static HookList HookCanRightClick = AddHook<Func<Item, bool>>(g => g.CanRightClick)
 
static HookList HookCanUseItem = AddHook<Func<Item, Player, bool>>(g => g.CanUseItem)
 
static HookList HookCaughtFishStack = AddHook<DelegateCaughtFishStack>(g => g.CaughtFishStack)
 
static HookList HookChoosePrefix = AddHook<Func<Item, UnifiedRandom, int>>(g => g.ChoosePrefix)
 
static HookList HookConsumeAmmo = AddHook<Func<Item, Player, bool>>(g => g.ConsumeAmmo)
 
static HookList HookConsumeItem = AddHook<Func<Item, Player, bool>>(g => g.ConsumeItem)
 
static HookList HookDrawArmorColor = AddHook<DelegateDrawArmorColor>(g => g.DrawArmorColor)
 
static HookList HookDrawBody = AddHook<Func<int, bool>>(g => g.DrawBody)
 
static HookList HookDrawHair = AddHook<DelegateDrawHair>(g => g.DrawHair)
 
static HookList HookDrawHands = AddHook<DelegateDrawHands>(g => g.DrawHands)
 
static HookList HookDrawHead = AddHook<Func<int, bool>>(g => g.DrawHead)
 
static HookList HookDrawLegs = AddHook<Func<int, int, bool>>(g => g.DrawLegs)
 
static HookList HookExtractinatorUse = AddHook<DelegateExtractinatorUse>(g => g.ExtractinatorUse)
 
static HookList HookGetAlpha = AddHook<Func<Item, Color, Color?>>(g => g.GetAlpha)
 
static HookList HookGetHealLife = AddHook<DelegateGetHealLife>(g => g.GetHealLife)
 
static HookList HookGetHealMana = AddHook<DelegateGetHealMana>(g => g.GetHealMana)
 
static HookList HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(g => g.GetWeaponCrit)
 
static HookList HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(g => g.GetWeaponDamage)
 
static HookList HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(g => g.GetWeaponKnockback)
 
static HookList HookGrabRange = AddHook<DelegateGrabRange>(g => g.GrabRange)
 
static HookList HookGrabStyle = AddHook<Func<Item, Player, bool>>(g => g.GrabStyle)
 
static HookList HookHoldItem = AddHook<Action<Item, Player>>(g => g.HoldItem)
 
static HookList HookHoldItemFrame = AddHook<Func<Item, Player, bool>>(g => g.HoldItemFrame)
 
static HookList HookHoldoutOffset = AddHook<Func<int, Vector2?>>(g => g.HoldoutOffset)
 
static HookList HookHoldoutOrigin = AddHook<Func<int, Vector2?>>(g => g.HoldoutOrigin)
 
static HookList HookHoldStyle = AddHook<Action<Item, Player>>(g => g.HoldStyle)
 
static HookList HookHorizontalWingSpeeds = AddHook<DelegateHorizontalWingSpeeds>(g => g.HorizontalWingSpeeds)
 
static HookList HookIsAnglerQuestAvailable = AddHook<Func<int, bool>>(g => g.IsAnglerQuestAvailable)
 
static HookList HookItemSpace = AddHook<Func<Item, Player, bool>>(g => g.ItemSpace)
 
static HookList HookMeleeEffects = AddHook<Action<Item, Player, Rectangle>>(g => g.MeleeEffects)
 
static HookList HookMeleeSpeedMultiplier = AddHook<Func<Item, Player, float>>(g => g.MeleeSpeedMultiplier)
 
static HookList HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(g => g.ModifyHitNPC)
 
static HookList HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(g => g.ModifyHitPvp)
 
static HookList HookModifyManaCost = AddHook<DelegateModifyManaCost>(g => g.ModifyManaCost)
 
static HookList HookModifyTooltips = AddHook<Action<Item, List<TooltipLine>>>(g => g.ModifyTooltips)
 
static HookList HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
 
static HookList HookModifyWeaponDamageOld = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
 
static HookList HookNeedsSaving = AddHook<Func<Item, bool>>(g => g.NeedsSaving)
 
static HookList HookOldPickAmmo = AddHook<DelegateOldPickAmmo>(g => g.PickAmmo)
 
static HookList HookOnConsumeAmmo = AddHook<Action<Item, Player>>(g => g.OnConsumeAmmo)
 
static HookList HookOnConsumeItem = AddHook<Action<Item, Player>>(g => g.OnConsumeItem)
 
static HookList HookOnConsumeMana = AddHook<Action<Item, Player, int>>(g => g.OnConsumeMana)
 
static HookList HookOnCraft = AddHook<Action<Item, Recipe>>(g => g.OnCraft)
 
static HookList HookOnHitNPC = AddHook<Action<Item, Player, NPC, int, float, bool>>(g => g.OnHitNPC)
 
static HookList HookOnHitPvp = AddHook<Action<Item, Player, Player, int, bool>>(g => g.OnHitPvp)
 
static HookList HookOnMissingMana = AddHook<Action<Item, Player, int>>(g => g.OnMissingMana)
 
static HookList HookOnPickup = AddHook<Func<Item, Player, bool>>(g => g.OnPickup)
 
static HookList HookOpenVanillaBag = AddHook<Action<string, Player, int>>(g => g.OpenVanillaBag)
 
static HookList HookPickAmmo = AddHook<DelegatePickAmmo>(g => g.PickAmmo)
 
static HookList HookPostDrawInInventory = AddHook<Action<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float>>(g => g.PostDrawInInventory)
 
static HookList HookPostDrawInWorld = AddHook<Action<Item, SpriteBatch, Color, Color, float, float, int>>(g => g.PostDrawInWorld)
 
static HookList HookPostDrawTooltip = AddHook<DelegatePostDrawTooltip>(g => g.PostDrawTooltip)
 
static HookList HookPostDrawTooltipLine = AddHook<DelegatePostDrawTooltipLine>(g => g.PostDrawTooltipLine)
 
static HookList HookPostReforge = AddHook<Action<Item>>(g => g.PostReforge)
 
static HookList HookPostUpdate = AddHook<Action<Item>>(g => g.PostUpdate)
 
static HookList HookPreDrawInInventory = AddHook<Func<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float, bool>>(g => g.PreDrawInInventory)
 
static HookList HookPreDrawInWorld = AddHook<DelegatePreDrawInWorld>(g => g.PreDrawInWorld)
 
static HookList HookPreDrawTooltip = AddHook<DelegatePreDrawTooltip>(g => g.PreDrawTooltip)
 
static HookList HookPreDrawTooltipLine = AddHook<DelegatePreDrawTooltipLine>(g => g.PreDrawTooltipLine)
 
static HookList HookPrefixChance = AddHook<Func<Item, int, UnifiedRandom, bool?>>(g => g.PrefixChance)
 
static HookList HookPreOpenVanillaBag = AddHook<Func<string, Player, int, bool>>(g => g.PreOpenVanillaBag)
 
static HookList HookPreReforge = AddHook<Func<Item, bool>>(g => g.NewPreReforge)
 
static HookList HookPreUpdateVanitySet = AddHook<Action<Player, string>>(g => g.PreUpdateVanitySet)
 
static HookList HookReforgePrice = AddHook<DelegateReforgePrice>(g => g.ReforgePrice)
 
static HookList HookRightClick = AddHook<Action<Item, Player>>(g => g.RightClick)
 
static List< HookListhooks = new List<HookList>()
 
static HookList HookSetDefaults = AddHook<Action<Item>>(g => g.SetDefaults)
 
static HookList HookSetMatch = AddHook<DelegateSetMatch>(g => g.SetMatch)
 
static HookList HookShoot = AddHook<DelegateShoot>(g => g.Shoot)
 
static HookList HookUpdate = AddHook<DelegateUpdate>(g => g.Update)
 
static HookList HookUpdateAccessory = AddHook<Action<Item, Player, bool>>(g => g.UpdateAccessory)
 
static HookList HookUpdateArmorSet = AddHook<Action<Player, string>>(g => g.UpdateArmorSet)
 
static HookList HookUpdateEquip = AddHook<Action<Item, Player>>(g => g.UpdateEquip)
 
static HookList HookUpdateInventory = AddHook<Action<Item, Player>>(g => g.UpdateInventory)
 
static HookList HookUpdateVanitySet = AddHook<Action<Player, string>>(g => g.UpdateVanitySet)
 
static HookList HookUseItem = AddHook<Func<Item, Player, bool>>(g => g.UseItem)
 
static HookList HookUseItemFrame = AddHook<Func<Item, Player, bool>>(g => g.UseItemFrame)
 
static HookList HookUseItemHitbox = AddHook<DelegateUseItemHitbox>(g => g.UseItemHitbox)
 
static HookList HookUseStyle = AddHook<Action<Item, Player>>(g => g.UseStyle)
 
static HookList HookUseTimeMultiplier = AddHook<Func<Item, Player, float>>(g => g.UseTimeMultiplier)
 
static HookList HookVerticalWingSpeeds = AddHook<DelegateVerticalWingSpeeds>(g => g.VerticalWingSpeeds)
 
static HookList HookWingUpdate = AddHook<Func<int, Player, bool, bool>>(g => g.WingUpdate)
 
static int nextItem = ItemID.Count
 

Detailed Description

This serves as the central class from which item-related functions are carried out. It also stores a list of mod items by ID.

Definition at line 21 of file ItemLoader.cs.

Member Function Documentation

static HookList Terraria.ModLoader.ItemLoader.AddHook< F > ( Expression< Func< GlobalItem, F >>  func)
staticprivate

Definition at line 46 of file ItemLoader.cs.

46  {
47  var hook = new HookList(ModLoader.Method(func));
48  hooks.Add(hook);
49  return hook;
50  }
static List< HookList > hooks
Definition: ItemLoader.cs:44
static bool Terraria.ModLoader.ItemLoader.AllowPrefix ( Item  item,
int  pre 
)
static

Definition at line 288 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

288  {
289  bool result = true;
290  foreach (var g in HookAllowPrefix.arr) {
291  result &= g.Instance(item).AllowPrefix(item, pre);
292  }
293  if (item.modItem != null) {
294  result &= item.modItem.AllowPrefix(pre);
295  }
296  return result;
297  }
static HookList HookAllowPrefix
Definition: ItemLoader.cs:287
static bool Terraria.ModLoader.ItemLoader.AltFunctionUse ( Item  item,
Player  player 
)
static

Calls ModItem.AltFunctionUse, then all GlobalItem.AltFunctionUse hooks, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 847 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

847  {
848  if (item.IsAir)
849  return false;
850 
851  if (item.modItem != null && item.modItem.AltFunctionUse(player))
852  return true;
853 
854  foreach (var g in HookAltFunctionUse.arr)
855  if (g.Instance(item).AltFunctionUse(item, player))
856  return true;
857 
858  return false;
859  }
static HookList HookAltFunctionUse
Definition: ItemLoader.cs:843
static string Terraria.ModLoader.ItemLoader.AnglerChat ( int  type)
static

Definition at line 1659 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1659  {
1660  string chat = "";
1661  string catchLocation = "";
1662  GetItem(type)?.AnglerQuestChat(ref chat, ref catchLocation);
1663 
1664  foreach (var g in HookAnglerChat.arr)
1665  g.AnglerChat(type, ref chat, ref catchLocation);
1666 
1667  if (string.IsNullOrEmpty(chat) || string.IsNullOrEmpty(catchLocation))
1668  return null;
1669 
1670  return chat + "\n\n(" + catchLocation + ")";
1671  }
static ModItem GetItem(int type)
Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the...
Definition: ItemLoader.cs:76
static HookList HookAnglerChat
Definition: ItemLoader.cs:1658
virtual void AnglerQuestChat(ref string description, ref string catchLocation)
Allows you to set what the Angler says when he requests for this item. The description parameter is h...
Definition: ModItem.cs:994
static Rectangle Terraria.ModLoader.ItemLoader.AnimatedItemFrame ( Item  item)
staticprivate

Definition at line 241 of file ItemLoader.cs.

241  {
242  int frameCount = Main.itemAnimations[item.type].FrameCount;
243  int frameDuration = Main.itemAnimations[item.type].TicksPerFrame;
244  return Main.itemAnimations[item.type].GetFrame(Main.itemTexture[item.type]);
245  }
static void Terraria.ModLoader.ItemLoader.ArmorArmGlowMask ( int  slot,
Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
static

Calls the item's body equipment texture's ArmorArmGlowMask hook, then all GlobalItem.ArmorArmGlowMask hooks.

Definition at line 1275 of file ItemLoader.cs.

References Terraria.ModLoader.EquipTexture.ArmorArmGlowMask(), Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1275  {
1276  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, slot);
1277  texture?.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
1278 
1279  foreach (var g in HookArmorArmGlowMask.arr)
1280  g.ArmorArmGlowMask(slot, drawPlayer, shadow, ref glowMask, ref color);
1281  }
static HookList HookArmorArmGlowMask
Definition: ItemLoader.cs:1271
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.ArmorSetShadows ( Player  player)
static

If the player's head texture's IsVanitySet returns true, calls the equipment texture's ArmorSetShadows. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.ArmorSetShadows, using player.head, player.body, and player.legs.

Definition at line 998 of file ItemLoader.cs.

References Terraria.ModLoader.EquipTexture.ArmorSetShadows(), Terraria.ModLoader.GlobalItem.ArmorSetShadows(), Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.EquipTexture.IsVanitySet(), and Terraria.ModLoader.GlobalItem.IsVanitySet().

998  {
999  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1000  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1001  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1002  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
1003  headTexture.ArmorSetShadows(player);
1004 
1005  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
1006  bodyTexture.ArmorSetShadows(player);
1007 
1008  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
1009  legTexture.ArmorSetShadows(player);
1010 
1011  foreach (GlobalItem globalItem in HookArmorSetShadows.arr) {
1012  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
1013  if (!string.IsNullOrEmpty(set))
1014  globalItem.ArmorSetShadows(player, set);
1015  }
1016  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6
static HookList HookArmorSetShadows
Definition: ItemLoader.cs:992

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.AutoLightSelect ( Item  item,
ref bool  dryTorch,
ref bool  wetTorch,
ref bool  glowstick 
)
static

Definition at line 1625 of file ItemLoader.cs.

1625  {
1626  if (item.modItem != null) {
1627  item.modItem.AutoLightSelect(ref dryTorch, ref wetTorch, ref glowstick);
1628  if (wetTorch) {
1629  dryTorch = false;
1630  glowstick = false;
1631  }
1632  if (dryTorch) {
1633  glowstick = false;
1634  }
1635  }
1636  }
static bool Terraria.ModLoader.ItemLoader.CanBurnInLava ( Item  item)
static

Calls ModItem.CanBurnInLava.

Definition at line 1391 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1392  {
1393  foreach (var g in HookCanBurnInLava.arr)
1394  if (g.Instance(item).CanBurnInLava(item))
1395  return true;
1396 
1397  return item.modItem?.CanBurnInLava() ?? false;
1398  }
static HookList HookCanBurnInLava
Definition: ItemLoader.cs:1387
static bool Terraria.ModLoader.ItemLoader.CanEquipAccessory ( Item  item,
int  slot 
)
static

Definition at line 1604 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1604  {
1605  Player player = Main.player[Main.myPlayer];
1606  if (item.modItem != null && !item.modItem.CanEquipAccessory(player, slot))
1607  return false;
1608 
1609  foreach (var g in HookCanEquipAccessory.arr)
1610  if (!g.Instance(item).CanEquipAccessory(item, player, slot))
1611  return false;
1612 
1613  return true;
1614  }
static HookList HookCanEquipAccessory
Definition: ItemLoader.cs:1601
static bool Terraria.ModLoader.ItemLoader.CanHitNPC ( Item  item,
Player  player,
NPC  target 
)
static

Gathers the results of ModItem.CanHitNPC and all GlobalItem.CanHitNPC hooks. If any of them returns false, this returns false. Otherwise, if any of them returns true then this returns true. If all of them return null, this returns null.

Definition at line 667 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

667  {
668  bool? canHit = item.modItem?.CanHitNPC(player, target);
669  if (canHit.HasValue && !canHit.Value) {
670  return false;
671  }
672  foreach (var g in HookCanHitNPC.arr) {
673  bool? globalCanHit = g.Instance(item).CanHitNPC(item, player, target);
674  if (globalCanHit.HasValue) {
675  if (globalCanHit.Value) {
676  canHit = true;
677  }
678  else {
679  return false;
680  }
681  }
682  }
683  return canHit;
684  }
static HookList HookCanHitNPC
Definition: ItemLoader.cs:656
static bool Terraria.ModLoader.ItemLoader.CanHitPvp ( Item  item,
Player  player,
Player  target 
)
static

Calls all GlobalItem.CanHitPvp hooks, then ModItem.CanHitPvp, until one of them returns false. If all of them return true, this returns true.

Definition at line 719 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

719  {
720  foreach (var g in HookCanHitPvp.arr)
721  if (!g.Instance(item).CanHitPvp(item, player, target))
722  return false;
723 
724  return item.modItem == null || item.modItem.CanHitPvp(player, target);
725  }
static HookList HookCanHitPvp
Definition: ItemLoader.cs:713
static bool Terraria.ModLoader.ItemLoader.CanPickup ( Item  item,
Player  player 
)
static

Definition at line 1442 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1442  {
1443  foreach (var g in HookCanPickup.arr)
1444  if (!g.Instance(item).CanPickup(item, player))
1445  return false;
1446 
1447  return item.modItem?.CanPickup(player) ?? true;
1448  }
static HookList HookCanPickup
Definition: ItemLoader.cs:1439
static bool Terraria.ModLoader.ItemLoader.CanRightClick ( Item  item)
static

Calls ModItem.CanRightClick, then all GlobalItem.CanRightClick hooks, until one of the returns true. If one of the returns true, returns Main.mouseRight. Otherwise, returns false.

Definition at line 1037 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1037  {
1038  if (item.IsAir || !Main.mouseRight)
1039  return false;
1040 
1041  if (item.modItem != null && item.modItem.CanRightClick())
1042  return true;
1043 
1044  foreach (var g in HookCanRightClick.arr)
1045  if (g.Instance(item).CanRightClick(item))
1046  return true;
1047 
1048  return false;
1049  }
static HookList HookCanRightClick
Definition: ItemLoader.cs:1031
static bool Terraria.ModLoader.ItemLoader.CanUseItem ( Item  item,
Player  player 
)
static

Returns the "and" operation on the results of ModItem.CanUseItem and all GlobalItem.CanUseItem hooks. Does not fail fast (every hook is called).

Parameters
itemThe item.
playerThe player holding the item.

Definition at line 309 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

309  {
310  bool flag = true;
311  if (item.modItem != null)
312  flag &= item.modItem.CanUseItem(player);
313 
314  foreach (var g in HookCanUseItem.arr)
315  flag &= g.Instance(item).CanUseItem(item, player);
316 
317  return flag;
318  }
static HookList HookCanUseItem
Definition: ItemLoader.cs:299
static void Terraria.ModLoader.ItemLoader.CaughtFishStack ( Item  item)
static

Definition at line 1640 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1640  {
1641  item.modItem?.CaughtFishStack(ref item.stack);
1642 
1643  foreach (var g in HookCaughtFishStack.arr)
1644  g.Instance(item).CaughtFishStack(item.type, ref item.stack);
1645  }
static HookList HookCaughtFishStack
Definition: ItemLoader.cs:1639
static bool Terraria.ModLoader.ItemLoader.CheckProjOnSwing ( Player  player,
Item  item 
)
static

If the item is a modded item, ModItem.checkProjOnSwing is true, and the player is not at the beginning of the item's use animation, sets canShoot to false.

Definition at line 538 of file ItemLoader.cs.

References Terraria.ModLoader.Item.

538  {
539  return item.modItem == null || !item.modItem.OnlyShootOnSwing || player.itemAnimation == player.itemAnimationMax - 1;
540  }
static int Terraria.ModLoader.ItemLoader.ChoosePrefix ( Item  item,
UnifiedRandom  rand 
)
static

Definition at line 249 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

249  {
250  foreach (var g in HookChoosePrefix.arr) {
251  int pre = g.Instance(item).ChoosePrefix(item, rand);
252  if (pre > 0) {
253  return pre;
254  }
255  }
256  if (item.modItem != null) {
257  int pre = item.modItem.ChoosePrefix(rand);
258  if (pre > 0) {
259  return pre;
260  }
261  }
262  return -1;
263  }
static HookList HookChoosePrefix
Definition: ItemLoader.cs:247
static bool Terraria.ModLoader.ItemLoader.ConsumeAmmo ( Item  item,
Item  ammo,
Player  player 
)
static

Calls ModItem.ConsumeAmmo for the weapon, ModItem.ConsumeAmmo for the ammo, then each GlobalItem.ConsumeAmmo hook for the weapon and ammo, until one of them returns false. If all of them return true, returns true.

Definition at line 568 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

568  {
569  if (item.modItem != null && !item.modItem.ConsumeAmmo(player) ||
570  ammo.modItem != null && !ammo.modItem.ConsumeAmmo(player))
571  return false;
572 
573  foreach (var g in HookConsumeAmmo.arr) {
574  if (!g.Instance(item).ConsumeAmmo(item, player) ||
575  !g.Instance(ammo).ConsumeAmmo(ammo, player))
576  return false;
577  }
578 
579  return true;
580  }
static HookList HookConsumeAmmo
Definition: ItemLoader.cs:562
static bool Terraria.ModLoader.ItemLoader.ConsumeItem ( Item  item,
Player  player 
)
static

If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to false.

Definition at line 779 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

779  {
780  if (item.IsAir) return true;
781  if (item.modItem != null && !item.modItem.ConsumeItem(player))
782  return false;
783 
784  foreach (var g in HookConsumeItem.arr)
785  if (!g.Instance(item).ConsumeItem(item, player))
786  return false;
787 
788  OnConsumeItem(item, player);
789  return true;
790  }
static void OnConsumeItem(Item item, Player player)
Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.
Definition: ItemLoader.cs:796
static HookList HookConsumeItem
Definition: ItemLoader.cs:773
delegate void Terraria.ModLoader.ItemLoader.DelegateAnglerChat ( int  type,
ref string  chat,
ref string  catchLocation 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateArmorArmGlowMask ( int  slot,
Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateCaughtFishStack ( int  type,
ref int  stack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHair ( int  body,
ref bool  drawHair,
ref bool  drawAltHair 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateDrawHands ( int  body,
ref bool  drawHands,
ref bool  drawArms 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateExtractinatorUse ( int  extractType,
ref int  resultType,
ref int  resultStack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealLife ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetHealMana ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponCrit ( Item  item,
Player  player,
ref int  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponDamage ( Item  item,
Player  player,
ref int  damage 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGetWeaponKnockback ( Item  item,
Player  player,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateGrabRange ( Item  item,
Player  player,
ref int  grabRange 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateHorizontalWingSpeeds ( Item  item,
Player  player,
ref float  speed,
ref float  acceleration 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitNPC ( Item  item,
Player  player,
NPC  target,
ref int  damage,
ref float  knockBack,
ref bool  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyHitPvp ( Item  item,
Player  player,
Player  target,
ref int  damage,
ref bool  crit 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateModifyWeaponDamageOld ( Item  item,
Player  player,
ref float  add,
ref float  mult 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateOldPickAmmo ( Item  item,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePickAmmo ( Item  weapon,
Item  ammo,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegatePostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
ref float  rotation,
ref float  scale,
int  whoAmI 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegatePreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegateReforgePrice ( Item  item,
ref int  reforgePrice,
ref bool  canApplyDiscount 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateSetMatch ( int  armorSlot,
int  type,
bool  male,
ref int  equipSlot,
ref bool  robes 
)
private
delegate bool Terraria.ModLoader.ItemLoader.DelegateShoot ( Item  item,
Player  player,
ref Vector2  position,
ref float  speedX,
ref float  speedY,
ref int  type,
ref int  damage,
ref float  knockBack 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateUpdate ( Item  item,
ref float  gravity,
ref float  maxFallSpeed 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateUseItemHitbox ( Item  item,
Player  player,
ref Rectangle  hitbox,
ref bool  noHitbox 
)
private
delegate void Terraria.ModLoader.ItemLoader.DelegateVerticalWingSpeeds ( Item  item,
Player  player,
ref float  ascentWhenFalling,
ref float  ascentWhenRising,
ref float  maxCanAscendMultiplier,
ref float  maxAscentMultiplier,
ref float  constantAscend 
)
private
static void Terraria.ModLoader.ItemLoader.DrawArmorColor ( EquipType  type,
int  slot,
Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
static

Calls the item's equipment texture's DrawArmorColor hook, then all GlobalItem.DrawArmorColor hooks.

Definition at line 1261 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawArmorColor(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1262  {
1263  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
1264  texture?.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1265 
1266  foreach (var g in HookDrawArmorColor.arr)
1267  g.DrawArmorColor(type, slot, drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
1268  }
static HookList HookDrawArmorColor
Definition: ItemLoader.cs:1257

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.DrawBody ( Player  player)
static

Calls the item's body equipment texture's DrawBody hook, then all GlobalItem.DrawBody hooks, until one of them returns false. Returns true if none of them return false.

Definition at line 1224 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawBody(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1224  {
1225  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1226  if (texture != null && !texture.DrawBody())
1227  return false;
1228 
1229  foreach (var g in HookDrawBody.arr)
1230  if (!g.DrawBody(player.body))
1231  return false;
1232 
1233  return true;
1234  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6
static HookList HookDrawBody
Definition: ItemLoader.cs:1220

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.DrawHair ( Player  player,
ref bool  drawHair,
ref bool  drawAltHair 
)
static

Calls the item's head equipment texture's DrawHair hook, then all GlobalItem.DrawHair hooks.

Definition at line 1193 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawHair(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1193  {
1194  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1195  texture?.DrawHair(ref drawHair, ref drawAltHair);
1196 
1197  foreach (var g in HookDrawHair.arr)
1198  g.DrawHair(player.body, ref drawHair, ref drawAltHair);
1199  }
static HookList HookDrawHair
Definition: ItemLoader.cs:1185
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.DrawHands ( Player  player,
ref bool  drawHands,
ref bool  drawArms 
)
static

Calls the item's body equipment texture's DrawHands hook, then all GlobalItem.DrawHands hooks.

Definition at line 1176 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawHands(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1176  {
1177  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
1178  texture?.DrawHands(ref drawHands, ref drawArms);
1179 
1180  foreach (var g in HookDrawHands.arr)
1181  g.DrawHands(player.body, ref drawHands, ref drawArms);
1182  }
static HookList HookDrawHands
Definition: ItemLoader.cs:1172
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.DrawHead ( Player  player)
static

Calls the item's head equipment texture's DrawHead hook, then all GlobalItem.DrawHead hooks, until one of them returns false. Returns true if none of them return false.

Definition at line 1208 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawHead(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1208  {
1209  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
1210  if (texture != null && !texture.DrawHead())
1211  return false;
1212 
1213  foreach (var g in HookDrawHead.arr)
1214  if (!g.DrawHead(player.head))
1215  return false;
1216 
1217  return true;
1218  }
static HookList HookDrawHead
Definition: ItemLoader.cs:1201
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.DrawLegs ( Player  player)
static

Calls the item's leg equipment texture's DrawLegs hook, then the item's shoe equipment texture's DrawLegs hook, then all GlobalItem.DrawLegs hooks, until one of them returns false. Returns true if none of them return false.

Definition at line 1240 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipTexture.DrawLegs(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

1240  {
1241  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
1242  if (texture != null && !texture.DrawLegs())
1243  return false;
1244 
1245  texture = EquipLoader.GetEquipTexture(EquipType.Shoes, player.shoe);
1246  if (texture != null && !texture.DrawLegs())
1247  return false;
1248 
1249  foreach (var g in HookDrawLegs.arr)
1250  if (!g.DrawLegs(player.legs, player.shoe))
1251  return false;
1252 
1253  return true;
1254  }
static HookList HookDrawLegs
Definition: ItemLoader.cs:1236
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.ExtractinatorUse ( ref int  resultType,
ref int  resultStack,
int  extractType 
)
static

Definition at line 1618 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1618  {
1619  GetItem(extractType)?.ExtractinatorUse(ref resultType, ref resultStack);
1620 
1621  foreach (var g in HookExtractinatorUse.arr)
1622  g.ExtractinatorUse(extractType, ref resultType, ref resultStack);
1623  }
static ModItem GetItem(int type)
Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the...
Definition: ItemLoader.cs:76
virtual void ExtractinatorUse(ref int resultType, ref int resultStack)
Allows you to modify what item, and in what quantity, is obtained when this item is fed into the Extr...
Definition: ModItem.cs:956
static HookList HookExtractinatorUse
Definition: ItemLoader.cs:1617
static void Terraria.ModLoader.ItemLoader.FindVanillaWings ( )
staticprivate

Definition at line 52 of file ItemLoader.cs.

References Terraria.ModLoader.ModNet.AllowVanillaClients, and Terraria.ModLoader.Item.

52  {
53  if (vanillaWings[1] != 0)
54  return;
55 
56  Item item = new Item();
57  for (int k = 0; k < ItemID.Count; k++) {
58  item.SetDefaults(k);
59  if (item.wingSlot > 0) {
60  vanillaWings[item.wingSlot] = k;
61  }
62  }
63  }
static bool Terraria.ModLoader.ItemLoader.GeneralPrefix ( Item  item)
staticprivate

Definition at line 173 of file ItemLoader.cs.

References Terraria.ModLoader.Item.

173  {
174  return item.maxStack == 1 && item.damage > 0 && item.ammo == 0 && !item.accessory;
175  }
static Color Terraria.ModLoader.ItemLoader.GetAlpha ( Item  item,
Color  lightColor 
)
static

Calls all GlobalItem.GetAlpha hooks then ModItem.GetAlpha, until one of them returns a color, and returns that color. Returns null if all of the hooks return null.

Definition at line 1483 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1483  {
1484  if (item.IsAir)
1485  return null;
1486 
1487  foreach (var g in HookGetAlpha.arr) {
1488  Color? color = g.Instance(item).GetAlpha(item, lightColor);
1489  if (color.HasValue)
1490  return color;
1491  }
1492 
1493  return item.modItem?.GetAlpha(lightColor);
1494  }
static HookList HookGetAlpha
Definition: ItemLoader.cs:1475
static void Terraria.ModLoader.ItemLoader.GetHealLife ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
static

Calls ModItem.GetHealLife, then all GlobalItem.GetHealLife hooks.

Definition at line 396 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

396  {
397  if (item.IsAir)
398  return;
399 
400  item.modItem?.GetHealLife(player, quickHeal, ref healValue);
401 
402  foreach (var g in HookGetHealLife.arr)
403  g.Instance(item).GetHealLife(item, player, quickHeal, ref healValue);
404  }
static HookList HookGetHealLife
Definition: ItemLoader.cs:392
static void Terraria.ModLoader.ItemLoader.GetHealMana ( Item  item,
Player  player,
bool  quickHeal,
ref int  healValue 
)
static

Calls ModItem.GetHealMana, then all GlobalItem.GetHealMana hooks.

Definition at line 411 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

411  {
412  if (item.IsAir)
413  return;
414 
415  item.modItem?.GetHealMana(player, quickHeal, ref healValue);
416 
417  foreach (var g in HookGetHealMana.arr)
418  g.Instance(item).GetHealMana(item, player, quickHeal, ref healValue);
419  }
static HookList HookGetHealMana
Definition: ItemLoader.cs:407
static ModItem Terraria.ModLoader.ItemLoader.GetItem ( int  type)
static

Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the given type.

Definition at line 76 of file ItemLoader.cs.

Referenced by Terraria.ModLoader.Mod.AddMusicBox(), and Terraria.ModLoader.ModContent.MusicExists().

76  {
77  return type >= ItemID.Count && type < ItemCount ? items[type - ItemID.Count] : null;
78  }

+ Here is the caller graph for this function:

static void Terraria.ModLoader.ItemLoader.GetWeaponCrit ( Item  item,
Player  player,
ref int  crit 
)
static

Calls ModItem.GetWeaponCrit, then all GlobalItem.GetWeaponCrit hooks.

Definition at line 525 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

525  {
526  if (item.IsAir)
527  return;
528 
529  item.modItem?.GetWeaponCrit(player, ref crit);
530 
531  foreach (var g in HookGetWeaponCrit.arr)
532  g.Instance(item).GetWeaponCrit(item, player, ref crit);
533  }
static HookList HookGetWeaponCrit
Definition: ItemLoader.cs:521
static void Terraria.ModLoader.ItemLoader.GetWeaponDamage ( Item  item,
Player  player,
ref int  damage 
)
static

Calls ModItem.GetWeaponDamage, then all GlobalItem.GetWeaponDamage hooks.

Definition at line 474 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

Referenced by Terraria.ModLoader.CombinedHooks.GetWeaponDamage().

474  {
475  if (item.IsAir)
476  return;
477 
478  item.modItem?.GetWeaponDamage(player, ref damage);
479 
480  foreach (var g in HookGetWeaponDamage.arr)
481  g.Instance(item).GetWeaponDamage(item, player, ref damage);
482  }
static HookList HookGetWeaponDamage
Definition: ItemLoader.cs:469

+ Here is the caller graph for this function:

static void Terraria.ModLoader.ItemLoader.GetWeaponKnockback ( Item  item,
Player  player,
ref float  knockback 
)
static

Calls ModItem.GetWeaponKnockback, then all GlobalItem.GetWeaponKnockback hooks.

Definition at line 509 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

509  {
510  if (item.IsAir)
511  return;
512 
513  item.modItem?.GetWeaponKnockback(player, ref knockback);
514 
515  foreach (var g in HookGetWeaponKnockback.arr)
516  g.Instance(item).GetWeaponKnockback(item, player, ref knockback);
517  }
static HookList HookGetWeaponKnockback
Definition: ItemLoader.cs:505
static Item Terraria.ModLoader.ItemLoader.GetWing ( Player  player)
static

s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified, so no equipped wing can be found to match what the player is using, this creates a new Item object to return.

Definition at line 1286 of file ItemLoader.cs.

References Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.Item, Terraria.ModLoader.ModItem.item, and Terraria.ModLoader.EquipTexture.item.

1286  {
1287  Item item = null;
1288  for (int k = 3; k < 8 + player.extraAccessorySlots; k++) {
1289  if (player.armor[k].wingSlot == player.wingsLogic) {
1290  item = player.armor[k];
1291  }
1292  }
1293  if (item != null) {
1294  return item;
1295  }
1296  if (player.wingsLogic > 0 && player.wingsLogic < Main.maxWings) {
1297  item = new Item();
1298  item.SetDefaults(vanillaWings[player.wingsLogic]);
1299  return item;
1300  }
1301  if (player.wingsLogic >= Main.maxWings) {
1302  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1303  if (texture?.item != null)
1304  return texture.item.item;
1305  }
1306  return null;
1307  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.GrabRange ( Item  item,
Player  player,
ref int  grabRange 
)
static

Calls ModItem.GrabRange, then all GlobalItem.GrabRange hooks.

Definition at line 1418 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1418  {
1419  item.modItem?.GrabRange(player, ref grabRange);
1420 
1421  foreach (var g in HookGrabRange.arr)
1422  g.Instance(item).GrabRange(item, player, ref grabRange);
1423  }
static HookList HookGrabRange
Definition: ItemLoader.cs:1412
static bool Terraria.ModLoader.ItemLoader.GrabStyle ( Item  item,
Player  player 
)
static

Calls all GlobalItem.GrabStyle hooks then ModItem.GrabStyle, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 1431 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1431  {
1432  foreach (var g in HookGrabStyle.arr)
1433  if (g.Instance(item).GrabStyle(item, player))
1434  return true;
1435 
1436  return item.modItem != null && item.modItem.GrabStyle(player);
1437  }
static HookList HookGrabStyle
Definition: ItemLoader.cs:1425
static bool Terraria.ModLoader.ItemLoader.HasMethod ( Type  t,
string  method,
params Type[]  args 
)
staticprivate

Definition at line 1772 of file ItemLoader.cs.

References Terraria.ModLoader.GlobalItem.CloneNewInstances, Terraria.ModLoader.GlobalItem.InstancePerEntity, and Terraria.ModLoader.Item.

1772  {
1773  return t.GetMethod(method, args).DeclaringType != typeof(GlobalItem);
1774  }
static void Terraria.ModLoader.ItemLoader.HoldItem ( Item  item,
Player  player 
)
static

Calls ModItem.HoldItem and all GlobalItem.HoldItem hooks.

Definition at line 355 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

355  {
356  if (item.IsAir)
357  return;
358 
359  item.modItem?.HoldItem(player);
360 
361  foreach (var g in HookHoldItem.arr)
362  g.Instance(item).HoldItem(item, player);
363  }
static HookList HookHoldItem
Definition: ItemLoader.cs:350
static bool Terraria.ModLoader.ItemLoader.HoldItemFrame ( Item  item,
Player  player 
)
static

Calls ModItem.HoldItemFrame, then all GlobalItem.HoldItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 829 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

829  {
830  if (item.IsAir)
831  return false;
832 
833  if (item.modItem != null && item.modItem.HoldItemFrame(player))
834  return true;
835 
836  foreach (var g in HookHoldItemFrame.arr)
837  if (g.Instance(item).HoldItemFrame(item, player))
838  return true;
839 
840  return false;
841  }
static HookList HookHoldItemFrame
Definition: ItemLoader.cs:823
static void Terraria.ModLoader.ItemLoader.HoldoutOffset ( float  gravDir,
int  type,
ref Vector2  offset 
)
static

Definition at line 1562 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ModItem.HoldoutOffset().

1562  {
1563  ModItem modItem = GetItem(type);
1564  if (modItem != null) {
1565  Vector2? modOffset = modItem.HoldoutOffset();
1566  if (modOffset.HasValue) {
1567  offset.X = modOffset.Value.X;
1568  offset.Y += gravDir * modOffset.Value.Y;
1569  }
1570  }
1571  foreach (var g in HookHoldoutOffset.arr) {
1572  Vector2? modOffset = g.HoldoutOffset(type);
1573  if (modOffset.HasValue) {
1574  offset.X = modOffset.Value.X;
1575  offset.Y = Main.itemTexture[type].Height / 2f + gravDir * modOffset.Value.Y;
1576  }
1577  }
1578  }
static ModItem GetItem(int type)
Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the...
Definition: ItemLoader.cs:76
static HookList HookHoldoutOffset
Definition: ItemLoader.cs:1561

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.HoldoutOrigin ( Player  player,
ref Vector2  origin 
)
static

Definition at line 1581 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1581  {
1582  Item item = player.inventory[player.selectedItem];
1583  Vector2 modOrigin = Vector2.Zero;
1584  if (item.modItem != null) {
1585  Vector2? modOrigin2 = item.modItem.HoldoutOrigin();
1586  if (modOrigin2.HasValue) {
1587  modOrigin = modOrigin2.Value;
1588  }
1589  }
1590  foreach (var g in HookHoldoutOrigin.arr) {
1591  Vector2? modOrigin2 = g.Instance(item).HoldoutOrigin(item.type);
1592  if (modOrigin2.HasValue) {
1593  modOrigin = modOrigin2.Value;
1594  }
1595  }
1596  modOrigin.X *= player.direction;
1597  modOrigin.Y *= -player.gravDir;
1598  origin += modOrigin;
1599  }
static HookList HookHoldoutOrigin
Definition: ItemLoader.cs:1580
static void Terraria.ModLoader.ItemLoader.HoldStyle ( Item  item,
Player  player 
)
static

If the player is not holding onto a rope and is not in the middle of using an item, calls ModItem.HoldStyle and all GlobalItem.HoldStyle hooks.

Definition at line 340 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

340  {
341  if (item.IsAir || player.pulley || player.itemAnimation > 0)
342  return;
343 
344  item.modItem?.HoldStyle(player);
345 
346  foreach (var g in HookHoldStyle.arr)
347  g.Instance(item).HoldStyle(item, player);
348  }
static HookList HookHoldStyle
Definition: ItemLoader.cs:335
static void Terraria.ModLoader.ItemLoader.HorizontalWingSpeeds ( Player  player)
static

If the player is using wings, this uses the result of GetWing, and calls ModItem.HorizontalWingSpeeds then all GlobalItem.HorizontalWingSpeeds hooks.

Definition at line 1342 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.EquipTexture.HorizontalWingSpeeds(), and Terraria.ModLoader.Item.

1342  {
1343  Item item = GetWing(player);
1344  if (item == null) {
1345  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1346  texture?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1347  return;
1348  }
1349 
1350  item.modItem?.HorizontalWingSpeeds(player, ref player.accRunSpeed, ref player.runAcceleration);
1351 
1352  foreach (var g in HookHorizontalWingSpeeds.arr)
1353  g.Instance(item).HorizontalWingSpeeds(item, player, ref player.accRunSpeed, ref player.runAcceleration);
1354  }
static Item GetWing(Player player)
s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified...
Definition: ItemLoader.cs:1286
static HookList HookHorizontalWingSpeeds
Definition: ItemLoader.cs:1336
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.IsAnglerQuestAvailable ( int  itemID,
ref bool  notAvailable 
)
static

Definition at line 1648 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ModItem.IsAnglerQuestAvailable().

1648  {
1649  ModItem modItem = GetItem(itemID);
1650  if (modItem != null)
1651  notAvailable |= !modItem.IsAnglerQuestAvailable();
1652 
1653  foreach (var g in HookIsAnglerQuestAvailable.arr)
1654  notAvailable |= !g.IsAnglerQuestAvailable(itemID);
1655  }
static ModItem GetItem(int type)
Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the...
Definition: ItemLoader.cs:76
static HookList HookIsAnglerQuestAvailable
Definition: ItemLoader.cs:1647

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.IsModBossBag ( Item  item)
static

Returns whether ModItem.bossBagNPC is greater than 0. Returns false if item is not a modded item.

Definition at line 1086 of file ItemLoader.cs.

1086  {
1087  return item.modItem != null && item.modItem.BossBagNPC > 0;
1088  }
static bool Terraria.ModLoader.ItemLoader.ItemSpace ( Item  item,
Player  player 
)
static

Definition at line 1467 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1467  {
1468  foreach (var g in HookItemSpace.arr)
1469  if (g.Instance(item).ItemSpace(item, player))
1470  return true;
1471 
1472  return item.modItem?.ItemSpace(player) ?? false;
1473  }
static HookList HookItemSpace
Definition: ItemLoader.cs:1464
static void Terraria.ModLoader.ItemLoader.MeleeEffects ( Item  item,
Player  player,
Rectangle  hitbox 
)
static

Calls ModItem.MeleeEffects and all GlobalItem.MeleeEffects hooks.

Definition at line 649 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

649  {
650  item.modItem?.MeleeEffects(player, hitbox);
651 
652  foreach (var g in HookMeleeEffects.arr)
653  g.Instance(item).MeleeEffects(item, player, hitbox);
654  }
static HookList HookMeleeEffects
Definition: ItemLoader.cs:643
static float Terraria.ModLoader.ItemLoader.MeleeSpeedMultiplier ( Item  item,
Player  player 
)
static

Definition at line 379 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

Referenced by Terraria.ModLoader.PlayerHooks.TotalMeleeSpeedMultiplier().

379  {
380  if (item.IsAir)
381  return 1f;
382 
383  float multiplier = item.modItem?.MeleeSpeedMultiplier(player) ?? 1f;
384 
385  foreach (var g in HookMeleeSpeedMultiplier.arr)
386  multiplier *= g.Instance(item).MeleeSpeedMultiplier(item, player);
387 
388  return multiplier;
389  }
static HookList HookMeleeSpeedMultiplier
Definition: ItemLoader.cs:378

+ Here is the caller graph for this function:

static void Terraria.ModLoader.ItemLoader.ModifyHitNPC ( Item  item,
Player  player,
NPC  target,
ref int  damage,
ref float  knockBack,
ref bool  crit 
)
static

Calls ModItem.ModifyHitNPC, then all GlobalItem.ModifyHitNPC hooks.

Definition at line 693 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

693  {
694  item.modItem?.ModifyHitNPC(player, target, ref damage, ref knockBack, ref crit);
695 
696  foreach (var g in HookModifyHitNPC.arr)
697  g.Instance(item).ModifyHitNPC(item, player, target, ref damage, ref knockBack, ref crit);
698  }
static HookList HookModifyHitNPC
Definition: ItemLoader.cs:687
static void Terraria.ModLoader.ItemLoader.ModifyHitPvp ( Item  item,
Player  player,
Player  target,
ref int  damage,
ref bool  crit 
)
static

Calls ModItem.ModifyHitPvp, then all GlobalItem.ModifyHitPvp hooks.

Definition at line 734 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

734  {
735  item.modItem?.ModifyHitPvp(player, target, ref damage, ref crit);
736 
737  foreach (var g in HookModifyHitPvp.arr)
738  g.Instance(item).ModifyHitPvp(item, player, target, ref damage, ref crit);
739  }
static HookList HookModifyHitPvp
Definition: ItemLoader.cs:728
static void Terraria.ModLoader.ItemLoader.ModifyManaCost ( Item  item,
Player  player,
ref float  reduce,
ref float  mult 
)
static

Calls ModItem.ModifyManaCost, then all GlobalItem.ModifyManaCost hooks.

Definition at line 426 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

Referenced by Terraria.ModLoader.CombinedHooks.ModifyManaCost().

426  {
427  if (item.IsAir)
428  return;
429 
430  item.modItem?.ModifyManaCost(player, ref reduce, ref mult);
431 
432  foreach (var g in HookModifyManaCost.arr) {
433  g.Instance(item).ModifyManaCost(item, player, ref reduce, ref mult);
434  }
435  }
static HookList HookModifyManaCost
Definition: ItemLoader.cs:422

+ Here is the caller graph for this function:

static List<TooltipLine> Terraria.ModLoader.ItemLoader.ModifyTooltips ( Item  item,
ref int  numTooltips,
string[]  names,
ref string[]  text,
ref bool[]  modifier,
ref bool[]  badModifier,
ref int  oneDropLogo,
out Color?[]  overrideColor 
)
static

Definition at line 1717 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.TooltipLine.isModifier, and Terraria.ModLoader.TooltipLine.isModifierBad.

1718  {
1719  List<TooltipLine> tooltips = new List<TooltipLine>();
1720  for (int k = 0; k < numTooltips; k++) {
1721  TooltipLine tooltip = new TooltipLine(names[k], text[k]);
1722  tooltip.isModifier = modifier[k];
1723  tooltip.isModifierBad = badModifier[k];
1724  if (k == oneDropLogo) {
1725  tooltip.oneDropLogo = true;
1726  }
1727  tooltips.Add(tooltip);
1728  }
1729  item.modItem?.ModifyTooltips(tooltips);
1730  foreach (var g in HookModifyTooltips.arr)
1731  g.Instance(item).ModifyTooltips(item, tooltips);
1732 
1733  numTooltips = tooltips.Count;
1734  text = new string[numTooltips];
1735  modifier = new bool[numTooltips];
1736  badModifier = new bool[numTooltips];
1737  oneDropLogo = -1;
1738  overrideColor = new Color?[numTooltips];
1739  for (int k = 0; k < numTooltips; k++) {
1740  text[k] = tooltips[k].text;
1741  modifier[k] = tooltips[k].isModifier;
1742  badModifier[k] = tooltips[k].isModifierBad;
1743  if (tooltips[k].oneDropLogo) {
1744  oneDropLogo = k;
1745  }
1746  overrideColor[k] = tooltips[k].overrideColor;
1747  }
1748 
1749  return tooltips;
1750  }
static HookList HookModifyTooltips
Definition: ItemLoader.cs:1716
static void Terraria.ModLoader.ItemLoader.ModifyWeaponDamage ( Item  item,
Player  player,
ref float  add,
ref float  mult,
ref float  flat 
)
static

Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks.

Definition at line 491 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

Referenced by Terraria.ModLoader.CombinedHooks.ModifyWeaponDamage().

491  {
492  if (item.IsAir)
493  return;
494 
495  item.modItem?.ModifyWeaponDamage(player, ref add, ref mult);
496  item.modItem?.ModifyWeaponDamage(player, ref add, ref mult, ref flat);
497 
498  foreach (var g in HookModifyWeaponDamageOld.arr)
499  g.Instance(item).ModifyWeaponDamage(item, player, ref add, ref mult);
500  foreach (var g in HookModifyWeaponDamage.arr)
501  g.Instance(item).ModifyWeaponDamage(item, player, ref add, ref mult, ref flat);
502  }
static HookList HookModifyWeaponDamageOld
Definition: ItemLoader.cs:485
static HookList HookModifyWeaponDamage
Definition: ItemLoader.cs:487

+ Here is the caller graph for this function:

static bool Terraria.ModLoader.ItemLoader.NeedsModSaving ( Item  item)
static

Definition at line 1753 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.ModNet.GetMod().

1753  {
1754  return item.type != 0 && (item.modItem != null || item.prefix >= PrefixID.Count || HookNeedsSaving.arr.Count(g => g.Instance(item).NeedsSaving(item)) > 0);
1755  }
static HookList HookNeedsSaving
Definition: ItemLoader.cs:1752

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.OnConsumeAmmo ( Item  item,
Item  ammo,
Player  player 
)
static

Calls ModItem.OnConsumeAmmo for the weapon, ModItem.OnConsumeAmmo for the ammo, then each GlobalItem.OnConsumeAmmo hook for the weapon and ammo.

Definition at line 586 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

586  {
587  if (item.IsAir)
588  return;
589 
590  item.modItem?.OnConsumeAmmo(player);
591  ammo.modItem?.OnConsumeAmmo(player);
592 
593  foreach (var g in HookOnConsumeAmmo.arr) {
594  g.Instance(item).OnConsumeAmmo(item, player);
595  g.Instance(ammo).OnConsumeAmmo(ammo, player);
596  }
597  }
static HookList HookOnConsumeAmmo
Definition: ItemLoader.cs:582
static void Terraria.ModLoader.ItemLoader.OnConsumeItem ( Item  item,
Player  player 
)
static

Calls ModItem.OnConsumeItem and all GlobalItem.OnConsumeItem hooks.

Definition at line 796 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

796  {
797  if (item.IsAir)
798  return;
799 
800  item.modItem?.OnConsumeItem(player);
801 
802  foreach (var g in HookOnConsumeItem.arr)
803  g.Instance(item).OnConsumeItem(item, player);
804  }
static HookList HookOnConsumeItem
Definition: ItemLoader.cs:792
static void Terraria.ModLoader.ItemLoader.OnConsumeMana ( Item  item,
Player  player,
int  manaConsumed 
)
static

Calls ModItem.OnConsumeMana, then all GlobalItem.OnConsumeMana hooks.

Definition at line 456 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

Referenced by Terraria.ModLoader.CombinedHooks.OnConsumeMana().

456  {
457  if (item.IsAir)
458  return;
459 
460  item.modItem?.OnConsumeMana(player, manaConsumed);
461 
462  foreach (var g in HookOnConsumeMana.arr) {
463  g.Instance(item).OnConsumeMana(item, player, manaConsumed);
464  }
465  }
static HookList HookOnConsumeMana
Definition: ItemLoader.cs:452

+ Here is the caller graph for this function:

static void Terraria.ModLoader.ItemLoader.OnCraft ( Item  item,
Recipe  recipe 
)
static

Definition at line 1674 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1674  {
1675  item.modItem?.OnCraft(recipe);
1676  foreach (var g in HookOnCraft.arr)
1677  g.Instance(item).OnCraft(item, recipe);
1678  }
static void Terraria.ModLoader.ItemLoader.OnHitNPC ( Item  item,
Player  player,
NPC  target,
int  damage,
float  knockBack,
bool  crit 
)
static

Calls ModItem.OnHitNPC and all GlobalItem.OnHitNPC hooks.

Definition at line 706 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

706  {
707  item.modItem?.OnHitNPC(player, target, damage, knockBack, crit);
708 
709  foreach (var g in HookOnHitNPC.arr)
710  g.Instance(item).OnHitNPC(item, player, target, damage, knockBack, crit);
711  }
static HookList HookOnHitNPC
Definition: ItemLoader.cs:700
static void Terraria.ModLoader.ItemLoader.OnHitPvp ( Item  item,
Player  player,
Player  target,
int  damage,
bool  crit 
)
static

Calls ModItem.OnHitPvp and all GlobalItem.OnHitPvp hooks.

Definition at line 747 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

747  {
748  item.modItem?.OnHitPvp(player, target, damage, crit);
749 
750  foreach (var g in HookOnHitPvp.arr)
751  g.Instance(item).OnHitPvp(item, player, target, damage, crit);
752  }
static HookList HookOnHitPvp
Definition: ItemLoader.cs:741
static void Terraria.ModLoader.ItemLoader.OnMissingMana ( Item  item,
Player  player,
int  neededMana 
)
static

Calls ModItem.OnMissingMana, then all GlobalItem.OnMissingMana hooks.

Definition at line 441 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

Referenced by Terraria.ModLoader.CombinedHooks.OnMissingMana().

441  {
442  if (item.IsAir)
443  return;
444 
445  item.modItem?.OnMissingMana(player, neededMana);
446 
447  foreach (var g in HookOnMissingMana.arr) {
448  g.Instance(item).OnMissingMana(item, player, neededMana);
449  }
450  }
static HookList HookOnMissingMana
Definition: ItemLoader.cs:437

+ Here is the caller graph for this function:

static bool Terraria.ModLoader.ItemLoader.OnPickup ( Item  item,
Player  player 
)
static

Calls all GlobalItem.OnPickup hooks then ModItem.OnPickup, until one of the returns false. Returns true if all of the hooks return true.

Definition at line 1456 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1456  {
1457  foreach (var g in HookOnPickup.arr)
1458  if (!g.Instance(item).OnPickup(item, player))
1459  return false;
1460 
1461  return item.modItem?.OnPickup(player) ?? true;
1462  }
static HookList HookOnPickup
Definition: ItemLoader.cs:1450
static void Terraria.ModLoader.ItemLoader.OpenBossBag ( int  type,
Player  player,
ref int  npc 
)
static

If the item is a modded item and ModItem.bossBagNPC is greater than 0, calls ModItem.OpenBossBag and sets npc to ModItem.bossBagNPC.

Definition at line 1095 of file ItemLoader.cs.

References Terraria.ModLoader.ModItem.BossBagNPC, and Terraria.ModLoader.ModItem.OpenBossBag().

1095  {
1096  ModItem modItem = GetItem(type);
1097  if (modItem != null && modItem.BossBagNPC > 0) {
1098  modItem.OpenBossBag(player);
1099  npc = modItem.BossBagNPC;
1100  }
1101  }
static ModItem GetItem(int type)
Gets the ModItem instance corresponding to the specified type. Returns null if no modded item has the...
Definition: ItemLoader.cs:76

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.OpenVanillaBag ( string  context,
Player  player,
int  arg 
)
static

Calls all GlobalItem.OpenVanillaBag hooks.

Definition at line 1130 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1130  {
1131  foreach (var g in HookOpenVanillaBag.arr)
1132  g.OpenVanillaBag(context, player, arg);
1133  }
static HookList HookOpenVanillaBag
Definition: ItemLoader.cs:1124
static void Terraria.ModLoader.ItemLoader.PickAmmo ( Item  weapon,
Item  ammo,
Player  player,
ref int  type,
ref float  speed,
ref int  damage,
ref float  knockback 
)
static

Calls ModItem.PickAmmo, then all GlobalItem.PickAmmo hooks.

Definition at line 550 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

550  {
551  ammo.modItem?.PickAmmo(weapon, player, ref type, ref speed, ref damage, ref knockback);
552  ammo.modItem?.PickAmmo(player, ref type, ref speed, ref damage, ref knockback); // deprecated
553 
554  foreach (var g in HookPickAmmo.arr) {
555  g.Instance(ammo).PickAmmo(weapon, ammo, player, ref type, ref speed, ref damage, ref knockback);
556  }
557  foreach (var g in HookOldPickAmmo.arr) {
558  g.Instance(ammo).PickAmmo(ammo, player, ref type, ref speed, ref damage, ref knockback); // deprecated
559  }
560  }
static HookList HookOldPickAmmo
Definition: ItemLoader.cs:543
static HookList HookPickAmmo
Definition: ItemLoader.cs:546
static void Terraria.ModLoader.ItemLoader.PostDrawInInventory ( Item  item,
SpriteBatch  spriteBatch,
Vector2  position,
Rectangle  frame,
Color  drawColor,
Color  itemColor,
Vector2  origin,
float  scale 
)
static

Calls ModItem.PostDrawInInventory, then all GlobalItem.PostDrawInInventory hooks.

Definition at line 1553 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1554  {
1555  item.modItem?.PostDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1556 
1557  foreach (var g in HookPostDrawInInventory.arr)
1558  g.Instance(item).PostDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1559  }
static HookList HookPostDrawInInventory
Definition: ItemLoader.cs:1546
static void Terraria.ModLoader.ItemLoader.PostDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
float  rotation,
float  scale,
int  whoAmI 
)
static

Calls ModItem.PostDrawInWorld, then all GlobalItem.PostDrawInWorld hooks.

Definition at line 1520 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1520  {
1521  item.modItem?.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1522 
1523  foreach (var g in HookPostDrawInWorld.arr)
1524  g.Instance(item).PostDrawInWorld(item, spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
1525  }
static HookList HookPostDrawInWorld
Definition: ItemLoader.cs:1514
static void Terraria.ModLoader.ItemLoader.PostDrawTooltip ( Item  item,
ReadOnlyCollection< DrawableTooltipLine lines 
)
static

Definition at line 1692 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1692  {
1693  item.modItem?.PostDrawTooltip(lines);
1694  foreach (var g in HookPostDrawTooltip.arr)
1695  g.Instance(item).PostDrawTooltip(item, lines);
1696  }
static HookList HookPostDrawTooltip
Definition: ItemLoader.cs:1691
static void Terraria.ModLoader.ItemLoader.PostDrawTooltipLine ( Item  item,
DrawableTooltipLine  line 
)
static

Definition at line 1710 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1710  {
1711  item.modItem?.PostDrawTooltipLine(line);
1712  foreach (var g in HookPostDrawTooltipLine.arr)
1713  g.Instance(item).PostDrawTooltipLine(item, line);
1714  }
static HookList HookPostDrawTooltipLine
Definition: ItemLoader.cs:1709
static void Terraria.ModLoader.ItemLoader.PostReforge ( Item  item)
static

Calls ModItem.PostReforge, then all GlobalItem.PostReforge hooks.

Definition at line 1165 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1165  {
1166  item.modItem?.PostReforge();
1167  foreach (var g in HookPostReforge.arr)
1168  g.Instance(item).PostReforge(item);
1169  }
static HookList HookPostReforge
Definition: ItemLoader.cs:1161
static void Terraria.ModLoader.ItemLoader.PostUpdate ( Item  item)
static

Calls ModItem.PostUpdate and all GlobalItem.PostUpdate hooks.

Definition at line 1404 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1404  {
1405  item.modItem?.PostUpdate();
1406 
1407  foreach (var g in HookPostUpdate.arr)
1408  g.Instance(item).PostUpdate(item);
1409  }
static HookList HookPostUpdate
Definition: ItemLoader.cs:1400
static bool Terraria.ModLoader.ItemLoader.PreDrawInInventory ( Item  item,
SpriteBatch  spriteBatch,
Vector2  position,
Rectangle  frame,
Color  drawColor,
Color  itemColor,
Vector2  origin,
float  scale 
)
static

Returns the "and" operator on the results of all GlobalItem.PreDrawInInventory hooks and ModItem.PreDrawInInventory.

Definition at line 1534 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1535  {
1536  bool flag = true;
1537  foreach (var g in HookPreDrawInInventory.arr)
1538  flag &= g.Instance(item).PreDrawInInventory(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1539 
1540  if (item.modItem != null)
1541  flag &= item.modItem.PreDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
1542 
1543  return flag;
1544  }
static HookList HookPreDrawInInventory
Definition: ItemLoader.cs:1527
static bool Terraria.ModLoader.ItemLoader.PreDrawInWorld ( Item  item,
SpriteBatch  spriteBatch,
Color  lightColor,
Color  alphaColor,
ref float  rotation,
ref float  scale,
int  whoAmI 
)
static

Returns the "and" operator on the results of ModItem.PreDrawInWorld and all GlobalItem.PreDrawInWorld hooks.

Definition at line 1503 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1503  {
1504  bool flag = true;
1505  if (item.modItem != null)
1506  flag &= item.modItem.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1507 
1508  foreach (var g in HookPreDrawInWorld.arr)
1509  flag &= g.Instance(item).PreDrawInWorld(item, spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
1510 
1511  return flag;
1512  }
static HookList HookPreDrawInWorld
Definition: ItemLoader.cs:1497
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltip ( Item  item,
ReadOnlyCollection< TooltipLine lines,
ref int  x,
ref int  y 
)
static

Definition at line 1682 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1682  {
1683  bool modItemPreDraw = item.modItem?.PreDrawTooltip(lines, ref x, ref y) ?? true;
1684  List<bool> globalItemPreDraw = new List<bool>();
1685  foreach (var g in HookPreDrawTooltip.arr)
1686  globalItemPreDraw.Add(g.PreDrawTooltip(item, lines, ref x, ref y));
1687  return modItemPreDraw && globalItemPreDraw.All(z => z);
1688  }
static HookList HookPreDrawTooltip
Definition: ItemLoader.cs:1681
static bool Terraria.ModLoader.ItemLoader.PreDrawTooltipLine ( Item  item,
DrawableTooltipLine  line,
ref int  yOffset 
)
static

Definition at line 1700 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

1700  {
1701  bool modItemPreDrawLine = item.modItem?.PreDrawTooltipLine(line, ref yOffset) ?? true;
1702  List<bool> globalItemPreDrawLine = new List<bool>();
1703  foreach (var g in HookPreDrawTooltipLine.arr)
1704  globalItemPreDrawLine.Add(g.PreDrawTooltipLine(item, line, ref yOffset));
1705  return modItemPreDrawLine && globalItemPreDrawLine.All(x => x);
1706  }
static HookList HookPreDrawTooltipLine
Definition: ItemLoader.cs:1699
static bool Terraria.ModLoader.ItemLoader.PrefixChance ( Item  item,
int  pre,
UnifiedRandom  rand 
)
static

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

Definition at line 272 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

272  {
273  bool? result = null;
274  foreach (var g in HookPrefixChance.arr) {
275  bool? r = g.Instance(item).PrefixChance(item, pre, rand);
276  if (r.HasValue)
277  result = r.Value && (result ?? true);
278  }
279  if (item.modItem != null) {
280  bool? r = item.modItem.PrefixChance(pre, rand);
281  if (r.HasValue)
282  result = r.Value && (result ?? true);
283  }
284  return result;
285  }
static HookList HookPrefixChance
Definition: ItemLoader.cs:265
static bool Terraria.ModLoader.ItemLoader.PreOpenVanillaBag ( string  context,
Player  player,
int  arg 
)
static

Calls each GlobalItem.PreOpenVanillaBag hook until one of them returns false. Returns true if all of them returned true.

Definition at line 1111 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.NPCLoader.blockLoot.

1111  {
1112  bool result = true;
1113  foreach (var g in HookPreOpenVanillaBag.arr)
1114  result &= g.PreOpenVanillaBag(context, player, arg);
1115 
1116  if (!result) {
1117  NPCLoader.blockLoot.Clear(); // clear blockloot
1118  return false;
1119  }
1120 
1121  return true;
1122  }
static HookList HookPreOpenVanillaBag
Definition: ItemLoader.cs:1103
static bool Terraria.ModLoader.ItemLoader.PreReforge ( Item  item)
static

Calls ModItem.PreReforge, then all GlobalItem.PreReforge hooks.

Definition at line 1154 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1154  {
1155  bool b = item.modItem?.NewPreReforge() ?? true;
1156  foreach (var g in HookPreReforge.arr)
1157  b &= g.Instance(item).NewPreReforge(item);
1158  return b;
1159  }
static HookList HookPreReforge
Definition: ItemLoader.cs:1150
static void Terraria.ModLoader.ItemLoader.PreUpdateVanitySet ( Player  player)
static

If the player's head texture's IsVanitySet returns true, calls the equipment texture's PreUpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.PreUpdateVanitySet, using player.head, player.body, and player.legs.

Definition at line 947 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.EquipTexture.IsVanitySet(), Terraria.ModLoader.GlobalItem.IsVanitySet(), Terraria.ModLoader.EquipTexture.PreUpdateVanitySet(), and Terraria.ModLoader.GlobalItem.PreUpdateVanitySet().

947  {
948  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
949  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
950  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
951  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
952  headTexture.PreUpdateVanitySet(player);
953 
954  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
955  bodyTexture.PreUpdateVanitySet(player);
956 
957  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
958  legTexture.PreUpdateVanitySet(player);
959 
960  foreach (GlobalItem globalItem in HookPreUpdateVanitySet.arr) {
961  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
962  if (!string.IsNullOrEmpty(set))
963  globalItem.PreUpdateVanitySet(player, set);
964  }
965  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6
static HookList HookPreUpdateVanitySet
Definition: ItemLoader.cs:942

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.ReforgePrice ( Item  item,
ref int  reforgePrice,
ref bool  canApplyDiscount 
)
static

Call all ModItem.ReforgePrice, then GlobalItem.ReforgePrice hooks.

Parameters
canApplyDiscount
Returns

Definition at line 1142 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1142  {
1143  bool b = item.modItem?.ReforgePrice(ref reforgePrice, ref canApplyDiscount) ?? true;
1144  foreach (var g in HookReforgePrice.arr)
1145  b &= g.Instance(item).ReforgePrice(item, ref reforgePrice, ref canApplyDiscount);
1146  return b;
1147  }
static HookList HookReforgePrice
Definition: ItemLoader.cs:1136
static void Terraria.ModLoader.ItemLoader.RightClick ( Item  item,
Player  player 
)
static

If Main.mouseRightRelease is true, the following steps are taken:

  1. Call ModItem.RightClick
  2. Calls all GlobalItem.RightClick hooks
  3. Call ItemLoader.ConsumeItem, and if it returns true, decrements the item's stack
  4. Sets the item's type to 0 if the item's stack is 0
  5. Plays the item-grabbing sound
  6. Sets Main.stackSplit to 30
  7. Sets Main.mouseRightRelease to false
  8. Calls Recipe.FindRecipes.

Definition at line 1064 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1064  {
1065  if (!Main.mouseRightRelease)
1066  return;
1067 
1068  item.modItem?.RightClick(player);
1069 
1070  foreach (var g in HookRightClick.arr)
1071  g.Instance(item).RightClick(item, player);
1072 
1073  if (ConsumeItem(item, player) && --item.stack == 0)
1074  item.SetDefaults();
1075 
1076  Main.PlaySound(7);
1077  Main.stackSplit = 30;
1078  Main.mouseRightRelease = false;
1079  Recipe.FindRecipes();
1080  }
static HookList HookRightClick
Definition: ItemLoader.cs:1051
static bool ConsumeItem(Item item, Player player)
If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to fals...
Definition: ItemLoader.cs:779
static void Terraria.ModLoader.ItemLoader.SetMatch ( int  armorSlot,
int  type,
bool  male,
ref int  equipSlot,
ref bool  robes 
)
static

Calls EquipTexture.SetMatch, then all GlobalItem.SetMatch hooks.

Definition at line 1023 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.EquipTexture.SetMatch().

1023  {
1024  EquipTexture texture = EquipLoader.GetEquipTexture((EquipType)armorSlot, type);
1025  texture?.SetMatch(male, ref equipSlot, ref robes);
1026 
1027  foreach (var g in HookSetMatch.arr)
1028  g.SetMatch(armorSlot, type, male, ref equipSlot, ref robes);
1029  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6
static HookList HookSetMatch
Definition: ItemLoader.cs:1019

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.Shoot ( Item  item,
Player  player,
ref Vector2  position,
ref float  speedX,
ref float  speedY,
ref int  type,
ref int  damage,
ref float  knockBack 
)
static

Calls each GlobalItem.Shoot hook, then ModItem.Shoot, until one of them returns false. If all of them return true, returns true.

Parameters
itemThe weapon item.
playerThe player.
positionThe shoot spawn position.
speedXThe speed x calculated from shootSpeed and mouse position.
speedYThe speed y calculated from shootSpeed and mouse position.
typeThe projectile type choosen by ammo and weapon.
damageThe projectile damage.
knockBackThe projectile knock back.
Returns

Definition at line 615 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, and Terraria.ModLoader.Item.

615  {
616  bool result = true;
617 
618  foreach (var g in HookShoot.arr) {
619  result &= g.Instance(item).Shoot(item, player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
620  }
621 
622  if (result && item.modItem != null) {
623  return item.modItem.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
624  }
625 
626  return result;
627  }
static void Terraria.ModLoader.ItemLoader.Update ( Item  item,
ref float  gravity,
ref float  maxFallSpeed 
)
static

Calls ModItem.Update, then all GlobalItem.Update hooks.

Definition at line 1380 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

1380  {
1381  item.modItem?.Update(ref gravity, ref maxFallSpeed);
1382 
1383  foreach (var g in HookUpdate.arr)
1384  g.Instance(item).Update(item, ref gravity, ref maxFallSpeed);
1385  }
static void Terraria.ModLoader.ItemLoader.UpdateAccessory ( Item  item,
Player  player,
bool  hideVisual 
)
static

Calls ModItem.UpdateAccessory and all GlobalItem.UpdateAccessory hooks.

Definition at line 899 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

899  {
900  if (item.IsAir)
901  return;
902 
903  item.modItem?.UpdateAccessory(player, hideVisual);
904 
905  foreach (var g in HookUpdateAccessory.arr)
906  g.Instance(item).UpdateAccessory(item, player, hideVisual);
907  }
static HookList HookUpdateAccessory
Definition: ItemLoader.cs:893
static void Terraria.ModLoader.ItemLoader.UpdateArmorSet ( Player  player,
Item  head,
Item  body,
Item  legs 
)
static

If the head's ModItem.IsArmorSet returns true, calls the head's ModItem.UpdateArmorSet. This is then repeated for the body, then the legs. Then for each GlobalItem, if GlobalItem.IsArmorSet returns a non-empty string, calls GlobalItem.UpdateArmorSet with that string.

Definition at line 925 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.GlobalItem.IsArmorSet(), and Terraria.ModLoader.GlobalItem.UpdateArmorSet().

925  {
926  if (head.modItem != null && head.modItem.IsArmorSet(head, body, legs))
927  head.modItem.UpdateArmorSet(player);
928 
929  if (body.modItem != null && body.modItem.IsArmorSet(head, body, legs))
930  body.modItem.UpdateArmorSet(player);
931 
932  if (legs.modItem != null && legs.modItem.IsArmorSet(head, body, legs))
933  legs.modItem.UpdateArmorSet(player);
934 
935  foreach (GlobalItem globalItem in HookUpdateArmorSet.arr) {
936  string set = globalItem.IsArmorSet(head, body, legs);
937  if (!string.IsNullOrEmpty(set))
938  globalItem.UpdateArmorSet(player, set);
939  }
940  }
static HookList HookUpdateArmorSet
Definition: ItemLoader.cs:920

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.UpdateEquip ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateEquip and all GlobalItem.UpdateEquip hooks.

Definition at line 883 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

883  {
884  if (item.IsAir)
885  return;
886 
887  item.modItem?.UpdateEquip(player);
888 
889  foreach (var g in HookUpdateEquip.arr)
890  g.Instance(item).UpdateEquip(item, player);
891  }
static HookList HookUpdateEquip
Definition: ItemLoader.cs:877
static void Terraria.ModLoader.ItemLoader.UpdateInventory ( Item  item,
Player  player 
)
static

Calls ModItem.UpdateInventory and all GlobalItem.UpdateInventory hooks.

Definition at line 867 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

867  {
868  if (item.IsAir)
869  return;
870 
871  item.modItem?.UpdateInventory(player);
872 
873  foreach (var g in HookUpdateInventory.arr)
874  g.Instance(item).UpdateInventory(item, player);
875  }
static HookList HookUpdateInventory
Definition: ItemLoader.cs:861
static void Terraria.ModLoader.ItemLoader.UpdateVanity ( Player  player)
static

Calls each of the item's equipment texture's UpdateVanity hook.

Definition at line 912 of file ItemLoader.cs.

References Terraria.ModLoader.EquipLoader.EquipTypes, Terraria.ModLoader.EquipLoader.GetEquipTexture(), and Terraria.ModLoader.EquipTexture.UpdateVanity().

912  {
913  foreach (EquipType type in EquipLoader.EquipTypes) {
914  int slot = EquipLoader.GetPlayerEquip(player, type);
915  EquipTexture texture = EquipLoader.GetEquipTexture(type, slot);
916  texture?.UpdateVanity(player, type);
917  }
918  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static void Terraria.ModLoader.ItemLoader.UpdateVanitySet ( Player  player)
static

If the player's head texture's IsVanitySet returns true, calls the equipment texture's UpdateVanitySet. This is then repeated for the player's body, then the legs. Then for each GlobalItem, if GlobalItem.IsVanitySet returns a non-empty string, calls GlobalItem.UpdateVanitySet, using player.head, player.body, and player.legs.

Definition at line 972 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.EquipTexture.IsVanitySet(), Terraria.ModLoader.GlobalItem.IsVanitySet(), Terraria.ModLoader.EquipTexture.UpdateVanitySet(), and Terraria.ModLoader.GlobalItem.UpdateVanitySet().

972  {
973  EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head);
974  EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body);
975  EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs);
976  if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs))
977  headTexture.UpdateVanitySet(player);
978 
979  if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs))
980  bodyTexture.UpdateVanitySet(player);
981 
982  if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs))
983  legTexture.UpdateVanitySet(player);
984 
985  foreach (GlobalItem globalItem in HookUpdateVanitySet.arr) {
986  string set = globalItem.IsVanitySet(player.head, player.body, player.legs);
987  if (!string.IsNullOrEmpty(set))
988  globalItem.UpdateVanitySet(player, set);
989  }
990  }
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6
static HookList HookUpdateVanitySet
Definition: ItemLoader.cs:967

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.UseItem ( Item  item,
Player  player 
)
static

Returns true if any of ModItem.UseItem or GlobalItem.UseItem return true Does not fail fast (calls every hook)

Definition at line 759 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

759  {
760  if (item.IsAir)
761  return false;
762 
763  bool flag = false;
764  if (item.modItem != null)
765  flag |= item.modItem.UseItem(player);
766 
767  foreach (var g in HookUseItem.arr)
768  flag |= g.Instance(item).UseItem(item, player);
769 
770  return flag;
771  }
static HookList HookUseItem
Definition: ItemLoader.cs:754
static bool Terraria.ModLoader.ItemLoader.UseItemFrame ( Item  item,
Player  player 
)
static

Calls ModItem.UseItemFrame, then all GlobalItem.UseItemFrame hooks, until one of them returns true. Returns whether any of the hooks returned true.

Definition at line 812 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

812  {
813  if (item.modItem != null && item.modItem.UseItemFrame(player))
814  return true;
815 
816  foreach (var g in HookUseItemFrame.arr)
817  if (g.Instance(item).UseItemFrame(item, player))
818  return true;
819 
820  return false;
821  }
static HookList HookUseItemFrame
Definition: ItemLoader.cs:806
static void Terraria.ModLoader.ItemLoader.UseItemHitbox ( Item  item,
Player  player,
ref Rectangle  hitbox,
ref bool  noHitbox 
)
static

Calls ModItem.UseItemHitbox, then all GlobalItem.UseItemHitbox hooks.

Definition at line 636 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

636  {
637  item.modItem?.UseItemHitbox(player, ref hitbox, ref noHitbox);
638 
639  foreach (var g in HookUseItemHitbox.arr)
640  g.Instance(item).UseItemHitbox(item, player, ref hitbox, ref noHitbox);
641  }
static HookList HookUseItemHitbox
Definition: ItemLoader.cs:630
static void Terraria.ModLoader.ItemLoader.UseStyle ( Item  item,
Player  player 
)
static

Calls ModItem.UseStyle and all GlobalItem.UseStyle hooks.

Definition at line 325 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

325  {
326  if (item.IsAir)
327  return;
328 
329  item.modItem?.UseStyle(player);
330 
331  foreach (var g in HookUseStyle.arr)
332  g.Instance(item).UseStyle(item, player);
333  }
static HookList HookUseStyle
Definition: ItemLoader.cs:320
static float Terraria.ModLoader.ItemLoader.UseTimeMultiplier ( Item  item,
Player  player 
)
static

Definition at line 366 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr.

Referenced by Terraria.ModLoader.PlayerHooks.TotalUseTimeMultiplier().

366  {
367  if (item.IsAir)
368  return 1f;
369 
370  float multiplier = item.modItem?.UseTimeMultiplier(player) ?? 1f;
371 
372  foreach (var g in HookUseTimeMultiplier.arr)
373  multiplier *= g.Instance(item).UseTimeMultiplier(item, player);
374 
375  return multiplier;
376  }
static HookList HookUseTimeMultiplier
Definition: ItemLoader.cs:365

+ Here is the caller graph for this function:

static void Terraria.ModLoader.ItemLoader.VerticalWingSpeeds ( Player  player,
ref float  ascentWhenFalling,
ref float  ascentWhenRising,
ref float  maxCanAscendMultiplier,
ref float  maxAscentMultiplier,
ref float  constantAscend 
)
static

If the player is using wings, this uses the result of GetWing, and calls ModItem.VerticalWingSpeeds then all GlobalItem.VerticalWingSpeeds hooks.

Definition at line 1316 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.Item, and Terraria.ModLoader.EquipTexture.VerticalWingSpeeds().

1317  {
1318  Item item = GetWing(player);
1319  if (item == null) {
1320  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wingsLogic);
1321  texture?.VerticalWingSpeeds(
1322  player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1323  ref maxAscentMultiplier, ref constantAscend);
1324  return;
1325  }
1326 
1327  item.modItem?.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
1328  ref maxAscentMultiplier, ref constantAscend);
1329 
1330  foreach (var g in HookVerticalWingSpeeds.arr)
1331  g.Instance(item).VerticalWingSpeeds(item, player, ref ascentWhenFalling, ref ascentWhenRising,
1332  ref maxCanAscendMultiplier, ref maxAscentMultiplier, ref constantAscend);
1333  }
static Item GetWing(Player player)
s Returns the wing item that the player is functionally using. If player.wingsLogic has been modified...
Definition: ItemLoader.cs:1286
static HookList HookVerticalWingSpeeds
Definition: ItemLoader.cs:1310
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

static bool Terraria.ModLoader.ItemLoader.WingUpdate ( Player  player,
bool  inUse 
)
static

If wings can be seen on the player, calls the player's wing's equipment texture's WingUpdate and all GlobalItem.WingUpdate hooks.

Definition at line 1360 of file ItemLoader.cs.

References Terraria.ModLoader.ItemLoader.HookList.arr, Terraria.ModLoader.EquipLoader.GetEquipTexture(), Terraria.ModLoader.Item, and Terraria.ModLoader.EquipTexture.WingUpdate().

1360  {
1361  if (player.wings <= 0)
1362  return false;
1363 
1364  EquipTexture texture = EquipLoader.GetEquipTexture(EquipType.Wings, player.wings);
1365  bool? retVal = texture?.WingUpdate(player, inUse);
1366 
1367  foreach (var g in HookWingUpdate.arr)
1368  retVal |= g.WingUpdate(player.wings, player, inUse);
1369 
1370  return retVal ?? false;
1371  }
static HookList HookWingUpdate
Definition: ItemLoader.cs:1356
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6

+ Here is the call graph for this function:

Member Data Documentation

HookList Terraria.ModLoader.ItemLoader.HookAllowPrefix = AddHook<Func<Item, int, bool>>(g => g.AllowPrefix)
staticprivate

Definition at line 287 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookAltFunctionUse = AddHook<Func<Item, Player, bool>>(g => g.AltFunctionUse)
staticprivate

Definition at line 843 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookAnglerChat = AddHook<DelegateAnglerChat>(g => g.AnglerChat)
staticprivate

Definition at line 1658 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookArmorArmGlowMask = AddHook<DelegateArmorArmGlowMask>(g => g.ArmorArmGlowMask)
staticprivate

Definition at line 1271 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookArmorSetShadows = AddHook<Action<Player, string>>(g => g.ArmorSetShadows)
staticprivate

Definition at line 992 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanBurnInLava = AddHook<Func<Item, bool>>(g => g.CanBurnInLava)
staticprivate

Definition at line 1387 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanEquipAccessory = AddHook<Func<Item, Player, int, bool>>(g => g.CanEquipAccessory)
staticprivate

Definition at line 1601 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanHitNPC = AddHook<Func<Item, Player, NPC, bool?>>(g => g.CanHitNPC)
staticprivate

Definition at line 656 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanHitPvp = AddHook<Func<Item, Player, Player, bool>>(g => g.CanHitPvp)
staticprivate

Definition at line 713 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanPickup = AddHook<Func<Item, Player, bool>>(g => g.CanPickup)
staticprivate

Definition at line 1439 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanRightClick = AddHook<Func<Item, bool>>(g => g.CanRightClick)
staticprivate

Definition at line 1031 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCanUseItem = AddHook<Func<Item, Player, bool>>(g => g.CanUseItem)
staticprivate

Definition at line 299 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookCaughtFishStack = AddHook<DelegateCaughtFishStack>(g => g.CaughtFishStack)
staticprivate

Definition at line 1639 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookChoosePrefix = AddHook<Func<Item, UnifiedRandom, int>>(g => g.ChoosePrefix)
staticprivate

Definition at line 247 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookConsumeAmmo = AddHook<Func<Item, Player, bool>>(g => g.ConsumeAmmo)
staticprivate

Definition at line 562 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookConsumeItem = AddHook<Func<Item, Player, bool>>(g => g.ConsumeItem)
staticprivate

Definition at line 773 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookDrawArmorColor = AddHook<DelegateDrawArmorColor>(g => g.DrawArmorColor)
staticprivate

Definition at line 1257 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookDrawBody = AddHook<Func<int, bool>>(g => g.DrawBody)
staticprivate

Definition at line 1220 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookDrawHair = AddHook<DelegateDrawHair>(g => g.DrawHair)
staticprivate

Definition at line 1185 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookDrawHands = AddHook<DelegateDrawHands>(g => g.DrawHands)
staticprivate

Definition at line 1172 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookDrawHead = AddHook<Func<int, bool>>(g => g.DrawHead)
staticprivate

Definition at line 1201 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookDrawLegs = AddHook<Func<int, int, bool>>(g => g.DrawLegs)
staticprivate

Definition at line 1236 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookExtractinatorUse = AddHook<DelegateExtractinatorUse>(g => g.ExtractinatorUse)
staticprivate

Definition at line 1617 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGetAlpha = AddHook<Func<Item, Color, Color?>>(g => g.GetAlpha)
staticprivate

Definition at line 1475 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGetHealLife = AddHook<DelegateGetHealLife>(g => g.GetHealLife)
staticprivate

Definition at line 392 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGetHealMana = AddHook<DelegateGetHealMana>(g => g.GetHealMana)
staticprivate

Definition at line 407 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(g => g.GetWeaponCrit)
staticprivate

Definition at line 521 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(g => g.GetWeaponDamage)
staticprivate

Definition at line 469 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(g => g.GetWeaponKnockback)
staticprivate

Definition at line 505 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGrabRange = AddHook<DelegateGrabRange>(g => g.GrabRange)
staticprivate

Definition at line 1412 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookGrabStyle = AddHook<Func<Item, Player, bool>>(g => g.GrabStyle)
staticprivate

Definition at line 1425 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookHoldItem = AddHook<Action<Item, Player>>(g => g.HoldItem)
staticprivate

Definition at line 350 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookHoldItemFrame = AddHook<Func<Item, Player, bool>>(g => g.HoldItemFrame)
staticprivate

Definition at line 823 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookHoldoutOffset = AddHook<Func<int, Vector2?>>(g => g.HoldoutOffset)
staticprivate

Definition at line 1561 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookHoldoutOrigin = AddHook<Func<int, Vector2?>>(g => g.HoldoutOrigin)
staticprivate

Definition at line 1580 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookHoldStyle = AddHook<Action<Item, Player>>(g => g.HoldStyle)
staticprivate

Definition at line 335 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookHorizontalWingSpeeds = AddHook<DelegateHorizontalWingSpeeds>(g => g.HorizontalWingSpeeds)
staticprivate

Definition at line 1336 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookIsAnglerQuestAvailable = AddHook<Func<int, bool>>(g => g.IsAnglerQuestAvailable)
staticprivate

Definition at line 1647 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookItemSpace = AddHook<Func<Item, Player, bool>>(g => g.ItemSpace)
staticprivate

Definition at line 1464 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookMeleeEffects = AddHook<Action<Item, Player, Rectangle>>(g => g.MeleeEffects)
staticprivate

Definition at line 643 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookMeleeSpeedMultiplier = AddHook<Func<Item, Player, float>>(g => g.MeleeSpeedMultiplier)
staticprivate

Definition at line 378 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(g => g.ModifyHitNPC)
staticprivate

Definition at line 687 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(g => g.ModifyHitPvp)
staticprivate

Definition at line 728 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookModifyManaCost = AddHook<DelegateModifyManaCost>(g => g.ModifyManaCost)
staticprivate

Definition at line 422 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookModifyTooltips = AddHook<Action<Item, List<TooltipLine>>>(g => g.ModifyTooltips)
staticprivate

Definition at line 1716 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
staticprivate

Definition at line 487 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookModifyWeaponDamageOld = AddHook<DelegateModifyWeaponDamage>(g => g.ModifyWeaponDamage)
staticprivate

Definition at line 485 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookNeedsSaving = AddHook<Func<Item, bool>>(g => g.NeedsSaving)
staticprivate

Definition at line 1752 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOldPickAmmo = AddHook<DelegateOldPickAmmo>(g => g.PickAmmo)
staticprivate

Definition at line 543 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnConsumeAmmo = AddHook<Action<Item, Player>>(g => g.OnConsumeAmmo)
staticprivate

Definition at line 582 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnConsumeItem = AddHook<Action<Item, Player>>(g => g.OnConsumeItem)
staticprivate

Definition at line 792 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnConsumeMana = AddHook<Action<Item, Player, int>>(g => g.OnConsumeMana)
staticprivate

Definition at line 452 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnCraft = AddHook<Action<Item, Recipe>>(g => g.OnCraft)
staticprivate

Definition at line 1673 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnHitNPC = AddHook<Action<Item, Player, NPC, int, float, bool>>(g => g.OnHitNPC)
staticprivate

Definition at line 700 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnHitPvp = AddHook<Action<Item, Player, Player, int, bool>>(g => g.OnHitPvp)
staticprivate

Definition at line 741 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnMissingMana = AddHook<Action<Item, Player, int>>(g => g.OnMissingMana)
staticprivate

Definition at line 437 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOnPickup = AddHook<Func<Item, Player, bool>>(g => g.OnPickup)
staticprivate

Definition at line 1450 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookOpenVanillaBag = AddHook<Action<string, Player, int>>(g => g.OpenVanillaBag)
staticprivate

Definition at line 1124 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPickAmmo = AddHook<DelegatePickAmmo>(g => g.PickAmmo)
staticprivate

Definition at line 546 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPostDrawInInventory = AddHook<Action<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float>>(g => g.PostDrawInInventory)
staticprivate

Definition at line 1546 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPostDrawInWorld = AddHook<Action<Item, SpriteBatch, Color, Color, float, float, int>>(g => g.PostDrawInWorld)
staticprivate

Definition at line 1514 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPostDrawTooltip = AddHook<DelegatePostDrawTooltip>(g => g.PostDrawTooltip)
staticprivate

Definition at line 1691 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPostDrawTooltipLine = AddHook<DelegatePostDrawTooltipLine>(g => g.PostDrawTooltipLine)
staticprivate

Definition at line 1709 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPostReforge = AddHook<Action<Item>>(g => g.PostReforge)
staticprivate

Definition at line 1161 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPostUpdate = AddHook<Action<Item>>(g => g.PostUpdate)
staticprivate

Definition at line 1400 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreDrawInInventory = AddHook<Func<Item, SpriteBatch, Vector2, Rectangle, Color, Color, Vector2, float, bool>>(g => g.PreDrawInInventory)
staticprivate

Definition at line 1527 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreDrawInWorld = AddHook<DelegatePreDrawInWorld>(g => g.PreDrawInWorld)
staticprivate

Definition at line 1497 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreDrawTooltip = AddHook<DelegatePreDrawTooltip>(g => g.PreDrawTooltip)
staticprivate

Definition at line 1681 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreDrawTooltipLine = AddHook<DelegatePreDrawTooltipLine>(g => g.PreDrawTooltipLine)
staticprivate

Definition at line 1699 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPrefixChance = AddHook<Func<Item, int, UnifiedRandom, bool?>>(g => g.PrefixChance)
staticprivate

Definition at line 265 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreOpenVanillaBag = AddHook<Func<string, Player, int, bool>>(g => g.PreOpenVanillaBag)
staticprivate

Definition at line 1103 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreReforge = AddHook<Func<Item, bool>>(g => g.NewPreReforge)
staticprivate

Definition at line 1150 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookPreUpdateVanitySet = AddHook<Action<Player, string>>(g => g.PreUpdateVanitySet)
staticprivate

Definition at line 942 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookReforgePrice = AddHook<DelegateReforgePrice>(g => g.ReforgePrice)
staticprivate

Definition at line 1136 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookRightClick = AddHook<Action<Item, Player>>(g => g.RightClick)
staticprivate

Definition at line 1051 of file ItemLoader.cs.

List<HookList> Terraria.ModLoader.ItemLoader.hooks = new List<HookList>()
staticprivate

Definition at line 44 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookSetDefaults = AddHook<Action<Item>>(g => g.SetDefaults)
staticprivate

Definition at line 193 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookSetMatch = AddHook<DelegateSetMatch>(g => g.SetMatch)
staticprivate

Definition at line 1019 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookShoot = AddHook<DelegateShoot>(g => g.Shoot)
staticprivate

Definition at line 600 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUpdate = AddHook<DelegateUpdate>(g => g.Update)
staticprivate

Definition at line 1374 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUpdateAccessory = AddHook<Action<Item, Player, bool>>(g => g.UpdateAccessory)
staticprivate

Definition at line 893 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUpdateArmorSet = AddHook<Action<Player, string>>(g => g.UpdateArmorSet)
staticprivate

Definition at line 920 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUpdateEquip = AddHook<Action<Item, Player>>(g => g.UpdateEquip)
staticprivate

Definition at line 877 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUpdateInventory = AddHook<Action<Item, Player>>(g => g.UpdateInventory)
staticprivate

Definition at line 861 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUpdateVanitySet = AddHook<Action<Player, string>>(g => g.UpdateVanitySet)
staticprivate

Definition at line 967 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUseItem = AddHook<Func<Item, Player, bool>>(g => g.UseItem)
staticprivate

Definition at line 754 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUseItemFrame = AddHook<Func<Item, Player, bool>>(g => g.UseItemFrame)
staticprivate

Definition at line 806 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUseItemHitbox = AddHook<DelegateUseItemHitbox>(g => g.UseItemHitbox)
staticprivate

Definition at line 630 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUseStyle = AddHook<Action<Item, Player>>(g => g.UseStyle)
staticprivate

Definition at line 320 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookUseTimeMultiplier = AddHook<Func<Item, Player, float>>(g => g.UseTimeMultiplier)
staticprivate

Definition at line 365 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookVerticalWingSpeeds = AddHook<DelegateVerticalWingSpeeds>(g => g.VerticalWingSpeeds)
staticprivate

Definition at line 1310 of file ItemLoader.cs.

HookList Terraria.ModLoader.ItemLoader.HookWingUpdate = AddHook<Func<int, Player, bool, bool>>(g => g.WingUpdate)
staticprivate

Definition at line 1356 of file ItemLoader.cs.

int Terraria.ModLoader.ItemLoader.nextItem = ItemID.Count
staticprivate

Definition at line 23 of file ItemLoader.cs.