52294 {
52295
52296
52297
52298
52299
52300
52301
52302
52303
52304
52305
52306
52307
52308
52309
52310
52311
52312
52313
52314
52315
52316
52317
52318
52319
52320
52321
52322
52323
52324
52325
52326
52327
52328
52329
52330
52331
52332
52333
52334
52335
52336
52337
52338
52339
52340
52341
52342
52343
52344
52345
52346
52347
52348
52349
52350
52351
52352
52353
52354
52355
52356
52357
52358
52359
52360
52361
52362
52363
52364
52365
52366
52367
52368
52369
52370
52371
52372
52373
52374
52375
52376
52377
52378
52379
52380
52381
52382
52383
52384
52385
52386
52387
52388
52389
52390
52391
52392
52393
52394
52395
52396
52397
52398
52399
52400
52401
52402
52403
52404
52405
52406
52407
52408
52409
52410
52411
52412
52413
52414
52415
52416
52417
52418
52419
52420
52421
52422
52423
52424
52425
52426
52427
52428
52429
52430
52431
52432
52433
52434
52435
52436
52437
52438
52439
52440
52441
52442
52443
52444
52445
52446
52447
52448
52449
52450
52451
52452
52453
52454
52455
52456
52457
52458
52459
52460
52461
52462
52463
52464
52465
52466
52467
52468
52469
52470
52471
52472
52473
52474
52475
52476
52477
52478
52479
52480
52481
52482
52483
52484
52485
52486
52487
52488
52489
52490
52491
52492
52493
52494
52495
52496
52497
52498
52499
52500
52501
52502
52503
52504
52505
52506
52507
52508
52509
52510
52511
52512
52513
52514
52515
52516
52517
52518
52519
52520
52521
52522
52523
52524
52525
52526
52527
52528
52529
52530
52531
52532
52533
52534
52535
52536
52537
52538
52539
52540
52541
52542
52543
52544
52545
52546
52547
52548
52549
52550
52551
52552
52553
52554
52555
52556
52557
52558
52559
52560
52561
52562
52563
52564
52565
52566
52567
52568
52569
52570
52571
52572
52573
52574
52575
52576
52577
52578
52579
52580
52581
52582
52583
52584
52585
52587 if (!player.active)
52588 {
52590 return;
52591 }
52602 {
52603 if (player.dead)
52604 {
52605 player.flinxMinion = false;
52606 }
52607 if (player.flinxMinion)
52608 {
52610 }
52612 }
52614 {
52615 if (player.dead)
52616 {
52617 player.pirateMinion = false;
52618 }
52619 if (player.pirateMinion)
52620 {
52622 }
52624 }
52627 {
52628 if (player.dead)
52629 {
52630 player.stormTiger = false;
52631 }
52632 if (player.stormTiger)
52633 {
52635 }
52638 {
52639 if (
velocity != Vector2.Zero && Main.rand.Next(18) == 0)
52640 {
52641 Dust[] dust = Main.dust;
52647 obj.fadeIn = 0.5f;
52648 obj.scale = 0.3f;
52649 obj.noLight = true;
52650 obj.velocity +=
velocity * 0.005f;
52651 }
52653 {
52654 Lighting.AddLight(
base.Center, Vector3.One * 0.5f);
52655 }
52657 {
52658 Lighting.AddLight(
base.Center, Vector3.One * 0.8f);
52659 }
52661 {
52663 newColor = Color.Lerp(Main.OurFavoriteColor, Color.White, 0.8f);
52665 }
52666 }
52667 if (
owner == Main.myPlayer)
52668 {
52670 {
52672 {
52673 834 => 300,
52674 835 => 240,
52676 };
52678 {
52681 }
52682 }
52683 else
52684 {
52686 }
52687 }
52688 }
52690 {
52691 if (player.dead)
52692 {
52693 player.vampireFrog = false;
52694 }
52695 if (player.vampireFrog)
52696 {
52698 }
52700 }
52702 {
52704 if (player.dead)
52705 {
52706 player.crimsonHeart = false;
52707 }
52708 if (player.crimsonHeart)
52709 {
52711 }
52712 }
52714 {
52716 if (player.dead)
52717 {
52718 player.companionCube = false;
52719 }
52720 if (player.companionCube)
52721 {
52723 }
52724 }
52726 {
52728 if (player.dead)
52729 {
52730 player.petFlagDirtiestBlock = false;
52731 }
52732 if (player.petFlagDirtiestBlock)
52733 {
52735 }
52736 }
52738 {
52742 {
52744 }
52746 if (!(
ai[1] <= 0
f))
52747 {
52748 return;
52749 }
52753 }
52754 Vector2
vector = player.Center;
52756 {
52757 vector.X -= (45 + player.width / 2) * player.direction;
52758 vector.X -=
minionPos * 30 * player.direction;
52759 }
52761 {
52762 vector.X -= (15 + player.width / 2) * player.direction;
52763 vector.X -=
minionPos * 20 * player.direction;
52764 }
52766 {
52767 vector.X -= (15 + player.width / 2) * player.direction;
52768 vector.X -=
minionPos * 40 * player.direction;
52769 }
52771 {
52772 vector.X -= (35 + player.width / 2) * player.direction;
52773 vector.X -=
minionPos * 40 * player.direction;
52774 }
52775 else if (
type == 500)
52776 {
52777 vector.X -= (15 + player.width / 2) * player.direction;
52778 vector.X -= 40 * player.direction;
52779 }
52780 else if (
type == 1018)
52781 {
52782 vector.X = player.Center.X;
52783 }
52784 else if (
type == 653)
52785 {
52786 vector.X = player.Center.X;
52787 }
52789 {
52790 Lighting.AddLight(
base.Center, 0.9f, 0.1f, 0.3f);
52793 {
52795 }
52797 {
52800 {
52802 }
52803 }
52807 Main.dust[
num50].scale = 1
f;
52808 Main.dust[
num50].velocity =
vector6.RotatedByRandom(0.7853981852531433) * 3.5f;
52809 Main.dust[
num50].noGravity =
true;
52811 }
52813 {
52815 }
52817 {
52821 {
52824 {
52826 }
52827 }
52830 {
52832 }
52833 else
52834 {
52836 }
52839 {
52841 {
52845 }
52847 }
52848 if (
flag13 &&
owner == Main.myPlayer && Main.netMode != 2)
52849 {
52850 newColor = Lighting.GetColor((
int)
base.Center.X / 16, (
int)
base.Center.Y / 16);
52852 newColor = Lighting.GetColor((
int)player.Center.X / 16, (int)player.Center.Y / 16);
52855 {
52857 }
52859 {
52861 }
52863 if (
localAI[1] > (
float)Main.rand.Next(30, 120) && !player.immune && player.velocity == Vector2.Zero)
52864 {
52865 if (Main.rand.Next(5) == 0)
52866 {
52869 }
52870 else
52871 {
52874 player.immune = false;
52875 player.immuneTime = 0;
52876 localAI[1] = -300 + Main.rand.Next(30) * -10;
52877 }
52878 }
52879 }
52880 }
52883 {
52885 }
52894 {
52897 }
52899 {
52903 }
52905 {
52909 }
52912 {
52914 }
52916 {
52918 }
52924 {
52926 {
52931 {
52934 return;
52935 }
52936 Point point =
nPC.Top.ToTileCoordinates();
52938 int num3 = point.Y;
52940 {
52941 Tile tile = Main.tile[point.X,
num3];
52942 if (tile == null || tile.active())
52943 {
52944 break;
52945 }
52948 }
52951 {
52954 return;
52955 }
52958 {
52961 }
52966 Vector2 top =
nPC.Top;
52967 float num8 = (float)
Math.Cos(Main.timeForVisualEffects / (
double)
num6 * 6.2831854820251465);
52969 {
52971 }
52976 {
52978 }
52982 {
52984 }
52986 }
52987 else
52988 {
52991 }
52992 return;
52993 }
52995 {
53000 if (
num10 <
Math.Abs(player.velocity.X) +
Math.Abs(player.velocity.Y))
53001 {
53002 num10 =
Math.Abs(player.velocity.X) +
Math.Abs(player.velocity.Y);
53003 }
53007 {
53009 }
53011 {
53015 {
53017 }
53018 }
53020 {
53024 {
53025 velocity.X +=
num9;
53027 {
53028 velocity.X +=
num9 * 1.5f;
53029 }
53030 }
53032 {
53033 velocity.X -=
num9;
53035 {
53036 velocity.X -=
num9 * 1.5f;
53037 }
53038 }
53040 {
53041 velocity.Y +=
num9;
53043 {
53044 velocity.Y +=
num9 * 1.5f;
53045 }
53046 }
53048 {
53049 velocity.Y -=
num9;
53051 {
53052 velocity.Y -=
num9 * 1.5f;
53053 }
53054 }
53055 }
53057 {
53059 }
53061 {
53064 {
53067 }
53069 {
53071 }
53073 }
53075 {
53078 {
53081 }
53083 {
53085 }
53087 }
53089 {
53092 {
53094 }
53097 }
53099 {
53102 {
53104 }
53106 }
53107 if (
type == 1018 && Main.LocalPlayer.miscCounter % 3 == 0)
53108 {
53110 Dust[]
dust2 = Main.dust;
53116 obj2.velocity = -
velocity * 0.25f;
53117 obj2.velocity =
obj2.velocity.RotatedByRandom(0.2617993950843811);
53118 }
53119 }
53120 if (
ai[0] == 2
f &&
ai[1] < 0
f)
53121 {
53125 {
53129 return;
53130 }
53131 }
53132 else if (
ai[0] == 2
f)
53133 {
53137 {
53141 {
53143 }
53144 }
53146 {
53148 if ((
double)
num15 > 0.25 && (double)
num15 < 0.75)
53149 {
53151 }
53154 {
53156 }
53158 {
53160 }
53161 else
53162 {
53164 }
53166 {
53167 velocity.X *= 0.8f;
53168 }
53169 }
53170 velocity.Y += 0.4f;
53172 {
53174 }
53177 {
53179 {
53183 return;
53184 }
53186 }
53187 }
53189 {
53193 {
53195 }
53200 {
53202 bool flag4 = velocity.Y == 0
f;
53204 {
53206 }
53208 {
53209 float num58 = (center.Y -
base.Center.Y) * -1
f;
53210 float num18 = 0.4f;
53213 {
53215 }
53216 velocity.Y = 0
f -
num19;
53217 }
53219 {
53221 {
53223 }
53227 direction = ((center.X - base.Center.X > 0
f) ? 1 : (-1));
53228 }
53230 {
53231 Point
point2 =
nPC2.Top.ToTileCoordinates();
53235 {
53238 {
53239 break;
53240 }
53243 }
53245 {
53249 return;
53250 }
53253 {
53256 }
53257 }
53258 }
53260 {
53263 {
53265 }
53266 vector.X += 20 * -
num23;
53267 }
53268 }
53270 {
53271 if (Main.player[
owner].rocketDelay2 > 0)
53272 {
53275 }
53278 {
53280 }
53282 {
53286 {
53288 }
53290 {
53292 }
53293 }
53294 }
53296 {
53298 {
53300 {
53302 }
53303 Rectangle
r = Utils.CenteredRectangle(
vector,
base.Size);
53304 for (int i = 0; i < 20; i++)
53305 {
53306 if (Collision.SolidCollision(
r.TopLeft(),
r.Width,
r.Height))
53307 {
53308 break;
53309 }
53310 r.Y += 16;
53312 }
53316 {
53318 if (player.Center.Distance(
base.Center) <
num24)
53319 {
53321 }
53322 }
53325 {
53326 Rectangle
r2 = Utils.CenteredRectangle(player.Center,
base.Size);
53330 {
53332 if (Collision.SolidCollision(
r2.TopLeft() +
vector2 *
num25,
r.Width,
r.Height))
53333 {
53334 break;
53335 }
53337 }
53339 }
53340 }
53342 float num26 = 0.5f;
53345 float num29 = 0.1f;
53347 {
53351 }
53353 {
53357 }
53359 {
53363 }
53365 {
53369 }
53370 if (
num28 <
Math.Abs(player.velocity.X) +
Math.Abs(player.velocity.Y))
53371 {
53372 num28 =
Math.Abs(player.velocity.X) +
Math.Abs(player.velocity.Y);
53374 }
53376 {
53377 float num30 = ((Vector2)(
ref player.velocity)).Length();
53379 {
53381 }
53383 {
53385 }
53386 }
53388 bool flag5 =
false;
53389 float num33 = vector.X -
base.Center.X;
53392 {
53394 velocity.X *= 0.9f;
53396 {
53398 }
53399 }
53401 {
53403 velocity.X *= 0.9f;
53405 {
53407 }
53408 }
53410 {
53412 {
53415 {
53416 velocity.X -=
num26;
53417 }
53418 else
53419 {
53420 velocity.X -=
num29;
53421 }
53422 }
53423 else
53424 {
53427 {
53428 velocity.X +=
num26;
53429 }
53430 else
53431 {
53432 velocity.X +=
num29;
53433 }
53434 }
53437 {
53439 }
53441 {
53443 }
53445 {
53447 }
53449 {
53451 }
53453 {
53454 flag6 = vector5.Y < -80
f;
53455 }
53457 {
53460 {
53463 }
53464 else
53465 {
53467 }
53469 }
53471 {
53473 }
53474 }
53475 else
53476 {
53477 velocity.X *= 0.9f;
53479 {
53481 }
53482 }
53485 {
53491 {
53493 {
53495 }
53496 }
53497 }
53499 {
53501 }
53503 {
53505 }
53507 {
53509 }
53513 {
53515 {
53516 for (
int k = 0;
k < 3;
k++)
53517 {
53520 {
53522 }
53524 {
53526 }
53529 {
53530 continue;
53531 }
53532 try
53533 {
53539 {
53540 velocity.Y = -5.1f;
53541 }
53543 {
53544 velocity.Y = -7.1f;
53545 }
53547 {
53548 velocity.Y = -11.1f;
53549 }
53551 {
53552 velocity.Y = -10.1f;
53553 }
53554 else
53555 {
53556 velocity.Y = -9.1f;
53557 }
53558 }
53559 catch
53560 {
53561 velocity.Y = -9.1f;
53562 }
53563 }
53565 {
53566 float num39 = vector.Y -
base.Center.Y;
53569 {
53571 }
53573 {
53575 }
53577 {
53579 }
53581 {
53583 }
53585 {
53587 }
53589 {
53591 }
53593 {
53595 }
53597 {
53599 }
53601 {
53603 }
53605 {
53607 }
53608 else
53609 {
53611 }
53612 }
53614 {
53616 }
53617 }
53619 {
53621 for (
int l = 0;
l < 6;
l++)
53622 {
53623 Dust[]
dust3 = Main.dust;
53627 obj4.velocity.X = velocity.X * 0.25f;
53629 obj4.velocity =
obj4.velocity.RotatedByRandom(0.2617993950843811);
53630 }
53631 }
53632 }
53633 else if (
type == 1018)
53634 {
53636 }
53638 {
53639 velocity.X =
num28;
53640 }
53642 {
53643 velocity.X = 0
f -
num28;
53644 }
53646 {
53648 }
53650 {
53652 }
53654 {
53655 direction = ((player.Center.X >
base.Center.X) ? 1 : (-1));
53656 }
53658 {
53660 }
53662 {
53664 }
53667 {
53669 {
53672 {
53675 }
53677 {
53681 {
53684 }
53686 {
53688 }
53689 }
53690 else
53691 {
53694 }
53695 }
53697 {
53700 {
53702 }
53705 }
53706 }
53708 {
53711 {
53713 {
53716 }
53718 {
53722 {
53725 }
53727 {
53729 }
53730 }
53731 else
53732 {
53735 }
53736 }
53738 {
53741 }
53742 }
53744 {
53747 {
53749 {
53752 {
53754 }
53757 {
53759 }
53761 {
53763 }
53765 }
53767 {
53773 {
53775 }
53778 }
53779 else
53780 {
53783 }
53784 }
53786 {
53788 {
53790 {
53793 }
53795 {
53798 }
53799 }
53800 else
53801 {
53803 {
53806 }
53808 {
53811 }
53812 }
53813 }
53814 }
53816 {
53819 {
53821 }
53824 {
53826 {
53829 }
53831 {
53835 {
53838 }
53840 {
53842 }
53843 }
53844 else
53845 {
53848 }
53849 }
53851 {
53855 {
53857 }
53858 }
53859 }
53860 velocity.Y += 0.4f +
num36 * 1
f;
53862 {
53864 }
53865 }
53867 {
53868 return;
53869 }
53872 {
53874 }
53875 if (
localAI[0] >= (
float)Main.rand.Next(900, 1200))
53876 {
53878 for (
int m = 0;
m < 6;
m++)
53879 {
53880 Vector2
val4 = base.Center + Vector2.UnitX * (float)(-
direction) * 8
f - Vector2.One * 5
f + Vector2.UnitY * 8
f;
53885 obj5.velocity /= 2
f;
53886 Main.dust[
num47].scale = 0.8f;
53887 }
53888 int num48 = Gore.NewGore(
base.Center + Vector2.UnitX * (
float)(-
direction) * 8
f, Vector2.Zero, Main.rand.Next(580, 583));
53890 obj6.velocity /= 2
f;
53891 Main.gore[
num48].velocity.Y =
Math.Abs(Main.gore[
num48].velocity.Y);
53893 }
53894 }
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 ...
static PlayerDeathReason ByOther(int type, int playerIndex=-1)
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
float Distance(Vector2 Other)
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
int height
The height of this Entity's hitbox, in pixels.
static ArmorShaderDataSet Armor
static readonly SoundStyle Item1
static readonly SoundStyle NPCDeath61
static readonly SoundStyle Item16
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...
bool IsInRangeOfMeOrMyOwner(Entity entity, float maxDistance, out float myDistance, out float playerDistance, out bool closerIsMe)
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
void Minion_FindTargetInRange(int startAttackRange, ref int attackTarget, bool skipIfCannotHitWithOwnBody, Func< Entity, int, bool > customEliminationCheck=null)
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
static float[] _CompanionCubeScreamCooldown
bool AI_067_TigerSpecialAttack()
bool friendly
If True, this projectile will hurt enemies (!F:Terraria.NPC.friendly) Defaults to false.
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
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...
float stepSpeed
Has nothing to do with the speed that this projectile travels, that is dictated by AI code adjusting ...
bool AI_067_CustomEliminationCheck_Pirates(Entity otherEntity, int currentTarget)
float gfxOffY
An offset from the actual position of the projectile that will be added to the draw position....
int minionPos
A number indicating the order of minions. Minion AI code typically uses this value to determine a sui...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.
This data type describes in detail how a sound should be played. Passable to the M:Terraria....