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

◆ AI_111_DryadsWard()

void Terraria.Projectile.AI_111_DryadsWard ( )
inlineprivate

Definition at line 42117 of file Projectile.cs.

42118 {
42119 //IL_022b: Unknown result type (might be due to invalid IL or missing references)
42120 //IL_024b: Unknown result type (might be due to invalid IL or missing references)
42121 //IL_0251: Unknown result type (might be due to invalid IL or missing references)
42122 //IL_0276: Unknown result type (might be due to invalid IL or missing references)
42123 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
42124 //IL_027e: Unknown result type (might be due to invalid IL or missing references)
42125 //IL_0283: Unknown result type (might be due to invalid IL or missing references)
42126 //IL_0288: Unknown result type (might be due to invalid IL or missing references)
42127 //IL_0359: Unknown result type (might be due to invalid IL or missing references)
42128 //IL_0379: Unknown result type (might be due to invalid IL or missing references)
42129 //IL_037f: Unknown result type (might be due to invalid IL or missing references)
42130 //IL_03a4: Unknown result type (might be due to invalid IL or missing references)
42131 //IL_03a9: Unknown result type (might be due to invalid IL or missing references)
42132 //IL_03b0: Unknown result type (might be due to invalid IL or missing references)
42133 //IL_03b5: Unknown result type (might be due to invalid IL or missing references)
42134 //IL_03ba: Unknown result type (might be due to invalid IL or missing references)
42135 //IL_02e3: Unknown result type (might be due to invalid IL or missing references)
42136 //IL_02ed: Unknown result type (might be due to invalid IL or missing references)
42137 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)
42138 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
42139 //IL_02ac: Unknown result type (might be due to invalid IL or missing references)
42140 //IL_02b6: Unknown result type (might be due to invalid IL or missing references)
42141 //IL_02bb: Unknown result type (might be due to invalid IL or missing references)
42142 //IL_0415: Unknown result type (might be due to invalid IL or missing references)
42143 //IL_041f: Unknown result type (might be due to invalid IL or missing references)
42144 //IL_0424: Unknown result type (might be due to invalid IL or missing references)
42145 //IL_03d4: Unknown result type (might be due to invalid IL or missing references)
42146 //IL_03de: Unknown result type (might be due to invalid IL or missing references)
42147 //IL_03e8: Unknown result type (might be due to invalid IL or missing references)
42148 //IL_03ed: Unknown result type (might be due to invalid IL or missing references)
42149 //IL_0462: Unknown result type (might be due to invalid IL or missing references)
42150 //IL_04f5: Unknown result type (might be due to invalid IL or missing references)
42151 //IL_0593: Unknown result type (might be due to invalid IL or missing references)
42152 //IL_059c: Unknown result type (might be due to invalid IL or missing references)
42153 if (!Main.npc[(int)ai[1]].active || Main.npc[(int)ai[1]].type != 20 || Main.npc[(int)ai[1]].ai[0] != 14f)
42154 {
42155 Kill();
42156 return;
42157 }
42158 ai[0] += 1f;
42159 rotation += (float)Math.PI / 300f;
42160 scale = ai[0] / 100f;
42161 if (scale > 1f)
42162 {
42163 scale = 1f;
42164 }
42165 alpha = (int)(255f * (1f - scale));
42166 float num = 300f;
42167 if (ai[0] >= 100f)
42168 {
42169 num = MathHelper.Lerp(300f, 600f, (ai[0] - 100f) / 200f);
42170 }
42171 if (num > 600f)
42172 {
42173 num = 600f;
42174 }
42175 if (ai[0] >= 500f)
42176 {
42177 alpha = (int)MathHelper.Lerp(0f, 255f, (ai[0] - 500f) / 100f);
42178 num = MathHelper.Lerp(600f, 1200f, (ai[0] - 500f) / 100f);
42179 rotation += (float)Math.PI / 300f;
42180 }
42181 int num2 = 163;
42182 if (ai[2] == 1f)
42183 {
42184 float num3 = (float)Math.Sin(ai[0] % 120f * ((float)Math.PI * 2f) / 120f) * 0.5f + 0.5f;
42185 if (Main.rand.NextFloat() < num3)
42186 {
42187 num2 = 70;
42188 }
42189 }
42190 if (Main.rand.Next(4) == 0)
42191 {
42192 float num4 = num;
42193 Vector2 vector = default(Vector2);
42194 ((Vector2)(ref vector))._002Ector((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
42195 float num5 = Main.rand.Next(3, 9);
42196 ((Vector2)(ref vector)).Normalize();
42197 int num6 = Dust.NewDust(new Vector2(position.X, position.Y), width, height, num2, 0f, 0f, 100);
42198 Main.dust[num6].noGravity = true;
42199 Main.dust[num6].position = base.Center + vector * num4;
42200 if (Main.rand.Next(8) == 0)
42201 {
42202 Main.dust[num6].velocity = vector * (0f - num5) * 3f;
42203 Main.dust[num6].scale += 0.5f;
42204 }
42205 else
42206 {
42207 Main.dust[num6].velocity = vector * (0f - num5);
42208 }
42209 }
42210 if (Main.rand.Next(2) == 0)
42211 {
42212 Vector2 vector2 = default(Vector2);
42213 ((Vector2)(ref vector2))._002Ector((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
42214 float num7 = Main.rand.Next(3, 9);
42215 ((Vector2)(ref vector2)).Normalize();
42216 int num8 = Dust.NewDust(new Vector2(position.X, position.Y), width, height, num2, 0f, 0f, 100, default(Color), 1.5f);
42217 Main.dust[num8].noGravity = true;
42218 Main.dust[num8].position = base.Center + vector2 * 30f;
42219 if (Main.rand.Next(8) == 0)
42220 {
42221 Main.dust[num8].velocity = vector2 * (0f - num7) * 3f;
42222 Main.dust[num8].scale += 0.5f;
42223 }
42224 else
42225 {
42226 Main.dust[num8].velocity = vector2 * (0f - num7);
42227 }
42228 }
42229 if (ai[0] >= 30f && Main.netMode != 2)
42230 {
42231 Player player = Main.player[Main.myPlayer];
42232 if (player.active && !player.dead && Distance(player.Center) <= num && player.FindBuffIndex(165) == -1)
42233 {
42234 player.AddBuff(165, 120);
42235 }
42236 }
42237 if (ai[0] >= 30f && ai[0] % 10f == 0f && Main.netMode != 1)
42238 {
42239 for (int i = 0; i < 200; i++)
42240 {
42241 NPC nPC = Main.npc[i];
42242 if (nPC.type != 488 && nPC.active && Distance(nPC.Center) <= num)
42243 {
42244 if (nPC.townNPC && (nPC.FindBuffIndex(165) == -1 || nPC.buffTime[nPC.FindBuffIndex(165)] <= 20))
42245 {
42246 nPC.AddBuff(165, 120);
42247 }
42248 else if (!nPC.friendly && nPC.lifeMax > 5 && !nPC.dontTakeDamage && (nPC.FindBuffIndex(186) == -1 || nPC.buffTime[nPC.FindBuffIndex(186)] <= 20) && (nPC.dryadBane || Collision.CanHit(base.Center, 1, 1, nPC.position, nPC.width, nPC.height)))
42249 {
42250 nPC.AddBuff(186, 120);
42251 }
42252 }
42253 }
42254 }
42255 if (ai[0] >= 570f)
42256 {
42257 Kill();
42258 }
42259 }
float Distance(Vector2 Other)
Definition Entity.cs:275
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
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
float scale
Scales how large the projectile will be drawn. Will also affect the hitbox (F:Terraria....

References Terraria.Entity.active, Terraria.Player.AddBuff(), Terraria.Collision.CanHit(), Terraria.Entity.Center, Terraria.Player.dead, Terraria.Main.dust, Terraria.Player.FindBuffIndex(), Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Dust.NewDust(), Terraria.Main.npc, Terraria.Main.player, and Terraria.Main.rand.

+ Here is the call graph for this function: