62974 {
62975
62976
62977
62978
62979
62980
62981
62982
62983
62984
62985
62986
62987
62988
62989
62990
62991
62992
62993
62994
62995
62996
62997
62998
62999
63000
63001
63002
63003
63004
63005
63006
63007
63008
63009
63010
63011
63012
63013
63014
63015
63016
63017
63018
63019
63020
63021
63022
63023
63024
63025
63026
63027
63028 if (
type == 31 &&
ai[0] != 2
f)
63029 {
63030 if (Main.rand.Next(2) == 0)
63031 {
63033 Main.dust[
num].velocity.X *= 0.4f;
63034 }
63035 }
63036 else if (
type == 39)
63037 {
63038 if (Main.rand.Next(2) == 0)
63039 {
63041 Main.dust[
num9].velocity.X *= 0.4f;
63042 }
63043 }
63044 else if (
type >= 411 &&
type <= 414)
63045 {
63046 if (Main.rand.Next(3) == 0)
63047 {
63050 {
63052 }
63054 {
63056 }
63058 Main.dust[
num11].noGravity =
true;
63061 }
63062 }
63063 else if (
type == 40)
63064 {
63065 if (Main.rand.Next(2) == 0)
63066 {
63069 obj2.velocity *= 0.4f;
63070 }
63071 }
63072 else if (
type == 42 ||
type == 31)
63073 {
63074 if (Main.rand.Next(2) == 0)
63075 {
63077 Main.dust[
num13].velocity.X *= 0.4f;
63078 }
63079 }
63080 else if (
type == 56 ||
type == 65)
63081 {
63082 if (Main.rand.Next(2) == 0)
63083 {
63085 Main.dust[
num14].velocity.X *= 0.4f;
63086 }
63087 }
63088 else if (
type == 67 ||
type == 68)
63089 {
63090 if (Main.rand.Next(2) == 0)
63091 {
63093 Main.dust[
num15].velocity.X *= 0.4f;
63094 }
63095 }
63096 else if (
type == 71)
63097 {
63098 if (Main.rand.Next(2) == 0)
63099 {
63101 Main.dust[
num16].velocity.X *= 0.4f;
63102 }
63103 }
63104 else if (
type == 179)
63105 {
63106 if (Main.rand.Next(2) == 0)
63107 {
63109 Main.dust[
num2].velocity.X *= 0.4f;
63110 }
63111 }
63112 else if (
type == 241 ||
type == 354)
63113 {
63114 if (Main.rand.Next(2) == 0)
63115 {
63117 Main.dust[
num3].velocity.X *= 0.4f;
63118 }
63119 }
63120 else if (
type >= 736 &&
type <= 738)
63121 {
63122 if (Main.rand.Next(40) == 0)
63123 {
63126 {
63127 Main.dust[
num4].velocity = Main.dust[
num4].velocity * 0.5f +
velocity * 0.5f;
63128 }
63129 }
63130 }
63131 else if (
type != 109 && Main.rand.Next(20) == 0)
63132 {
63134 }
63136 {
63138 {
63139 frame = Main.rand.Next(3);
63140 scale = 1
f - (float)Main.rand.Next(30) * 0.01f;
63141 }
63143 }
63146 if (Main.myPlayer ==
owner &&
ai[0] == 0
f)
63147 {
63150 {
63153 Vector2
vector =
default(Vector2);
63155 float num6 = (float)Main.mouseX + Main.screenPosition.X -
vector.X;
63156 float num7 = (float)Main.mouseY + Main.screenPosition.Y -
vector.Y;
63157 if (Main.player[
owner].gravDir == -1
f)
63158 {
63159 num7 = Main.screenPosition.Y + (float)Main.screenHeight - (
float)Main.mouseY -
vector.Y;
63160 }
63164 {
63169 {
63171 }
63174 }
63175 else
63176 {
63178 {
63180 }
63183 }
63184 }
63185 else
63186 {
63189 }
63190 }
63191 if (
ai[0] == 1
f &&
type != 109)
63192 {
63194 {
63197 {
63199 velocity.Y += 0.2f;
63200 }
63201 }
63202 else
63203 {
63204 velocity.Y += 0.41f;
63205 }
63206 }
63207 else if (
ai[0] == 2
f &&
type != 109)
63208 {
63209 velocity.Y += 0.2f;
63210 if ((double)velocity.X < -0.04)
63211 {
63212 velocity.X += 0.04f;
63213 }
63214 else if ((double)velocity.X > 0.04)
63215 {
63216 velocity.X -= 0.04f;
63217 }
63218 else
63219 {
63221 }
63222 }
63224 {
63225 for (
int i = (
int)(position.X / 16
f); i <= (int)((
position.X + (
float)
width) / 16
f); i++)
63226 {
63227 for (
int j = (
int)(position.Y / 16
f);
j <= (int)((
position.Y + (
float)
height) / 16
f);
j++)
63228 {
63230 {
63231 continue;
63232 }
63233 Tile tile = Main.tile[i,
j];
63234 if (tile == null || !tile.active())
63235 {
63236 continue;
63237 }
63238 if ((tile.type >= 185 && tile.type <= 187) || tile.type == 165 || tile.type == 12 || tile.type == 665 || tile.type == 639 || tile.type == 105 || tile.type == 178)
63239 {
63241 }
63243 {
63245 if (Main.netMode != 0)
63246 {
63247 NetMessage.SendData(17, -1, -1,
null, 14, i,
j);
63248 }
63250 }
63251 }
63252 }
63253 }
63255 {
63257 {
63259 }
63260 else if (
frame == 1)
63261 {
63263 }
63264 else
63265 {
63267 }
63269 {
63271 }
63272 }
63273 else
63274 {
63277 {
63279 }
63280 }
63281 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
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.
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...
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...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
float scale
Scales how large the projectile will be drawn. Will also affect the hitbox (F:Terraria....