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

◆ AI_176_EdgyLightning()

void Terraria.Projectile.AI_176_EdgyLightning ( )
inlineprivate

Definition at line 47294 of file Projectile.cs.

47295 {
47296 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
47297 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
47298 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
47299 //IL_0087: Unknown result type (might be due to invalid IL or missing references)
47300 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
47301 //IL_0093: Unknown result type (might be due to invalid IL or missing references)
47302 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
47303 //IL_009f: Unknown result type (might be due to invalid IL or missing references)
47304 int num = (int)ai[0] - 1;
47305 if (num != -1 && (!Main.npc[num].CanBeChasedBy(this) || localNPCImmunity[num] != 0))
47306 {
47307 ai[0] = 0f;
47308 num = -1;
47309 }
47310 if (num == -1)
47311 {
47313 if (nPC != null)
47314 {
47315 num = nPC.whoAmI;
47316 ai[0] = num + 1;
47317 netUpdate = true;
47318 }
47319 }
47320 if (num != -1)
47321 {
47322 NPC nPC2 = Main.npc[num];
47323 Vector2 vector = DirectionTo(nPC2.Center);
47324 float num2 = 10f;
47325 if (!vector.HasNaNs())
47326 {
47327 velocity = vector * num2;
47328 rotation = velocity.ToRotation();
47329 }
47330 if (++frameCounter >= 3)
47331 {
47332 frameCounter = 0;
47333 frame = Main.rand.Next(Main.projFrames[type]);
47334 }
47335 }
47336 else
47337 {
47338 Kill();
47339 }
47340 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
NPC FindTargetWithinRange(float maxRange, bool checkCanHit=false)
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.

References Terraria.Main.npc, Terraria.Main.projFrames, and Terraria.Main.rand.