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

◆ AI_122_PirateGhost()

void Terraria.NPC.AI_122_PirateGhost ( )
inline

Definition at line 45421 of file NPC.cs.

45422 {
45423 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
45424 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
45425 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
45426 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
45427 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
45428 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
45429 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
45430 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
45431 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
45432 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
45433 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
45434 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
45435 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
45436 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
45437 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
45438 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
45439 //IL_0144: Unknown result type (might be due to invalid IL or missing references)
45440 //IL_0149: Unknown result type (might be due to invalid IL or missing references)
45441 //IL_015f: Unknown result type (might be due to invalid IL or missing references)
45442 //IL_0165: Unknown result type (might be due to invalid IL or missing references)
45443 //IL_016a: Unknown result type (might be due to invalid IL or missing references)
45444 //IL_016d: Unknown result type (might be due to invalid IL or missing references)
45445 //IL_0172: Unknown result type (might be due to invalid IL or missing references)
45446 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
45447 //IL_0178: Unknown result type (might be due to invalid IL or missing references)
45448 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
45449 if (localAI[0] == 0f)
45450 {
45451 localAI[0] = 1f;
45453 }
45455 if (targetData.Invalid)
45456 {
45457 TargetClosest();
45459 }
45460 if (targetData.Invalid)
45461 {
45462 velocity *= 0.9f;
45463 alpha = Utils.Clamp(alpha + 5, 0, 255);
45464 if (alpha >= 255)
45465 {
45466 StrikeNPCNoInteraction(9999, 0f, 0);
45467 }
45468 return;
45469 }
45470 alpha = Utils.Clamp(alpha - 5, 0, 255);
45471 Vector2 targetPosition = Vector2.Zero.MoveTowards(targetData.Center - base.Center, 4f);
45472 velocity = velocity.MoveTowards(targetPosition, 2f / 15f);
45473 for (int i = 0; i < 200; i++)
45474 {
45475 if (Main.npc[i].active && Main.npc[i].type == type && i != whoAmI)
45476 {
45477 Vector2 vector = Main.npc[i].Center - base.Center;
45478 if (((Vector2)(ref vector)).Length() < 50f)
45479 {
45480 ((Vector2)(ref vector)).Normalize();
45481 vector *= 0.1f;
45482 velocity -= vector;
45483 velocity.X -= vector.X * 1f;
45484 }
45485 }
45486 }
45487 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
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
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static readonly SoundStyle NPCHit6
Definition SoundID.cs:439
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
Definition NPC.cs:1003
void TargetClosest(bool faceTarget=true)
Definition NPC.cs:83247
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
Definition NPC.cs:1668
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
int alpha
0 is opaque, and 255 is transparent. Note that this is the opposite of how alpha is typically express...
Definition NPC.cs:1092
int StrikeNPCNoInteraction(int Damage, float knockBack, int hitDirection)
Definition NPC.cs:91674

References Terraria.NPC.alpha, Terraria.NPC.GetTargetData(), Terraria.NPC.localAI, Terraria.Main.npc, Terraria.ID.SoundID.NPCHit6, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.NPC.StrikeNPCNoInteraction(), Terraria.NPC.TargetClosest(), Terraria.NPC.type, Terraria.Entity.velocity, and Terraria.Entity.whoAmI.

Referenced by Terraria.NPC.VanillaAI_Inner().

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