15677 {
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15819 {
15820 return;
15821 }
15823 {
15826 if (!Main.sectionManager.TileLoaded(
num,
num11))
15827 {
15828 return;
15829 }
15830 }
15832 Vector2
vector =
default(Vector2);
15833 Vector2
vector2 =
default(Vector2);
15835 {
15837 if (
type == 640 &&
ai[1] > 0
f)
15838 {
15840 continue;
15841 }
15842 if (
position.X <= Main.leftWorld ||
position.X + (
float)
width >= Main.rightWorld || position.Y <= Main.topWorld || position.Y + (float)
height >= Main.bottomWorld)
15843 {
15845 return;
15846 }
15848 {
15850 }
15852 {
15857 }
15859 {
15862 {
15863 if ((
type == 627 ||
type == 626) &&
owner == Main.myPlayer)
15864 {
15867 {
15868 Projectile projectile = Main.projectile[
byUUID];
15869 if (projectile.type != 625)
15870 {
15871 projectile.localAI[1] =
localAI[1];
15872 }
15873 projectile = Main.projectile[(int)
localAI[1]];
15874 projectile.ai[0] =
ai[0];
15875 projectile.ai[1] = 1
f;
15876 projectile.netUpdate = true;
15877 }
15878 }
15880 }
15881 else
15882 {
15883 Main.player[
owner].numMinions++;
15885 }
15886 }
15889 {
15892 {
15894 }
15895 }
15897 {
15900 {
15902 }
15903 }
15905 {
15907 }
15909 {
15911 }
15916 {
15918 }
15920 for (
int j = 0;
j < 255;
j++)
15921 {
15923 {
15925 }
15926 }
15928 {
15929 for (
int k = 0;
k < 200;
k++)
15930 {
15932 {
15934 }
15935 }
15936 }
15938 if (
ShouldUseWindPhysics() && (
double)
base.Center.Y < Main.worldSurface * 16.0 && Main.tile[(
int)
base.Center.X / 16, (
int)
base.Center.Y / 16] !=
null && Main.tile[(
int)
base.Center.X / 16, (
int)
base.Center.Y / 16].wall == 0 && ((
velocity.X > 0
f && Main.windSpeedCurrent < 0
f) || (
velocity.X < 0
f && Main.windSpeedCurrent > 0
f) ||
Math.Abs(
velocity.X) <
Math.Abs(Main.windSpeedCurrent * Main.windPhysicsStrength) * 180
f) &&
Math.Abs(
velocity.X) < 16
f)
15939 {
15940 velocity.X += Main.windSpeedCurrent * Main.windPhysicsStrength;
15942 }
15943 if (
owner < 255 && !Main.player[
owner].active)
15944 {
15946 }
15948 {
15950 }
15953 {
15956 try
15957 {
15961 {
15963 }
15964 if (Collision.honey)
15965 {
15967 }
15968 if (Collision.shimmer)
15969 {
15971 }
15972 }
15973 catch
15974 {
15976 return;
15977 }
15979 {
15981 {
15983 }
15985 {
15988 }
15989 }
15991 {
15993 {
15995 }
15997 {
15999 }
16000 }
16002 {
16006 {
16008 }
16009 }
16011 {
16013 {
16015 {
16017 {
16018 for (
int l = 0;
l < 10;
l++)
16019 {
16021 Main.dust[
num28].velocity.Y -= 4
f;
16022 Main.dust[
num28].velocity.X *= 2.5f;
16023 Main.dust[
num28].scale = 1.3f;
16024 Main.dust[
num28].noGravity =
true;
16027 {
16028 case 0:
16029 Main.dust[
num28].color =
new Color(255, 255, 210);
16030 break;
16031 case 1:
16032 Main.dust[
num28].color =
new Color(190, 245, 255);
16033 break;
16034 case 2:
16035 Main.dust[
num28].color =
new Color(255, 150, 255);
16036 break;
16037 default:
16038 Main.dust[
num28].color =
new Color(190, 175, 255);
16039 break;
16040 }
16042 }
16043 }
16045 {
16046 for (
int m = 0;
m < 10;
m++)
16047 {
16049 Main.dust[
num29].velocity.Y -= 1
f;
16050 Main.dust[
num29].velocity.X *= 2.5f;
16051 Main.dust[
num29].scale = 1.3f;
16052 Main.dust[
num29].alpha = 100;
16053 Main.dust[
num29].noGravity =
true;
16054 }
16056 }
16057 else
16058 {
16059 for (
int n = 0;
n < 10;
n++)
16060 {
16062 Main.dust[
num30].velocity.Y -= 4
f;
16063 Main.dust[
num30].velocity.X *= 2.5f;
16064 Main.dust[
num30].scale = 1.3f;
16065 Main.dust[
num30].alpha = 100;
16066 Main.dust[
num30].noGravity =
true;
16067 }
16069 }
16070 }
16071 else
16072 {
16074 {
16076 Main.dust[
num32].velocity.Y -= 1.5f;
16077 Main.dust[
num32].velocity.X *= 2.5f;
16078 Main.dust[
num32].scale = 1.3f;
16079 Main.dust[
num32].alpha = 100;
16080 Main.dust[
num32].noGravity =
true;
16081 }
16083 }
16084 }
16086 }
16088 {
16091 {
16092 velocity.Y *= 0.5f;
16093 }
16095 {
16098 {
16100 {
16102 {
16104 Main.dust[
num2].velocity.Y -= 4
f;
16105 Main.dust[
num2].velocity.X *= 2.5f;
16106 Main.dust[
num2].scale = 1.3f;
16107 Main.dust[
num2].noGravity =
true;
16110 {
16111 case 0:
16112 Main.dust[
num2].color =
new Color(255, 255, 210);
16113 break;
16114 case 1:
16115 Main.dust[
num2].color =
new Color(190, 245, 255);
16116 break;
16117 case 2:
16118 Main.dust[
num2].color =
new Color(255, 150, 255);
16119 break;
16120 default:
16121 Main.dust[
num2].color =
new Color(190, 175, 255);
16122 break;
16123 }
16125 }
16126 }
16128 {
16130 {
16132 Main.dust[
num4].velocity.Y -= 1
f;
16133 Main.dust[
num4].velocity.X *= 2.5f;
16134 Main.dust[
num4].scale = 1.3f;
16135 Main.dust[
num4].alpha = 100;
16136 Main.dust[
num4].noGravity =
true;
16137 }
16139 }
16140 else
16141 {
16143 {
16145 Main.dust[
num6].velocity.Y -= 4
f;
16146 Main.dust[
num6].velocity.X *= 2.5f;
16147 Main.dust[
num6].scale = 1.3f;
16148 Main.dust[
num6].alpha = 100;
16149 Main.dust[
num6].noGravity =
true;
16150 }
16152 }
16153 }
16154 else
16155 {
16157 {
16159 Main.dust[
num8].velocity.Y -= 1.5f;
16160 Main.dust[
num8].velocity.X *= 2.5f;
16161 Main.dust[
num8].scale = 1.3f;
16162 Main.dust[
num8].alpha = 100;
16163 Main.dust[
num8].noGravity =
true;
16164 }
16166 }
16167 }
16168 }
16170 {
16174 }
16176 {
16178 }
16179 }
16181 {
16183 }
16188 {
16190 {
16192 }
16193 else
16194 {
16196 }
16197 }
16199 {
16200 return;
16201 }
16204 {
16206 }
16208 {
16210 }
16211 else if (
type == 172)
16212 {
16214 }
16215 else if (
type == 103)
16216 {
16218 if (Main.rand.Next(2) == 0)
16219 {
16220 Main.dust[
num9].noGravity =
true;
16221 Main.dust[
num9].scale *= 2
f;
16222 }
16223 }
16224 else if (
type == 278)
16225 {
16227 if (Main.rand.Next(2) == 0)
16228 {
16229 Main.dust[
num10].noGravity =
true;
16230 Main.dust[
num10].scale *= 1.5f;
16231 }
16232 }
16233 else if (
type == 4)
16234 {
16235 if (Main.rand.Next(5) == 0)
16236 {
16238 }
16239 }
16240 else if (
type == 5)
16241 {
16244 {
16245 0 => 15,
16246 1 => 57,
16249 }
16252 {
16258 }
16259 if (Main.netMode != 1 && (
type == 99 ||
type == 1013 ||
type == 655 ||
type == 727 ||
type == 1014 ||
type == 1021))
16260 {
16262 }
16264 {
16266 {
16268 }
16270 }
16272 {
16274 {
16276 {
16278 }
16281 {
16282 float num14 =
rotation + (float)
Math.PI / 2
f + ((Main.rand.Next(2) == 1) ? (-1
f) : 1
f) * ((
float)Math.PI / 2
f);
16283 float num15 = (float)Main.rand.NextDouble() * 2
f + 2
f;
16286 Main.dust[
num16].noGravity =
true;
16287 Main.dust[
num16].scale = 1.7f;
16288 }
16290 {
16291 float num17 =
rotation + (float)
Math.PI / 2
f + ((Main.rand.Next(2) == 1) ? (-1
f) : 1
f) * ((
float)Math.PI / 2
f);
16292 float num18 = (float)Main.rand.NextDouble() * 2
f + 2
f;
16295 Main.dust[
num19].noGravity =
true;
16296 Main.dust[
num19].scale = 1.7f;
16297 }
16298 }
16299 }
16301 {
16303 {
16307 }
16311 }
16313 {
16315 {
16319 }
16323 float amount = 0.65f;
16326 {
16328 {
16330 {
16332 {
16334 }
16336 }
16337 }
16338 }
16339 }
16341 {
16342 Vector2
vector3 = Main.player[
owner].position - Main.player[
owner].oldPosition;
16344 {
16349 {
16352 }
16353 }
16357 }
16359 {
16361 {
16365 }
16369 }
16371 {
16373 }
16376 {
16378 }
16380 {
16382 }
16384 {
16385 continue;
16386 }
16388 {
16390 }
16392 {
16394 }
16396 {
16398 {
16400 NetMessage.SendData(27, -1, -1, null, i);
16402 }
16403 else
16404 {
16406 }
16407 }
16409 {
16411 }
16412 }
16414 }
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 ...
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
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 int[] TrailingMode
Determines what data will be remembered for projectile trails. Each projectile type defaults to -1,...
static bool[] IsAGolfBall
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile is a kind of g...
static bool[] IsADD2Turret
Iff true for a given projectile type (F:Terraria.Projectile.type), then that projectile is counted as...
bool sentry
Indicates that this projectile is a sentry Defaults to false. All sentries should set F:Terraria....
float minionSlots
Set to 1f on a minion to count it towards the minion limit of the summoning player (Optic Staff summo...
bool netUpdate2
Used internally to check for projectiles that spam F:Terraria.Projectile.netUpdate....
bool minion
Indicates that this projectile is a minion Defaults to false.
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] oldRot
Holds the value of F:Terraria.Projectile.rotation from previous updates from newest to oldest....
void HandleMovement(Vector2 wetVelocity, out int overrideWidth, out int overrideHeight)
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...
int OriginalCritChance
The crit chance of this projectile, without any player bonuses, similar to F:Terraria....
int penetrate
The remaining number of npc can this projectile hit before dying. (Or tile bounces)....
int ArmorPenetration
The number of defense points that this projectile can ignore on its own. Cannot be set to negative va...
bool ShouldUseWindPhysics()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
bool ignoreWater
The projectile will not be affected by water. Defaults to false.
int[] oldSpriteDirection
Holds the value of F:Terraria.Projectile.spriteDirection from previous updates from newest to oldest....
bool ContinuouslyUpdateDamageStats
If set F:Terraria.Projectile.damage will be recalculated based on F:Terraria.Projectile....
Vector2[] oldPos
Holds the value of F:Terraria.Entity.position from previous updates from newest to oldest....
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 AutomaticallyChangesDirection()
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float light
Set to a value above 0f to make this projectile emit a white light (higher number: more intensive lig...
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 ...
int extraUpdates
Additional update steps per tick. Useful for really fast projectiles such as Shadowbeam Staff....
bool npcProj
If true, this projectile was spawned by a friendly Town NPC.
bool usesLocalNPCImmunity
If true, this projectile manages it's own immunity timers for each npc. Use this rather than F:Terra...
static int GetByUUID(int owner, float uuid)
int CritChance
The critical strike chance modifier of this projectile. Cannot be set to negative values....
int OriginalArmorPenetration
The crit chance of this projectile, without any player bonuses, similar to F:Terraria....
void UpdateEnchantmentVisuals()
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.
bool noEnchantmentVisuals
DamageClass DamageType
The damage type assigned to this projectile, represented as a DamageClass. Leave blank or use DamageC...