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

◆ MowTheLawn()

void Terraria.Player.MowTheLawn ( )
inlineprivate

Definition at line 18732 of file Player.cs.

18733 {
18734 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
18735 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
18736 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
18737 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
18738 //IL_0095: Unknown result type (might be due to invalid IL or missing references)
18739 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
18740 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
18741 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
18742 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
18743 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
18744 //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
18745 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
18746 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
18747 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
18748 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
18749 //IL_011e: Unknown result type (might be due to invalid IL or missing references)
18750 //IL_0128: Unknown result type (might be due to invalid IL or missing references)
18751 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
18752 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
18753 //IL_015f: Unknown result type (might be due to invalid IL or missing references)
18754 //IL_0169: Unknown result type (might be due to invalid IL or missing references)
18755 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
18756 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
18757 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
18758 //IL_0183: Unknown result type (might be due to invalid IL or missing references)
18759 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
18760 //IL_01bd: Unknown result type (might be due to invalid IL or missing references)
18761 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)
18762 //IL_01ef: Unknown result type (might be due to invalid IL or missing references)
18763 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
18764 //IL_0240: Unknown result type (might be due to invalid IL or missing references)
18765 //IL_0246: Unknown result type (might be due to invalid IL or missing references)
18766 //IL_0247: Unknown result type (might be due to invalid IL or missing references)
18767 //IL_0259: Unknown result type (might be due to invalid IL or missing references)
18768 //IL_026b: Unknown result type (might be due to invalid IL or missing references)
18769 //IL_0270: Unknown result type (might be due to invalid IL or missing references)
18770 if (miscCounter % 2 != 0 || velocity.Y != 0f || grappling[0] != -1 || itemAnimation < 1)
18771 {
18772 return;
18773 }
18774 Vector2 vector = base.Center + new Vector2((float)(direction * 38), (float)(height / 2 + 4) * gravDir);
18775 float num = 1f - (float)itemAnimation / (float)itemAnimationMax;
18776 num *= 2f;
18777 num = ((!(num < 1f)) ? (num - 1f) : (1f - num));
18778 Vector2 val = vector + new Vector2((float)(direction * -16), gravDir * -4f);
18779 Vector2 value2 = vector + new Vector2((float)(direction * -6), gravDir * -4f);
18780 Dust dust = Dust.NewDustDirect(Vector2.Lerp(val, value2, num), 0, 0, 31, 0f, (0f - gravDir) * 0.25f, 127);
18781 dust.scale = 0.9f;
18782 dust.position -= new Vector2(4f);
18783 if (dust.velocity.Y > 0f)
18784 {
18785 dust.velocity.Y *= -1f;
18786 }
18787 dust.velocity *= 0.25f;
18788 Rectangle rectangle = Utils.CenteredRectangle(vector, new Vector2(8f, 20f));
18789 if (velocity.X * (float)direction > 0f || velocity.Y * gravDir > 0f)
18790 {
18791 Rectangle myRect = rectangle;
18792 myRect.Height -= 4;
18793 myRect.Y += 2;
18794 float damage = 8f;
18795 float knockback = 2f;
18796 int nPCImmuneTime = 12;
18797 int playerImmuneTime = 6;
18799 }
18800 rectangle.X -= direction * 10;
18801 if (whoAmI == Main.myPlayer)
18802 {
18806 if (!WorldGen.SolidTile(Framing.GetTileSafely(vector.ToTileCoordinates())))
18807 {
18808 MowGrassTile(vector + new Vector2(0f, 16f * gravDir));
18809 }
18810 }
18811 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
int itemAnimationMax
Definition Player.cs:3127
bool[] ItemCheck_GetTileCutIgnoreList(Item sItem)
Definition Player.cs:43958
void ItemCheck_CutTiles(Item sItem, Rectangle itemRectangle, bool[] shouldIgnore)
Definition Player.cs:43983
void MowGrassTile(Vector2 thePos)
Definition Player.cs:18813
int[] grappling
Definition Player.cs:2840
int CollideWithNPCs(Rectangle myRect, float Damage, float Knockback, int NPCImmuneTime, int PlayerImmuneTime, DamageClass? damageType=null)
Definition Player.cs:18859

References Terraria.Utils.CenteredRectangle(), Terraria.Player.CollideWithNPCs(), Terraria.Entity.direction, Terraria.Framing.GetTileSafely(), Terraria.Player.grappling, Terraria.Player.gravDir, Terraria.Entity.height, Terraria.Player.HeldItem, Terraria.Player.itemAnimation, Terraria.Player.itemAnimationMax, Terraria.Player.ItemCheck_CutTiles(), Terraria.Player.ItemCheck_GetTileCutIgnoreList(), Terraria.Player.miscCounter, Terraria.Player.MowGrassTile(), Terraria.Main.myPlayer, Terraria.Dust.NewDustDirect(), Terraria.WorldGen.SolidTile(), Terraria.Dust.velocity, Terraria.Entity.velocity, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.HorizontalMovement().

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