Terraria ModLoader  0.11.1
A framework for Terraria mods
Terraria.ModLoader.PlayerHooks Class Reference

This is where all ModPlayer hooks are gathered and called. More...

+ Collaboration diagram for Terraria.ModLoader.PlayerHooks:

Classes

class  HookList
 

Static Public Member Functions

static void AnglerQuestReward (Player player, float rareMultiplier, List< Item > rewardItems)
 
static bool CanBeHitByNPC (Player player, NPC npc, ref int cooldownSlot)
 
static bool CanBeHitByProjectile (Player player, Projectile proj)
 
static bool CanBuyItem (Player player, NPC npc, Item[] shopInventory, Item item)
 
static bool CanHitNPC (Player player, Item item, NPC target)
 
static bool CanHitNPCWithProj (Projectile proj, NPC target)
 
static bool CanHitPvp (Player player, Item item, Player target)
 
static bool CanHitPvpWithProj (Projectile proj, Player target)
 
static bool CanSellItem (Player player, NPC npc, Item[] shopInventory, Item item)
 
static void CatchFish (Player player, Item fishingRod, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk)
 
static void clientClone (Player player, Player clientClone)
 
static bool ConsumeAmmo (Player player, Item weapon, Item ammo)
 
static void CopyCustomBiomesTo (Player player, Player other)
 
static bool CustomBiomesMatch (Player player, Player other)
 
static void DrawEffects (PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright)
 
static void FrameEffects (Player player)
 
static List< PlayerHeadLayerGetDrawHeadLayers (Player drawPlayer)
 
static List< PlayerLayerGetDrawLayers (Player drawPlayer)
 
static void GetDyeTraderReward (Player player, List< int > rewardPool)
 
static void GetFishingLevel (Player player, Item fishingRod, Item bait, ref int fishingLevel)
 
static void GetHealLife (Player player, Item item, bool quickHeal, ref int healValue)
 
static void GetHealMana (Player player, Item item, bool quickHeal, ref int healValue)
 
static Texture2D GetMapBackgroundImage (Player player)
 
static void GetWeaponCrit (Player player, Item item, ref int crit)
 
static void GetWeaponDamage (Player player, Item item, ref int damage)
 
static void GetWeaponKnockback (Player player, Item item, ref float knockback)
 
static void Hurt (Player player, bool pvp, bool quiet, double damage, int hitDirection, bool crit)
 
static void Kill (Player player, double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
 
static void MeleeEffects (Player player, Item item, Rectangle hitbox)
 
static float MeleeSpeedMultiplier (Player player, Item item)
 
static void ModifyDrawInfo (ref PlayerDrawInfo drawInfo)
 
static void ModifyHitByNPC (Player player, NPC npc, ref int damage, ref bool crit)
 
static void ModifyHitByProjectile (Player player, Projectile proj, ref int damage, ref bool crit)
 
static void ModifyHitNPC (Player player, Item item, NPC target, ref int damage, ref float knockback, ref bool crit)
 
static void ModifyHitNPCWithProj (Projectile proj, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
 
static void ModifyHitPvp (Player player, Item item, Player target, ref int damage, ref bool crit)
 
static void ModifyHitPvpWithProj (Projectile proj, Player target, ref int damage, ref bool crit)
 
static void ModifyManaCost (Player player, Item item, ref float reduce, ref float mult)
 
static bool ModifyNurseHeal (Player p, NPC npc, ref int health, ref bool removeDebuffs, ref string chat)
 
static void ModifyNursePrice (Player p, NPC npc, int health, bool removeDebuffs, ref int price)
 
static void ModifyScreenPosition (Player player)
 
static void ModifyWeaponDamage (Player player, Item item, ref float add, ref float mult)
 Calls ModItem.HookModifyWeaponDamage, then all GlobalItem.HookModifyWeaponDamage hooks. More...
 
static void ModifyZoom (Player player, ref float zoom)
 
static void NaturalLifeRegen (Player player, ref float regen)
 
static void OnConsumeAmmo (Player player, Item weapon, Item ammo)
 
static void OnConsumeMana (Player player, Item item, int manaConsumed)
 
static void OnEnterWorld (int playerIndex)
 
static void OnHitAnything (Player player, float x, float y, Entity victim)
 
static void OnHitByNPC (Player player, NPC npc, int damage, bool crit)
 
static void OnHitByProjectile (Player player, Projectile proj, int damage, bool crit)
 
static void OnHitNPC (Player player, Item item, NPC target, int damage, float knockback, bool crit)
 
static void OnHitNPCWithProj (Projectile proj, NPC target, int damage, float knockback, bool crit)
 
static void OnHitPvp (Player player, Item item, Player target, int damage, bool crit)
 
static void OnHitPvpWithProj (Projectile proj, Player target, int damage, bool crit)
 
static void OnMissingMana (Player player, Item item, int manaNeeded)
 
static void OnRespawn (Player player)
 
static void PlayerConnect (int playerIndex)
 
static void PlayerDisconnect (int playerIndex)
 
static void PostBuyItem (Player player, NPC npc, Item[] shopInventory, Item item)
 
static void PostHurt (Player player, bool pvp, bool quiet, double damage, int hitDirection, bool crit)
 
static void PostItemCheck (Player player)
 
static void PostNurseHeal (Player player, NPC npc, int health, bool removeDebuffs, int price)
 
static void PostSavePlayer (Player player)
 
static void PostSellItem (Player player, NPC npc, Item[] shopInventory, Item item)
 
static void PostUpdate (Player player)
 
static void PostUpdateBuffs (Player player)
 
static void PostUpdateEquips (Player player)
 
static void PostUpdateMiscEffects (Player player)
 
static void PostUpdateRunSpeeds (Player player)
 
static bool PreHurt (Player player, bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 
static bool PreItemCheck (Player player)
 
static bool PreKill (Player player, double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 
static void PreSavePlayer (Player player)
 
static void PreUpdate (Player player)
 
static void PreUpdateBuffs (Player player)
 
static void PreUpdateMovement (Player player)
 
static void ProcessTriggers (Player player, TriggersSet triggersSet)
 
static void ReceiveCustomBiomes (Player player, BinaryReader reader)
 
static void ResetEffects (Player player)
 
static void SendClientChanges (Player player, Player clientPlayer)
 
static void SendCustomBiomes (Player player, BinaryWriter writer)
 
static void SetControls (Player player)
 
static void SetStartInventory (Player player, IList< Item > items)
 
static void SetStartInventory (Player player)
 
static IList< ItemSetupStartInventory (Player player, bool mediumcoreDeath=false)
 
static bool ShiftClickSlot (Player player, Item[] inventory, int context, int slot)
 
static bool Shoot (Player player, Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 
static void SyncPlayer (Player player, int toWho, int fromWho, bool newPlayer)
 
static float TotalMeleeSpeedMultiplier (Player player, Item item)
 
static int TotalMeleeTime (float useAnimation, Player player, Item item)
 
static int TotalUseTime (float useTime, Player player, Item item)
 
static float TotalUseTimeMultiplier (Player player, Item item)
 
static void UpdateAutopause (Player player)
 
static void UpdateBadLifeRegen (Player player)
 
static void UpdateBiomes (Player player)
 
static void UpdateBiomeVisuals (Player player)
 
static void UpdateDead (Player player)
 
static void UpdateEquips (Player player, ref bool wallSpeedBuff, ref bool tileSpeedBuff, ref bool tileRangeBuff)
 
static void UpdateLifeRegen (Player player)
 
static void UpdateVanityAccessories (Player player)
 
static float UseTimeMultiplier (Player player, Item item)
 

Private Member Functions

delegate bool DelegateCanBeHitByNPC (NPC npc, ref int cooldownSlot)
 
delegate void DelegateCatchFish (Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk)
 
delegate void DelegateDrawEffects (PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright)
 
delegate void DelegateGetFishingLevel (Item fishingRod, Item bait, ref int fishingLevel)
 
delegate void DelegateGetHealLife (Item item, bool quickHeal, ref int healValue)
 
delegate void DelegateGetHealMana (Item item, bool quickHeal, ref int healValue)
 
delegate void DelegateGetWeaponCrit (Item item, ref int crit)
 
delegate void DelegateGetWeaponDamage (Item item, ref int damage)
 
delegate void DelegateGetWeaponKnockback (Item item, ref float knockback)
 
delegate void DelegateModifyDrawInfo (ref PlayerDrawInfo drawInfo)
 
delegate void DelegateModifyHitByNPC (NPC npc, ref int damage, ref bool crit)
 
delegate void DelegateModifyHitByProjectile (Projectile proj, ref int damage, ref bool crit)
 
delegate void DelegateModifyHitNPC (Item item, NPC target, ref int damage, ref float knockback, ref bool crit)
 
delegate void DelegateModifyHitNPCWithProj (Projectile proj, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
 
delegate void DelegateModifyHitPvp (Item item, Player target, ref int damage, ref bool crit)
 
delegate void DelegateModifyHitPvpWithProj (Projectile proj, Player target, ref int damage, ref bool crit)
 
delegate void DelegateModifyManaCost (Item item, ref float reduce, ref float mult)
 
delegate bool DelegateModifyNurseHeal (NPC npc, ref int health, ref bool removeDebuffs, ref string chatText)
 
delegate void DelegateModifyNursePrice (NPC npc, int health, bool removeDebuffs, ref int price)
 
delegate void DelegateModifyWeaponDamage (Item item, ref float add, ref float mult)
 
delegate void DelegateModifyZoom (ref float zoom)
 
delegate void DelegateNaturalLifeRegen (ref float regen)
 
delegate bool DelegatePreHurt (bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 
delegate bool DelegatePreKill (double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 
delegate bool DelegateShoot (Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 
delegate void DelegateUpdateEquips (ref bool wallSpeedBuff, ref bool tileSpeedBuff, ref bool tileRangeBuff)
 

Static Private Member Functions

static HookList AddHook< F > (Expression< Func< ModPlayer, F >> func)
 
static bool HasMethod (Type t, string method, params Type[] args)
 
static bool SendCustomBiomes (ModPlayer modPlayer, BinaryWriter writer)
 

Static Private Attributes

static HookList HookAnglerQuestReward = AddHook<Action<float, List<Item>>>(p => p.AnglerQuestReward)
 
static HookList HookCanBeHitByNPC = AddHook<DelegateCanBeHitByNPC>(p => p.CanBeHitByNPC)
 
static HookList HookCanBeHitByProjectile = AddHook<Func<Projectile, bool>>(p => p.CanBeHitByProjectile)
 
static HookList HookCanBuyItem = AddHook<Func<NPC, Item[], Item, bool>>(p => p.CanBuyItem)
 
static HookList HookCanHitNPC = AddHook<Func<Item, NPC, bool?>>(p => p.CanHitNPC)
 
static HookList HookCanHitNPCWithProj = AddHook<Func<Projectile, NPC, bool?>>(p => p.CanHitNPCWithProj)
 
static HookList HookCanHitPvp = AddHook<Func<Item, Player, bool>>(p => p.CanHitPvp)
 
static HookList HookCanHitPvpWithProj = AddHook<Func<Projectile, Player, bool>>(p => p.CanHitPvpWithProj)
 
static HookList HookCanSellItem = AddHook<Func<NPC, Item[], Item, bool>>(p => p.CanSellItem)
 
static HookList HookCatchFish = AddHook<DelegateCatchFish>(p => p.CatchFish)
 
static HookList HookClientClone = AddHook<Action<ModPlayer>>(p => p.clientClone)
 
static HookList HookConsumeAmmo = AddHook<Func<Item, Item, bool>>(p => p.ConsumeAmmo)
 
static HookList HookCopyCustomBiomesTo = AddHook<Action<Player>>(p => p.CopyCustomBiomesTo)
 
static HookList HookCustomBiomesMatch = AddHook<Func<Player, bool>>(p => p.CustomBiomesMatch)
 
static HookList HookDrawEffects = AddHook<DelegateDrawEffects>(p => p.DrawEffects)
 
static HookList HookFrameEffects = AddHook<Action>(p => p.FrameEffects)
 
static HookList HookGetDyeTraderReward = AddHook<Action<List<int>>>(p => p.GetDyeTraderReward)
 
static HookList HookGetFishingLevel = AddHook<DelegateGetFishingLevel>(p => p.GetFishingLevel)
 
static HookList HookGetHealLife = AddHook<DelegateGetHealLife>(p => p.GetHealLife)
 
static HookList HookGetHealMana = AddHook<DelegateGetHealMana>(p => p.GetHealMana)
 
static HookList HookGetMapBackgroundImage = AddHook<Func<Texture2D>>(p => p.GetMapBackgroundImage)
 
static HookList HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(p => p.GetWeaponCrit)
 
static HookList HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(p => p.GetWeaponDamage)
 
static HookList HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(p => p.GetWeaponKnockback)
 
static HookList HookHurt = AddHook<Action<bool, bool, double, int, bool>>(p => p.Hurt)
 
static HookList HookKill = AddHook<Action<double, int, bool, PlayerDeathReason>>(p => p.Kill)
 
static HookList HookMeleeEffects = AddHook<Action<Item, Rectangle>>(p => p.MeleeEffects)
 
static HookList HookMeleeSpeedMultiplier = AddHook<Func<Item, float>>(p => p.MeleeSpeedMultiplier)
 
static HookList HookModifyDrawHeadLayers = AddHook<Action<List<PlayerHeadLayer>>>(p => p.ModifyDrawHeadLayers)
 
static HookList HookModifyDrawInfo = AddHook<DelegateModifyDrawInfo>(p => p.ModifyDrawInfo)
 
static HookList HookModifyDrawLayers = AddHook<Action<List<PlayerLayer>>>(p => p.ModifyDrawLayers)
 
static HookList HookModifyHitByNPC = AddHook<DelegateModifyHitByNPC>(p => p.ModifyHitByNPC)
 
static HookList HookModifyHitByProjectile = AddHook<DelegateModifyHitByProjectile>(p => p.ModifyHitByProjectile)
 
static HookList HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(p => p.ModifyHitNPC)
 
static HookList HookModifyHitNPCWithProj = AddHook<DelegateModifyHitNPCWithProj>(p => p.ModifyHitNPCWithProj)
 
static HookList HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(p => p.ModifyHitPvp)
 
static HookList HookModifyHitPvpWithProj = AddHook<DelegateModifyHitPvpWithProj>(p => p.ModifyHitPvpWithProj)
 
static HookList HookModifyManaCost = AddHook<DelegateModifyManaCost>(p => p.ModifyManaCost)
 
static HookList HookModifyNurseHeal = AddHook<DelegateModifyNurseHeal>(p => p.ModifyNurseHeal)
 
static HookList HookModifyNursePrice = AddHook<DelegateModifyNursePrice>(p => p.ModifyNursePrice)
 
static HookList HookModifyScreenPosition = AddHook<Action>(p => p.ModifyScreenPosition)
 
static HookList HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(p => p.ModifyWeaponDamage)
 
static HookList HookModifyZoom = AddHook<DelegateModifyZoom>(p => p.ModifyZoom)
 
static HookList HookNaturalLifeRegen = AddHook<DelegateNaturalLifeRegen>(p => p.NaturalLifeRegen)
 
static HookList HookOnConsumeAmmo = AddHook<Action<Item, Item>>(p => p.OnConsumeAmmo)
 
static HookList HookOnConsumeMana = AddHook<Action<Item, int>>(p => p.OnConsumeMana)
 
static HookList HookOnEnterWorld = AddHook<Action<Player>>(p => p.OnEnterWorld)
 
static HookList HookOnHitAnything = AddHook<Action<float, float, Entity>>(p => p.OnHitAnything)
 
static HookList HookOnHitByNPC = AddHook<Action<NPC, int, bool>>(p => p.OnHitByNPC)
 
static HookList HookOnHitByProjectile = AddHook<Action<Projectile, int, bool>>(p => p.OnHitByProjectile)
 
static HookList HookOnHitNPC = AddHook<Action<Item, NPC, int, float, bool>>(p => p.OnHitNPC)
 
static HookList HookOnHitNPCWithProj = AddHook<Action<Projectile, NPC, int, float, bool>>(p => p.OnHitNPCWithProj)
 
static HookList HookOnHitPvp = AddHook<Action<Item, Player, int, bool>>(p => p.OnHitPvp)
 
static HookList HookOnHitPvpWithProj = AddHook<Action<Projectile, Player, int, bool>>(p => p.OnHitPvpWithProj)
 
static HookList HookOnMissingMana = AddHook<Action<Item, int>>(p => p.OnMissingMana)
 
static HookList HookOnRespawn = AddHook<Action<Player>>(p => p.OnRespawn)
 
static HookList HookPlayerConnect = AddHook<Action<Player>>(p => p.PlayerConnect)
 
static HookList HookPlayerDisconnect = AddHook<Action<Player>>(p => p.PlayerDisconnect)
 
static HookList HookPostBuyItem = AddHook<Action<NPC, Item[], Item>>(p => p.PostBuyItem)
 
static HookList HookPostHurt = AddHook<Action<bool, bool, double, int, bool>>(p => p.PostHurt)
 
static HookList HookPostItemCheck = AddHook<Action>(p => p.PostItemCheck)
 
static HookList HookPostNurseHeal = AddHook<Action<NPC, int, bool, int>>(p => p.PostNurseHeal)
 
static HookList HookPostSavePlayer = AddHook<Action>(p => p.PostSavePlayer)
 
static HookList HookPostSellItem = AddHook<Action<NPC, Item[], Item>>(p => p.PostSellItem)
 
static HookList HookPostUpdate = AddHook<Action>(p => p.PostUpdate)
 
static HookList HookPostUpdateBuffs = AddHook<Action>(p => p.PostUpdateBuffs)
 
static HookList HookPostUpdateEquips = AddHook<Action>(p => p.PostUpdateEquips)
 
static HookList HookPostUpdateMiscEffects = AddHook<Action>(p => p.PostUpdateMiscEffects)
 
static HookList HookPostUpdateRunSpeeds = AddHook<Action>(p => p.PostUpdateRunSpeeds)
 
static HookList HookPreHurt = AddHook<DelegatePreHurt>(p => p.PreHurt)
 
static HookList HookPreItemCheck = AddHook<Func<bool>>(p => p.PreItemCheck)
 
static HookList HookPreKill = AddHook<DelegatePreKill>(p => p.PreKill)
 
static HookList HookPreSavePlayer = AddHook<Action>(p => p.PreSavePlayer)
 
static HookList HookPreUpdate = AddHook<Action>(p => p.PreUpdate)
 
static HookList HookPreUpdateBuffs = AddHook<Action>(p => p.PreUpdateBuffs)
 
static HookList HookPreUpdateMovement = AddHook<Action>(p => p.PreUpdateMovement)
 
static HookList HookProcessTriggers = AddHook<Action<TriggersSet>>(p => p.ProcessTriggers)
 
static HookList HookResetEffects = AddHook<Action>(p => p.ResetEffects)
 
static List< HookListhooks = new List<HookList>()
 
static HookList HookSendClientChanges = AddHook<Action<ModPlayer>>(p => p.SendClientChanges)
 
static HookList HookSendCustomBiomes = AddHook<Action<BinaryWriter>>(p => p.SendCustomBiomes)
 
static HookList HookSetControls = AddHook<Action>(p => p.SetControls)
 
static HookList HookSetupStartInventory = AddHook<Action<List<Item>, bool>>(p => p.SetupStartInventory)
 
static HookList HookSetupStartInventoryOld = AddHook<Action<List<Item>>>(p => p.SetupStartInventory)
 
static HookList HookShiftClickSlot = AddHook<Func<Item[], int, int, bool>>(p => p.ShiftClickSlot)
 
static HookList HookShoot = AddHook<DelegateShoot>(p => p.Shoot)
 
static HookList HookSyncPlayer = AddHook<Action<int, int, bool>>(p => p.SyncPlayer)
 
static HookList HookUpdateAutopause = AddHook<Action>(p => p.UpdateAutopause)
 
static HookList HookUpdateBadLifeRegen = AddHook<Action>(p => p.UpdateBadLifeRegen)
 
static HookList HookUpdateBiomes = AddHook<Action>(p => p.UpdateBiomes)
 
static HookList HookUpdateBiomeVisuals = AddHook<Action>(p => p.UpdateBiomeVisuals)
 
static HookList HookUpdateDead = AddHook<Action>(p => p.UpdateDead)
 
static HookList HookUpdateEquips = AddHook<DelegateUpdateEquips>(p => p.UpdateEquips)
 
static HookList HookUpdateLifeRegen = AddHook<Action>(p => p.UpdateLifeRegen)
 
static HookList HookUpdateVanityAccessories = AddHook<Action>(p => p.UpdateVanityAccessories)
 
static HookList HookUseTimeMultiplier = AddHook<Func<Item, float>>(p => p.UseTimeMultiplier)
 
static readonly IDictionary< string, int > indexes = new Dictionary<string, int>()
 
static readonly IDictionary< Type, int > indexesByType = new Dictionary<Type, int>()
 
static readonly IList< ModPlayerplayers = new List<ModPlayer>()
 

Detailed Description

This is where all ModPlayer hooks are gathered and called.

Definition at line 20 of file PlayerHooks.cs.

Member Function Documentation

◆ AddHook< F >()

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

Definition at line 38 of file PlayerHooks.cs.

References Terraria.ModLoader.ModPlayer.mod, Terraria.ModLoader.ModPlayer.Name, and Terraria.ModLoader.Mod.Name.

38  {
39  var hook = new HookList(ModLoader.Method(func));
40  hooks.Add(hook);
41  return hook;
42  }
static List< HookList > hooks
Definition: PlayerHooks.cs:36

◆ AnglerQuestReward()

static void Terraria.ModLoader.PlayerHooks.AnglerQuestReward ( Player  player,
float  rareMultiplier,
List< Item rewardItems 
)
static

Definition at line 954 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

954  {
955  foreach (int index in HookAnglerQuestReward.arr) {
956  player.modPlayers[index].AnglerQuestReward(rareMultiplier, rewardItems);
957  }
958  }
static HookList HookAnglerQuestReward
Definition: PlayerHooks.cs:952

◆ CanBeHitByNPC()

static bool Terraria.ModLoader.PlayerHooks.CanBeHitByNPC ( Player  player,
NPC  npc,
ref int  cooldownSlot 
)
static

Definition at line 873 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

873  {
874  foreach (int index in HookCanBeHitByNPC.arr) {
875  if (!player.modPlayers[index].CanBeHitByNPC(npc, ref cooldownSlot)) {
876  return false;
877  }
878  }
879  return true;
880  }
static HookList HookCanBeHitByNPC
Definition: PlayerHooks.cs:871

◆ CanBeHitByProjectile()

static bool Terraria.ModLoader.PlayerHooks.CanBeHitByProjectile ( Player  player,
Projectile  proj 
)
static

Definition at line 901 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

901  {
902  foreach (int index in HookCanBeHitByProjectile.arr) {
903  if (!player.modPlayers[index].CanBeHitByProjectile(proj)) {
904  return false;
905  }
906  }
907  return true;
908  }
static HookList HookCanBeHitByProjectile
Definition: PlayerHooks.cs:899

◆ CanBuyItem()

static bool Terraria.ModLoader.PlayerHooks.CanBuyItem ( Player  player,
NPC  npc,
Item []  shopInventory,
Item  item 
)
static

Definition at line 1188 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.ModPlayer.CanBuyItem().

1188  {
1189  foreach (int index in HookCanBuyItem.arr) {
1190  if (!player.modPlayers[index].CanBuyItem(npc, shopInventory, item))
1191  return false;
1192  }
1193  return true;
1194  }
+ Here is the call graph for this function:

◆ CanHitNPC()

static bool Terraria.ModLoader.PlayerHooks.CanHitNPC ( Player  player,
Item  item,
NPC  target 
)
static

Definition at line 735 of file PlayerHooks.cs.

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

735  {
736  bool? flag = null;
737  foreach (int index in HookCanHitNPC.arr) {
738  bool? canHit = player.modPlayers[index].CanHitNPC(item, target);
739  if (canHit.HasValue && !canHit.Value) {
740  return false;
741  }
742  if (canHit.HasValue) {
743  flag = canHit.Value;
744  }
745  }
746  return flag;
747  }

◆ CanHitNPCWithProj()

static bool Terraria.ModLoader.PlayerHooks.CanHitNPCWithProj ( Projectile  proj,
NPC  target 
)
static

Definition at line 768 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

768  {
769  if (proj.npcProj || proj.trap) {
770  return null;
771  }
772  Player player = Main.player[proj.owner];
773  bool? flag = null;
774  foreach (int index in HookCanHitNPCWithProj.arr) {
775  bool? canHit = player.modPlayers[index].CanHitNPCWithProj(proj, target);
776  if (canHit.HasValue && !canHit.Value) {
777  return false;
778  }
779  if (canHit.HasValue) {
780  flag = canHit.Value;
781  }
782  }
783  return flag;
784  }
static HookList HookCanHitNPCWithProj
Definition: PlayerHooks.cs:766

◆ CanHitPvp()

static bool Terraria.ModLoader.PlayerHooks.CanHitPvp ( Player  player,
Item  item,
Player  target 
)
static

Definition at line 813 of file PlayerHooks.cs.

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

813  {
814  foreach (int index in HookCanHitPvp.arr) {
815  if (!player.modPlayers[index].CanHitPvp(item, target)) {
816  return false;
817  }
818  }
819  return true;
820  }

◆ CanHitPvpWithProj()

static bool Terraria.ModLoader.PlayerHooks.CanHitPvpWithProj ( Projectile  proj,
Player  target 
)
static

Definition at line 841 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

841  {
842  Player player = Main.player[proj.owner];
843  foreach (int index in HookCanHitPvpWithProj.arr) {
844  if (!player.modPlayers[index].CanHitPvpWithProj(proj, target)) {
845  return false;
846  }
847  }
848  return true;
849  }
static HookList HookCanHitPvpWithProj
Definition: PlayerHooks.cs:839

◆ CanSellItem()

static bool Terraria.ModLoader.PlayerHooks.CanSellItem ( Player  player,
NPC  npc,
Item []  shopInventory,
Item  item 
)
static

Definition at line 1170 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.ModPlayer.CanSellItem().

1170  {
1171  foreach (int index in HookCanSellItem.arr) {
1172  if (!player.modPlayers[index].CanSellItem(npc, shopInventory, item))
1173  return false;
1174  }
1175  return true;
1176  }
+ Here is the call graph for this function:

◆ CatchFish()

static void Terraria.ModLoader.PlayerHooks.CatchFish ( Player  player,
Item  fishingRod,
int  power,
int  liquidType,
int  poolSize,
int  worldLayer,
int  questFish,
ref int  caughtType,
ref bool  junk 
)
static

Definition at line 930 of file PlayerHooks.cs.

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

930  {
931  int i = 0;
932  while (i < 58) {
933  if (player.inventory[i].stack > 0 && player.inventory[i].bait > 0) {
934  break;
935  }
936  i++;
937  }
938  foreach (int index in HookCatchFish.arr) {
939  player.modPlayers[index].CatchFish(fishingRod, player.inventory[i], power, liquidType, poolSize, worldLayer, questFish, ref caughtType, ref junk);
940  }
941  }

◆ clientClone()

static void Terraria.ModLoader.PlayerHooks.clientClone ( Player  player,
Player  clientClone 
)
static

Definition at line 294 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

294  {
295  foreach (int index in HookClientClone.arr) {
296  player.modPlayers[index].clientClone(clientClone.modPlayers[index]);
297  }
298  }
static HookList HookClientClone
Definition: PlayerHooks.cs:292
static void clientClone(Player player, Player clientClone)
Definition: PlayerHooks.cs:294

◆ ConsumeAmmo()

static bool Terraria.ModLoader.PlayerHooks.ConsumeAmmo ( Player  player,
Item  weapon,
Item  ammo 
)
static

Definition at line 689 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

689  {
690  foreach (int index in HookConsumeAmmo.arr) {
691  if (!player.modPlayers[index].ConsumeAmmo(weapon, ammo)) {
692  return false;
693  }
694  }
695  return true;
696  }
static HookList HookConsumeAmmo
Definition: PlayerHooks.cs:687

◆ CopyCustomBiomesTo()

static void Terraria.ModLoader.PlayerHooks.CopyCustomBiomesTo ( Player  player,
Player  other 
)
static

Definition at line 217 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

217  {
218  foreach (int index in HookCopyCustomBiomesTo.arr) {
219  player.modPlayers[index].CopyCustomBiomesTo(other);
220  }
221  }
static HookList HookCopyCustomBiomesTo
Definition: PlayerHooks.cs:215

◆ CustomBiomesMatch()

static bool Terraria.ModLoader.PlayerHooks.CustomBiomesMatch ( Player  player,
Player  other 
)
static

Definition at line 206 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

206  {
207  foreach (int index in HookCustomBiomesMatch.arr) {
208  if (!player.modPlayers[index].CustomBiomesMatch(other)) {
209  return false;
210  }
211  }
212  return true;
213  }
static HookList HookCustomBiomesMatch
Definition: PlayerHooks.cs:204

◆ DelegateCanBeHitByNPC()

delegate bool Terraria.ModLoader.PlayerHooks.DelegateCanBeHitByNPC ( NPC  npc,
ref int  cooldownSlot 
)
private

◆ DelegateCatchFish()

delegate void Terraria.ModLoader.PlayerHooks.DelegateCatchFish ( Item  fishingRod,
Item  bait,
int  power,
int  liquidType,
int  poolSize,
int  worldLayer,
int  questFish,
ref int  caughtType,
ref bool  junk 
)
private

◆ DelegateDrawEffects()

delegate void Terraria.ModLoader.PlayerHooks.DelegateDrawEffects ( PlayerDrawInfo  drawInfo,
ref float  r,
ref float  g,
ref float  b,
ref float  a,
ref bool  fullBright 
)
private

◆ DelegateGetFishingLevel()

delegate void Terraria.ModLoader.PlayerHooks.DelegateGetFishingLevel ( Item  fishingRod,
Item  bait,
ref int  fishingLevel 
)
private

◆ DelegateGetHealLife()

delegate void Terraria.ModLoader.PlayerHooks.DelegateGetHealLife ( Item  item,
bool  quickHeal,
ref int  healValue 
)
private

◆ DelegateGetHealMana()

delegate void Terraria.ModLoader.PlayerHooks.DelegateGetHealMana ( Item  item,
bool  quickHeal,
ref int  healValue 
)
private

◆ DelegateGetWeaponCrit()

delegate void Terraria.ModLoader.PlayerHooks.DelegateGetWeaponCrit ( Item  item,
ref int  crit 
)
private

◆ DelegateGetWeaponDamage()

delegate void Terraria.ModLoader.PlayerHooks.DelegateGetWeaponDamage ( Item  item,
ref int  damage 
)
private

◆ DelegateGetWeaponKnockback()

delegate void Terraria.ModLoader.PlayerHooks.DelegateGetWeaponKnockback ( Item  item,
ref float  knockback 
)
private

◆ DelegateModifyDrawInfo()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyDrawInfo ( ref PlayerDrawInfo  drawInfo)
private

◆ DelegateModifyHitByNPC()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyHitByNPC ( NPC  npc,
ref int  damage,
ref bool  crit 
)
private

◆ DelegateModifyHitByProjectile()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyHitByProjectile ( Projectile  proj,
ref int  damage,
ref bool  crit 
)
private

◆ DelegateModifyHitNPC()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyHitNPC ( Item  item,
NPC  target,
ref int  damage,
ref float  knockback,
ref bool  crit 
)
private

◆ DelegateModifyHitNPCWithProj()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyHitNPCWithProj ( Projectile  proj,
NPC  target,
ref int  damage,
ref float  knockback,
ref bool  crit,
ref int  hitDirection 
)
private

◆ DelegateModifyHitPvp()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyHitPvp ( Item  item,
Player  target,
ref int  damage,
ref bool  crit 
)
private

◆ DelegateModifyHitPvpWithProj()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyHitPvpWithProj ( Projectile  proj,
Player  target,
ref int  damage,
ref bool  crit 
)
private

◆ DelegateModifyManaCost()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyManaCost ( Item  item,
ref float  reduce,
ref float  mult 
)
private

◆ DelegateModifyNurseHeal()

delegate bool Terraria.ModLoader.PlayerHooks.DelegateModifyNurseHeal ( NPC  npc,
ref int  health,
ref bool  removeDebuffs,
ref string  chatText 
)
private

◆ DelegateModifyNursePrice()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyNursePrice ( NPC  npc,
int  health,
bool  removeDebuffs,
ref int  price 
)
private

◆ DelegateModifyWeaponDamage()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyWeaponDamage ( Item  item,
ref float  add,
ref float  mult 
)
private

◆ DelegateModifyZoom()

delegate void Terraria.ModLoader.PlayerHooks.DelegateModifyZoom ( ref float  zoom)
private

◆ DelegateNaturalLifeRegen()

delegate void Terraria.ModLoader.PlayerHooks.DelegateNaturalLifeRegen ( ref float  regen)
private

◆ DelegatePreHurt()

delegate bool Terraria.ModLoader.PlayerHooks.DelegatePreHurt ( bool  pvp,
bool  quiet,
ref int  damage,
ref int  hitDirection,
ref bool  crit,
ref bool  customDamage,
ref bool  playSound,
ref bool  genGore,
ref PlayerDeathReason  damageSource 
)
private

◆ DelegatePreKill()

delegate bool Terraria.ModLoader.PlayerHooks.DelegatePreKill ( double  damage,
int  hitDirection,
bool  pvp,
ref bool  playSound,
ref bool  genGore,
ref PlayerDeathReason  damageSource 
)
private

◆ DelegateShoot()

delegate bool Terraria.ModLoader.PlayerHooks.DelegateShoot ( Item  item,
ref Vector2  position,
ref float  speedX,
ref float  speedY,
ref int  type,
ref int  damage,
ref float  knockBack 
)
private

◆ DelegateUpdateEquips()

delegate void Terraria.ModLoader.PlayerHooks.DelegateUpdateEquips ( ref bool  wallSpeedBuff,
ref bool  tileSpeedBuff,
ref bool  tileRangeBuff 
)
private

◆ DrawEffects()

static void Terraria.ModLoader.PlayerHooks.DrawEffects ( PlayerDrawInfo  drawInfo,
ref float  r,
ref float  g,
ref float  b,
ref float  a,
ref bool  fullBright 
)
static

Definition at line 971 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.PlayerDrawInfo.drawPlayer.

971  {
972  ModPlayer[] modPlayers = drawInfo.drawPlayer.modPlayers;
973  foreach (int index in HookDrawEffects.arr) {
974  modPlayers[index].DrawEffects(drawInfo, ref r, ref g, ref b, ref a, ref fullBright);
975  }
976  }
static HookList HookDrawEffects
Definition: PlayerHooks.cs:969

◆ FrameEffects()

static void Terraria.ModLoader.PlayerHooks.FrameEffects ( Player  player)
static

Definition at line 453 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

453  {
454  foreach (int index in HookFrameEffects.arr) {
455  player.modPlayers[index].FrameEffects();
456  }
457  }
static HookList HookFrameEffects
Definition: PlayerHooks.cs:451

◆ GetDrawHeadLayers()

static List<PlayerHeadLayer> Terraria.ModLoader.PlayerHooks.GetDrawHeadLayers ( Player  drawPlayer)
static

Definition at line 1043 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHeadLayer.AltHair, Terraria.ModLoader.PlayerHeadLayer.Armor, Terraria.ModLoader.PlayerHooks.HookList.arr, Terraria.ModLoader.PlayerHeadLayer.FaceAcc, Terraria.ModLoader.PlayerHeadLayer.Hair, Terraria.ModLoader.PlayerHeadLayer.Head, and Terraria.ModLoader.DrawLayer< InfoType >.visible.

1043  {
1044  List<PlayerHeadLayer> layers = new List<PlayerHeadLayer> {
1045  PlayerHeadLayer.Head,
1046  PlayerHeadLayer.Hair,
1047  PlayerHeadLayer.AltHair,
1048  PlayerHeadLayer.Armor,
1049  PlayerHeadLayer.FaceAcc
1050  };
1051  foreach (PlayerHeadLayer layer in layers) {
1052  layer.visible = true;
1053  }
1054  foreach (int index in HookModifyDrawHeadLayers.arr) {
1055  drawPlayer.modPlayers[index].ModifyDrawHeadLayers(layers);
1056  }
1057  return layers;
1058  }
static HookList HookModifyDrawHeadLayers

◆ GetDrawLayers()

static List<PlayerLayer> Terraria.ModLoader.PlayerHooks.GetDrawLayers ( Player  drawPlayer)
static

Definition at line 990 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerLayer.Arms, Terraria.ModLoader.PlayerHooks.HookList.arr, Terraria.ModLoader.PlayerLayer.BackAcc, Terraria.ModLoader.PlayerLayer.BalloonAcc, Terraria.ModLoader.PlayerLayer.Body, Terraria.ModLoader.PlayerLayer.Face, Terraria.ModLoader.PlayerLayer.FaceAcc, Terraria.ModLoader.PlayerLayer.FrontAcc, Terraria.ModLoader.PlayerLayer.Hair, Terraria.ModLoader.PlayerLayer.HairBack, Terraria.ModLoader.PlayerLayer.HandOffAcc, Terraria.ModLoader.PlayerLayer.HandOnAcc, Terraria.ModLoader.PlayerLayer.Head, Terraria.ModLoader.PlayerLayer.HeldItem, Terraria.ModLoader.PlayerLayer.HeldProjBack, Terraria.ModLoader.PlayerLayer.HeldProjFront, Terraria.ModLoader.PlayerLayer.Legs, Terraria.ModLoader.PlayerLayer.MiscEffectsBack, Terraria.ModLoader.PlayerLayer.MiscEffectsFront, Terraria.ModLoader.PlayerLayer.MountBack, Terraria.ModLoader.PlayerLayer.MountFront, Terraria.ModLoader.PlayerLayer.NeckAcc, Terraria.ModLoader.PlayerLayer.ShieldAcc, Terraria.ModLoader.PlayerLayer.ShoeAcc, Terraria.ModLoader.PlayerLayer.Skin, Terraria.ModLoader.PlayerLayer.SolarShield, Terraria.ModLoader.DrawLayer< InfoType >.visible, Terraria.ModLoader.PlayerLayer.WaistAcc, and Terraria.ModLoader.PlayerLayer.Wings.

990  {
991  List<PlayerLayer> layers = new List<PlayerLayer> {
992  PlayerLayer.HairBack,
993  PlayerLayer.MountBack,
994  PlayerLayer.MiscEffectsBack,
995  PlayerLayer.BackAcc,
996  PlayerLayer.Wings,
997  PlayerLayer.BalloonAcc,
998  PlayerLayer.Skin
999  };
1000  if (drawPlayer.wearsRobe) {
1001  layers.Add(PlayerLayer.ShoeAcc);
1002  layers.Add(PlayerLayer.Legs);
1003  }
1004  else {
1005  layers.Add(PlayerLayer.Legs);
1006  layers.Add(PlayerLayer.ShoeAcc);
1007  }
1008  layers.Add(PlayerLayer.Body);
1009  layers.Add(PlayerLayer.HandOffAcc);
1010  layers.Add(PlayerLayer.WaistAcc);
1011  layers.Add(PlayerLayer.NeckAcc);
1012  layers.Add(PlayerLayer.Face);
1013  layers.Add(PlayerLayer.Hair);
1014  layers.Add(PlayerLayer.Head);
1015  layers.Add(PlayerLayer.FaceAcc);
1016  if (drawPlayer.mount.Cart) {
1017  layers.Add(PlayerLayer.ShieldAcc);
1018  layers.Add(PlayerLayer.MountFront);
1019  }
1020  else {
1021  layers.Add(PlayerLayer.MountFront);
1022  layers.Add(PlayerLayer.ShieldAcc);
1023  }
1024  layers.Add(PlayerLayer.SolarShield);
1025  layers.Add(PlayerLayer.HeldProjBack);
1026  layers.Add(PlayerLayer.HeldItem);
1027  layers.Add(PlayerLayer.Arms);
1028  layers.Add(PlayerLayer.HandOnAcc);
1029  layers.Add(PlayerLayer.HeldProjFront);
1030  layers.Add(PlayerLayer.FrontAcc);
1031  layers.Add(PlayerLayer.MiscEffectsFront);
1032  foreach (PlayerLayer layer in layers) {
1033  layer.visible = true;
1034  }
1035  foreach (int index in HookModifyDrawLayers.arr) {
1036  drawPlayer.modPlayers[index].ModifyDrawLayers(layers);
1037  }
1038  return layers;
1039  }
static HookList HookModifyDrawLayers
Definition: PlayerHooks.cs:988

◆ GetDyeTraderReward()

static void Terraria.ModLoader.PlayerHooks.GetDyeTraderReward ( Player  player,
List< int >  rewardPool 
)
static

Definition at line 962 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

962  {
963  foreach (int index in HookGetDyeTraderReward.arr) {
964  player.modPlayers[index].GetDyeTraderReward(rewardPool);
965  }
966  }
static HookList HookGetDyeTraderReward
Definition: PlayerHooks.cs:960

◆ GetFishingLevel()

static void Terraria.ModLoader.PlayerHooks.GetFishingLevel ( Player  player,
Item  fishingRod,
Item  bait,
ref int  fishingLevel 
)
static

Definition at line 946 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

946  {
947  foreach (int index in HookGetFishingLevel.arr) {
948  player.modPlayers[index].GetFishingLevel(fishingRod, bait, ref fishingLevel);
949  }
950  }
static HookList HookGetFishingLevel
Definition: PlayerHooks.cs:944

◆ GetHealLife()

static void Terraria.ModLoader.PlayerHooks.GetHealLife ( Player  player,
Item  item,
bool  quickHeal,
ref int  healValue 
)
static

Definition at line 575 of file PlayerHooks.cs.

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

575  {
576  if (item.IsAir)
577  return;
578 
579  foreach (int index in HookGetHealLife.arr) {
580  player.modPlayers[index].GetHealLife(item, quickHeal, ref healValue);
581  }
582  }
static HookList HookGetHealLife
Definition: PlayerHooks.cs:573

◆ GetHealMana()

static void Terraria.ModLoader.PlayerHooks.GetHealMana ( Player  player,
Item  item,
bool  quickHeal,
ref int  healValue 
)
static

Definition at line 587 of file PlayerHooks.cs.

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

587  {
588  if (item.IsAir)
589  return;
590 
591  foreach (int index in HookGetHealMana.arr) {
592  player.modPlayers[index].GetHealMana(item, quickHeal, ref healValue);
593  }
594  }
static HookList HookGetHealMana
Definition: PlayerHooks.cs:585

◆ GetMapBackgroundImage()

static Texture2D Terraria.ModLoader.PlayerHooks.GetMapBackgroundImage ( Player  player)
static

Definition at line 318 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

318  {
319  Texture2D texture = null;
320  foreach (int index in HookGetMapBackgroundImage.arr) {
321  texture = player.modPlayers[index].GetMapBackgroundImage();
322  if (texture != null) {
323  return texture;
324  }
325  }
326  return texture;
327  }
static HookList HookGetMapBackgroundImage
Definition: PlayerHooks.cs:316

◆ GetWeaponCrit()

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

Definition at line 680 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

680  {
681  if (item.IsAir) return;
682  foreach (int index in HookGetWeaponCrit.arr) {
683  player.modPlayers[index].GetWeaponCrit(item, ref crit);
684  }
685  }
static HookList HookGetWeaponCrit
Definition: PlayerHooks.cs:678

◆ GetWeaponDamage()

static void Terraria.ModLoader.PlayerHooks.GetWeaponDamage ( Player  player,
Item  item,
ref int  damage 
)
static

Definition at line 634 of file PlayerHooks.cs.

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

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

634  {
635  if (item.IsAir)
636  return;
637 
638  foreach (int index in HookGetWeaponDamage.arr) {
639  player.modPlayers[index].GetWeaponDamage(item, ref damage);
640  }
641  }
static HookList HookGetWeaponDamage
Definition: PlayerHooks.cs:632
+ Here is the caller graph for this function:

◆ GetWeaponKnockback()

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

Definition at line 668 of file PlayerHooks.cs.

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

668  {
669  if (item.IsAir)
670  return;
671 
672  foreach (int index in HookGetWeaponKnockback.arr) {
673  player.modPlayers[index].GetWeaponKnockback(item, ref knockback);
674  }
675  }
static HookList HookGetWeaponKnockback
Definition: PlayerHooks.cs:666

◆ HasMethod()

static bool Terraria.ModLoader.PlayerHooks.HasMethod ( Type  t,
string  method,
params Type []  args 
)
staticprivate

Definition at line 1124 of file PlayerHooks.cs.

1124  {
1125  return t.GetMethod(method, args).DeclaringType != typeof(ModPlayer);
1126  }

◆ Hurt()

static void Terraria.ModLoader.PlayerHooks.Hurt ( Player  player,
bool  pvp,
bool  quiet,
double  damage,
int  hitDirection,
bool  crit 
)
static

Definition at line 477 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

477  {
478  foreach (int index in HookHurt.arr) {
479  player.modPlayers[index].Hurt(pvp, quiet, damage, hitDirection, crit);
480  }
481  }

◆ Kill()

static void Terraria.ModLoader.PlayerHooks.Kill ( Player  player,
double  damage,
int  hitDirection,
bool  pvp,
PlayerDeathReason  damageSource 
)
static

Definition at line 508 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

508  {
509  foreach (int index in HookKill.arr) {
510  player.modPlayers[index].Kill(damage, hitDirection, pvp, damageSource);
511  }
512  }

◆ MeleeEffects()

static void Terraria.ModLoader.PlayerHooks.MeleeEffects ( Player  player,
Item  item,
Rectangle  hitbox 
)
static

Definition at line 719 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

719  {
720  foreach (int index in HookMeleeEffects.arr) {
721  player.modPlayers[index].MeleeEffects(item, hitbox);
722  }
723  }
static HookList HookMeleeEffects
Definition: PlayerHooks.cs:717

◆ MeleeSpeedMultiplier()

static float Terraria.ModLoader.PlayerHooks.MeleeSpeedMultiplier ( Player  player,
Item  item 
)
static

Definition at line 554 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

554  {
555  float multiplier = 1f;
556  if (item.IsAir) return multiplier;
557  foreach (int index in HookMeleeSpeedMultiplier.arr) {
558  multiplier *= player.modPlayers[index].MeleeSpeedMultiplier(item);
559  }
560  return multiplier;
561  }
static HookList HookMeleeSpeedMultiplier
Definition: PlayerHooks.cs:552

◆ ModifyDrawInfo()

static void Terraria.ModLoader.PlayerHooks.ModifyDrawInfo ( ref PlayerDrawInfo  drawInfo)
static

Definition at line 981 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.ModPlayer.ModifyDrawInfo().

981  {
982  ModPlayer[] modPlayers = drawInfo.drawPlayer.modPlayers;
983  foreach (int index in HookModifyDrawInfo.arr) {
984  modPlayers[index].ModifyDrawInfo(ref drawInfo);
985  }
986  }
static HookList HookModifyDrawInfo
Definition: PlayerHooks.cs:979
+ Here is the call graph for this function:

◆ ModifyHitByNPC()

static void Terraria.ModLoader.PlayerHooks.ModifyHitByNPC ( Player  player,
NPC  npc,
ref int  damage,
ref bool  crit 
)
static

Definition at line 885 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

885  {
886  foreach (int index in HookModifyHitByNPC.arr) {
887  player.modPlayers[index].ModifyHitByNPC(npc, ref damage, ref crit);
888  }
889  }
static HookList HookModifyHitByNPC
Definition: PlayerHooks.cs:883

◆ ModifyHitByProjectile()

static void Terraria.ModLoader.PlayerHooks.ModifyHitByProjectile ( Player  player,
Projectile  proj,
ref int  damage,
ref bool  crit 
)
static

Definition at line 913 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

913  {
914  foreach (int index in HookModifyHitByProjectile.arr) {
915  player.modPlayers[index].ModifyHitByProjectile(proj, ref damage, ref crit);
916  }
917  }
static HookList HookModifyHitByProjectile
Definition: PlayerHooks.cs:911

◆ ModifyHitNPC()

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

Definition at line 752 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

752  {
753  foreach (int index in HookModifyHitNPC.arr) {
754  player.modPlayers[index].ModifyHitNPC(item, target, ref damage, ref knockback, ref crit);
755  }
756  }
static HookList HookModifyHitNPC
Definition: PlayerHooks.cs:750

◆ ModifyHitNPCWithProj()

static void Terraria.ModLoader.PlayerHooks.ModifyHitNPCWithProj ( Projectile  proj,
NPC  target,
ref int  damage,
ref float  knockback,
ref bool  crit,
ref int  hitDirection 
)
static

Definition at line 789 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

789  {
790  if (proj.npcProj || proj.trap) {
791  return;
792  }
793  Player player = Main.player[proj.owner];
794  foreach (int index in HookModifyHitNPCWithProj.arr) {
795  player.modPlayers[index].ModifyHitNPCWithProj(proj, target, ref damage, ref knockback, ref crit, ref hitDirection);
796  }
797  }
static HookList HookModifyHitNPCWithProj
Definition: PlayerHooks.cs:787

◆ ModifyHitPvp()

static void Terraria.ModLoader.PlayerHooks.ModifyHitPvp ( Player  player,
Item  item,
Player  target,
ref int  damage,
ref bool  crit 
)
static

Definition at line 825 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

825  {
826  foreach (int index in HookModifyHitPvp.arr) {
827  player.modPlayers[index].ModifyHitPvp(item, target, ref damage, ref crit);
828  }
829  }
static HookList HookModifyHitPvp
Definition: PlayerHooks.cs:823

◆ ModifyHitPvpWithProj()

static void Terraria.ModLoader.PlayerHooks.ModifyHitPvpWithProj ( Projectile  proj,
Player  target,
ref int  damage,
ref bool  crit 
)
static

Definition at line 854 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

854  {
855  Player player = Main.player[proj.owner];
856  foreach (int index in HookModifyHitPvpWithProj.arr) {
857  player.modPlayers[index].ModifyHitPvpWithProj(proj, target, ref damage, ref crit);
858  }
859  }
static HookList HookModifyHitPvpWithProj
Definition: PlayerHooks.cs:852

◆ ModifyManaCost()

static void Terraria.ModLoader.PlayerHooks.ModifyManaCost ( Player  player,
Item  item,
ref float  reduce,
ref float  mult 
)
static

Definition at line 599 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

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

599  {
600  if (item.IsAir)
601  return;
602 
603  foreach (int index in HookModifyManaCost.arr) {
604  player.modPlayers[index].ModifyManaCost(item, ref reduce, ref mult);
605  }
606  }
static HookList HookModifyManaCost
Definition: PlayerHooks.cs:597
+ Here is the caller graph for this function:

◆ ModifyNurseHeal()

static bool Terraria.ModLoader.PlayerHooks.ModifyNurseHeal ( Player  p,
NPC  npc,
ref int  health,
ref bool  removeDebuffs,
ref string  chat 
)
static

Definition at line 1199 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1199  {
1200  foreach (int index in HookModifyNurseHeal.arr) {
1201  if (!p.modPlayers[index].ModifyNurseHeal(npc, ref health, ref removeDebuffs, ref chat))
1202  return false;
1203  }
1204  return true;
1205  }
static HookList HookModifyNurseHeal

◆ ModifyNursePrice()

static void Terraria.ModLoader.PlayerHooks.ModifyNursePrice ( Player  p,
NPC  npc,
int  health,
bool  removeDebuffs,
ref int  price 
)
static

Definition at line 1210 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1210  {
1211  foreach (int index in HookModifyNursePrice.arr) {
1212  p.modPlayers[index].ModifyNursePrice(npc, health, removeDebuffs, ref price);
1213  }
1214  }
static HookList HookModifyNursePrice

◆ ModifyScreenPosition()

static void Terraria.ModLoader.PlayerHooks.ModifyScreenPosition ( Player  player)
static

Definition at line 1062 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1062  {
1063  foreach (int index in HookModifyScreenPosition.arr) {
1064  player.modPlayers[index].ModifyScreenPosition();
1065  }
1066  }
static HookList HookModifyScreenPosition

◆ ModifyWeaponDamage()

static void Terraria.ModLoader.PlayerHooks.ModifyWeaponDamage ( Player  player,
Item  item,
ref float  add,
ref float  mult 
)
static

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

Definition at line 648 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

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

648  {
649  if (item.IsAir)
650  return;
651 
652  foreach (int index in HookModifyWeaponDamage.arr) {
653  player.modPlayers[index].ModifyWeaponDamage(item, ref add, ref mult);
654  }
655  }
static HookList HookModifyWeaponDamage
Definition: PlayerHooks.cs:644
+ Here is the caller graph for this function:

◆ ModifyZoom()

static void Terraria.ModLoader.PlayerHooks.ModifyZoom ( Player  player,
ref float  zoom 
)
static

Definition at line 1071 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1071  {
1072  foreach (int index in HookModifyZoom.arr) {
1073  player.modPlayers[index].ModifyZoom(ref zoom);
1074  }
1075  }

◆ NaturalLifeRegen()

static void Terraria.ModLoader.PlayerHooks.NaturalLifeRegen ( Player  player,
ref float  regen 
)
static

Definition at line 348 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

348  {
349  foreach (int index in HookNaturalLifeRegen.arr) {
350  player.modPlayers[index].NaturalLifeRegen(ref regen);
351  }
352  }
static HookList HookNaturalLifeRegen
Definition: PlayerHooks.cs:346

◆ OnConsumeAmmo()

static void Terraria.ModLoader.PlayerHooks.OnConsumeAmmo ( Player  player,
Item  weapon,
Item  ammo 
)
static

Definition at line 700 of file PlayerHooks.cs.

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

700  {
701  foreach (int index in HookOnConsumeAmmo.arr)
702  player.modPlayers[index].OnConsumeAmmo(weapon, ammo);
703  }
static HookList HookOnConsumeAmmo
Definition: PlayerHooks.cs:698

◆ OnConsumeMana()

static void Terraria.ModLoader.PlayerHooks.OnConsumeMana ( Player  player,
Item  item,
int  manaConsumed 
)
static

Definition at line 621 of file PlayerHooks.cs.

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

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

621  {
622  if (item.IsAir)
623  return;
624 
625  foreach (int index in HookOnConsumeMana.arr) {
626  player.modPlayers[index].OnConsumeMana(item, manaConsumed);
627  }
628  }
static HookList HookOnConsumeMana
Definition: PlayerHooks.cs:619
+ Here is the caller graph for this function:

◆ OnEnterWorld()

static void Terraria.ModLoader.PlayerHooks.OnEnterWorld ( int  playerIndex)
static

Definition at line 1098 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1098  {
1099  var player = Main.player[playerIndex];
1100  foreach (int index in HookOnEnterWorld.arr) {
1101  player.modPlayers[index].OnEnterWorld(player);
1102  }
1103  }
static HookList HookOnEnterWorld

◆ OnHitAnything()

static void Terraria.ModLoader.PlayerHooks.OnHitAnything ( Player  player,
float  x,
float  y,
Entity  victim 
)
static

Definition at line 727 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

727  {
728  foreach (int index in HookOnHitAnything.arr) {
729  player.modPlayers[index].OnHitAnything(x, y, victim);
730  }
731  }
static HookList HookOnHitAnything
Definition: PlayerHooks.cs:725

◆ OnHitByNPC()

static void Terraria.ModLoader.PlayerHooks.OnHitByNPC ( Player  player,
NPC  npc,
int  damage,
bool  crit 
)
static

Definition at line 893 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

893  {
894  foreach (int index in HookOnHitByNPC.arr) {
895  player.modPlayers[index].OnHitByNPC(npc, damage, crit);
896  }
897  }
static HookList HookOnHitByNPC
Definition: PlayerHooks.cs:891

◆ OnHitByProjectile()

static void Terraria.ModLoader.PlayerHooks.OnHitByProjectile ( Player  player,
Projectile  proj,
int  damage,
bool  crit 
)
static

Definition at line 921 of file PlayerHooks.cs.

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

921  {
922  foreach (int index in HookOnHitByProjectile.arr) {
923  player.modPlayers[index].OnHitByProjectile(proj, damage, crit);
924  }
925  }
static HookList HookOnHitByProjectile
Definition: PlayerHooks.cs:919

◆ OnHitNPC()

static void Terraria.ModLoader.PlayerHooks.OnHitNPC ( Player  player,
Item  item,
NPC  target,
int  damage,
float  knockback,
bool  crit 
)
static

Definition at line 760 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

760  {
761  foreach (int index in HookOnHitNPC.arr) {
762  player.modPlayers[index].OnHitNPC(item, target, damage, knockback, crit);
763  }
764  }

◆ OnHitNPCWithProj()

static void Terraria.ModLoader.PlayerHooks.OnHitNPCWithProj ( Projectile  proj,
NPC  target,
int  damage,
float  knockback,
bool  crit 
)
static

Definition at line 801 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

801  {
802  if (proj.npcProj || proj.trap) {
803  return;
804  }
805  Player player = Main.player[proj.owner];
806  foreach (int index in HookOnHitNPCWithProj.arr) {
807  player.modPlayers[index].OnHitNPCWithProj(proj, target, damage, knockback, crit);
808  }
809  }
static HookList HookOnHitNPCWithProj
Definition: PlayerHooks.cs:799

◆ OnHitPvp()

static void Terraria.ModLoader.PlayerHooks.OnHitPvp ( Player  player,
Item  item,
Player  target,
int  damage,
bool  crit 
)
static

Definition at line 833 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

833  {
834  foreach (int index in HookOnHitPvp.arr) {
835  player.modPlayers[index].OnHitPvp(item, target, damage, crit);
836  }
837  }

◆ OnHitPvpWithProj()

static void Terraria.ModLoader.PlayerHooks.OnHitPvpWithProj ( Projectile  proj,
Player  target,
int  damage,
bool  crit 
)
static

Definition at line 863 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

863  {
864  Player player = Main.player[proj.owner];
865  foreach (int index in HookOnHitPvpWithProj.arr) {
866  player.modPlayers[index].OnHitPvpWithProj(proj, target, damage, crit);
867  }
868  }
static HookList HookOnHitPvpWithProj
Definition: PlayerHooks.cs:861

◆ OnMissingMana()

static void Terraria.ModLoader.PlayerHooks.OnMissingMana ( Player  player,
Item  item,
int  manaNeeded 
)
static

Definition at line 610 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

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

610  {
611  if (item.IsAir)
612  return;
613 
614  foreach (int index in HookOnMissingMana.arr) {
615  player.modPlayers[index].OnMissingMana(item, manaNeeded);
616  }
617  }
static HookList HookOnMissingMana
Definition: PlayerHooks.cs:608
+ Here is the caller graph for this function:

◆ OnRespawn()

static void Terraria.ModLoader.PlayerHooks.OnRespawn ( Player  player)
static

Definition at line 1107 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1107  {
1108  foreach (int index in HookOnRespawn.arr) {
1109  player.modPlayers[index].OnRespawn(player);
1110  }
1111  }

◆ PlayerConnect()

static void Terraria.ModLoader.PlayerHooks.PlayerConnect ( int  playerIndex)
static

Definition at line 1079 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1079  {
1080  var player = Main.player[playerIndex];
1081  foreach (int index in HookPlayerConnect.arr) {
1082  player.modPlayers[index].PlayerConnect(player);
1083  }
1084  }
static HookList HookPlayerConnect

◆ PlayerDisconnect()

static void Terraria.ModLoader.PlayerHooks.PlayerDisconnect ( int  playerIndex)
static

Definition at line 1088 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1088  {
1089  var player = Main.player[playerIndex];
1090  foreach (int index in HookPlayerDisconnect.arr) {
1091  player.modPlayers[index].PlayerDisconnect(player);
1092  }
1093  }
static HookList HookPlayerDisconnect

◆ PostBuyItem()

static void Terraria.ModLoader.PlayerHooks.PostBuyItem ( Player  player,
NPC  npc,
Item []  shopInventory,
Item  item 
)
static

Definition at line 1180 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.ModPlayer.PostBuyItem().

1180  {
1181  foreach (int index in HookPostBuyItem.arr) {
1182  player.modPlayers[index].PostBuyItem(npc, shopInventory, item);
1183  }
1184  }
+ Here is the call graph for this function:

◆ PostHurt()

static void Terraria.ModLoader.PlayerHooks.PostHurt ( Player  player,
bool  pvp,
bool  quiet,
double  damage,
int  hitDirection,
bool  crit 
)
static

Definition at line 485 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

485  {
486  foreach (int index in HookPostHurt.arr) {
487  player.modPlayers[index].PostHurt(pvp, quiet, damage, hitDirection, crit);
488  }
489  }

◆ PostItemCheck()

static void Terraria.ModLoader.PlayerHooks.PostItemCheck ( Player  player)
static

Definition at line 527 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

527  {
528  foreach (int index in HookPostItemCheck.arr) {
529  player.modPlayers[index].PostItemCheck();
530  }
531  }
static HookList HookPostItemCheck
Definition: PlayerHooks.cs:525

◆ PostNurseHeal()

static void Terraria.ModLoader.PlayerHooks.PostNurseHeal ( Player  player,
NPC  npc,
int  health,
bool  removeDebuffs,
int  price 
)
static

Definition at line 1218 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.ModPlayer.PostNurseHeal().

1218  {
1219  foreach (int index in HookPostNurseHeal.arr) {
1220  player.modPlayers[index].PostNurseHeal(npc, health, removeDebuffs, price);
1221  }
1222  }
static HookList HookPostNurseHeal
+ Here is the call graph for this function:

◆ PostSavePlayer()

static void Terraria.ModLoader.PlayerHooks.PostSavePlayer ( Player  player)
static

Definition at line 190 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

190  {
191  foreach (int index in HookPostSavePlayer.arr) {
192  player.modPlayers[index].PostSavePlayer();
193  }
194  }
static HookList HookPostSavePlayer
Definition: PlayerHooks.cs:188

◆ PostSellItem()

static void Terraria.ModLoader.PlayerHooks.PostSellItem ( Player  player,
NPC  npc,
Item []  shopInventory,
Item  item 
)
static

Definition at line 1161 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr, and Terraria.ModLoader.ModPlayer.PostSellItem().

1161  {
1162  foreach (int index in HookPostSellItem.arr) {
1163  player.modPlayers[index].PostSellItem(npc, shopInventory, item);
1164  }
1165  }
static HookList HookPostSellItem
+ Here is the call graph for this function:

◆ PostUpdate()

static void Terraria.ModLoader.PlayerHooks.PostUpdate ( Player  player)
static

Definition at line 445 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

445  {
446  foreach (int index in HookPostUpdate.arr) {
447  player.modPlayers[index].PostUpdate();
448  }
449  }
static HookList HookPostUpdate
Definition: PlayerHooks.cs:443

◆ PostUpdateBuffs()

static void Terraria.ModLoader.PlayerHooks.PostUpdateBuffs ( Player  player)
static

Definition at line 388 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

388  {
389  foreach (int index in HookPostUpdateBuffs.arr) {
390  player.modPlayers[index].PostUpdateBuffs();
391  }
392  }
static HookList HookPostUpdateBuffs
Definition: PlayerHooks.cs:386

◆ PostUpdateEquips()

static void Terraria.ModLoader.PlayerHooks.PostUpdateEquips ( Player  player)
static

Definition at line 413 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

413  {
414  foreach (int index in HookPostUpdateEquips.arr) {
415  player.modPlayers[index].PostUpdateEquips();
416  }
417  }
static HookList HookPostUpdateEquips
Definition: PlayerHooks.cs:411

◆ PostUpdateMiscEffects()

static void Terraria.ModLoader.PlayerHooks.PostUpdateMiscEffects ( Player  player)
static

Definition at line 421 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

421  {
422  foreach (int index in HookPostUpdateMiscEffects.arr) {
423  player.modPlayers[index].PostUpdateMiscEffects();
424  }
425  }
static HookList HookPostUpdateMiscEffects
Definition: PlayerHooks.cs:419

◆ PostUpdateRunSpeeds()

static void Terraria.ModLoader.PlayerHooks.PostUpdateRunSpeeds ( Player  player)
static

Definition at line 429 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

429  {
430  foreach (int index in HookPostUpdateRunSpeeds.arr) {
431  player.modPlayers[index].PostUpdateRunSpeeds();
432  }
433  }
static HookList HookPostUpdateRunSpeeds
Definition: PlayerHooks.cs:427

◆ PreHurt()

static bool Terraria.ModLoader.PlayerHooks.PreHurt ( Player  player,
bool  pvp,
bool  quiet,
ref int  damage,
ref int  hitDirection,
ref bool  crit,
ref bool  customDamage,
ref bool  playSound,
ref bool  genGore,
ref PlayerDeathReason  damageSource 
)
static

Definition at line 463 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

464  {
465  bool flag = true;
466  foreach (int index in HookPreHurt.arr) {
467  if (!player.modPlayers[index].PreHurt(pvp, quiet, ref damage, ref hitDirection, ref crit, ref customDamage,
468  ref playSound, ref genGore, ref damageSource)) {
469  flag = false;
470  }
471  }
472  return flag;
473  }

◆ PreItemCheck()

static bool Terraria.ModLoader.PlayerHooks.PreItemCheck ( Player  player)
static

Definition at line 516 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

516  {
517  foreach (int index in HookPreItemCheck.arr) {
518  if (!player.modPlayers[index].PreItemCheck()) {
519  return false;
520  }
521  }
522  return true;
523  }
static HookList HookPreItemCheck
Definition: PlayerHooks.cs:514

◆ PreKill()

static bool Terraria.ModLoader.PlayerHooks.PreKill ( Player  player,
double  damage,
int  hitDirection,
bool  pvp,
ref bool  playSound,
ref bool  genGore,
ref PlayerDeathReason  damageSource 
)
static

Definition at line 495 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

496  {
497  bool flag = true;
498  foreach (int index in HookPreKill.arr) {
499  if (!player.modPlayers[index].PreKill(damage, hitDirection, pvp, ref playSound, ref genGore, ref damageSource)) {
500  flag = false;
501  }
502  }
503  return flag;
504  }

◆ PreSavePlayer()

static void Terraria.ModLoader.PlayerHooks.PreSavePlayer ( Player  player)
static

Definition at line 182 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

182  {
183  foreach (int index in HookPreSavePlayer.arr) {
184  player.modPlayers[index].PreSavePlayer();
185  }
186  }
static HookList HookPreSavePlayer
Definition: PlayerHooks.cs:180

◆ PreUpdate()

static void Terraria.ModLoader.PlayerHooks.PreUpdate ( Player  player)
static

Definition at line 364 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

364  {
365  foreach (int index in HookPreUpdate.arr) {
366  player.modPlayers[index].PreUpdate();
367  }
368  }

◆ PreUpdateBuffs()

static void Terraria.ModLoader.PlayerHooks.PreUpdateBuffs ( Player  player)
static

Definition at line 380 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

380  {
381  foreach (int index in HookPreUpdateBuffs.arr) {
382  player.modPlayers[index].PreUpdateBuffs();
383  }
384  }
static HookList HookPreUpdateBuffs
Definition: PlayerHooks.cs:378

◆ PreUpdateMovement()

static void Terraria.ModLoader.PlayerHooks.PreUpdateMovement ( Player  player)
static

Definition at line 437 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

437  {
438  foreach (int index in HookPreUpdateMovement.arr) {
439  player.modPlayers[index].PreUpdateMovement();
440  }
441  }
static HookList HookPreUpdateMovement
Definition: PlayerHooks.cs:435

◆ ProcessTriggers()

static void Terraria.ModLoader.PlayerHooks.ProcessTriggers ( Player  player,
TriggersSet  triggersSet 
)
static

Definition at line 659 of file PlayerHooks.cs.

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

659  {
660  foreach (int index in HookProcessTriggers.arr) {
661  player.modPlayers[index].ProcessTriggers(triggersSet);
662  }
663  }
static HookList HookProcessTriggers
Definition: PlayerHooks.cs:657

◆ ReceiveCustomBiomes()

static void Terraria.ModLoader.PlayerHooks.ReceiveCustomBiomes ( Player  player,
BinaryReader  reader 
)
static

Definition at line 262 of file PlayerHooks.cs.

References Terraria.ModLoader.ModLoader.GetMod(), and Terraria.ModLoader.ModPlayer.ReceiveCustomBiomes().

262  {
263  int count = reader.ReadUInt16();
264  for (int k = 0; k < count; k++) {
265  string modName = reader.ReadString();
266  string name = reader.ReadString();
267  byte[] data = reader.ReadBytes(reader.ReadByte());
268  Mod mod = ModLoader.GetMod(modName);
269  ModPlayer modPlayer = mod == null ? null : player.GetModPlayer(mod, name);
270  if (modPlayer != null) {
271  using (MemoryStream stream = new MemoryStream(data)) {
272  using (BinaryReader customReader = new BinaryReader(stream)) {
273  try {
274  modPlayer.ReceiveCustomBiomes(customReader);
275  }
276  catch {
277  }
278  }
279  }
280  }
281  }
282  }
+ Here is the call graph for this function:

◆ ResetEffects()

static void Terraria.ModLoader.PlayerHooks.ResetEffects ( Player  player)
static

Definition at line 84 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

84  {
85  foreach (int index in HookResetEffects.arr) {
86  player.modPlayers[index].ResetEffects();
87  }
88  }
static HookList HookResetEffects
Definition: PlayerHooks.cs:82

◆ SendClientChanges()

static void Terraria.ModLoader.PlayerHooks.SendClientChanges ( Player  player,
Player  clientPlayer 
)
static

Definition at line 310 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

310  {
311  foreach (int index in HookSendClientChanges.arr) {
312  player.modPlayers[index].SendClientChanges(clientPlayer.modPlayers[index]);
313  }
314  }
static HookList HookSendClientChanges
Definition: PlayerHooks.cs:308

◆ SendCustomBiomes() [1/2]

static void Terraria.ModLoader.PlayerHooks.SendCustomBiomes ( Player  player,
BinaryWriter  writer 
)
static

Definition at line 225 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

225  {
226  ushort count = 0;
227  byte[] data;
228  using (MemoryStream stream = new MemoryStream()) {
229  using (BinaryWriter customWriter = new BinaryWriter(stream)) {
230  foreach (int index in HookSendCustomBiomes.arr) {
231  if (SendCustomBiomes(player.modPlayers[index], customWriter)) {
232  count++;
233  }
234  }
235  customWriter.Flush();
236  data = stream.ToArray();
237  }
238  }
239  writer.Write(count);
240  writer.Write(data);
241  }
static void SendCustomBiomes(Player player, BinaryWriter writer)
Definition: PlayerHooks.cs:225
static HookList HookSendCustomBiomes
Definition: PlayerHooks.cs:223

◆ SendCustomBiomes() [2/2]

static bool Terraria.ModLoader.PlayerHooks.SendCustomBiomes ( ModPlayer  modPlayer,
BinaryWriter  writer 
)
staticprivate

Definition at line 243 of file PlayerHooks.cs.

References Terraria.ModLoader.ModPlayer.mod, Terraria.ModLoader.ModPlayer.Name, Terraria.ModLoader.Mod.Name, and Terraria.ModLoader.ModPlayer.SendCustomBiomes().

243  {
244  byte[] data;
245  using (MemoryStream stream = new MemoryStream()) {
246  using (BinaryWriter customWriter = new BinaryWriter(stream)) {
247  modPlayer.SendCustomBiomes(customWriter);
248  customWriter.Flush();
249  data = stream.ToArray();
250  }
251  }
252  if (data.Length > 0) {
253  writer.Write(modPlayer.mod.Name);
254  writer.Write(modPlayer.Name);
255  writer.Write((byte)data.Length);
256  writer.Write(data);
257  return true;
258  }
259  return false;
260  }
+ Here is the call graph for this function:

◆ SetControls()

static void Terraria.ModLoader.PlayerHooks.SetControls ( Player  player)
static

Definition at line 372 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

372  {
373  foreach (int index in HookSetControls.arr) {
374  player.modPlayers[index].SetControls();
375  }
376  }
static HookList HookSetControls
Definition: PlayerHooks.cs:370

◆ SetStartInventory() [1/2]

static void Terraria.ModLoader.PlayerHooks.SetStartInventory ( Player  player,
IList< Item items 
)
static

Definition at line 157 of file PlayerHooks.cs.

References Terraria.ModLoader.ModLoader.GetMod(), Terraria.ModLoader.Item, and Terraria.ModLoader.Mod.ItemType().

157  {
158  if (items.Count <= 50) {
159  for (int k = 0; k < items.Count; k++) {
160  player.inventory[k] = items[k];
161  }
162  }
163  else {
164  for (int k = 0; k < 49; k++) {
165  player.inventory[k] = items[k];
166  }
167  Item bag = new Item();
168  bag.SetDefaults(ModLoader.GetMod("ModLoader").ItemType("StartBag"));
169  for (int k = 49; k < items.Count; k++) {
170  ((StartBag)bag.modItem).AddItem(items[k]);
171  }
172  player.inventory[49] = bag;
173  }
174  }
+ Here is the call graph for this function:

◆ SetStartInventory() [2/2]

static void Terraria.ModLoader.PlayerHooks.SetStartInventory ( Player  player)
static

Definition at line 176 of file PlayerHooks.cs.

176  {
177  SetStartInventory(player, SetupStartInventory(player));
178  }
static void SetStartInventory(Player player, IList< Item > items)
Definition: PlayerHooks.cs:157
static IList< Item > SetupStartInventory(Player player, bool mediumcoreDeath=false)
Definition: PlayerHooks.cs:101

◆ SetupStartInventory()

static IList<Item> Terraria.ModLoader.PlayerHooks.SetupStartInventory ( Player  player,
bool  mediumcoreDeath = false 
)
static

Definition at line 101 of file PlayerHooks.cs.

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

101  {
102  IList<Item> items = new List<Item>();
103  Item item = new Item();
104  item.SetDefaults(3507);
105  item.Prefix(-1);
106  items.Add(item);
107  item = new Item();
108  item.SetDefaults(3509);
109  item.Prefix(-1);
110  items.Add(item);
111  item = new Item();
112  item.SetDefaults(3506);
113  item.Prefix(-1);
114  items.Add(item);
115  if (Main.cEd && !mediumcoreDeath) {
116  item = new Item();
117  item.SetDefaults(603);
118  items.Add(item);
119  }
120  foreach (int index in HookSetupStartInventory.arr) {
121  player.modPlayers[index].SetupStartInventory(items, mediumcoreDeath);
122  }
123  foreach (int index in HookSetupStartInventoryOld.arr) {
124  player.modPlayers[index].SetupStartInventory(items);
125  }
126  IDictionary<int, int> counts = new Dictionary<int, int>();
127  foreach (Item item0 in items) {
128  if (item0.maxStack > 1) {
129  if (!counts.ContainsKey(item0.netID)) {
130  counts[item0.netID] = 0;
131  }
132  counts[item0.netID] += item0.stack;
133  }
134  }
135  int k = 0;
136  while (k < items.Count) {
137  bool flag = true;
138  int id = items[k].netID;
139  if (counts.ContainsKey(id)) {
140  items[k].stack = counts[id];
141  if (items[k].stack > items[k].maxStack) {
142  items[k].stack = items[k].maxStack;
143  }
144  counts[id] -= items[k].stack;
145  if (items[k].stack <= 0) {
146  items.RemoveAt(k);
147  flag = false;
148  }
149  }
150  if (flag) {
151  k++;
152  }
153  }
154  return items;
155  }
static HookList HookSetupStartInventory
Definition: PlayerHooks.cs:98
static HookList HookSetupStartInventoryOld
Definition: PlayerHooks.cs:99

◆ ShiftClickSlot()

static bool Terraria.ModLoader.PlayerHooks.ShiftClickSlot ( Player  player,
Item []  inventory,
int  context,
int  slot 
)
static

Definition at line 1115 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

1115  {
1116  foreach (int index in HookShiftClickSlot.arr) {
1117  if (player.modPlayers[index].ShiftClickSlot(inventory, context, slot)) {
1118  return true;
1119  }
1120  }
1121  return false;
1122  }
static HookList HookShiftClickSlot

◆ Shoot()

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

Definition at line 708 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

708  {
709  foreach (int index in HookShoot.arr) {
710  if (!player.modPlayers[index].Shoot(item, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack)) {
711  return false;
712  }
713  }
714  return true;
715  }

◆ SyncPlayer()

static void Terraria.ModLoader.PlayerHooks.SyncPlayer ( Player  player,
int  toWho,
int  fromWho,
bool  newPlayer 
)
static

Definition at line 302 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

302  {
303  foreach (int index in HookSyncPlayer.arr) {
304  player.modPlayers[index].SyncPlayer(toWho, fromWho, newPlayer);
305  }
306  }
static HookList HookSyncPlayer
Definition: PlayerHooks.cs:300

◆ TotalMeleeSpeedMultiplier()

static float Terraria.ModLoader.PlayerHooks.TotalMeleeSpeedMultiplier ( Player  player,
Item  item 
)
static

Definition at line 563 of file PlayerHooks.cs.

References Terraria.ModLoader.ItemLoader.MeleeSpeedMultiplier().

563  {
564  return TotalUseTimeMultiplier(player, item) * MeleeSpeedMultiplier(player, item)
565  * ItemLoader.MeleeSpeedMultiplier(item, player);
566  }
static float MeleeSpeedMultiplier(Player player, Item item)
Definition: PlayerHooks.cs:554
static float TotalUseTimeMultiplier(Player player, Item item)
Definition: PlayerHooks.cs:544
+ Here is the call graph for this function:

◆ TotalMeleeTime()

static int Terraria.ModLoader.PlayerHooks.TotalMeleeTime ( float  useAnimation,
Player  player,
Item  item 
)
static

Definition at line 568 of file PlayerHooks.cs.

References Terraria.ModLoader.Item.

568  {
569  return Math.Max(2, (int)(useAnimation / TotalMeleeSpeedMultiplier(player, item)));
570  }
static float TotalMeleeSpeedMultiplier(Player player, Item item)
Definition: PlayerHooks.cs:563

◆ TotalUseTime()

static int Terraria.ModLoader.PlayerHooks.TotalUseTime ( float  useTime,
Player  player,
Item  item 
)
static

Definition at line 548 of file PlayerHooks.cs.

548  {
549  return Math.Max(2, (int)(useTime / TotalUseTimeMultiplier(player, item)));
550  }
static float TotalUseTimeMultiplier(Player player, Item item)
Definition: PlayerHooks.cs:544

◆ TotalUseTimeMultiplier()

static float Terraria.ModLoader.PlayerHooks.TotalUseTimeMultiplier ( Player  player,
Item  item 
)
static

Definition at line 544 of file PlayerHooks.cs.

References Terraria.ModLoader.ItemLoader.UseTimeMultiplier().

544  {
545  return UseTimeMultiplier(player, item) * ItemLoader.UseTimeMultiplier(item, player);
546  }
static float UseTimeMultiplier(Player player, Item item)
Definition: PlayerHooks.cs:535
+ Here is the call graph for this function:

◆ UpdateAutopause()

static void Terraria.ModLoader.PlayerHooks.UpdateAutopause ( Player  player)
static

Definition at line 356 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

356  {
357  foreach (int index in HookUpdateAutopause.arr) {
358  player.modPlayers[index].UpdateAutopause();
359  }
360  }
static HookList HookUpdateAutopause
Definition: PlayerHooks.cs:354

◆ UpdateBadLifeRegen()

static void Terraria.ModLoader.PlayerHooks.UpdateBadLifeRegen ( Player  player)
static

Definition at line 331 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

331  {
332  foreach (int index in HookUpdateBadLifeRegen.arr) {
333  player.modPlayers[index].UpdateBadLifeRegen();
334  }
335  }
static HookList HookUpdateBadLifeRegen
Definition: PlayerHooks.cs:329

◆ UpdateBiomes()

static void Terraria.ModLoader.PlayerHooks.UpdateBiomes ( Player  player)
static

Definition at line 198 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

198  {
199  foreach (int index in HookUpdateBiomes.arr) {
200  player.modPlayers[index].UpdateBiomes();
201  }
202  }
static HookList HookUpdateBiomes
Definition: PlayerHooks.cs:196

◆ UpdateBiomeVisuals()

static void Terraria.ModLoader.PlayerHooks.UpdateBiomeVisuals ( Player  player)
static

Definition at line 286 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

286  {
287  foreach (int index in HookUpdateBiomeVisuals.arr) {
288  player.modPlayers[index].UpdateBiomeVisuals();
289  }
290  }
static HookList HookUpdateBiomeVisuals
Definition: PlayerHooks.cs:284

◆ UpdateDead()

static void Terraria.ModLoader.PlayerHooks.UpdateDead ( Player  player)
static

Definition at line 92 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

92  {
93  foreach (int index in HookUpdateDead.arr) {
94  player.modPlayers[index].UpdateDead();
95  }
96  }
static HookList HookUpdateDead
Definition: PlayerHooks.cs:90

◆ UpdateEquips()

static void Terraria.ModLoader.PlayerHooks.UpdateEquips ( Player  player,
ref bool  wallSpeedBuff,
ref bool  tileSpeedBuff,
ref bool  tileRangeBuff 
)
static

Definition at line 397 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

397  {
398  foreach (int index in HookUpdateEquips.arr) {
399  player.modPlayers[index].UpdateEquips(ref wallSpeedBuff, ref tileSpeedBuff, ref tileRangeBuff);
400  }
401  }
static HookList HookUpdateEquips
Definition: PlayerHooks.cs:395

◆ UpdateLifeRegen()

static void Terraria.ModLoader.PlayerHooks.UpdateLifeRegen ( Player  player)
static

Definition at line 339 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

339  {
340  foreach (int index in HookUpdateLifeRegen.arr) {
341  player.modPlayers[index].UpdateLifeRegen();
342  }
343  }
static HookList HookUpdateLifeRegen
Definition: PlayerHooks.cs:337

◆ UpdateVanityAccessories()

static void Terraria.ModLoader.PlayerHooks.UpdateVanityAccessories ( Player  player)
static

Definition at line 405 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

405  {
406  foreach (int index in HookUpdateVanityAccessories.arr) {
407  player.modPlayers[index].UpdateVanityAccessories();
408  }
409  }
static HookList HookUpdateVanityAccessories
Definition: PlayerHooks.cs:403

◆ UseTimeMultiplier()

static float Terraria.ModLoader.PlayerHooks.UseTimeMultiplier ( Player  player,
Item  item 
)
static

Definition at line 535 of file PlayerHooks.cs.

References Terraria.ModLoader.PlayerHooks.HookList.arr.

535  {
536  float multiplier = 1f;
537  if (item.IsAir) return multiplier;
538  foreach (int index in HookUseTimeMultiplier.arr) {
539  multiplier *= player.modPlayers[index].UseTimeMultiplier(item);
540  }
541  return multiplier;
542  }
static HookList HookUseTimeMultiplier
Definition: PlayerHooks.cs:533

Member Data Documentation

◆ HookAnglerQuestReward

HookList Terraria.ModLoader.PlayerHooks.HookAnglerQuestReward = AddHook<Action<float, List<Item>>>(p => p.AnglerQuestReward)
staticprivate

Definition at line 952 of file PlayerHooks.cs.

◆ HookCanBeHitByNPC

HookList Terraria.ModLoader.PlayerHooks.HookCanBeHitByNPC = AddHook<DelegateCanBeHitByNPC>(p => p.CanBeHitByNPC)
staticprivate

Definition at line 871 of file PlayerHooks.cs.

◆ HookCanBeHitByProjectile

HookList Terraria.ModLoader.PlayerHooks.HookCanBeHitByProjectile = AddHook<Func<Projectile, bool>>(p => p.CanBeHitByProjectile)
staticprivate

Definition at line 899 of file PlayerHooks.cs.

◆ HookCanBuyItem

HookList Terraria.ModLoader.PlayerHooks.HookCanBuyItem = AddHook<Func<NPC, Item[], Item, bool>>(p => p.CanBuyItem)
staticprivate

Definition at line 1186 of file PlayerHooks.cs.

◆ HookCanHitNPC

HookList Terraria.ModLoader.PlayerHooks.HookCanHitNPC = AddHook<Func<Item, NPC, bool?>>(p => p.CanHitNPC)
staticprivate

Definition at line 733 of file PlayerHooks.cs.

◆ HookCanHitNPCWithProj

HookList Terraria.ModLoader.PlayerHooks.HookCanHitNPCWithProj = AddHook<Func<Projectile, NPC, bool?>>(p => p.CanHitNPCWithProj)
staticprivate

Definition at line 766 of file PlayerHooks.cs.

◆ HookCanHitPvp

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

Definition at line 811 of file PlayerHooks.cs.

◆ HookCanHitPvpWithProj

HookList Terraria.ModLoader.PlayerHooks.HookCanHitPvpWithProj = AddHook<Func<Projectile, Player, bool>>(p => p.CanHitPvpWithProj)
staticprivate

Definition at line 839 of file PlayerHooks.cs.

◆ HookCanSellItem

HookList Terraria.ModLoader.PlayerHooks.HookCanSellItem = AddHook<Func<NPC, Item[], Item, bool>>(p => p.CanSellItem)
staticprivate

Definition at line 1167 of file PlayerHooks.cs.

◆ HookCatchFish

HookList Terraria.ModLoader.PlayerHooks.HookCatchFish = AddHook<DelegateCatchFish>(p => p.CatchFish)
staticprivate

Definition at line 928 of file PlayerHooks.cs.

◆ HookClientClone

HookList Terraria.ModLoader.PlayerHooks.HookClientClone = AddHook<Action<ModPlayer>>(p => p.clientClone)
staticprivate

Definition at line 292 of file PlayerHooks.cs.

◆ HookConsumeAmmo

HookList Terraria.ModLoader.PlayerHooks.HookConsumeAmmo = AddHook<Func<Item, Item, bool>>(p => p.ConsumeAmmo)
staticprivate

Definition at line 687 of file PlayerHooks.cs.

◆ HookCopyCustomBiomesTo

HookList Terraria.ModLoader.PlayerHooks.HookCopyCustomBiomesTo = AddHook<Action<Player>>(p => p.CopyCustomBiomesTo)
staticprivate

Definition at line 215 of file PlayerHooks.cs.

◆ HookCustomBiomesMatch

HookList Terraria.ModLoader.PlayerHooks.HookCustomBiomesMatch = AddHook<Func<Player, bool>>(p => p.CustomBiomesMatch)
staticprivate

Definition at line 204 of file PlayerHooks.cs.

◆ HookDrawEffects

HookList Terraria.ModLoader.PlayerHooks.HookDrawEffects = AddHook<DelegateDrawEffects>(p => p.DrawEffects)
staticprivate

Definition at line 969 of file PlayerHooks.cs.

◆ HookFrameEffects

HookList Terraria.ModLoader.PlayerHooks.HookFrameEffects = AddHook<Action>(p => p.FrameEffects)
staticprivate

Definition at line 451 of file PlayerHooks.cs.

◆ HookGetDyeTraderReward

HookList Terraria.ModLoader.PlayerHooks.HookGetDyeTraderReward = AddHook<Action<List<int>>>(p => p.GetDyeTraderReward)
staticprivate

Definition at line 960 of file PlayerHooks.cs.

◆ HookGetFishingLevel

HookList Terraria.ModLoader.PlayerHooks.HookGetFishingLevel = AddHook<DelegateGetFishingLevel>(p => p.GetFishingLevel)
staticprivate

Definition at line 944 of file PlayerHooks.cs.

◆ HookGetHealLife

HookList Terraria.ModLoader.PlayerHooks.HookGetHealLife = AddHook<DelegateGetHealLife>(p => p.GetHealLife)
staticprivate

Definition at line 573 of file PlayerHooks.cs.

◆ HookGetHealMana

HookList Terraria.ModLoader.PlayerHooks.HookGetHealMana = AddHook<DelegateGetHealMana>(p => p.GetHealMana)
staticprivate

Definition at line 585 of file PlayerHooks.cs.

◆ HookGetMapBackgroundImage

HookList Terraria.ModLoader.PlayerHooks.HookGetMapBackgroundImage = AddHook<Func<Texture2D>>(p => p.GetMapBackgroundImage)
staticprivate

Definition at line 316 of file PlayerHooks.cs.

◆ HookGetWeaponCrit

HookList Terraria.ModLoader.PlayerHooks.HookGetWeaponCrit = AddHook<DelegateGetWeaponCrit>(p => p.GetWeaponCrit)
staticprivate

Definition at line 678 of file PlayerHooks.cs.

◆ HookGetWeaponDamage

HookList Terraria.ModLoader.PlayerHooks.HookGetWeaponDamage = AddHook<DelegateGetWeaponDamage>(p => p.GetWeaponDamage)
staticprivate

Definition at line 632 of file PlayerHooks.cs.

◆ HookGetWeaponKnockback

HookList Terraria.ModLoader.PlayerHooks.HookGetWeaponKnockback = AddHook<DelegateGetWeaponKnockback>(p => p.GetWeaponKnockback)
staticprivate

Definition at line 666 of file PlayerHooks.cs.

◆ HookHurt

HookList Terraria.ModLoader.PlayerHooks.HookHurt = AddHook<Action<bool, bool, double, int, bool>>(p => p.Hurt)
staticprivate

Definition at line 475 of file PlayerHooks.cs.

◆ HookKill

HookList Terraria.ModLoader.PlayerHooks.HookKill = AddHook<Action<double, int, bool, PlayerDeathReason>>(p => p.Kill)
staticprivate

Definition at line 506 of file PlayerHooks.cs.

◆ HookMeleeEffects

HookList Terraria.ModLoader.PlayerHooks.HookMeleeEffects = AddHook<Action<Item, Rectangle>>(p => p.MeleeEffects)
staticprivate

Definition at line 717 of file PlayerHooks.cs.

◆ HookMeleeSpeedMultiplier

HookList Terraria.ModLoader.PlayerHooks.HookMeleeSpeedMultiplier = AddHook<Func<Item, float>>(p => p.MeleeSpeedMultiplier)
staticprivate

Definition at line 552 of file PlayerHooks.cs.

◆ HookModifyDrawHeadLayers

HookList Terraria.ModLoader.PlayerHooks.HookModifyDrawHeadLayers = AddHook<Action<List<PlayerHeadLayer>>>(p => p.ModifyDrawHeadLayers)
staticprivate

Definition at line 1041 of file PlayerHooks.cs.

◆ HookModifyDrawInfo

HookList Terraria.ModLoader.PlayerHooks.HookModifyDrawInfo = AddHook<DelegateModifyDrawInfo>(p => p.ModifyDrawInfo)
staticprivate

Definition at line 979 of file PlayerHooks.cs.

◆ HookModifyDrawLayers

HookList Terraria.ModLoader.PlayerHooks.HookModifyDrawLayers = AddHook<Action<List<PlayerLayer>>>(p => p.ModifyDrawLayers)
staticprivate

Definition at line 988 of file PlayerHooks.cs.

◆ HookModifyHitByNPC

HookList Terraria.ModLoader.PlayerHooks.HookModifyHitByNPC = AddHook<DelegateModifyHitByNPC>(p => p.ModifyHitByNPC)
staticprivate

Definition at line 883 of file PlayerHooks.cs.

◆ HookModifyHitByProjectile

HookList Terraria.ModLoader.PlayerHooks.HookModifyHitByProjectile = AddHook<DelegateModifyHitByProjectile>(p => p.ModifyHitByProjectile)
staticprivate

Definition at line 911 of file PlayerHooks.cs.

◆ HookModifyHitNPC

HookList Terraria.ModLoader.PlayerHooks.HookModifyHitNPC = AddHook<DelegateModifyHitNPC>(p => p.ModifyHitNPC)
staticprivate

Definition at line 750 of file PlayerHooks.cs.

◆ HookModifyHitNPCWithProj

HookList Terraria.ModLoader.PlayerHooks.HookModifyHitNPCWithProj = AddHook<DelegateModifyHitNPCWithProj>(p => p.ModifyHitNPCWithProj)
staticprivate

Definition at line 787 of file PlayerHooks.cs.

◆ HookModifyHitPvp

HookList Terraria.ModLoader.PlayerHooks.HookModifyHitPvp = AddHook<DelegateModifyHitPvp>(p => p.ModifyHitPvp)
staticprivate

Definition at line 823 of file PlayerHooks.cs.

◆ HookModifyHitPvpWithProj

HookList Terraria.ModLoader.PlayerHooks.HookModifyHitPvpWithProj = AddHook<DelegateModifyHitPvpWithProj>(p => p.ModifyHitPvpWithProj)
staticprivate

Definition at line 852 of file PlayerHooks.cs.

◆ HookModifyManaCost

HookList Terraria.ModLoader.PlayerHooks.HookModifyManaCost = AddHook<DelegateModifyManaCost>(p => p.ModifyManaCost)
staticprivate

Definition at line 597 of file PlayerHooks.cs.

◆ HookModifyNurseHeal

HookList Terraria.ModLoader.PlayerHooks.HookModifyNurseHeal = AddHook<DelegateModifyNurseHeal>(p => p.ModifyNurseHeal)
staticprivate

Definition at line 1197 of file PlayerHooks.cs.

◆ HookModifyNursePrice

HookList Terraria.ModLoader.PlayerHooks.HookModifyNursePrice = AddHook<DelegateModifyNursePrice>(p => p.ModifyNursePrice)
staticprivate

Definition at line 1208 of file PlayerHooks.cs.

◆ HookModifyScreenPosition

HookList Terraria.ModLoader.PlayerHooks.HookModifyScreenPosition = AddHook<Action>(p => p.ModifyScreenPosition)
staticprivate

Definition at line 1060 of file PlayerHooks.cs.

◆ HookModifyWeaponDamage

HookList Terraria.ModLoader.PlayerHooks.HookModifyWeaponDamage = AddHook<DelegateModifyWeaponDamage>(p => p.ModifyWeaponDamage)
staticprivate

Definition at line 644 of file PlayerHooks.cs.

◆ HookModifyZoom

HookList Terraria.ModLoader.PlayerHooks.HookModifyZoom = AddHook<DelegateModifyZoom>(p => p.ModifyZoom)
staticprivate

Definition at line 1069 of file PlayerHooks.cs.

◆ HookNaturalLifeRegen

HookList Terraria.ModLoader.PlayerHooks.HookNaturalLifeRegen = AddHook<DelegateNaturalLifeRegen>(p => p.NaturalLifeRegen)
staticprivate

Definition at line 346 of file PlayerHooks.cs.

◆ HookOnConsumeAmmo

HookList Terraria.ModLoader.PlayerHooks.HookOnConsumeAmmo = AddHook<Action<Item, Item>>(p => p.OnConsumeAmmo)
staticprivate

Definition at line 698 of file PlayerHooks.cs.

◆ HookOnConsumeMana

HookList Terraria.ModLoader.PlayerHooks.HookOnConsumeMana = AddHook<Action<Item, int>>(p => p.OnConsumeMana)
staticprivate

Definition at line 619 of file PlayerHooks.cs.

◆ HookOnEnterWorld

HookList Terraria.ModLoader.PlayerHooks.HookOnEnterWorld = AddHook<Action<Player>>(p => p.OnEnterWorld)
staticprivate

Definition at line 1095 of file PlayerHooks.cs.

◆ HookOnHitAnything

HookList Terraria.ModLoader.PlayerHooks.HookOnHitAnything = AddHook<Action<float, float, Entity>>(p => p.OnHitAnything)
staticprivate

Definition at line 725 of file PlayerHooks.cs.

◆ HookOnHitByNPC

HookList Terraria.ModLoader.PlayerHooks.HookOnHitByNPC = AddHook<Action<NPC, int, bool>>(p => p.OnHitByNPC)
staticprivate

Definition at line 891 of file PlayerHooks.cs.

◆ HookOnHitByProjectile

HookList Terraria.ModLoader.PlayerHooks.HookOnHitByProjectile = AddHook<Action<Projectile, int, bool>>(p => p.OnHitByProjectile)
staticprivate

Definition at line 919 of file PlayerHooks.cs.

◆ HookOnHitNPC

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

Definition at line 758 of file PlayerHooks.cs.

◆ HookOnHitNPCWithProj

HookList Terraria.ModLoader.PlayerHooks.HookOnHitNPCWithProj = AddHook<Action<Projectile, NPC, int, float, bool>>(p => p.OnHitNPCWithProj)
staticprivate

Definition at line 799 of file PlayerHooks.cs.

◆ HookOnHitPvp

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

Definition at line 831 of file PlayerHooks.cs.

◆ HookOnHitPvpWithProj

HookList Terraria.ModLoader.PlayerHooks.HookOnHitPvpWithProj = AddHook<Action<Projectile, Player, int, bool>>(p => p.OnHitPvpWithProj)
staticprivate

Definition at line 861 of file PlayerHooks.cs.

◆ HookOnMissingMana

HookList Terraria.ModLoader.PlayerHooks.HookOnMissingMana = AddHook<Action<Item, int>>(p => p.OnMissingMana)
staticprivate

Definition at line 608 of file PlayerHooks.cs.

◆ HookOnRespawn

HookList Terraria.ModLoader.PlayerHooks.HookOnRespawn = AddHook<Action<Player>>(p => p.OnRespawn)
staticprivate

Definition at line 1105 of file PlayerHooks.cs.

◆ HookPlayerConnect

HookList Terraria.ModLoader.PlayerHooks.HookPlayerConnect = AddHook<Action<Player>>(p => p.PlayerConnect)
staticprivate

Definition at line 1077 of file PlayerHooks.cs.

◆ HookPlayerDisconnect

HookList Terraria.ModLoader.PlayerHooks.HookPlayerDisconnect = AddHook<Action<Player>>(p => p.PlayerDisconnect)
staticprivate

Definition at line 1086 of file PlayerHooks.cs.

◆ HookPostBuyItem

HookList Terraria.ModLoader.PlayerHooks.HookPostBuyItem = AddHook<Action<NPC, Item[], Item>>(p => p.PostBuyItem)
staticprivate

Definition at line 1178 of file PlayerHooks.cs.

◆ HookPostHurt

HookList Terraria.ModLoader.PlayerHooks.HookPostHurt = AddHook<Action<bool, bool, double, int, bool>>(p => p.PostHurt)
staticprivate

Definition at line 483 of file PlayerHooks.cs.

◆ HookPostItemCheck

HookList Terraria.ModLoader.PlayerHooks.HookPostItemCheck = AddHook<Action>(p => p.PostItemCheck)
staticprivate

Definition at line 525 of file PlayerHooks.cs.

◆ HookPostNurseHeal

HookList Terraria.ModLoader.PlayerHooks.HookPostNurseHeal = AddHook<Action<NPC, int, bool, int>>(p => p.PostNurseHeal)
staticprivate

Definition at line 1216 of file PlayerHooks.cs.

◆ HookPostSavePlayer

HookList Terraria.ModLoader.PlayerHooks.HookPostSavePlayer = AddHook<Action>(p => p.PostSavePlayer)
staticprivate

Definition at line 188 of file PlayerHooks.cs.

◆ HookPostSellItem

HookList Terraria.ModLoader.PlayerHooks.HookPostSellItem = AddHook<Action<NPC, Item[], Item>>(p => p.PostSellItem)
staticprivate

Definition at line 1159 of file PlayerHooks.cs.

◆ HookPostUpdate

HookList Terraria.ModLoader.PlayerHooks.HookPostUpdate = AddHook<Action>(p => p.PostUpdate)
staticprivate

Definition at line 443 of file PlayerHooks.cs.

◆ HookPostUpdateBuffs

HookList Terraria.ModLoader.PlayerHooks.HookPostUpdateBuffs = AddHook<Action>(p => p.PostUpdateBuffs)
staticprivate

Definition at line 386 of file PlayerHooks.cs.

◆ HookPostUpdateEquips

HookList Terraria.ModLoader.PlayerHooks.HookPostUpdateEquips = AddHook<Action>(p => p.PostUpdateEquips)
staticprivate

Definition at line 411 of file PlayerHooks.cs.

◆ HookPostUpdateMiscEffects

HookList Terraria.ModLoader.PlayerHooks.HookPostUpdateMiscEffects = AddHook<Action>(p => p.PostUpdateMiscEffects)
staticprivate

Definition at line 419 of file PlayerHooks.cs.

◆ HookPostUpdateRunSpeeds

HookList Terraria.ModLoader.PlayerHooks.HookPostUpdateRunSpeeds = AddHook<Action>(p => p.PostUpdateRunSpeeds)
staticprivate

Definition at line 427 of file PlayerHooks.cs.

◆ HookPreHurt

HookList Terraria.ModLoader.PlayerHooks.HookPreHurt = AddHook<DelegatePreHurt>(p => p.PreHurt)
staticprivate

Definition at line 461 of file PlayerHooks.cs.

◆ HookPreItemCheck

HookList Terraria.ModLoader.PlayerHooks.HookPreItemCheck = AddHook<Func<bool>>(p => p.PreItemCheck)
staticprivate

Definition at line 514 of file PlayerHooks.cs.

◆ HookPreKill

HookList Terraria.ModLoader.PlayerHooks.HookPreKill = AddHook<DelegatePreKill>(p => p.PreKill)
staticprivate

Definition at line 493 of file PlayerHooks.cs.

◆ HookPreSavePlayer

HookList Terraria.ModLoader.PlayerHooks.HookPreSavePlayer = AddHook<Action>(p => p.PreSavePlayer)
staticprivate

Definition at line 180 of file PlayerHooks.cs.

◆ HookPreUpdate

HookList Terraria.ModLoader.PlayerHooks.HookPreUpdate = AddHook<Action>(p => p.PreUpdate)
staticprivate

Definition at line 362 of file PlayerHooks.cs.

◆ HookPreUpdateBuffs

HookList Terraria.ModLoader.PlayerHooks.HookPreUpdateBuffs = AddHook<Action>(p => p.PreUpdateBuffs)
staticprivate

Definition at line 378 of file PlayerHooks.cs.

◆ HookPreUpdateMovement

HookList Terraria.ModLoader.PlayerHooks.HookPreUpdateMovement = AddHook<Action>(p => p.PreUpdateMovement)
staticprivate

Definition at line 435 of file PlayerHooks.cs.

◆ HookProcessTriggers

HookList Terraria.ModLoader.PlayerHooks.HookProcessTriggers = AddHook<Action<TriggersSet>>(p => p.ProcessTriggers)
staticprivate

Definition at line 657 of file PlayerHooks.cs.

◆ HookResetEffects

HookList Terraria.ModLoader.PlayerHooks.HookResetEffects = AddHook<Action>(p => p.ResetEffects)
staticprivate

Definition at line 82 of file PlayerHooks.cs.

◆ hooks

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

Definition at line 36 of file PlayerHooks.cs.

◆ HookSendClientChanges

HookList Terraria.ModLoader.PlayerHooks.HookSendClientChanges = AddHook<Action<ModPlayer>>(p => p.SendClientChanges)
staticprivate

Definition at line 308 of file PlayerHooks.cs.

◆ HookSendCustomBiomes

HookList Terraria.ModLoader.PlayerHooks.HookSendCustomBiomes = AddHook<Action<BinaryWriter>>(p => p.SendCustomBiomes)
staticprivate

Definition at line 223 of file PlayerHooks.cs.

◆ HookSetControls

HookList Terraria.ModLoader.PlayerHooks.HookSetControls = AddHook<Action>(p => p.SetControls)
staticprivate

Definition at line 370 of file PlayerHooks.cs.

◆ HookSetupStartInventory

HookList Terraria.ModLoader.PlayerHooks.HookSetupStartInventory = AddHook<Action<List<Item>, bool>>(p => p.SetupStartInventory)
staticprivate

Definition at line 98 of file PlayerHooks.cs.

◆ HookSetupStartInventoryOld

HookList Terraria.ModLoader.PlayerHooks.HookSetupStartInventoryOld = AddHook<Action<List<Item>>>(p => p.SetupStartInventory)
staticprivate

Definition at line 99 of file PlayerHooks.cs.

◆ HookShiftClickSlot

HookList Terraria.ModLoader.PlayerHooks.HookShiftClickSlot = AddHook<Func<Item[], int, int, bool>>(p => p.ShiftClickSlot)
staticprivate

Definition at line 1113 of file PlayerHooks.cs.

◆ HookShoot

HookList Terraria.ModLoader.PlayerHooks.HookShoot = AddHook<DelegateShoot>(p => p.Shoot)
staticprivate

Definition at line 706 of file PlayerHooks.cs.

◆ HookSyncPlayer

HookList Terraria.ModLoader.PlayerHooks.HookSyncPlayer = AddHook<Action<int, int, bool>>(p => p.SyncPlayer)
staticprivate

Definition at line 300 of file PlayerHooks.cs.

◆ HookUpdateAutopause

HookList Terraria.ModLoader.PlayerHooks.HookUpdateAutopause = AddHook<Action>(p => p.UpdateAutopause)
staticprivate

Definition at line 354 of file PlayerHooks.cs.

◆ HookUpdateBadLifeRegen

HookList Terraria.ModLoader.PlayerHooks.HookUpdateBadLifeRegen = AddHook<Action>(p => p.UpdateBadLifeRegen)
staticprivate

Definition at line 329 of file PlayerHooks.cs.

◆ HookUpdateBiomes

HookList Terraria.ModLoader.PlayerHooks.HookUpdateBiomes = AddHook<Action>(p => p.UpdateBiomes)
staticprivate

Definition at line 196 of file PlayerHooks.cs.

◆ HookUpdateBiomeVisuals

HookList Terraria.ModLoader.PlayerHooks.HookUpdateBiomeVisuals = AddHook<Action>(p => p.UpdateBiomeVisuals)
staticprivate

Definition at line 284 of file PlayerHooks.cs.

◆ HookUpdateDead

HookList Terraria.ModLoader.PlayerHooks.HookUpdateDead = AddHook<Action>(p => p.UpdateDead)
staticprivate

Definition at line 90 of file PlayerHooks.cs.

◆ HookUpdateEquips

HookList Terraria.ModLoader.PlayerHooks.HookUpdateEquips = AddHook<DelegateUpdateEquips>(p => p.UpdateEquips)
staticprivate

Definition at line 395 of file PlayerHooks.cs.

◆ HookUpdateLifeRegen

HookList Terraria.ModLoader.PlayerHooks.HookUpdateLifeRegen = AddHook<Action>(p => p.UpdateLifeRegen)
staticprivate

Definition at line 337 of file PlayerHooks.cs.

◆ HookUpdateVanityAccessories

HookList Terraria.ModLoader.PlayerHooks.HookUpdateVanityAccessories = AddHook<Action>(p => p.UpdateVanityAccessories)
staticprivate

Definition at line 403 of file PlayerHooks.cs.

◆ HookUseTimeMultiplier

HookList Terraria.ModLoader.PlayerHooks.HookUseTimeMultiplier = AddHook<Func<Item, float>>(p => p.UseTimeMultiplier)
staticprivate

Definition at line 533 of file PlayerHooks.cs.

◆ indexes

readonly IDictionary<string, int> Terraria.ModLoader.PlayerHooks.indexes = new Dictionary<string, int>()
staticprivate

Definition at line 23 of file PlayerHooks.cs.

◆ indexesByType

readonly IDictionary<Type, int> Terraria.ModLoader.PlayerHooks.indexesByType = new Dictionary<Type, int>()
staticprivate

Definition at line 24 of file PlayerHooks.cs.

◆ players

readonly IList<ModPlayer> Terraria.ModLoader.PlayerHooks.players = new List<ModPlayer>()
staticprivate

Definition at line 22 of file PlayerHooks.cs.