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

◆ AI_067_TigerSpecialAttack()

bool Terraria.Projectile.AI_067_TigerSpecialAttack ( )
inlineprivate

Definition at line 52158 of file Projectile.cs.

52159 {
52160 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
52161 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
52162 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
52163 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
52164 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
52165 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
52166 //IL_0064: Unknown result type (might be due to invalid IL or missing references)
52167 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
52168 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
52169 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
52170 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
52171 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
52172 //IL_00be: Unknown result type (might be due to invalid IL or missing references)
52173 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
52174 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
52175 //IL_0119: Unknown result type (might be due to invalid IL or missing references)
52176 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
52177 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
52178 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
52179 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
52180 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
52181 //IL_01a5: Unknown result type (might be due to invalid IL or missing references)
52182 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
52183 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
52184 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
52185 //IL_023b: Unknown result type (might be due to invalid IL or missing references)
52186 //IL_0200: Unknown result type (might be due to invalid IL or missing references)
52187 //IL_0206: Unknown result type (might be due to invalid IL or missing references)
52188 //IL_0210: Unknown result type (might be due to invalid IL or missing references)
52189 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
52190 //IL_022f: Unknown result type (might be due to invalid IL or missing references)
52191 //IL_026b: Unknown result type (might be due to invalid IL or missing references)
52192 //IL_0270: Unknown result type (might be due to invalid IL or missing references)
52193 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
52194 //IL_0282: Unknown result type (might be due to invalid IL or missing references)
52195 //IL_0333: Unknown result type (might be due to invalid IL or missing references)
52196 //IL_0299: Unknown result type (might be due to invalid IL or missing references)
52197 //IL_029b: Unknown result type (might be due to invalid IL or missing references)
52198 //IL_029d: Unknown result type (might be due to invalid IL or missing references)
52199 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
52200 //IL_02da: Unknown result type (might be due to invalid IL or missing references)
52201 //IL_02dc: Unknown result type (might be due to invalid IL or missing references)
52202 //IL_0312: Unknown result type (might be due to invalid IL or missing references)
52203 //IL_0314: Unknown result type (might be due to invalid IL or missing references)
52204 List<NPC> list = new List<NPC>();
52205 Vector2 center = Main.player[owner].Center;
52206 Rectangle value = Utils.CenteredRectangle(center, new Vector2(1600f, 800f));
52207 int num = Main.player[owner].ownedProjectileCounts[831] + 1;
52208 for (int i = 0; i < 200; i++)
52209 {
52210 NPC nPC = Main.npc[i];
52211 if (nPC.CanBeChasedBy(this))
52212 {
52213 Rectangle hitbox = nPC.Hitbox;
52214 if (((Rectangle)(ref hitbox)).Intersects(value))
52215 {
52216 list.Add(nPC);
52217 }
52218 }
52219 }
52220 if (list.Count == 0)
52221 {
52222 return false;
52223 }
52224 NPC nPC2 = list[0];
52225 for (int j = 1; j < list.Count; j++)
52226 {
52227 if (Vector2.Distance(nPC2.Center, center) > Vector2.Distance(list[j].Center, center))
52228 {
52229 nPC2 = list[j];
52230 }
52231 }
52232 list.Remove(nPC2);
52233 NPC nPC3 = null;
52234 if (list.Count > 0)
52235 {
52236 nPC3 = list[0];
52237 for (int k = 1; k < list.Count; k++)
52238 {
52239 if (Distance(nPC3.Center) > Distance(list[k].Center))
52240 {
52241 nPC3 = list[k];
52242 }
52243 }
52244 list.Remove(nPC3);
52245 }
52247 if (nPC3 != null)
52248 {
52249 list2.Add(nPC3.Center);
52250 }
52251 int num2 = 0;
52252 while (list.Count > 0 && list2.Count < num - 1)
52253 {
52254 int index = Main.rand.Next(list.Count);
52255 Vector2 vector = list[index].velocity * 4f * (float)(num2 + 1);
52256 list2.Add(list[index].Center + vector);
52257 list.RemoveAt(index);
52258 num2++;
52259 }
52260 if (nPC2 != null)
52261 {
52262 list2.Add(nPC2.Center);
52263 }
52264 if (list2.Count > 0 && Collision.SolidCollision(list2[list2.Count - 1] - base.Size / 2f, width, height))
52265 {
52266 list2.Add(center);
52267 }
52268 Vector2 vector2 = base.Center;
52269 float num3 = Math.Min(20, 30 / list2.Count);
52270 float num4 = 0f;
52271 for (int l = 0; l < list2.Count; l++)
52272 {
52273 float num5 = 20f;
52274 Vector2 vector3 = list2[l];
52275 vector3.X += ((vector2.X < vector3.X) ? num5 : (0f - num5));
52276 Vector2 vector4 = vector3 - vector2;
52277 int num6 = (int)Math.Min(num3, 4.0 + Math.Ceiling(((Vector2)(ref vector4)).Length() / 50f));
52278 if (num6 < 5)
52279 {
52280 num6 = 5;
52281 }
52283 vector2 = vector3;
52284 num4 += (float)num6;
52285 }
52286 base.Center = vector2;
52287 ai[0] = 4f;
52288 ai[1] = num4;
52289 netUpdate = true;
52290 return true;
52291 }
Vector2 Center
Definition Entity.cs:70
float Distance(Vector2 Other)
Definition Entity.cs:275
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
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
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...
IEntitySource GetProjectileSource_FromThis()
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and...

References Terraria.Utils.CenteredRectangle(), Terraria.Main.npc, Terraria.Main.player, Terraria.Main.rand, and Terraria.Collision.SolidCollision().

+ Here is the call graph for this function: