45615 {
45616
45617
45618
45619
45620
45621
45622
45623
45624
45625
45626
45627
45628
45629
45630
45631
45632
45633
45634
45635
45636
45637
45638
45639
45640
45641
45642
45643
45644
45645
45646
45647
45648
45649
45650
45651
45652
45653
45654
45655
45656
45657
45658
45659
45660
45661
45662
45663
45664
45665
45666
45667
45668
45669
45670
45671
45672
45673
45674
45675
45676
45677
45678
45679
45680
45681
45682
45683
45684
45685
45686
45687
45688
45689
45690
45691
45692
45693
45694
45695
45696
45697
45698
45699
45700
45701
45702
45703
45704
45705
45706
45707
45708
45709
45710
45711
45712
45713
45714
45715
45716
45717
45718
45719
45720
45721
45722
45723
45724
45725
45726
45727
45728
45729
45730
45731
45732
45733
45734
45735
45736
45737
45738
45739
45740
45741
45742
45743
45744
45745
45746
45747
45748
45749
45750
45751
45752
45753
45754
45756 if (!player.active || player.dead || player.noItems || player.CCed || Vector2.Distance(
base.Center, player.Center) > 900
f)
45757 {
45759 return;
45760 }
45761 if (Main.myPlayer ==
owner && Main.mapFullscreen)
45762 {
45764 return;
45765 }
45767 {
45770 }
45774 bool flag2 =
false;
45790 {
45791 case 947:
45792 case 948:
45797 break;
45798 case 25:
45803 break;
45804 case 154:
45809 break;
45810 case 26:
45815 break;
45816 case 35:
45821 break;
45822 case 63:
45828 break;
45829 case 757:
45835 break;
45836 case 247:
45840 break;
45841 }
45842 float num7 = 1
f / player.inverseMeleeSpeed;
45853 switch ((
int)
ai[0])
45854 {
45855 case 0:
45856 {
45858 if (
owner == Main.myPlayer)
45859 {
45862 player.ChangeDir((
vector3.X > 0
f) ? 1 : (-1));
45863 if (!player.channel)
45864 {
45872 break;
45873 }
45874 }
45876 Vector2
vector4 = Utils.RotatedBy(
new Vector2((
float)player.direction), (
float)
Math.PI * 10
f * (
localAI[1] / 60
f) * (
float)player.direction);
45877 vector4.Y *= 0.8f;
45878 if (
vector4.Y * player.gravDir > 0
f)
45879 {
45880 vector4.Y *= 0.5f;
45881 }
45885 break;
45886 }
45887 case 1:
45888 {
45892 if (player.controlUseItem)
45893 {
45898 if (Main.myPlayer ==
owner &&
type == 757)
45899 {
45901 }
45902 break;
45903 }
45905 {
45910 if (Main.myPlayer ==
owner &&
type == 757)
45911 {
45913 }
45914 }
45915 player.ChangeDir((player.Center.X <
base.Center.X) ? 1 : (-1));
45917 break;
45918 }
45919 case 2:
45920 {
45923 {
45925 return;
45926 }
45927 if (player.controlUseItem)
45928 {
45933 }
45934 else
45935 {
45938 player.ChangeDir((player.Center.X <
base.Center.X) ? 1 : (-1));
45939 }
45940 break;
45941 }
45942 case 3:
45943 {
45944 if (!player.controlUseItem)
45945 {
45949 break;
45950 }
45955 {
45959 }
45961 {
45963 {
45966 }
45969 }
45970 else
45971 {
45973 {
45974 velocity.X *= 0.96f;
45975 velocity.Y += 0.2f;
45976 }
45977 if (player.velocity.X == 0
f)
45978 {
45979 velocity.X *= 0.96f;
45980 }
45981 }
45982 player.ChangeDir((player.Center.X <
base.Center.X) ? 1 : (-1));
45983 break;
45984 }
45985 case 4:
45986 {
45990 {
45992 return;
45993 }
45996 Vector2 target = base.Center +
velocity;
45997 Vector2 value =
mountedCenter.DirectionFrom(target).SafeNormalize(Vector2.Zero);
45998 if (Vector2.Dot(
vector2, value) < 0
f)
45999 {
46001 return;
46002 }
46003 player.ChangeDir((player.Center.X <
base.Center.X) ? 1 : (-1));
46004 break;
46005 }
46006 case 5:
46007 if (
ai[1]++ >= (
float)
num6)
46008 {
46012 }
46013 else
46014 {
46016 velocity.Y += 0.6f;
46017 velocity.X *= 0.95f;
46018 player.ChangeDir((player.Center.X <
base.Center.X) ? 1 : (-1));
46019 }
46020 break;
46021 case 6:
46023 {
46027 break;
46028 }
46030 {
46031 velocity.Y += 0.8f;
46032 }
46033 velocity.X *= 0.95f;
46034 player.ChangeDir((player.Center.X <
base.Center.X) ? 1 : (-1));
46035 break;
46036 }
46038 {
46043 {
46044 rotation += (float)
Math.PI * 2
f / 15
f * (
float)player.direction;
46045 }
46048 if (
owner == Main.myPlayer)
46049 {
46052 {
46054 for (int i = 0; i < 200; i++)
46055 {
46057 if (
nPC2.CanBeChasedBy(
this))
46058 {
46061 {
46064 }
46065 }
46066 }
46067 }
46069 {
46075 }
46076 }
46077 }
46082 {
46084 {
46086 }
46087 else
46088 {
46090 }
46091 }
46093 player.heldProj =
whoAmI;
46094 player.SetDummyItemTime(2);
46097 {
46098 player.itemRotation += (float)
Math.PI;
46099 }
46100 player.itemRotation =
MathHelper.WrapAngle(player.itemRotation);
46102 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Vector2 DirectionFrom(Vector2 Source)
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.
Vector2 DirectionTo(Vector2 Destination)
int height
The height of this Entity's hitbox, in pixels.
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...
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
float knockBack
This will always be set in Projectile.NewProjectile based on the weapons knockback and player stat mo...
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:...
bool ownerHitCheck
If true, then this projectile will only deal damage if its owner has line of sight to the hit....
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...
void ResetLocalNPCHitImmunity()
void AI_015_Flails_Dust(bool doFastThrowDust)
int localNPCHitCooldown
When used in conjunction with F:Terraria.Projectile.usesLocalNPCImmunity, determines how many ticks m...
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...