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

◆ AI_137_LightningAura()

void Terraria.Projectile.AI_137_LightningAura ( )
inlineprivate

Definition at line 75907 of file Projectile.cs.

75908 {
75909 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
75910 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
75911 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
75912 //IL_0137: Unknown result type (might be due to invalid IL or missing references)
75913 //IL_013c: Unknown result type (might be due to invalid IL or missing references)
75914 //IL_0141: Unknown result type (might be due to invalid IL or missing references)
75915 //IL_0333: Unknown result type (might be due to invalid IL or missing references)
75916 //IL_0338: Unknown result type (might be due to invalid IL or missing references)
75917 //IL_033e: Unknown result type (might be due to invalid IL or missing references)
75918 //IL_0343: Unknown result type (might be due to invalid IL or missing references)
75919 //IL_034d: Unknown result type (might be due to invalid IL or missing references)
75920 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
75921 //IL_0358: Unknown result type (might be due to invalid IL or missing references)
75922 //IL_035d: Unknown result type (might be due to invalid IL or missing references)
75923 //IL_0367: Unknown result type (might be due to invalid IL or missing references)
75924 //IL_036c: Unknown result type (might be due to invalid IL or missing references)
75925 //IL_038b: Unknown result type (might be due to invalid IL or missing references)
75926 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
75927 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
75928 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
75929 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
75930 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
75931 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
75932 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
75933 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
75934 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
75935 //IL_023c: Unknown result type (might be due to invalid IL or missing references)
75936 //IL_0241: Unknown result type (might be due to invalid IL or missing references)
75937 //IL_0243: Unknown result type (might be due to invalid IL or missing references)
75938 //IL_024f: Unknown result type (might be due to invalid IL or missing references)
75939 //IL_0254: Unknown result type (might be due to invalid IL or missing references)
75940 //IL_025c: Unknown result type (might be due to invalid IL or missing references)
75941 //IL_0263: Unknown result type (might be due to invalid IL or missing references)
75942 //IL_026b: Unknown result type (might be due to invalid IL or missing references)
75943 //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
75944 //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
75945 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
75946 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
75947 //IL_03cf: Unknown result type (might be due to invalid IL or missing references)
75948 //IL_03d4: Unknown result type (might be due to invalid IL or missing references)
75949 //IL_03d6: Unknown result type (might be due to invalid IL or missing references)
75950 //IL_020d: Unknown result type (might be due to invalid IL or missing references)
75951 //IL_0214: Unknown result type (might be due to invalid IL or missing references)
75952 //IL_03ed: Unknown result type (might be due to invalid IL or missing references)
75953 //IL_03f2: Unknown result type (might be due to invalid IL or missing references)
75954 //IL_03ff: Unknown result type (might be due to invalid IL or missing references)
75955 //IL_0404: Unknown result type (might be due to invalid IL or missing references)
75956 //IL_0409: Unknown result type (might be due to invalid IL or missing references)
75957 //IL_040e: Unknown result type (might be due to invalid IL or missing references)
75958 //IL_0410: Unknown result type (might be due to invalid IL or missing references)
75959 //IL_041b: Unknown result type (might be due to invalid IL or missing references)
75960 //IL_0432: Unknown result type (might be due to invalid IL or missing references)
75961 //IL_04ec: Unknown result type (might be due to invalid IL or missing references)
75962 //IL_04f1: Unknown result type (might be due to invalid IL or missing references)
75963 //IL_04f3: Unknown result type (might be due to invalid IL or missing references)
75964 //IL_02d6: Unknown result type (might be due to invalid IL or missing references)
75965 //IL_043b: Unknown result type (might be due to invalid IL or missing references)
75966 //IL_0452: Unknown result type (might be due to invalid IL or missing references)
75967 //IL_0458: Unknown result type (might be due to invalid IL or missing references)
75968 //IL_0468: Unknown result type (might be due to invalid IL or missing references)
75969 //IL_046a: Unknown result type (might be due to invalid IL or missing references)
75970 //IL_0471: Unknown result type (might be due to invalid IL or missing references)
75971 //IL_0475: Unknown result type (might be due to invalid IL or missing references)
75972 //IL_047a: Unknown result type (might be due to invalid IL or missing references)
75973 //IL_047f: Unknown result type (might be due to invalid IL or missing references)
75974 //IL_0484: Unknown result type (might be due to invalid IL or missing references)
75975 //IL_0489: Unknown result type (might be due to invalid IL or missing references)
75976 //IL_050a: Unknown result type (might be due to invalid IL or missing references)
75977 //IL_050f: Unknown result type (might be due to invalid IL or missing references)
75978 //IL_051c: Unknown result type (might be due to invalid IL or missing references)
75979 //IL_0521: Unknown result type (might be due to invalid IL or missing references)
75980 //IL_0530: Unknown result type (might be due to invalid IL or missing references)
75981 //IL_0535: Unknown result type (might be due to invalid IL or missing references)
75982 //IL_053a: Unknown result type (might be due to invalid IL or missing references)
75983 //IL_053c: Unknown result type (might be due to invalid IL or missing references)
75984 //IL_0547: Unknown result type (might be due to invalid IL or missing references)
75985 //IL_055b: Unknown result type (might be due to invalid IL or missing references)
75986 //IL_05f7: Unknown result type (might be due to invalid IL or missing references)
75987 //IL_0603: Unknown result type (might be due to invalid IL or missing references)
75988 //IL_0608: Unknown result type (might be due to invalid IL or missing references)
75989 //IL_062d: Unknown result type (might be due to invalid IL or missing references)
75990 //IL_0633: Unknown result type (might be due to invalid IL or missing references)
75991 //IL_0641: Unknown result type (might be due to invalid IL or missing references)
75992 //IL_064b: Unknown result type (might be due to invalid IL or missing references)
75993 //IL_0650: Unknown result type (might be due to invalid IL or missing references)
75994 //IL_0657: Unknown result type (might be due to invalid IL or missing references)
75995 //IL_065c: Unknown result type (might be due to invalid IL or missing references)
75996 //IL_0666: Unknown result type (might be due to invalid IL or missing references)
75997 //IL_066b: Unknown result type (might be due to invalid IL or missing references)
75998 //IL_0670: Unknown result type (might be due to invalid IL or missing references)
75999 //IL_0564: Unknown result type (might be due to invalid IL or missing references)
76000 //IL_057b: Unknown result type (might be due to invalid IL or missing references)
76001 //IL_0581: Unknown result type (might be due to invalid IL or missing references)
76002 //IL_058f: Unknown result type (might be due to invalid IL or missing references)
76003 //IL_0599: Unknown result type (might be due to invalid IL or missing references)
76004 //IL_059e: Unknown result type (might be due to invalid IL or missing references)
76005 //IL_05a5: Unknown result type (might be due to invalid IL or missing references)
76006 //IL_05aa: Unknown result type (might be due to invalid IL or missing references)
76007 //IL_05b4: Unknown result type (might be due to invalid IL or missing references)
76008 //IL_05b9: Unknown result type (might be due to invalid IL or missing references)
76009 //IL_05be: Unknown result type (might be due to invalid IL or missing references)
76010 int num = 10;
76011 int num2 = 999;
76012 int num3 = 30;
76013 int num4 = 40;
76014 int num5 = 4;
76015 knockBack = 0f;
76016 if (Main.player[owner].setMonkT2)
76017 {
76018 num3 -= 5;
76019 }
76020 if (Main.player[owner].setMonkT3)
76021 {
76022 num = 14;
76023 num5 = 8;
76024 }
76025 ai[0] += 1f;
76026 if (ai[0] >= (float)num3)
76027 {
76028 ai[0] = 0f;
76029 }
76030 if (ai[0] == 0f)
76031 {
76032 bool flag = false;
76033 for (int i = 0; i < 200; i++)
76034 {
76035 NPC nPC = Main.npc[i];
76036 if (nPC.CanBeChasedBy(this) && nPC.Hitbox.Distance(base.Center) < (float)(width / 2) && Colliding(base.Hitbox, nPC.Hitbox))
76037 {
76038 flag = true;
76039 break;
76040 }
76041 }
76042 if (flag)
76043 {
76045 }
76046 }
76047 if (localAI[0] == 0f)
76048 {
76049 localAI[0] = 1f;
76050 velocity = Vector2.Zero;
76051 Point origin = base.Center.ToTileCoordinates();
76052 bool flag2 = true;
76054 {
76055 flag2 = false;
76056 position.Y += 16f;
76057 return;
76058 }
76060 {
76061 ((Point)(ref result2))._002Ector(origin.X, origin.Y - num - 1);
76062 }
76063 int num6 = 0;
76064 if (flag2 && Main.tile[result.X, result.Y] != null && Main.tile[result.X, result.Y].blockType() == 1)
76065 {
76066 num6 += 8;
76067 }
76068 Vector2 center = result.ToWorldCoordinates(8f, num6);
76069 Vector2 vector = result2.ToWorldCoordinates(8f, 0f);
76070 base.Size = new Vector2(1f, center.Y - vector.Y);
76071 if (height > num * 16)
76072 {
76073 height = num * 16;
76074 }
76075 if (height < num5 * 16)
76076 {
76077 height = num5 * 16;
76078 }
76079 height *= 2;
76080 width = (int)((float)height * 1f);
76081 if (width > num2)
76082 {
76083 width = num2;
76084 }
76085 base.Center = center;
76086 }
76087 if (++frameCounter >= 8)
76088 {
76089 frameCounter = 0;
76090 if (++frame >= Main.projFrames[type])
76091 {
76092 frame = 0;
76093 }
76094 }
76095 DelegateMethods.v3_1 = new Vector3(0.2f, 0.7f, 1f);
76096 Utils.PlotTileLine(base.Center + Vector2.UnitX * -40f, base.Center + Vector2.UnitX * 40f, 80f, DelegateMethods.CastLightOpen);
76097 Vector2 vector2 = default(Vector2);
76098 ((Vector2)(ref vector2))._002Ector(base.Top.X, position.Y + (float)num4);
76099 for (int j = 0; j < 4; j++)
76100 {
76101 if (Main.rand.Next(6) != 0)
76102 {
76103 continue;
76104 }
76105 Vector2 vector3 = Main.rand.NextVector2Unit();
76106 if (!(Math.Abs(vector3.X) < 0.12f))
76107 {
76108 Vector2 targetPosition = base.Center + vector3 * new Vector2((float)((height - num4) / 2));
76109 if (!WorldGen.SolidTile((int)targetPosition.X / 16, (int)targetPosition.Y / 16) && AI_137_CanHit(targetPosition))
76110 {
76111 Dust dust = Dust.NewDustDirect(targetPosition, 0, 0, 226, 0f, 0f, 100);
76112 dust.position = targetPosition;
76113 dust.velocity = (vector2 - dust.position).SafeNormalize(Vector2.Zero);
76114 dust.scale = 0.7f;
76115 dust.fadeIn = 1f;
76116 dust.noGravity = true;
76117 dust.noLight = true;
76118 }
76119 }
76120 }
76121 for (int k = 0; k < 0; k++)
76122 {
76123 if (Main.rand.Next(10) != 0)
76124 {
76125 continue;
76126 }
76127 Vector2 vector4 = Main.rand.NextVector2Unit();
76128 if (!(Math.Abs(vector4.X) < 0.12f))
76129 {
76130 Vector2 targetPosition2 = base.Center + vector4 * new Vector2((float)((height - num4) / 2)) * Main.rand.NextFloat();
76131 if (!WorldGen.SolidTile((int)targetPosition2.X / 16, (int)targetPosition2.Y / 16) && AI_137_CanHit(targetPosition2))
76132 {
76133 Dust dust2 = Dust.NewDustDirect(targetPosition2, 0, 0, 226, 0f, 0f, 100);
76134 dust2.velocity *= 0.6f;
76135 dust2.velocity += Vector2.UnitY * -2f;
76136 dust2.noGravity = true;
76137 dust2.noLight = true;
76138 }
76139 }
76140 }
76141 for (int l = 0; l < 4; l++)
76142 {
76143 if (Main.rand.Next(10) == 0)
76144 {
76145 Dust dust3 = Dust.NewDustDirect(vector2 - new Vector2(8f, 0f), 16, height / 2 - 40, 226, 0f, 0f, 100);
76146 dust3.velocity *= 0.6f;
76147 dust3.velocity += Vector2.UnitY * -2f;
76148 dust3.scale = 0.7f;
76149 dust3.noGravity = true;
76150 dust3.noLight = true;
76151 }
76152 }
76153 tileCollide = true;
76154 velocity.Y += 0.2f;
76155 }
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
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 readonly SoundStyle DD2_LightningAuraZap
Definition SoundID.cs:65
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
static Conditions.NotNull _cachedConditions_notNull
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
float knockBack
This will always be set in Projectile.NewProjectile based on the weapons knockback and player stat mo...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
static Conditions.IsSolid _cachedConditions_solid
bool Colliding(Rectangle myRect, Rectangle targetRect)
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.
bool AI_137_CanHit(Vector2 targetPosition)
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:154
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:30

References Terraria.DelegateMethods.CastLightOpen(), Terraria.WorldBuilding.Searches.Chain(), Terraria.ID.SoundID.DD2_LightningAuraZap, Terraria.WorldBuilding.WorldUtils.Find(), Terraria.Dust.NewDustDirect(), Terraria.Main.npc, Terraria.Main.player, Terraria.Audio.SoundEngine.PlayTrackedSound(), Terraria.Utils.PlotTileLine(), Terraria.Dust.position, Terraria.Main.projFrames, Terraria.Main.rand, Terraria.WorldGen.SolidTile(), and Terraria.Main.tile.

+ Here is the call graph for this function: