TModLoader v1.4.4.9
TModLoader 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 46104 of file Projectile.cs.

46105 {
46106 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
46107 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
46108 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
46109 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
46110 bool flag = false;
46111 if (lastVelocity.X != velocity.X)
46112 {
46113 if (Math.Abs(lastVelocity.X) > 4f)
46114 {
46115 flag = true;
46116 }
46117 position.X += velocity.X;
46118 velocity.X = (0f - lastVelocity.X) * 0.2f;
46119 }
46120 if (lastVelocity.Y != velocity.Y)
46121 {
46122 if (Math.Abs(lastVelocity.Y) > 4f)
46123 {
46124 flag = true;
46125 }
46126 position.Y += velocity.Y;
46127 velocity.Y = (0f - lastVelocity.Y) * 0.2f;
46128 }
46129 ai[0] = 1f;
46130 if (flag)
46131 {
46132 netUpdate = true;
46133 Collision.HitTiles(position, velocity, width, height);
46134 SoundEngine.PlaySound(0, (int)position.X, (int)position.Y);
46135 }
46136 if (wet)
46137 {
46139 }
46140 }
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 ...
Definition Entity.cs:57
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
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...

References Terraria.Collision.HitTiles(), and Terraria.Audio.SoundEngine.PlaySound().

+ Here is the call graph for this function: