44799 {
44800
44801
44802
44803
44804
44805
44806
44807
44808
44809
44810
44811
44812
44813
44814
44815
44816
44817
44818
44819
44820
44821
44822
44823
44824
44825
44826
44827
44828
44829
44830
44831
44832
44833
44834
44835
44836
44837
44838
44839
44840
44841
44842
44843
44844
44845
44846
44847
44848
44849
44850
44851
44852
44853
44854
44855
44856
44857
44858
44859
44860
44861
44862
44863
44864
44865
44866
44867
44868
44869
44870
44871
44872
44873
44874
44875
44876
44877
44878
44879
44880
44881
44882
44883
44884
44885
44886
44887
44888
44889
44890
44891
44892
44893
44894
44895
44896
44897
44898
44899
44900
44901
44902
44903
44904
44905
44906
44907
44908
44909
44910
44911
44912
44913
44914
44915
44916
44917
44918
44919
44920
44921
44922
44923
44924
44925
44926
44927
44928
44929
44930
44931
44932
44933
44934
44935
44936
44937
44938
44939
44940
44941
44942
44943
44945 {
44947 return;
44948 }
44951 int num4 = Main.maxTilesY * 16;
44954 {
44956 }
44959 {
44961 {
44964 {
44966 }
44967 }
44969 {
44973 }
44975 {
44978 }
44979 if (
num5 > 0 ||
ai[0] == -2
f)
44980 {
44982 }
44983 }
44984 if (
owner == Main.myPlayer)
44985 {
44987 {
44988 if (player.channel && player.HeldItem.shoot ==
type)
44989 {
44993 {
44996 ai[1] = pointPoisition.Y + (float)(
num4 *
num5);
44997 }
44998 }
44999 else
45000 {
45006 {
45008 }
45010 {
45012 }
45013 else
45014 {
45016 }
45017 }
45018 }
45020 {
45023 {
45026 }
45027 }
45028 }
45031 if (
ai[0] > 0
f &&
ai[1] > 0
f)
45032 {
45034 }
45036 {
45038 if (Main.npc.IndexInRange(
num8))
45039 {
45041 if (
nPC.CanBeChasedBy(
this))
45042 {
45047 }
45048 else
45049 {
45052 }
45053 }
45054 }
45055 bool flag2 =
false;
45057 {
45059 }
45061 {
45062 Vector2 value =
vector.Value;
45064 {
45066 Vector2 v = value -
base.Center;
45067 Vector2
val = v.SafeNormalize(Vector2.Zero);
45071 {
45072 velocity +=
velocity.SafeNormalize(Vector2.Zero).RotatedBy(0.7853981852531433).SafeNormalize(Vector2.Zero) * 4
f;
45073 }
45075 {
45077 }
45079 }
45080 else
45081 {
45085 }
45087 {
45089 }
45090 }
45092 {
45094 {
45096 }
45098 {
45100 }
45101 }
45103 {
45105 }
45106 else
45107 {
45109 }
45112 {
45114 {
45117 }
45118 if (Main.rand.Next(9) == 0)
45119 {
45122 obj.velocity *= 0.3f;
45123 Main.dust[
num11].position.X = position.X + (float)(
width / 2) + 4
f + (float)Main.rand.Next(-4, 5);
45124 Main.dust[
num11].position.Y = position.Y + (float)(
height / 2) + (float)Main.rand.Next(-4, 5);
45125 Main.dust[
num11].noGravity =
true;
45127 obj2.velocity += Main.rand.NextVector2Circular(2
f, 2
f);
45128 }
45130 {
45131 int num2 = Main.rand.Next(2, 5);
45132 for (
int i = 0; i <
num2; i++)
45133 {
45135 dust5.velocity *= 0.3f;
45136 dust5.position =
base.Center;
45137 dust5.noGravity = true;
45138 dust5.velocity += Main.rand.NextVector2Circular(0.5
f, 0.5
f);
45139 dust5.fadeIn = 2.2f;
45140 }
45141 }
45142 }
45144 {
45145 return;
45146 }
45149 if (Main.rand.Next(6) == 0)
45150 {
45152 dust6.noGravity = true;
45153 dust6.velocity *= 1.4f;
45154 dust6.velocity += Main.rand.NextVector2Circular(1
f, 1
f);
45155 dust6.velocity +=
velocity * 0.15f;
45156 }
45157 if (Main.rand.Next(12) == 0)
45158 {
45160 dust7.velocity += Main.rand.NextVector2Circular(1
f, 1
f);
45161 dust7.velocity +=
velocity * 0.15f;
45162 }
45164 {
45166 for (
int j = 0;
j <
num3;
j++)
45167 {
45169 dust4.velocity *= 0.3f;
45170 dust4.position =
base.Center;
45171 dust4.noGravity = true;
45172 dust4.velocity += Main.rand.NextVector2Circular(0.5
f, 0.5
f);
45173 dust4.fadeIn = 2.2f;
45174 dust4.position += (dust4.position -
base.Center) *
lerpValue * 10
f;
45175 }
45176 }
45177 }
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 ...
Vector2 DirectionFrom(Vector2 Source)
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.
int height
The height of this Entity's hitbox, in pixels.
static readonly SoundStyle Item9
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
void AI_009_MagicMissiles_Old()
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...
int penetrate
The remaining number of npc can this projectile hit before dying. (Or tile bounces)....
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int FindTargetWithLineOfSight(float maxRange=800f)
Finds the closest NPC to this projectile which can be targeted and which it has line of sight to.
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...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.