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

◆ OnHurt_Part1()

void Terraria.Player.OnHurt_Part1 ( HurtInfo info)
inlineprivate

Definition at line 37090 of file Player.cs.

37091 {
37092 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
37093 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
37094 int hitDirection = info.HitDirection;
37095 if (whoAmI == Main.myPlayer && panic)
37096 {
37097 AddBuff(63, 480);
37098 }
37099 if (whoAmI == Main.myPlayer && setSquireT2)
37100 {
37101 AddBuff(205, 300);
37102 }
37103 stealth = 1f;
37104 if (Main.netMode == 1)
37105 {
37106 NetMessage.SendData(84, -1, -1, null, whoAmI);
37107 }
37108 if (whoAmI == Main.myPlayer)
37109 {
37110 Main.NotifyOfEvent(GameNotificationType.Damage);
37111 if (hasFootball)
37112 {
37113 for (int i = 0; i < 59; i++)
37114 {
37115 if (inventory[i].stack > 0 && inventory[i].type == 4743)
37116 {
37117 Projectile.NewProjectile(GetProjectileSource_Misc(12), base.Center, new Vector2((float)(-hitDirection * 4), -6f), 861, 0, 0f, whoAmI, 0f, 1f);
37119 if (i == 58)
37120 {
37121 Main.mouseItem = new Item();
37122 }
37123 }
37124 }
37125 }
37126 }
37127 if (inventory[selectedItem].type == 4790 || inventory[selectedItem].type == 4788 || inventory[selectedItem].type == 4789)
37128 {
37129 for (int j = 0; j < 1000; j++)
37130 {
37131 if (Main.projectile[j].active && Main.projectile[j].owner == whoAmI && (Main.projectile[j].type == 879 || Main.projectile[j].type == 877 || Main.projectile[j].type == 878))
37132 {
37133 Main.projectile[j].active = false;
37134 }
37135 }
37136 }
37137 if (channel && inventory[selectedItem].InterruptChannelOnHurt)
37138 {
37139 channel = false;
37140 }
37141 if (itemAnimation > 0 && inventory[selectedItem].StopAnimationOnHurt)
37142 {
37143 channel = false;
37144 itemAnimation = 0;
37145 itemAnimationMax = 0;
37146 }
37147 if (!invis)
37148 {
37149 return;
37150 }
37151 for (int k = 0; k < maxBuffs; k++)
37152 {
37153 if (buffType[k] == 10)
37154 {
37155 DelBuff(k);
37156 }
37157 }
37158 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
void SetDefaults(int Type=0)
Definition Item.cs:48800
int itemAnimationMax
Definition Player.cs:3127
IEntitySource GetProjectileSource_Misc(int projectileSourceId)
Definition Player.cs:7871
int[] buffType
The T:Terraria.ID.BuffIDs of all buffs this player has active. A value of 0 means that buff slot is...
Definition Player.cs:1684
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Gives the player the provided buff. This accounts for if the player is immune to the buff....
Definition Player.cs:5700
static int maxBuffs
Definition Player.cs:3380
void DelBuff(int b)
Removes the buff at the provided index in F:Terraria.Player.buffType and F:Terraria....
Definition Player.cs:5868
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.Player.AddBuff(), Terraria.Player.buffType, Terraria.Player.channel, Terraria.Player.DelBuff(), Terraria.Player.GetProjectileSource_Misc(), Terraria.Player.hasFootball, Terraria.Player.inventory, Terraria.Player.invis, Terraria.Player.itemAnimation, Terraria.Player.itemAnimationMax, Terraria.Player.maxBuffs, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Projectile.NewProjectile(), Terraria.Main.NotifyOfEvent(), Terraria.Player.panic, Terraria.Main.projectile, Terraria.Player.selectedItem, Terraria.NetMessage.SendData(), Terraria.Item.SetDefaults(), Terraria.Player.setSquireT2, Terraria.Player.stealth, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.Hurt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: