64729 {
64730
64731
64732
64733
64734
64735
64736
64737
64738
64739
64740
64741
64742
64743
64744
64745
64746
64747
64748
64749
64750
64751
64752
64753
64754
64755
64756
64757
64758
64759
64760
64761
64762
64763
64764
64765
64766
64767
64768
64769
64770
64771
64772
64773
64774
64775
64776
64777
64778
64779
64780
64781
64782
64783
64784
64785
64786
64787
64788
64789
64790
64791
64792
64793
64794
64795
64796
64797
64798
64799
64800
64801
64802
64803
64804
64805
64806
64807
64808
64809
64810
64811
64812
64813
64814
64815
64816
64817
64818
64819
64820
64821
64822
64823
64824
64825
64826
64827
64828
64829
64830
64831
64832
64833
64834
64835
64836
64837
64838
64839
64840
64841
64842
64843
64844
64845
64846
64847
64848
64849
64850
64851
64852
64853
64854
64855
64856
64857
64858
64859
64860
64861
64862
64863
64864
64865
64866
64867
64868
64869
64870
64871
64872
64873
64874
64875
64876
64877
64878
64879
64880
64881
64882
64883
64884
64885
64886
64887
64888
64889
64890
64891
64892
64893
64894
64895
64896
64897
64898
64899
64900
64901
64902
64903
64904
64905
64906
64907
64908
64909
64910
64911
64912
64913
64914
64915
64916
64917
64918
64919
64920
64921
64922
64923 if (
type == 1 && (
ai[1] == 1
f ||
ai[1] == 2
f ||
ai[1] == 3
f))
64924 {
64926 }
64927 if (
type == 1 &&
ai[1] == 75
f)
64928 {
64930 Lighting.AddLight((
int)(
base.Center.X / 16
f), (
int)(
base.Center.Y / 16
f), 0.8f *
num, 0.7f *
num, 0.1f *
num);
64931 if (Main.rand.Next(12) == 0)
64932 {
64933 Dust
dust3 = Dust.NewDustPerfect(
base.Center +
new Vector2(0
f, (
float)
height * 0.2
f) + Main.rand.NextVector2CircularEdge(
width, (
float)
height * 0.6f) * (0.3f + Main.rand.NextFloat() * 0.5f), 228, (Vector2?)
new Vector2(0
f, (0
f - Main.rand.NextFloat()) * 0.3f - 1.5f), 127,
default(Color), 1
f);
64934 dust3.scale = 0.5f;
64935 dust3.fadeIn = 1.1f;
64936 dust3.noGravity = true;
64937 dust3.noLight = true;
64938 }
64939 }
64940 if (
type == 1 &&
ai[1] == 0
f && Main.netMode != 1 &&
value > 0
f)
64941 {
64943 if (Main.remixWorld &&
ai[0] != -999
f && Main.rand.Next(3) == 0)
64944 {
64947 }
64948 else if (Main.rand.Next(20) == 0)
64949 {
64953 }
64954 }
64955 if (
type == 1 &&
ai[0] == -999
f)
64956 {
64957 frame.Y = 0;
64960 return;
64961 }
64963 {
64964 float num23 = (float)Main.DiscoR / 255
f;
64965 float num29 = (float)Main.DiscoG / 255
f;
64966 float num30 = (float)Main.DiscoB / 255
f;
64972 }
64974 if (!Main.dayTime ||
life !=
lifeMax || (
double)
position.Y > Main.worldSurface * 16.0 || Main.slimeRain)
64975 {
64977 }
64979 {
64981 }
64983 {
64985 if (Main.rand.Next(30) == 0)
64986 {
64990 obj.velocity *= 0.3f;
64992 }
64993 }
64995 {
64997 }
64999 {
65001 }
65003 {
65005 }
65007 {
65009 }
65011 {
65014 }
65015 if (
type == 147 && Main.rand.Next(10) == 0)
65016 {
65019 Main.dust[
num32].noGravity =
true;
65021 obj2.velocity *= 0.1f;
65023 }
65025 {
65026 Color
color =
default(Color);
65028 Lighting.AddLight((
int)(base.Center.X / 16
f), (
int)(base.Center.Y / 16
f), (
float)(int)((Color)(
ref color)).R / 255
f * 1.1f, (float)(
int)((Color)(
ref color)).G / 255
f * 1.1
f, (
float)(int)((Color)(
ref color)).B / 255
f * 1.1f);
65029 if (((Vector2)(
ref velocity)).Length() > 1
f || Main.rand.Next(4) != 0)
65030 {
65037 Main.dust[
num3].noGravity =
true;
65038 Main.dust[
num3].noLightEmittence =
true;
65040 obj3.velocity *= 0.2f;
65041 Main.dust[
num3].scale = 1.5f;
65043 }
65044 }
65046 {
65047 Lighting.AddLight(
base.Center, 23);
65048 if ((((Vector2)(
ref velocity)).Length() > 1
f && Main.rand.Next(3) == 0) || Main.rand.Next(5) == 0)
65049 {
65050 Dust
dust2 = Dust.NewDustPerfect(Main.rand.NextVector2FromRectangle(
base.Hitbox), 306);
65051 dust2.noGravity = true;
65052 dust2.noLightEmittence = true;
65053 dust2.alpha = 127;
65054 dust2.color = Main.hslToRgb(((
float)Main.timeForVisualEffects / 300
f + Main.rand.NextFloat() * 0.1f) % 1
f, 1
f, 0.65f);
65056 dust2.velocity = dust2.position -
base.Center;
65057 dust2.velocity *= 0.1f;
65058 dust2.velocity.X *= 0.25f;
65059 if (
dust2.velocity.Y > 0
f)
65060 {
65061 dust2.velocity.Y *= -1
f;
65062 }
65063 dust2.scale = Main.rand.NextFloat() * 0.3f + 0.5f;
65064 dust2.fadeIn = 0.9f;
65066 }
65067 }
65069 {
65070 if (Main.rand.Next(8) == 0)
65071 {
65074 Main.dust[
num4].noGravity =
true;
65076 obj4.velocity *= 0.15f;
65078 }
65081 {
65083 }
65085 {
65086 Vector2
vector2 =
default(Vector2);
65092 {
65095 {
65096 velocity.X *= 0.9f;
65097 }
65098 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65099 {
65100 Vector2
vector3 =
default(Vector2);
65101 for (int i = 0; i < 5; i++)
65102 {
65104 vector3.X *= 1
f + (float)Main.rand.Next(-50, 51) * 0.005f;
65105 vector3.Y *= 1
f + (float)Main.rand.Next(-50, 51) * 0.005f;
65107 vector3 *= 4
f + (float)Main.rand.Next(-50, 51) * 0.01f;
65111 }
65112 }
65113 }
65115 {
65118 {
65119 velocity.X *= 0.9f;
65120 }
65121 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65122 {
65123 num6 = Main.player[
target].position.Y - vector2.Y - (float)Main.rand.Next(0, 200);
65130 }
65131 }
65132 }
65133 }
65135 {
65138 {
65140 }
65142 {
65143 Vector2
vector4 =
default(Vector2);
65149 {
65152 {
65153 velocity.X *= 0.9f;
65154 }
65155 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65156 {
65157 Vector2
vector5 =
default(Vector2);
65158 for (
int j = 0;
j < 5;
j++)
65159 {
65161 vector5.X *= 1
f + (float)Main.rand.Next(-50, 51) * 0.005f;
65162 vector5.Y *= 1
f + (float)Main.rand.Next(-50, 51) * 0.005f;
65164 vector5 *= 4
f + (float)Main.rand.Next(-50, 51) * 0.01f;
65168 }
65169 }
65170 }
65172 {
65175 {
65176 velocity.X *= 0.9f;
65177 }
65178 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65179 {
65180 num9 = Main.player[
target].position.Y - vector4.Y - (float)Main.rand.Next(0, 200);
65187 }
65188 }
65189 }
65190 }
65192 {
65195 {
65197 }
65199 {
65207 {
65210 {
65211 velocity.X *= 0.9f;
65212 }
65213 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65214 {
65215 Vector2
vector6 =
default(Vector2);
65216 for (
int k = 0;
k < 3;
k++)
65217 {
65219 vector6.X *= 1
f + (float)Main.rand.Next(-50, 51) * 0.005f;
65220 vector6.Y *= 1
f + (float)Main.rand.Next(-50, 51) * 0.005f;
65222 vector6 *= 6
f + (float)Main.rand.Next(-50, 51) * 0.01f;
65224 {
65226 }
65228 {
65230 }
65235 {
65236 break;
65237 }
65238 }
65239 }
65240 }
65242 {
65246 {
65247 velocity.X *= 0.9f;
65248 }
65249 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65250 {
65251 num13 = Main.player[
target].position.Y - center.Y - (float)Main.rand.Next(0, 200);
65256 {
65258 }
65260 {
65262 }
65268 }
65269 }
65270 }
65271 }
65273 {
65276 {
65278 }
65280 {
65288 {
65291 {
65292 velocity.X *= 0.9f;
65293 }
65294 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65295 {
65296 num18 = Main.player[
target].position.Y - center2.Y - (float)Main.rand.Next(0, 200);
65301 {
65303 }
65305 {
65307 }
65311 if (Main.expertMode)
65312 {
65314 }
65317 }
65318 }
65319 }
65320 }
65322 {
65325 {
65327 }
65329 {
65330 Vector2
vector7 =
default(Vector2);
65336 {
65339 {
65340 velocity.X *= 0.9f;
65341 }
65342 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65343 {
65344 Vector2
vector8 =
default(Vector2);
65345 for (
int l = 0;
l < 5;
l++)
65346 {
65348 vector8.X *= 1
f + (float)Main.rand.Next(-50, 51) * 0.02f;
65349 vector8.Y *= 1
f + (float)Main.rand.Next(-50, 51) * 0.02f;
65351 vector8 *= 3
f + (float)Main.rand.Next(-50, 51) * 0.01f;
65355 }
65356 }
65357 }
65359 {
65362 {
65363 velocity.X *= 0.9f;
65364 }
65365 if (Main.netMode != 1 &&
localAI[0] == 0
f)
65366 {
65367 num22 = Main.player[
target].position.Y - vector7.Y - (float)Main.rand.Next(-30, 20);
65369 num21 = Main.player[
target].position.X - vector7.X - (float)Main.rand.Next(-20, 20);
65376 }
65377 }
65378 }
65379 }
65381 {
65383 {
65385 }
65386 else
65387 {
65389 }
65390 }
65392 {
65394 Lighting.AddLight((
int)((position.X + (float)(
width / 2)) / 16
f), (int)((
position.Y + (
float)(
height / 2)) / 16
f), 1
f, 0.3
f, 0.1
f);
65396 Main.dust[
num25].noGravity =
true;
65398 }
65400 {
65402 }
65404 {
65406 {
65408 }
65410 {
65413 }
65415 {
65417 }
65418 if (
type == 59 && !Main.remixWorld)
65419 {
65421 {
65422 velocity.Y *= 0.9f;
65423 }
65425 {
65426 velocity.Y -= 0.8f;
65427 }
65428 velocity.Y -= 0.5f;
65430 {
65432 }
65433 }
65434 else
65435 {
65437 {
65438 velocity.Y *= 0.9f;
65439 }
65440 velocity.Y -= 0.5f;
65442 {
65444 }
65445 }
65447 {
65449 }
65450 }
65453 {
65457 }
65459 {
65461 {
65462 position.X -= velocity.X + (float)
direction;
65463 }
65465 {
65468 }
65470 velocity.X *= 0.8f;
65471 if ((
double)velocity.X > -0.1 && (double)
velocity.X < 0.1)
65472 {
65474 }
65476 {
65478 }
65480 if (
type == 59 && !Main.remixWorld)
65481 {
65483 }
65485 {
65487 }
65489 {
65491 }
65493 {
65495 }
65497 {
65499 }
65501 {
65503 }
65505 {
65507 }
65509 {
65512 }
65514 {
65516 }
65518 {
65520 {
65522 }
65523 else
65524 {
65526 }
65527 }
65530 {
65532 }
65534 {
65536 }
65539 {
65541 }
65543 {
65545 }
65547 {
65549 }
65551 {
65554 {
65556 }
65558 {
65560 if (
type == 59 && !Main.remixWorld)
65561 {
65563 }
65565 if (
type == 59 && !Main.remixWorld)
65566 {
65568 }
65571 }
65572 else
65573 {
65576 if (
type == 59 && !Main.remixWorld)
65577 {
65579 }
65582 {
65584 }
65585 else
65586 {
65588 }
65589 }
65591 {
65592 velocity.Y *= 1.6f;
65593 velocity.X *= 1.2f;
65594 }
65596 {
65597 velocity.Y *= 0.5f;
65598 velocity.X *= 0.2f;
65599 if (Main.rand.Next(2) == 0)
65600 {
65602 }
65603 }
65605 {
65606 velocity.Y *= 1.3f;
65607 velocity.X *= 1.2f;
65608 }
65610 {
65611 velocity.Y *= 0.9f;
65612 velocity.X *= 0.6f;
65614 {
65617 }
65618 int i2 = (int)(
base.Center.X / 16
f);
65619 int j2 = (int)(
base.Center.Y / 16
f) - 1;
65621 {
65622 velocity.Y = -(16 -
height);
65623 }
65624 }
65625 }
65626 else if (
ai[0] >= -30
f)
65627 {
65629 }
65630 }
65632 {
65634 {
65636 }
65638 {
65639 position.X -= velocity.X + (float)
direction;
65640 }
65642 {
65644 }
65645 else
65646 {
65647 velocity.X *= 0.93f;
65648 }
65649 }
65650 }
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.
int height
The height of this Entity's hitbox, in pixels.
int GetAttackDamage_ForProjectiles_MultiLerp(float normalDamage, float expertDamage, float masterDamage)
static int CountNPCS(int Type)
Returns the number of active NPC in the world of the given NPC type (F:Terraria.NPC....
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
void AI_001_SetRainbowSlimeColor()
int lifeMax
The maximum life of this NPC.
void TargetClosest(bool faceTarget=true)
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
bool friendly
Indicates that an NPC is friendly to players. If true, a player won't damage the NPC and the NPC won'...
float value
How many copper coins the NPC will drop when killed (100 copper coins = 1 silver coin etc....
float scale
Makes the NPC bigger or smaller. Bigger than 1f is bigger. Defaults to 1f.
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...
static int AI_001_Slimes_GenerateItemInsideBody(bool isBallooned)
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
IEntitySource GetSpawnSource_ForProjectile()