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

◆ AI_015_HandleMovementCollision()

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

Definition at line 45523 of file Projectile.cs.

45524 {
45525 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
45526 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
45527 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
45528 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
45529 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
45530 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
45531 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
45532 //IL_0137: Unknown result type (might be due to invalid IL or missing references)
45533 //IL_013e: Unknown result type (might be due to invalid IL or missing references)
45534 //IL_0156: Unknown result type (might be due to invalid IL or missing references)
45535 //IL_015d: Unknown result type (might be due to invalid IL or missing references)
45536 //IL_0165: Unknown result type (might be due to invalid IL or missing references)
45537 //IL_016a: Unknown result type (might be due to invalid IL or missing references)
45538 //IL_016b: Unknown result type (might be due to invalid IL or missing references)
45539 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
45540 //IL_023b: Unknown result type (might be due to invalid IL or missing references)
45541 //IL_0240: Unknown result type (might be due to invalid IL or missing references)
45542 //IL_0186: Unknown result type (might be due to invalid IL or missing references)
45543 //IL_018b: Unknown result type (might be due to invalid IL or missing references)
45544 int num = 10;
45545 int num2 = 0;
45546 Vector2 vector = velocity;
45547 float num3 = 0.2f;
45548 if (ai[0] == 1f || ai[0] == 5f)
45549 {
45550 num3 = 0.4f;
45551 }
45552 if (ai[0] == 6f)
45553 {
45554 num3 = 0f;
45555 }
45556 if (lastVelocity.X != velocity.X)
45557 {
45558 if (Math.Abs(lastVelocity.X) > 4f)
45559 {
45560 num2 = 1;
45561 }
45562 velocity.X = (0f - lastVelocity.X) * num3;
45563 localAI[0] += 1f;
45564 }
45565 if (lastVelocity.Y != velocity.Y)
45566 {
45567 if (Math.Abs(lastVelocity.Y) > 4f)
45568 {
45569 num2 = 1;
45570 }
45571 velocity.Y = (0f - lastVelocity.Y) * num3;
45572 localAI[0] += 1f;
45573 }
45574 if (ai[0] == 1f)
45575 {
45576 ai[0] = 5f;
45578 netUpdate = true;
45579 Point scanAreaStart = base.TopLeft.ToTileCoordinates();
45580 Point scanAreaEnd = base.BottomRight.ToTileCoordinates();
45581 num2 = 2;
45584 position -= vector;
45585 }
45586 if (num2 > 0)
45587 {
45588 netUpdate = true;
45589 for (int i = 0; i < num2; i++)
45590 {
45591 Collision.HitTiles(position, vector, width, height);
45592 }
45593 SoundEngine.PlaySound(0, (int)position.X, (int)position.Y);
45594 }
45595 if (ai[0] != 3f && ai[0] != 0f && ai[0] != 5f && ai[0] != 6f && localAI[0] >= 10f)
45596 {
45597 ai[0] = 4f;
45598 netUpdate = true;
45599 }
45600 if (wet)
45601 {
45603 }
45604 }
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
void CreateImpactExplosion(int dustAmountMultiplier, Vector2 explosionOrigin, ref Point scanAreaStart, ref Point scanAreaEnd, int explosionRange, out bool causedShockwaves)
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 localNPCHitCooldown
When used in conjunction with F:Terraria.Projectile.usesLocalNPCImmunity, determines how many ticks m...
void CreateImpactExplosion2_FlailTileCollision(Vector2 explosionOrigin, bool causedShockwaves, Vector2 velocityBeforeCollision)

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

Referenced by Terraria.Projectile.HandleMovement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: