48796 {
48797
48798
48799
48800
48801
48802
48803
48804
48805
48806
48807
48808
48809
48810
48811
48812
48813
48814
48815
48816
48817
48818
48819
48820
48821
48822
48823
48824
48825
48826
48827
48828
48829
48830
48831
48832
48833
48834
48835
48836
48837
48838
48839
48840
48841
48842
48843
48844
48845
48846
48847
48848
48849
48850
48851
48852
48853
48854
48855
48856
48857
48858
48859
48860
48861
48862
48863
48864
48865
48866
48867
48868
48869
48870
48871
48872
48873
48874
48875
48876
48877
48878
48879
48880
48881
48882
48883
48884
48885
48886
48887
48888
48889
48890
48891
48892
48893
48894
48895
48896
48897
48898
48899
48900
48901
48902
48903
48904
48905
48906
48907
48908
48909
48910
48911
48912
48913
48914
48915
48916
48917
48918
48919
48920
48921
48922
48923
48924
48925
48926
48927
48928
48929
48930
48931
48932
48933
48934
48935
48936
48937
48938
48939
48940
48941
48942
48943
48944
48945
48946
48947
48948
48949
48950
48951
48952
48953
48954
48955
48956
48957
48958
48959
48960
48961
48962
48963
48964
48965
48966
48967
48968
48969
48970
48971
48972
48973
48974
48975
48976
48977
48978
48979
48980
48981
48982
48983
48984
48985
48986
48987
48988
48989
48990
48991
48992
48993
48994
48995
48996
48997
48998
48999
49000
49001
49002
49003
49004
49005
49006
49007
49008
49009
49010
49011
49012
49013
49014
49015
49016
49017
49018
49019
49020
49021
49022
49023
49024
49025
49026
49027
49028
49029
49030
49031
49032
49033
49034
49035
49036
49037
49038
49039
49040
49041
49042
49043
49044
49045
49046
49047
49048
49049
49050
49051
49052
49053
49054
49055
49056
49057
49058
49059
49060
49061
49062
49063
49064
49065
49066
49067
49068
49069
49070
49071
49072
49073
49074
49075
49076
49077
49078
49079
49080
49081
49082
49083
49084
49085
49086
49087
49088
49089
49090
49091
49092
49093
49094
49095
49096
49097
49098
49099
49100
49101
49102
49103
49104
49105
49106
49107
49108
49109
49110
49111
49112
49113
49114
49115
49116
49117
49118
49119
49120
49121
49122
49123
49124
49125
49126
49127
49128
49129
49130
49131
49132
49133
49134
49135
49136
49137
49138
49139
49140
49141
49142
49143
49144
49145
49146
49147
49148
49149
49150
49151
49152
49153
49154
49155
49156 float moveSpeed = 0.15f;
49167 {
49170 if (Main.netMode != 1)
49171 {
49174 }
49175 }
49176 if (
ai[0] != -1
f && Main.rand.Next(4) == 0)
49177 {
49180 dust.velocity *= 0.5f;
49181 if (dust.velocity.Y < 0
f)
49182 {
49183 dust.velocity.Y *= -1
f;
49184 }
49185 dust.alpha = 120;
49186 dust.scale = 1
f + Main.rand.NextFloat() * 0.4f;
49189 }
49191 {
49194 }
49195 if (Main.player[
target].dead || Vector2.Distance(Main.player[
target].Center,
base.Center) > 2000
f)
49196 {
49198 }
49200 if (Main.dayTime || !Main.bloodMoon)
49201 {
49203 }
49206 switch ((
int)
ai[0])
49207 {
49208 case -1:
49209 {
49213 {
49216 }
49218 {
49222 {
49230 Main.dust[
num11].noGravity =
true;
49231 Main.dust[
num11].velocity = Vector2.Normalize(
vector3) * 3
f;
49233 }
49234 }
49236 {
49237 velocity.Y = -2.5f;
49240 {
49243 {
49245 }
49246 }
49248 {
49250 }
49251 }
49254 {
49260 }
49261 break;
49262 }
49263 case 0:
49264 {
49265 Vector2
destination = nPCAimedTarget.Center +
new Vector2((0
f -
ai[2]) * 300
f, -200
f);
49267 {
49270 }
49274 {
49276 }
49278 {
49282 }
49286 {
49290 {
49292 }
49293 else if (
num8 % 2 == 0)
49294 {
49297 }
49298 else
49299 {
49302 }
49303 }
49304 break;
49305 }
49306 case 1:
49307 {
49311 {
49313 }
49316 {
49320 }
49322 {
49324 {
49326 }
49334 dust5.velocity =
dust5.position.DirectionTo(
mouthPosition4 + Main.rand.NextVector2Circular(15
f, 15
f)) * ((Vector2)(
ref dust5.velocity)).Length();
49335 dust5.noGravity = true;
49337 dust5.fadeIn = 1.5f;
49338 dust5.velocity =
dust5.position.DirectionTo(
mouthPosition4 + Main.rand.NextVector2Circular(15
f, 15
f)) * (((Vector2)(
ref dust5.velocity)).Length() + 5
f);
49339 dust5.noGravity = true;
49341 }
49343 {
49348 {
49350 }
49351 for (
int m = 0;
m < 4;
m++)
49352 {
49354 dust6.velocity =
dust6.position.DirectionFrom(
mouthPosition5 + Main.rand.NextVector2Circular(5
f, 5
f)) * ((Vector2)(
ref dust6.velocity)).Length();
49358 dust6.velocity =
dust6.position.DirectionFrom(
mouthPosition5 + Main.rand.NextVector2Circular(10
f, 10
f)) * (((Vector2)(
ref dust6.velocity)).Length() + 5
f);
49361 }
49363 }
49366 {
49368 }
49369 break;
49370 }
49371 case 2:
49372 {
49376 {
49378 }
49380 {
49384 }
49387 {
49391 if (Main.rand.Next(4) != 0)
49392 {
49395 dust2.velocity =
dust2.position.DirectionTo(
mouthPosition2 + Main.rand.NextVector2Circular(15
f, 15
f)) * (((Vector2)(
ref dust2.velocity)).Length() + 3
f);
49396 dust2.noGravity = true;
49398 dust2.fadeIn = 1.5f;
49399 dust2.velocity =
dust2.position.DirectionTo(
mouthPosition2 + Main.rand.NextVector2Circular(15
f, 15
f)) * (((Vector2)(
ref dust2.velocity)).Length() + 5
f);
49400 dust2.noGravity = true;
49401 }
49403 }
49405 {
49411 {
49412 for (int i = 0; i < 5; i++)
49413 {
49415 dust3.velocity =
dust3.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(5
f, 5
f)) * ((Vector2)(
ref dust3.velocity)).Length();
49419 dust3.velocity =
dust3.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(10
f, 10
f)) * (((Vector2)(
ref dust3.velocity)).Length() + 5
f);
49422 }
49423 }
49424 if ((
int)
num5 == 0)
49425 {
49427 for (
int j = 0;
j < 20;
j++)
49428 {
49430 dust4.velocity =
dust4.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(5
f, 5
f)) * ((Vector2)(
ref dust4.velocity)).Length();
49434 dust4.velocity =
dust4.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(10
f, 10
f)) * (((Vector2)(
ref dust4.velocity)).Length() + 5
f);
49437 }
49438 if (Main.netMode != 1)
49439 {
49440 int num6 = Main.rand.Next(5, 11);
49443 for (
int k = 0;
k <
num6;
k++)
49444 {
49447 }
49448 }
49449 }
49451 }
49454 {
49456 }
49457 break;
49458 }
49459 case 3:
49460 {
49465 {
49474 float num3 = Utils.GetLerpValue(0
f, 0.5
f, t) * Utils.GetLerpValue(1
f, 0.5
f, t);
49475 Lighting.AddLight(
base.Center,
new Vector3(1
f, 0.5
f, 0.5
f) *
num3);
49476 if (Main.rand.Next(3) != 0)
49477 {
49478 Dust
dust7 = Dust.NewDustDirect(
base.Center -
new Vector2(6
f), 12, 12, 5, 0
f, 0
f, 60, Color.Transparent, 1.4f);
49480 dust7.velocity *= 0.1f;
49481 }
49483 }
49484 if (
ai[1] == 10
f ||
ai[1] == 20
f ||
ai[1] == 30
f)
49485 {
49487 }
49490 {
49492 }
49493 break;
49494 }
49495 }
49497 {
49504 {
49506 }
49507 else
49508 {
49510 }
49511 }
49513 }
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 ...
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 Item170
static readonly SoundStyle Item172
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
void TargetClosest(bool faceTarget=true)
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...
int alpha
0 is opaque, and 255 is transparent. Note that this is the opposite of how alpha is typically express...
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
void BloodNautilus_CallForHelp()
IEntitySource GetSpawnSource_ForProjectile()
void BloodNautilus_GetMouthPositionAndRotation(out Vector2 mouthPosition, out Vector2 mouthDirection)
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)