53131 {
53132
53133
53134
53135
53136
53137
53138
53139
53140
53141
53142
53143
53144
53145
53146
53147
53148
53149
53150
53151
53152
53153
53154
53155
53156
53157
53158
53159
53160
53161
53162
53163
53164
53165
53166
53167
53168
53169
53170
53171
53172
53173
53174
53175
53176
53177
53178
53179
53180
53181
53182
53183
53184
53185
53186
53187
53188
53189
53190
53191
53192
53193
53194
53195
53196
53197
53198
53199
53200
53201
53202
53203
53204
53205
53206
53207
53208
53209
53210
53211
53212
53213
53214
53215
53216
53217
53218
53219
53220
53221
53222
53223
53224
53225
53226
53227
53228
53229
53230
53231
53232
53233
53234
53235
53236
53237
53238
53239
53240
53241
53242
53243
53244
53245
53246
53247
53248
53249
53250
53251
53252
53253
53255 {
53257 }
53259 {
53261 }
53263 {
53264 if (Main.dayTime)
53265 {
53266 velocity.Y -= 0.3f;
53268 }
53271 {
53274 for (int i = 0; i < 35; i++)
53275 {
53277 dust.velocity *= 1
f;
53278 dust.scale = 1
f + Main.rand.NextFloat() * 0.5f;
53279 dust.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
53281 }
53282 }
53285 {
53287 }
53289 {
53290 for (
int j = 0;
j < 2;
j++)
53291 {
53293 dust2.velocity *= 1
f;
53294 dust2.scale = 1
f + Main.rand.NextFloat() * 0.5f;
53295 dust2.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
53296 dust2.velocity +=
velocity * 0.3f;
53297 }
53298 }
53300 }
53304 {
53306 }
53308 float num12 = 0.05f;
53310 {
53313 if (
type == 6 && Main.expertMode)
53314 {
53316 }
53317 if (Main.remixWorld)
53318 {
53321 }
53322 }
53323 else if (
type == 94)
53324 {
53327 }
53328 else if (
type == 619)
53329 {
53332 }
53333 else if (
type == 252)
53334 {
53336 {
53339 }
53340 else
53341 {
53344 }
53345 }
53347 {
53351 {
53354 }
53357 if ((
double)(
position.Y / 16
f) < Main.worldSurface)
53358 {
53360 {
53361 velocity.Y *= 0.97f;
53362 }
53364 {
53365 velocity.Y *= 0.97f;
53366 }
53367 }
53368 }
53369 else if (
type == 205)
53370 {
53373 }
53374 else if (
type == 176)
53375 {
53378 }
53379 else if (
type == 23)
53380 {
53383 }
53384 else if (
type == 5)
53385 {
53388 }
53389 else if (
type == 210 ||
type == 211)
53390 {
53394 {
53396 }
53397 else
53398 {
53400 {
53402 }
53404 {
53406 }
53408 {
53410 }
53412 {
53414 }
53415 }
53419 }
53420 else if (
type == 139 && Main.zenithWorld)
53421 {
53423 }
53424 Vector2
vector =
default(Vector2);
53427 float num24 = targetData.Position.Y + (float)(
targetData.Height / 2);
53430 vector.X = (int)(
vector.X / 8
f) * 8;
53431 vector.Y = (int)(
vector.Y / 8
f) * 8;
53436 bool flag2 =
false;
53438 {
53440 }
53442 {
53445 }
53446 else
53447 {
53451 }
53456 {
53458 {
53461 {
53462 velocity.Y += 0.023f;
53463 }
53464 else
53465 {
53466 velocity.Y -= 0.023f;
53467 }
53468 if (
ai[0] < -100
f ||
ai[0] > 100
f)
53469 {
53470 velocity.X += 0.023f;
53471 }
53472 else
53473 {
53474 velocity.X -= 0.023f;
53475 }
53477 {
53479 }
53480 }
53482 {
53483 velocity.X +=
num23 * 0.007f;
53484 velocity.Y +=
num24 * 0.007f;
53485 }
53486 }
53488 {
53491 }
53493 {
53494 velocity.Y -= 0.3f;
53495 }
53496 if (
type == 139 &&
ai[3] != 0
f)
53497 {
53499 {
53501 Vector2
vector2 =
default(Vector2);
53505 {
53509 }
53511 {
53513 if (!
nPC2.active ||
nPC2.type != 134)
53514 {
53517 {
53519 }
53521 }
53522 else
53523 {
53529 }
53530 }
53531 else
53532 {
53535 {
53537 }
53539 }
53540 }
53541 else
53542 {
53545 {
53547 }
53549 }
53550 }
53551 else
53552 {
53554 {
53556 }
53558 {
53559 velocity.X +=
num12;
53561 {
53562 velocity.X +=
num12;
53563 }
53564 }
53566 {
53567 velocity.X -=
num12;
53569 {
53570 velocity.X -=
num12;
53571 }
53572 }
53574 {
53575 velocity.Y +=
num12;
53577 {
53578 velocity.Y +=
num12;
53579 }
53580 }
53582 {
53583 velocity.Y -=
num12;
53585 {
53586 velocity.Y -=
num12;
53587 }
53588 }
53589 }
53591 {
53593 {
53596 }
53598 {
53601 }
53602 }
53603 else if (
type == 139)
53604 {
53607 {
53609 }
53611 {
53613 }
53616 {
53618 }
53620 {
53623 {
53626 Vector2
vector3 =
default(Vector2);
53629 {
53630 Vector2
v3 = targetData.Center - base.Center - targetData.Velocity * 20
f;
53633 }
53635 }
53636 }
53642 {
53644 }
53646 {
53649 }
53651 {
53654 }
53655 }
53657 {
53659 }
53661 {
53663 {
53665 }
53667 {
53669 }
53671 }
53672 else
53673 {
53675 }
53677 {
53680 {
53682 }
53684 {
53686 velocity.X = oldVelocity.X * (0
f -
num7);
53688 {
53690 }
53692 {
53694 }
53695 }
53697 {
53699 velocity.Y = oldVelocity.Y * (0
f -
num7);
53700 if (
velocity.Y > 0
f && (
double)velocity.Y < 1.5)
53701 {
53703 }
53704 if (
velocity.Y < 0
f && (
double)velocity.Y > -1.5)
53705 {
53707 }
53708 }
53711 {
53714 obj.velocity *= 0.5f;
53715 }
53717 {
53720 {
53722 }
53724 Main.dust[
num10].velocity.X *= 0.5f;
53725 Main.dust[
num10].velocity.Y *= 0.1f;
53726 }
53728 }
53729 else if (
type != 252 && Main.rand.Next(40) == 0)
53730 {
53732 Main.dust[
num11].velocity.X *= 0.5f;
53733 Main.dust[
num11].velocity.Y *= 0.1f;
53734 }
53736 {
53738 {
53739 velocity.Y *= 0.95f;
53740 }
53741 velocity.Y -= 0.3f;
53743 {
53745 }
53746 }
53748 {
53750 {
53751 velocity.Y *= 0.95f;
53752 }
53753 velocity.Y -= 0.5f;
53755 {
53757 }
53759 }
53761 {
53763 {
53765 {
53766 velocity.Y *= 0.95f;
53767 }
53768 velocity.Y -= 0.5f;
53770 {
53772 }
53774 }
53776 {
53779 }
53780 if (Main.netMode != 1)
53781 {
53782 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f *
scale;
53784 {
53785 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f *
scale;
53786 }
53787 if (Main.getGoodWorld)
53788 {
53789 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f *
scale;
53790 }
53792 {
53794 if (player !=
null && player.stealth == 0
f && player.itemAnimation == 0)
53795 {
53797 }
53798 }
53800 {
53802 {
53804 Vector2
vector4 =
default(Vector2);
53806 float num14 = targetData.Center.X - vector4.X + (float)Main.rand.Next(-20, 21);
53807 float num15 = targetData.Center.Y - vector4.Y + (float)Main.rand.Next(-20, 21);
53809 {
53816 {
53818 }
53821 Main.projectile[
num19].timeLeft = 300;
53824 }
53825 else
53826 {
53828 }
53829 }
53830 else
53831 {
53833 }
53834 }
53835 }
53836 }
53838 {
53840 {
53843 {
53845 }
53847 {
53848 velocity.X *= 1.05f;
53849 }
53850 }
53851 else
53852 {
53853 velocity.X *= 0.9f;
53854 }
53855 }
53857 {
53861 if (((Vector2)(
ref v2)).Length() < (
float)
num21)
53862 {
53863 base.Center =
center -
v2.SafeNormalize(Vector2.UnitY) * (float)
num21;
53864 }
53865 }
53866 if (Main.netMode != 1)
53867 {
53868 if (Main.getGoodWorld &&
type == 6 &&
AnyNPCs(13))
53869 {
53871 {
53873 }
53876 {
53878 {
53880 }
53882 }
53883 }
53885 {
53887 {
53889 }
53892 {
53894 {
53896 }
53898 }
53899 }
53901 {
53903 {
53905 }
53908 {
53910 {
53912 if (((Vector2)(
ref val)).Length() < 400
f)
53913 {
53920 }
53921 else
53922 {
53924 }
53925 }
53926 else
53927 {
53929 }
53930 }
53931 }
53932 }
53934 {
53935 velocity.Y -=
num12 * 2
f;
53937 }
53939 {
53941 }
53942 }
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 ...
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.
Vector2 DirectionTo(Vector2 Destination)
int height
The height of this Entity's hitbox, in pixels.
static readonly SoundStyle Item17
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
static int FindFirstNPC(int Type)
Returns the index within F:Terraria.Main.npc of the the first active NPC in the world of the given NP...
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
static bool IsMechQueenUp
float scale
Makes the NPC bigger or smaller. Bigger than 1f is bigger. Defaults to 1f.
static bool AnyNPCs(int Type)
Returns true if there are any active NPC in the world of the given NPC type (F:Terraria....
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
int alpha
0 is opaque, and 255 is transparent. Note that this is the opposite of how alpha is typically express...
IEntitySource GetSpawnSourceForNPCFromNPCAI()
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Spawns an NPC into the game world with the given type. This method should not be called on multipla...
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
IEntitySource GetSpawnSource_ForProjectile()
static void TargetClosestNonBees(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)