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

◆ WOFTongue()

void Terraria.Player.WOFTongue ( )
inline

Definition at line 20168 of file Player.cs.

20169 {
20170 //IL_02bd: Unknown result type (might be due to invalid IL or missing references)
20171 //IL_02c2: Unknown result type (might be due to invalid IL or missing references)
20172 //IL_02ec: Unknown result type (might be due to invalid IL or missing references)
20173 //IL_031c: Unknown result type (might be due to invalid IL or missing references)
20174 if (Main.wofNPCIndex < 0 || !Main.npc[Main.wofNPCIndex].active)
20175 {
20176 return;
20177 }
20178 float num = Main.npc[Main.wofNPCIndex].position.X + 40f;
20179 if (Main.npc[Main.wofNPCIndex].direction > 0)
20180 {
20181 num -= 96f;
20182 }
20183 if (position.X + (float)width > num && position.X < num + 140f && gross)
20184 {
20185 noKnockback = false;
20186 int attackDamage_ScaledByStrength = Main.npc[Main.wofNPCIndex].GetAttackDamage_ScaledByStrength(50f);
20187 Hurt(PlayerDeathReason.LegacyDefault(), attackDamage_ScaledByStrength, Main.npc[Main.wofNPCIndex].direction);
20188 }
20189 if (!gross && position.Y > (float)((Main.maxTilesY - 250) * 16) && position.X > num - 1920f && position.X < num + 1920f)
20190 {
20191 AddBuff(37, 10);
20192 SoundEngine.PlaySound(4, (int)Main.npc[Main.wofNPCIndex].position.X, (int)Main.npc[Main.wofNPCIndex].position.Y, 10);
20193 }
20194 if (gross)
20195 {
20196 if (position.Y < (float)(Main.UnderworldLayer * 16))
20197 {
20198 AddBuff(38, 10);
20199 }
20200 if (Main.npc[Main.wofNPCIndex].direction < 0)
20201 {
20202 if (position.X + (float)(width / 2) > Main.npc[Main.wofNPCIndex].position.X + (float)(Main.npc[Main.wofNPCIndex].width / 2) + 40f)
20203 {
20204 AddBuff(38, 10);
20205 }
20206 }
20207 else if (position.X + (float)(width / 2) < Main.npc[Main.wofNPCIndex].position.X + (float)(Main.npc[Main.wofNPCIndex].width / 2) - 40f)
20208 {
20209 AddBuff(38, 10);
20210 }
20211 }
20212 if (!tongued)
20213 {
20214 return;
20215 }
20216 controlHook = false;
20217 controlUseItem = false;
20218 for (int i = 0; i < 1000; i++)
20219 {
20220 if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].aiStyle == 7)
20221 {
20222 Main.projectile[i].Kill();
20223 }
20224 }
20225 Vector2 center = base.Center;
20226 float num3 = Main.npc[Main.wofNPCIndex].position.X + (float)(Main.npc[Main.wofNPCIndex].width / 2) - center.X;
20227 float num2 = Main.npc[Main.wofNPCIndex].position.Y + (float)(Main.npc[Main.wofNPCIndex].height / 2) - center.Y;
20228 if ((float)Math.Sqrt(num3 * num3 + num2 * num2) > 3000f)
20229 {
20230 KillMe(PlayerDeathReason.ByOther(11), 1000.0, 0);
20231 }
20232 else if (Main.npc[Main.wofNPCIndex].position.X < 608f || Main.npc[Main.wofNPCIndex].position.X > (float)((Main.maxTilesX - 38) * 16))
20233 {
20234 KillMe(PlayerDeathReason.ByOther(12), 1000.0, 0);
20235 }
20236 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static PlayerDeathReason ByOther(int type, int playerIndex=-1)
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
void KillMe(PlayerDeathReason damageSource, double dmg, int hitDirection, bool pvp=false)
Definition Player.cs:37626
double Hurt(PlayerDeathReason damageSource, int Damage, int hitDirection, bool pvp, bool quiet, bool Crit, int cooldownCounter, bool dodgeable=true, float armorPenetration=0f)
Definition Player.cs:36998
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
bool controlUseItem
Definition Player.cs:1904

References Terraria.Player.AddBuff(), Terraria.DataStructures.PlayerDeathReason.ByOther(), Terraria.Player.controlHook, Terraria.Player.controlUseItem, Terraria.Player.gross, Terraria.Player.Hurt(), Terraria.Player.KillMe(), Terraria.DataStructures.PlayerDeathReason.LegacyDefault(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.myPlayer, Terraria.Player.noKnockback, Terraria.Main.npc, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.projectile, Terraria.Player.tongued, Terraria.Main.UnderworldLayer, Terraria.Entity.width, and Terraria.Main.wofNPCIndex.

Referenced by Terraria.Player.Update().

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