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

◆ Counterweight()

void Terraria.Player.Counterweight ( Vector2 hitPos,
int dmg,
float kb )
inline

Definition at line 10341 of file Player.cs.

10342 {
10343 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
10344 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
10345 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
10346 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
10347 //IL_013c: Unknown result type (might be due to invalid IL or missing references)
10348 //IL_0143: Unknown result type (might be due to invalid IL or missing references)
10349 //IL_0148: Unknown result type (might be due to invalid IL or missing references)
10350 //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
10351 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
10352 //IL_01da: Unknown result type (might be due to invalid IL or missing references)
10353 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
10354 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
10355 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
10356 //IL_0183: Unknown result type (might be due to invalid IL or missing references)
10357 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
10358 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
10359 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
10360 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
10361 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
10362 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
10363 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
10364 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
10365 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
10366 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
10367 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
10368 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
10369 if (!yoyoGlove && counterWeight <= 0)
10370 {
10371 return;
10372 }
10373 int num = -1;
10374 int num2 = 0;
10375 int num3 = 0;
10376 for (int i = 0; i < 1000; i++)
10377 {
10378 if (Main.projectile[i].active && Main.projectile[i].owner == whoAmI)
10379 {
10380 if (Main.projectile[i].counterweight)
10381 {
10382 num3++;
10383 }
10384 else if (Main.projectile[i].aiStyle == 99)
10385 {
10386 num2++;
10387 num = i;
10388 }
10389 }
10390 }
10391 if (yoyoGlove && num2 < 2)
10392 {
10393 if (num >= 0)
10394 {
10395 Vector2 vector = hitPos - base.Center;
10396 ((Vector2)(ref vector)).Normalize();
10397 vector *= 16f;
10398 Projectile.NewProjectile(Entity.InheritSource(Main.projectile[num]), base.Center.X, base.Center.Y, vector.X, vector.Y, Main.projectile[num].type, Main.projectile[num].damage, Main.projectile[num].knockBack, whoAmI, 1f);
10399 }
10400 }
10401 else if (num3 < num2)
10402 {
10403 Vector2 vector2 = hitPos - base.Center;
10404 ((Vector2)(ref vector2)).Normalize();
10405 vector2 *= 16f;
10406 float knockBack = (kb + 6f) / 2f;
10407 IEntitySource spawnSource = Entity.InheritSource(Main.projectile[num]);
10408 if (num3 > 0)
10409 {
10410 Projectile.NewProjectile(spawnSource, base.Center.X, base.Center.Y, vector2.X, vector2.Y, counterWeight, (int)((double)dmg * 0.8), knockBack, whoAmI, 1f);
10411 }
10412 else
10413 {
10414 Projectile.NewProjectile(spawnSource, base.Center.X, base.Center.Y, vector2.X, vector2.Y, counterWeight, (int)((double)dmg * 0.8), knockBack, whoAmI);
10415 }
10416 }
10417 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
This object encapsulates context information about the source of a particular spawning event of an It...

References Terraria.Player.counterWeight, Terraria.Entity.InheritSource(), Terraria.Projectile.NewProjectile(), Terraria.Main.projectile, Terraria.Entity.whoAmI, and Terraria.Player.yoyoGlove.

+ Here is the call graph for this function: