Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AI_015_HandleMovementCollision_Old()

void Terraria.Projectile.AI_015_HandleMovementCollision_Old ( ref Vector2 wetVelocity,
ref Vector2 lastVelocity )
inlineprivate

Definition at line 36151 of file Projectile.cs.

36152 {
36153 bool flag = false;
36154 if (lastVelocity.X != velocity.X)
36155 {
36156 if (Math.Abs(lastVelocity.X) > 4f)
36157 {
36158 flag = true;
36159 }
36160 position.X += velocity.X;
36161 velocity.X = (0f - lastVelocity.X) * 0.2f;
36162 }
36163 if (lastVelocity.Y != velocity.Y)
36164 {
36165 if (Math.Abs(lastVelocity.Y) > 4f)
36166 {
36167 flag = true;
36168 }
36169 position.Y += velocity.Y;
36170 velocity.Y = (0f - lastVelocity.Y) * 0.2f;
36171 }
36172 ai[0] = 1f;
36173 if (flag)
36174 {
36175 netUpdate = true;
36176 Collision.HitTiles(position, velocity, width, height);
36177 SoundEngine.PlaySound(0, (int)position.X, (int)position.Y);
36178 }
36179 if (wet)
36180 {
36182 }
36183 }
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14

References System.Math.Abs(), Terraria.Collision.HitTiles(), Terraria.Audio.SoundEngine.PlaySound(), Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.