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

◆ CutTiles()

void Terraria.Projectile.CutTiles ( )
inlineprivate

Definition at line 14030 of file Projectile.cs.

14031 {
14032 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
14033 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
14034 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
14035 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
14036 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
14037 //IL_04f2: Unknown result type (might be due to invalid IL or missing references)
14038 //IL_015b: Unknown result type (might be due to invalid IL or missing references)
14039 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
14040 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
14041 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
14042 //IL_0171: Unknown result type (might be due to invalid IL or missing references)
14043 //IL_0176: Unknown result type (might be due to invalid IL or missing references)
14044 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
14045 //IL_018b: Unknown result type (might be due to invalid IL or missing references)
14046 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
14047 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
14048 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)
14049 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
14050 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
14051 //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
14052 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
14053 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
14054 //IL_01f5: Unknown result type (might be due to invalid IL or missing references)
14055 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
14056 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)
14057 //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
14058 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
14059 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
14060 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
14061 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
14062 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
14063 //IL_02a5: Unknown result type (might be due to invalid IL or missing references)
14064 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
14065 //IL_02b1: Unknown result type (might be due to invalid IL or missing references)
14066 //IL_02b6: Unknown result type (might be due to invalid IL or missing references)
14067 //IL_02bb: Unknown result type (might be due to invalid IL or missing references)
14068 //IL_02c0: Unknown result type (might be due to invalid IL or missing references)
14069 //IL_02ca: Unknown result type (might be due to invalid IL or missing references)
14070 //IL_02cf: Unknown result type (might be due to invalid IL or missing references)
14071 //IL_0305: Unknown result type (might be due to invalid IL or missing references)
14072 //IL_030b: Unknown result type (might be due to invalid IL or missing references)
14073 //IL_0311: Unknown result type (might be due to invalid IL or missing references)
14074 //IL_0316: Unknown result type (might be due to invalid IL or missing references)
14075 //IL_031c: Unknown result type (might be due to invalid IL or missing references)
14076 //IL_0321: Unknown result type (might be due to invalid IL or missing references)
14077 //IL_0326: Unknown result type (might be due to invalid IL or missing references)
14078 //IL_0330: Unknown result type (might be due to invalid IL or missing references)
14079 //IL_0335: Unknown result type (might be due to invalid IL or missing references)
14080 //IL_03b8: Unknown result type (might be due to invalid IL or missing references)
14081 //IL_03bf: Unknown result type (might be due to invalid IL or missing references)
14082 //IL_03cc: Unknown result type (might be due to invalid IL or missing references)
14083 //IL_03d1: Unknown result type (might be due to invalid IL or missing references)
14084 //IL_03d7: Unknown result type (might be due to invalid IL or missing references)
14085 //IL_03de: Unknown result type (might be due to invalid IL or missing references)
14086 //IL_03e5: Unknown result type (might be due to invalid IL or missing references)
14087 //IL_03ea: Unknown result type (might be due to invalid IL or missing references)
14088 //IL_043f: Unknown result type (might be due to invalid IL or missing references)
14089 //IL_0449: Unknown result type (might be due to invalid IL or missing references)
14090 //IL_0454: Unknown result type (might be due to invalid IL or missing references)
14091 //IL_0459: Unknown result type (might be due to invalid IL or missing references)
14092 //IL_0467: Unknown result type (might be due to invalid IL or missing references)
14093 //IL_0471: Unknown result type (might be due to invalid IL or missing references)
14094 //IL_047c: Unknown result type (might be due to invalid IL or missing references)
14095 //IL_0481: Unknown result type (might be due to invalid IL or missing references)
14096 //IL_0492: Unknown result type (might be due to invalid IL or missing references)
14097 //IL_0497: Unknown result type (might be due to invalid IL or missing references)
14098 //IL_0499: Unknown result type (might be due to invalid IL or missing references)
14099 //IL_049f: Unknown result type (might be due to invalid IL or missing references)
14100 //IL_04a4: Unknown result type (might be due to invalid IL or missing references)
14101 //IL_04a6: Unknown result type (might be due to invalid IL or missing references)
14102 //IL_04d6: Unknown result type (might be due to invalid IL or missing references)
14103 //IL_04d7: Unknown result type (might be due to invalid IL or missing references)
14104 //IL_04dc: Unknown result type (might be due to invalid IL or missing references)
14105 //IL_04e2: Unknown result type (might be due to invalid IL or missing references)
14106 if (!CanCutTiles())
14107 {
14108 return;
14109 }
14110 AchievementsHelper.CurrentlyMining = true;
14111 bool flag = true;
14112 bool[] tileCutIgnorance = Main.player[owner].GetTileCutIgnorance(allowRegrowth: false, trap);
14113 DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
14114 DelegateMethods.tileCutIgnore = tileCutIgnorance;
14115 Rectangle extensionBox;
14116 if (type == 461 || type == 632 || type == 642)
14117 {
14118 Utils.PlotTileLine(base.Center, base.Center + velocity * localAI[1], (float)width * scale, DelegateMethods.CutTiles);
14119 }
14120 else if (ProjectileID.Sets.IsAWhip[type])
14121 {
14122 flag = false;
14123 WhipPointsForCollision.Clear();
14125 Vector2 vector = default(Vector2);
14126 ((Vector2)(ref vector))._002Ector((float)width * scale / 2f, 0f);
14127 for (int i = 0; i < WhipPointsForCollision.Count; i++)
14128 {
14129 Utils.PlotTileLine(WhipPointsForCollision[i] - vector, WhipPointsForCollision[i] + vector, (float)height * scale, DelegateMethods.CutTiles);
14130 }
14131 }
14132 else if (type == 756)
14133 {
14134 Utils.PlotTileLine(base.Center, base.Center + velocity.SafeNormalize(-Vector2.UnitY) * 200f * scale, 22f * scale, DelegateMethods.CutTiles);
14135 }
14136 else if (type == 927)
14137 {
14138 Vector2 end = base.Center + velocity.SafeNormalize(Vector2.UnitX) * 220f * scale;
14139 Utils.PlotTileLine(base.Center, end, 80f * scale, DelegateMethods.CutTiles);
14140 }
14141 else if (type == 802 || type == 842 || type == 938 || type == 939 || type == 940 || type == 941 || type == 942 || type == 943 || type == 944 || type == 945)
14142 {
14143 Utils.PlotTileLine(base.Center, base.Center + velocity.SafeNormalize(-Vector2.UnitY) * 10f, 10f * scale, DelegateMethods.CutTiles);
14144 }
14145 else if (type == 611)
14146 {
14147 Utils.PlotTileLine(base.Center, base.Center + velocity + velocity.SafeNormalize(Vector2.Zero) * 48f, (float)width * scale, DelegateMethods.CutTiles);
14148 }
14149 else if (type == 697 || type == 707)
14150 {
14151 float num = 40f;
14152 if (type == 707)
14153 {
14154 num = 60f;
14155 }
14156 float f = rotation - (float)Math.PI / 4f * (float)Math.Sign(velocity.X);
14157 Utils.PlotTileLine(base.Center + f.ToRotationVector2() * (0f - num), base.Center + f.ToRotationVector2() * num, (float)width * scale, DelegateMethods.CutTiles);
14158 }
14159 else if (aiStyle == 190 || aiStyle == 191)
14160 {
14161 flag = false;
14162 Vector2 vector2 = (rotation - (float)Math.PI / 4f).ToRotationVector2() * 60f * scale;
14163 Vector2 vector3 = (rotation + (float)Math.PI / 4f).ToRotationVector2() * 60f * scale;
14164 float num2 = 60f * scale;
14165 Utils.PlotTileLine(base.Center + vector2, base.Center + vector3, num2, DelegateMethods.CutTiles);
14166 }
14168 {
14169 CutTilesAt(extensionBox.TopLeft(), extensionBox.Width, extensionBox.Height);
14170 }
14171 if (flag)
14172 {
14174 }
14175 AchievementsHelper.CurrentlyMining = false;
14176 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
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
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static bool[] IsAWhip
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will use whip ...
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla projectile AI styles are enumerated in t...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
static void FillWhipControlPoints(Projectile proj, List< Vector2 > controlPoints)
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool AI_019_Spears_GetExtensionHitbox(out Rectangle extensionBox)
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
bool trap
If true, this projectile was spawned by a trap tile.
List< Vector2 > WhipPointsForCollision
void CutTilesAt(Vector2 boxPosition, int boxWidth, int boxHeight)
float scale
Scales how large the projectile will be drawn. Will also affect the hitbox (F:Terraria....

References Terraria.Projectile.AI_019_Spears_GetExtensionHitbox(), Terraria.Projectile.aiStyle, Terraria.Projectile.CanCutTiles(), Terraria.DelegateMethods.CutTiles(), Terraria.Projectile.CutTilesAt(), Terraria.Projectile.FillWhipControlPoints(), Terraria.Entity.height, Terraria.ID.ProjectileID.Sets.IsAWhip, Terraria.Projectile.localAI, Terraria.Projectile.owner, Terraria.Main.player, Terraria.Utils.PlotTileLine(), Terraria.Entity.position, Terraria.Projectile.rotation, Terraria.Projectile.scale, Terraria.Projectile.trap, Terraria.Projectile.type, Terraria.Entity.velocity, Terraria.Projectile.WhipPointsForCollision, and Terraria.Entity.width.

Referenced by Terraria.Projectile.Damage().

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