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

◆ AI_140_MonkStaffT1()

void Terraria.Projectile.AI_140_MonkStaffT1 ( )
inlineprivate

Definition at line 76266 of file Projectile.cs.

76267 {
76268 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
76269 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
76270 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
76271 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
76272 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
76273 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
76274 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
76275 //IL_0991: Unknown result type (might be due to invalid IL or missing references)
76276 //IL_0994: Unknown result type (might be due to invalid IL or missing references)
76277 //IL_099e: Unknown result type (might be due to invalid IL or missing references)
76278 //IL_09a3: Unknown result type (might be due to invalid IL or missing references)
76279 //IL_09a8: Unknown result type (might be due to invalid IL or missing references)
76280 //IL_09af: Unknown result type (might be due to invalid IL or missing references)
76281 //IL_09b4: Unknown result type (might be due to invalid IL or missing references)
76282 //IL_09b6: Unknown result type (might be due to invalid IL or missing references)
76283 //IL_09bb: Unknown result type (might be due to invalid IL or missing references)
76284 //IL_053e: Unknown result type (might be due to invalid IL or missing references)
76285 //IL_0572: Unknown result type (might be due to invalid IL or missing references)
76286 //IL_0577: Unknown result type (might be due to invalid IL or missing references)
76287 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
76288 //IL_059b: Unknown result type (might be due to invalid IL or missing references)
76289 //IL_0185: Unknown result type (might be due to invalid IL or missing references)
76290 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
76291 //IL_018d: Unknown result type (might be due to invalid IL or missing references)
76292 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
76293 //IL_0676: Unknown result type (might be due to invalid IL or missing references)
76294 //IL_067b: Unknown result type (might be due to invalid IL or missing references)
76295 //IL_067e: Unknown result type (might be due to invalid IL or missing references)
76296 //IL_0680: Unknown result type (might be due to invalid IL or missing references)
76297 //IL_0210: Unknown result type (might be due to invalid IL or missing references)
76298 //IL_021f: Unknown result type (might be due to invalid IL or missing references)
76299 //IL_0225: Unknown result type (might be due to invalid IL or missing references)
76300 //IL_022a: Unknown result type (might be due to invalid IL or missing references)
76301 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
76302 //IL_070f: Unknown result type (might be due to invalid IL or missing references)
76303 //IL_0714: Unknown result type (might be due to invalid IL or missing references)
76304 //IL_0717: Unknown result type (might be due to invalid IL or missing references)
76305 //IL_0719: Unknown result type (might be due to invalid IL or missing references)
76306 //IL_0723: Unknown result type (might be due to invalid IL or missing references)
76307 //IL_0246: Unknown result type (might be due to invalid IL or missing references)
76308 //IL_0250: Unknown result type (might be due to invalid IL or missing references)
76309 //IL_0255: Unknown result type (might be due to invalid IL or missing references)
76310 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
76311 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
76312 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)
76313 //IL_074f: Unknown result type (might be due to invalid IL or missing references)
76314 //IL_075e: Unknown result type (might be due to invalid IL or missing references)
76315 //IL_0764: Unknown result type (might be due to invalid IL or missing references)
76316 //IL_0769: Unknown result type (might be due to invalid IL or missing references)
76317 //IL_076c: Unknown result type (might be due to invalid IL or missing references)
76318 //IL_06b8: Unknown result type (might be due to invalid IL or missing references)
76319 //IL_06bd: Unknown result type (might be due to invalid IL or missing references)
76320 //IL_0269: Unknown result type (might be due to invalid IL or missing references)
76321 //IL_0270: Unknown result type (might be due to invalid IL or missing references)
76322 //IL_0275: Unknown result type (might be due to invalid IL or missing references)
76323 //IL_029d: Unknown result type (might be due to invalid IL or missing references)
76324 //IL_02a3: Unknown result type (might be due to invalid IL or missing references)
76325 //IL_02b6: Unknown result type (might be due to invalid IL or missing references)
76326 //IL_02bb: Unknown result type (might be due to invalid IL or missing references)
76327 //IL_02c5: Unknown result type (might be due to invalid IL or missing references)
76328 //IL_02cc: Unknown result type (might be due to invalid IL or missing references)
76329 //IL_02d6: Unknown result type (might be due to invalid IL or missing references)
76330 //IL_02db: Unknown result type (might be due to invalid IL or missing references)
76331 //IL_02e0: Unknown result type (might be due to invalid IL or missing references)
76332 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
76333 //IL_02f6: Unknown result type (might be due to invalid IL or missing references)
76334 //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
76335 //IL_0320: Unknown result type (might be due to invalid IL or missing references)
76336 //IL_0326: Unknown result type (might be due to invalid IL or missing references)
76337 //IL_0339: Unknown result type (might be due to invalid IL or missing references)
76338 //IL_033e: Unknown result type (might be due to invalid IL or missing references)
76339 //IL_0348: Unknown result type (might be due to invalid IL or missing references)
76340 //IL_034f: Unknown result type (might be due to invalid IL or missing references)
76341 //IL_0359: Unknown result type (might be due to invalid IL or missing references)
76342 //IL_035e: Unknown result type (might be due to invalid IL or missing references)
76343 //IL_0363: Unknown result type (might be due to invalid IL or missing references)
76344 //IL_0380: Unknown result type (might be due to invalid IL or missing references)
76345 //IL_0385: Unknown result type (might be due to invalid IL or missing references)
76346 //IL_0785: Unknown result type (might be due to invalid IL or missing references)
76347 //IL_078f: Unknown result type (might be due to invalid IL or missing references)
76348 //IL_0794: Unknown result type (might be due to invalid IL or missing references)
76349 //IL_0799: Unknown result type (might be due to invalid IL or missing references)
76350 //IL_079d: Unknown result type (might be due to invalid IL or missing references)
76351 //IL_07a2: Unknown result type (might be due to invalid IL or missing references)
76352 //IL_07a4: Unknown result type (might be due to invalid IL or missing references)
76353 //IL_07b6: Unknown result type (might be due to invalid IL or missing references)
76354 //IL_07bc: Unknown result type (might be due to invalid IL or missing references)
76355 //IL_07be: Unknown result type (might be due to invalid IL or missing references)
76356 //IL_07c3: Unknown result type (might be due to invalid IL or missing references)
76357 //IL_07d2: Unknown result type (might be due to invalid IL or missing references)
76358 //IL_07d9: Unknown result type (might be due to invalid IL or missing references)
76359 //IL_07de: Unknown result type (might be due to invalid IL or missing references)
76360 //IL_0806: Unknown result type (might be due to invalid IL or missing references)
76361 //IL_080c: Unknown result type (might be due to invalid IL or missing references)
76362 //IL_081f: Unknown result type (might be due to invalid IL or missing references)
76363 //IL_0824: Unknown result type (might be due to invalid IL or missing references)
76364 //IL_082e: Unknown result type (might be due to invalid IL or missing references)
76365 //IL_0835: Unknown result type (might be due to invalid IL or missing references)
76366 //IL_083f: Unknown result type (might be due to invalid IL or missing references)
76367 //IL_0844: Unknown result type (might be due to invalid IL or missing references)
76368 //IL_0849: Unknown result type (might be due to invalid IL or missing references)
76369 //IL_04bc: Unknown result type (might be due to invalid IL or missing references)
76370 //IL_04c9: Unknown result type (might be due to invalid IL or missing references)
76371 //IL_04ce: Unknown result type (might be due to invalid IL or missing references)
76372 //IL_04d3: Unknown result type (might be due to invalid IL or missing references)
76373 //IL_0505: Unknown result type (might be due to invalid IL or missing references)
76374 //IL_0485: Unknown result type (might be due to invalid IL or missing references)
76375 //IL_0487: Unknown result type (might be due to invalid IL or missing references)
76376 //IL_03ba: Unknown result type (might be due to invalid IL or missing references)
76377 //IL_03c1: Unknown result type (might be due to invalid IL or missing references)
76378 //IL_03c6: Unknown result type (might be due to invalid IL or missing references)
76379 //IL_03eb: Unknown result type (might be due to invalid IL or missing references)
76380 //IL_03f1: Unknown result type (might be due to invalid IL or missing references)
76381 //IL_03ff: Unknown result type (might be due to invalid IL or missing references)
76382 //IL_0409: Unknown result type (might be due to invalid IL or missing references)
76383 //IL_040e: Unknown result type (might be due to invalid IL or missing references)
76384 //IL_043a: Unknown result type (might be due to invalid IL or missing references)
76385 //IL_043f: Unknown result type (might be due to invalid IL or missing references)
76386 //IL_051d: Unknown result type (might be due to invalid IL or missing references)
76387 //IL_08b3: Unknown result type (might be due to invalid IL or missing references)
76388 //IL_08cd: Unknown result type (might be due to invalid IL or missing references)
76389 //IL_08d3: Unknown result type (might be due to invalid IL or missing references)
76390 //IL_08e4: Unknown result type (might be due to invalid IL or missing references)
76391 //IL_08e9: Unknown result type (might be due to invalid IL or missing references)
76392 //IL_0901: Unknown result type (might be due to invalid IL or missing references)
76393 //IL_0908: Unknown result type (might be due to invalid IL or missing references)
76394 //IL_090d: Unknown result type (might be due to invalid IL or missing references)
76395 //IL_0912: Unknown result type (might be due to invalid IL or missing references)
76396 //IL_0919: Unknown result type (might be due to invalid IL or missing references)
76397 //IL_0931: Unknown result type (might be due to invalid IL or missing references)
76398 //IL_0938: Unknown result type (might be due to invalid IL or missing references)
76399 //IL_093f: Unknown result type (might be due to invalid IL or missing references)
76400 //IL_0944: Unknown result type (might be due to invalid IL or missing references)
76401 float num = 50f;
76402 float num9 = 2f;
76403 float num10 = 20f;
76404 Player player = Main.player[owner];
76405 float num11 = -(float)Math.PI / 4f;
76406 Vector2 vector = player.RotatedRelativePoint(player.MountedCenter);
76407 Vector2 vector2 = Vector2.Zero;
76408 if (player.dead)
76409 {
76410 Kill();
76411 return;
76412 }
76413 if (type == 697)
76414 {
76415 int num12 = damage * 3;
76416 int num13 = Math.Sign(velocity.X);
76417 velocity = new Vector2((float)num13, 0f);
76418 if (ai[0] == 0f)
76419 {
76420 rotation = Utils.ToRotation(new Vector2((float)num13, 0f - player.gravDir)) + num11 + (float)Math.PI;
76421 if (velocity.X < 0f)
76422 {
76423 rotation -= (float)Math.PI / 2f;
76424 }
76425 }
76426 alpha -= 128;
76427 if (alpha < 0)
76428 {
76429 alpha = 0;
76430 }
76431 float num16 = ai[0] / num;
76432 float num14 = 1f;
76433 ai[0] += num14;
76434 rotation += (float)Math.PI * 2f * num9 / num * (float)num13;
76435 bool flag = ai[0] == (float)(int)(num / 2f);
76436 if (ai[0] >= num || (flag && !player.controlUseItem))
76437 {
76438 Kill();
76439 player.reuseDelay = 10;
76440 }
76441 else if (flag)
76442 {
76443 Vector2 mouseWorld = Main.MouseWorld;
76444 int num15 = ((player.DirectionTo(mouseWorld).X > 0f) ? 1 : (-1));
76445 if ((float)num15 != velocity.X)
76446 {
76447 player.ChangeDir(num15);
76448 velocity = new Vector2((float)num15, 0f);
76449 netUpdate = true;
76450 rotation -= (float)Math.PI;
76451 }
76452 }
76453 float num2 = rotation - (float)Math.PI / 4f * (float)num13;
76454 vector2 = (num2 + ((num13 == -1) ? ((float)Math.PI) : 0f)).ToRotationVector2() * (ai[0] / num) * num10;
76455 Vector2 vector3 = base.Center + (num2 + ((num13 == -1) ? ((float)Math.PI) : 0f)).ToRotationVector2() * 30f;
76456 if (Main.rand.Next(2) == 0)
76457 {
76458 Dust dust = Dust.NewDustDirect(vector3 - new Vector2(5f), 10, 10, 31, player.velocity.X, player.velocity.Y, 150);
76459 dust.velocity = DirectionTo(dust.position) * 0.1f + dust.velocity * 0.1f;
76460 }
76461 if (num16 >= 0.75f)
76462 {
76463 Dust dust2 = Dust.NewDustDirect(vector3 - new Vector2(5f), 10, 10, 55, player.velocity.X, player.velocity.Y, 50);
76464 dust2.velocity = DirectionTo(dust2.position) * 0.1f + dust2.velocity * 0.1f;
76465 dust2.noGravity = true;
76466 dust2.color = new Color(20, 255, 100, 160);
76467 }
76468 if (ai[0] >= num - 8f && ai[0] < num - 2f)
76469 {
76470 for (int i = 0; i < 5; i++)
76471 {
76472 Dust dust5 = Dust.NewDustDirect(vector3 - new Vector2(5f), 10, 10, 55, player.velocity.X, player.velocity.Y, 50);
76473 dust5.velocity *= 1.2f;
76474 dust5.noGravity = true;
76475 dust5.scale += 0.1f;
76476 dust5.color = new Color(20, 255, 100, 160);
76477 }
76478 }
76479 if (ai[0] == num - 3f && owner == Main.myPlayer)
76480 {
76482 {
76483 NewProjectile(GetProjectileSource_FromThis(), vector3 + new Vector2((float)(num13 * 20), -60f), Vector2.Zero, 698, num12, 0f, owner);
76485 }
76486 else
76487 {
76489 }
76490 }
76491 }
76492 if (type == 707)
76493 {
76494 Lighting.AddLight(player.Center, 0.75f, 0.9f, 1.15f);
76495 int num3 = Math.Sign(velocity.X);
76496 velocity = new Vector2((float)num3, 0f);
76497 if (ai[0] == 0f)
76498 {
76499 rotation = Utils.ToRotation(new Vector2((float)num3, 0f - player.gravDir)) + num11 + (float)Math.PI;
76500 if (velocity.X < 0f)
76501 {
76502 rotation -= (float)Math.PI / 2f;
76503 }
76504 }
76505 alpha -= 128;
76506 if (alpha < 0)
76507 {
76508 alpha = 0;
76509 }
76510 _ = ai[0] / num;
76511 float num4 = 1f;
76512 ai[0] += num4;
76513 rotation += (float)Math.PI * 2f * num9 / num * (float)num3;
76514 bool flag2 = ai[0] == (float)(int)(num / 2f);
76515 if (ai[0] >= num || (flag2 && !player.controlUseItem))
76516 {
76517 Kill();
76518 player.reuseDelay = 2;
76519 }
76520 else if (flag2)
76521 {
76522 Vector2 mouseWorld2 = Main.MouseWorld;
76523 int num5 = ((player.DirectionTo(mouseWorld2).X > 0f) ? 1 : (-1));
76524 if ((float)num5 != velocity.X)
76525 {
76526 player.ChangeDir(num5);
76527 velocity = new Vector2((float)num5, 0f);
76528 netUpdate = true;
76529 rotation -= (float)Math.PI;
76530 }
76531 }
76532 if ((ai[0] == num4 || (ai[0] == (float)(int)(num / 2f) && active)) && owner == Main.myPlayer)
76533 {
76534 Vector2 mouseWorld3 = Main.MouseWorld;
76535 _ = player.DirectionTo(mouseWorld3) * 0f;
76536 }
76537 float num6 = rotation - (float)Math.PI / 4f * (float)num3;
76538 vector2 = (num6 + ((num3 == -1) ? ((float)Math.PI) : 0f)).ToRotationVector2() * (ai[0] / num) * num10;
76539 Vector2 vector4 = base.Center + (num6 + ((num3 == -1) ? ((float)Math.PI) : 0f)).ToRotationVector2() * 30f;
76540 Vector2 vector5 = num6.ToRotationVector2();
76541 Vector2 vector6 = vector5.RotatedBy((float)Math.PI / 2f * (float)spriteDirection);
76542 if (Main.rand.Next(2) == 0)
76543 {
76544 Dust dust3 = Dust.NewDustDirect(vector4 - new Vector2(5f), 10, 10, 31, player.velocity.X, player.velocity.Y, 150);
76545 dust3.velocity = DirectionTo(dust3.position) * 0.1f + dust3.velocity * 0.1f;
76546 }
76547 for (int j = 0; j < 4; j++)
76548 {
76549 float num7 = 1f;
76550 float num8 = 1f;
76551 switch (j)
76552 {
76553 case 1:
76554 num8 = -1f;
76555 break;
76556 case 2:
76557 num8 = 1.25f;
76558 num7 = 0.5f;
76559 break;
76560 case 3:
76561 num8 = -1.25f;
76562 num7 = 0.5f;
76563 break;
76564 }
76565 if (Main.rand.Next(6) != 0)
76566 {
76567 Dust dust4 = Dust.NewDustDirect(position, 0, 0, 226, 0f, 0f, 100);
76568 dust4.position = base.Center + vector5 * (60f + Main.rand.NextFloat() * 20f) * num8;
76569 dust4.velocity = vector6 * (4f + 4f * Main.rand.NextFloat()) * num8 * num7;
76570 dust4.noGravity = true;
76571 dust4.noLight = true;
76572 dust4.scale = 0.5f;
76573 dust4.customData = this;
76574 if (Main.rand.Next(4) == 0)
76575 {
76576 dust4.noGravity = false;
76577 }
76578 }
76579 }
76580 }
76581 position = vector - base.Size / 2f;
76582 position += vector2;
76584 timeLeft = 2;
76585 player.ChangeDir(direction);
76586 player.heldProj = whoAmI;
76587 player.SetDummyItemTime(2);
76588 player.itemRotation = MathHelper.WrapAngle(rotation);
76589 }
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
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
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
static readonly SoundStyle DD2_MonkStaffGroundImpact
Definition SoundID.cs:213
static readonly SoundStyle DD2_MonkStaffGroundMiss
Definition SoundID.cs:215
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...
static Conditions.NotNull _cachedConditions_notNull
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
static Conditions.IsSolid _cachedConditions_solid
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
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...
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:154
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:30

References Terraria.Lighting.AddLight(), Terraria.Entity.Center, Terraria.WorldBuilding.Searches.Chain(), Terraria.Player.ChangeDir(), Terraria.Player.controlUseItem, Terraria.ID.SoundID.DD2_MonkStaffGroundImpact, Terraria.ID.SoundID.DD2_MonkStaffGroundMiss, Terraria.Player.dead, Terraria.Entity.DirectionTo(), Terraria.WorldBuilding.WorldUtils.Find(), Terraria.Player.gravDir, Terraria.Player.MountedCenter, Terraria.Main.MouseWorld, Terraria.Main.myPlayer, Terraria.Dust.NewDustDirect(), Terraria.Main.player, Terraria.Audio.SoundEngine.PlayTrackedSound(), Terraria.Dust.position, Terraria.Main.rand, Terraria.Player.RotatedRelativePoint(), Terraria.Player.SetDummyItemTime(), Terraria.Utils.ToRotation(), and Terraria.Entity.velocity.

+ Here is the call graph for this function: