46705 {
46706
46707
46708
46709
46710
46711
46712
46713
46714
46715
46716
46717
46718
46719
46720
46721
46722
46723
46724
46725
46726
46727
46728
46729
46730
46731
46732
46733
46734
46735
46736
46737
46738
46739
46740
46741
46742
46743
46744
46745
46746
46747
46748
46749
46750
46751
46752
46753
46754
46755
46756
46757
46758
46759
46760
46761
46762
46763
46764
46765
46766
46767
46768
46769
46770
46771
46772
46773
46774
46775
46776
46777
46778
46779
46780
46781
46782
46783
46784
46785
46786
46787
46788
46789
46790
46791
46792
46793
46794
46795
46796
46797
46798
46799
46800
46801
46802
46803
46804
46805
46806
46807
46808
46809
46810
46811
46812
46813
46814
46815
46816
46817
46818
46819
46820
46821
46822
46823
46824
46825
46826
46827
46828
46829
46830
46832 if (!player.active)
46833 {
46835 return;
46836 }
46838 Vector2
vector = player.Center;
46845 {
46846 if (player.dead)
46847 {
46848 player.stardustGuardian = false;
46849 }
46850 if (player.stardustGuardian)
46851 {
46853 }
46855 vector.X -= (5 + player.width / 2) * player.direction;
46857 Lighting.AddLight(
base.Center, 0.9f, 0.9f, 0.7f);
46859 {
46861 for (int i = 0; i < 30; i++)
46862 {
46864 Main.dust[
num17].noGravity =
true;
46866 obj.velocity *= 3
f;
46870 obj2.velocity *= 2
f;
46871 Main.dust[
num17].noGravity =
true;
46872 Main.dust[
num17].fadeIn = 2.5f;
46874 }
46875 }
46876 }
46878 {
46880 Main.player[
owner].tankPetReset =
false;
46881 }
46883 {
46884 base.Center = Vector2.Lerp(
base.Center,
vector, 0.05f);
46888 {
46891 {
46893 }
46894 }
46899 {
46901 }
46903 {
46905 }
46907 {
46914 float num2 = (nPC.Center.Y >
base.Bottom.Y).ToDirectionInt();
46916 {
46918 }
46919 else
46920 {
46921 velocity.X *= 0.7f;
46922 }
46924 {
46925 velocity.Y += 0.1f *
num2;
46926 }
46927 else
46928 {
46929 velocity.Y *= 0.7f;
46930 }
46932 {
46936 }
46937 }
46938 }
46939 else if (
ai[0] == 1
f)
46940 {
46941 if (player.HasMinionRestTarget)
46942 {
46943 vector = player.MinionRestTargetPoint;
46944 }
46945 else
46946 {
46949 }
46954 {
46956 }
46958 {
46960 }
46962 {
46969 float num7 = (nPC2.Center.Y >
base.Bottom.Y).ToDirectionInt();
46971 {
46973 }
46974 else
46975 {
46976 velocity.X *= 0.7f;
46977 }
46979 {
46980 velocity.Y += 0.1f *
num7;
46981 }
46982 else
46983 {
46984 velocity.Y *= 0.7f;
46985 }
46987 {
46991 }
46992 }
46993 else
46994 {
46996 {
46999 }
47001 {
47003 velocity.X += 0.06f * (float)
direction;
47004 }
47005 else
47006 {
47007 velocity.X *= 0.8f;
47009 }
47011 {
47014 }
47016 {
47017 velocity.Y += 0.06f * (float)
Math.Sign(
vector.Y -
base.Center.Y);
47018 }
47019 else
47020 {
47021 velocity.Y *= 0.8f;
47022 }
47023 }
47025 {
47027 if (++
frame >= Main.projFrames[
type] - 4)
47028 {
47030 }
47031 }
47032 }
47033 else if (
ai[0] == 2
f)
47034 {
47036 {
47039 {
47041 }
47043 {
47045 }
47047 {
47050 {
47052 }
47053 }
47054 }
47055 bool flag5 =
false;
47057 {
47059 }
47062 if (Main.npc.IndexInRange(
num9))
47063 {
47066 {
47068 }
47069 }
47071 {
47076 {
47078 }
47079 }
47080 else
47081 {
47082 int num10 = (((nPC3.Center - player.Center).X > 1
f) ? 1 : (-1));
47090 {
47096 {
47099 }
47100 }
47101 }
47102 }
47103 else
47104 {
47106 }
47108 {
47109 return;
47110 }
47111 if (player.HasMinionRestTarget)
47112 {
47113 vector = player.MinionRestTargetPoint;
47114 }
47115 else
47116 {
47119 }
47121 {
47123 for (
int j = 0;
j < 30;
j++)
47124 {
47126 Main.dust[
num13].noGravity =
true;
47128 obj3.velocity *= 3
f;
47132 obj4.velocity *= 2
f;
47133 Main.dust[
num13].noGravity =
true;
47134 Main.dust[
num13].fadeIn = 2.5f;
47136 }
47137 }
47138 else
47139 {
47140 for (
int k = 0;
k < 2;
k++)
47141 {
47143 Main.dust[
num14].noGravity =
true;
47145 obj5.velocity *= 3
f;
47146 Main.dust[
num14].noLight =
true;
47150 obj6.velocity *= 2
f;
47151 Main.dust[
num14].noGravity =
true;
47152 Main.dust[
num14].fadeIn = 2.5f;
47153 Main.dust[
num14].noLight =
true;
47155 }
47156 }
47158 base.Center = Vector2.Lerp(
base.Center,
vector, 0.2f);
47160 {
47163 }
47164 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
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
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
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...
void AI_120_StardustGuardian_FindTarget(float lookupRange, ref int targetNPCIndex, ref float distanceToClosestTarget)
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.