71046 {
71047
71048
71049
71050
71051
71052
71053
71054
71055
71056
71057
71058
71059
71060
71061
71062
71063
71064
71065
71066
71067
71068
71069
71070
71071
71072
71073
71074
71075
71076
71077
71078
71079
71080
71081
71082
71083
71084
71085
71086
71087
71088
71089
71090
71091
71092
71093
71094
71095
71096
71097
71098
71099
71100
71101
71102
71103
71104
71105
71106
71107
71108
71109
71110
71111
71112
71113
71114
71116 bool flag4 =
false;
71118 bool flag6 =
false;
71122 float num15 = 0.2f;
71124 float num17 = -0.2f;
71128 float num20 = 0.1f;
71130 float num3 = 0.04f;
71131 bool flag8 =
false;
71132 float num4 = 0.96f;
71136 {
71150 DelegateMethods.v3_1 =
new Vector3(0.3
f, 0.05
f, 0.45
f) * 1.5f;
71151 Utils.PlotTileLine(
base.Top,
base.Bottom,
width, DelegateMethods.CastLightOpen);
71153 {
71155 }
71157 {
71162 if (
ai[0] == 80
f &&
ai[1] == 2
f)
71163 {
71165 }
71166 if (
ai[1] == 2
f &&
ai[0] == 64
f && Main.netMode != 1)
71167 {
71170 }
71171 if (
ai[1] == 0
f &&
ai[0] == 32
f)
71172 {
71173 Vector2
vector = (targetData.Center - (base.Center +
new Vector2((
float)(
direction * 10), -16
f))).SafeNormalize(Vector2.UnitY) * 14
f;
71175 if (Main.netMode != 1)
71176 {
71178 }
71179 }
71180 if (
ai[0] == 126
f &&
ai[1] == 1
f)
71181 {
71183 }
71185 {
71187 }
71189 {
71193 {
71195 }
71198 {
71200 }
71202 }
71203 }
71205 {
71207 Vector2
minimum = base.Center +
new Vector2(-600
f, -200
f);
71208 Vector2
maximum = base.Center +
new Vector2(600
f, 200
f);
71210 for (int i = 0; i < 200; i++)
71211 {
71214 {
71216 break;
71217 }
71218 }
71220 {
71222 }
71224 {
71226 }
71229 {
71231 }
71233 {
71234 switch ((
int)
ai[1])
71235 {
71236 case 0:
71238 break;
71239 case 1:
71241 break;
71242 case 2:
71244 break;
71245 }
71248 }
71249 }
71251 {
71253 }
71255 {
71257 }
71259 {
71263 {
71265 }
71267 Vector2 size =
base.Size;
71268 float num7 = ((Vector2)(
ref size)).Length() / 2
f;
71272 {
71274 }
71275 for (
int j = 0;
j <
num6;
j++)
71276 {
71277 if (Main.rand.Next(
maxValue) == 0)
71278 {
71280 dust.scale = 0.55f;
71281 dust.fadeIn = 0.7f;
71282 dust.velocity *= 0.1f *
num7;
71284 }
71285 }
71286 }
71287 }
71289 {
71291 }
71293 {
71295 {
71297 bool flag2 =
false;
71298 bool flag3 =
false;
71300 {
71302 }
71304 {
71307 }
71309 {
71311 }
71313 {
71316 {
71318 }
71320 {
71325 }
71326 }
71327 else
71328 {
71332 }
71334 {
71336 }
71337 }
71338 else
71339 {
71341 direction = ((targetData.Center.X >
base.Center.X) ? 1 : (-1));
71342 }
71343 }
71349 {
71351 return;
71352 }
71354 {
71355 if (Main.tile[
num9,
k] ==
null)
71356 {
71358 }
71359 if ((Main.tile[
num9,
k].nactive() && Main.tileSolid[Main.tile[
num9,
k].type]) || Main.tile[
num9,
k].liquid > 0)
71360 {
71362 {
71364 }
71366 break;
71367 }
71368 }
71370 {
71371 if (Main.tile[
num13,
l] ==
null)
71372 {
71374 }
71375 if ((Main.tile[
num13,
l].nactive() && Main.tileSolid[Main.tile[
num13,
l].type]) || Main.tile[
num13,
l].liquid > 0)
71376 {
71379 break;
71380 }
71381 }
71383 {
71385 {
71386 if (Main.tile[
num9,
m] ==
null)
71387 {
71389 }
71390 if ((Main.tile[
num9,
m].nactive() && Main.tileSolid[Main.tile[
num9,
m].type]) || Main.tile[
num9,
m].liquid > 0)
71391 {
71394 break;
71395 }
71396 }
71397 }
71399 {
71402 }
71404 {
71405 velocity.Y +=
num15;
71407 {
71408 velocity.Y =
num16;
71409 }
71410 }
71411 else
71412 {
71414 {
71415 velocity.Y +=
num17;
71416 }
71418 {
71419 velocity.Y =
num18;
71420 }
71421 }
71423 {
71424 velocity.X = oldVelocity.X * -0.4f;
71426 {
71428 }
71430 {
71432 }
71433 }
71435 {
71436 velocity.Y = oldVelocity.Y * -0.25f;
71438 {
71440 }
71442 {
71444 }
71445 }
71447 {
71448 velocity.X -=
num20;
71450 {
71451 velocity.X -=
num20;
71452 }
71454 {
71455 velocity.X +=
num20 / 2
f;
71456 }
71458 {
71459 velocity.X = 0
f -
num19;
71460 }
71461 }
71463 {
71464 velocity.X +=
num20;
71466 {
71467 velocity.X +=
num20;
71468 }
71470 {
71471 velocity.X -=
num20 / 2
f;
71472 }
71474 {
71475 velocity.X =
num19;
71476 }
71477 }
71479 {
71480 velocity.Y -=
num3;
71482 {
71483 velocity.Y -=
num3 * 1.25f;
71484 }
71486 {
71487 velocity.Y +=
num3 * 0.75f;
71488 }
71490 {
71491 velocity.Y = 0
f -
num19;
71492 }
71493 }
71495 {
71496 velocity.Y +=
num3;
71498 {
71499 velocity.Y +=
num3 * 1.25f;
71500 }
71502 {
71503 velocity.Y -=
num3 * 0.75f;
71504 }
71506 {
71508 }
71509 }
71510 }
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
float Distance(Vector2 Other)
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.
static bool CanRaiseGoblinsHere(Vector2 spot)
static void RaiseGoblins(NPC caller, Vector2 spot)
static readonly SoundStyle DD2_DarkMageSummonSkeleton
static readonly SoundStyle DD2_DarkMageCastHeal
static readonly SoundStyle DD2_EtherianPortalSpawnEnemy
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
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 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 GetSpawnSource_ForProjectile()
static void TargetClosestOldOnesInvasion(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
static bool Find(Point origin, GenSearch search, out Point result)