45501 {
45502
45503
45504
45505
45506
45507
45508
45509
45510
45511
45512
45513
45514
45515
45516
45517
45518
45519
45520
45521
45522
45523
45524
45525
45526
45527
45528
45529
45530
45531
45532
45533
45534
45535
45536
45537
45538
45539
45540
45541
45542
45543
45544
45545
45546
45547
45548
45549
45550
45551
45552
45553
45554
45555
45556
45557
45558
45559
45560
45561
45562
45563
45564
45565
45566
45567
45568
45569
45570
45571
45572
45573
45574
45575
45576
45577
45578
45579
45580
45581
45586 {
45587 newColor2 = Main.hslToRgb(Main.GlobalTimeWrappedHourly * 0.33f % 1
f, 1
f, 0.5f);
45589 rgb += Vector3.One * 0.1f;
45590 Lighting.AddLight(
base.Center,
rgb);
45596 {
45598 }
45600 {
45603 }
45606 {
45608 if (Main.netMode != 1)
45609 {
45610 NetMessage.SendData(23, -1, -1,
null,
whoAmI);
45611 }
45612 return;
45613 }
45616 {
45618 for (
int i = 0; i <
num29; i++)
45619 {
45620 if (Main.rand.Next(5) == 0)
45621 {
45623 Color
newColor = Main.hslToRgb(Main.GlobalTimeWrappedHourly * 0.3f % 1
f, 1
f, 0.5f) * 0.5f;
45625 Main.dust[
num31].position = base.Center + Main.rand.NextVector2Circular(
width,
height);
45627 obj.velocity *= Main.rand.NextFloat() * 0.8f;
45630 Main.dust[
num31].noGravity =
true;
45631 Main.dust[
num31].fadeIn = 0.6f + Main.rand.NextFloat() * 0.7f *
num30;
45632 Main.dust[
num31].scale = 0.35f;
45634 {
45635 Dust dust = Dust.CloneDust(
num31);
45637 dust.fadeIn *= 0.85f;
45638 dust.color = new Color(255, 255, 255, 255) * 0.5f;
45639 }
45640 }
45641 }
45642 }
45644 }
45645 if (Main.netMode != 1)
45646 {
45647 if (
ai[2] == 0
f &&
type != 661)
45648 {
45657 int num8 = Main.rand.Next(100);
45660 }
45662 {
45663 ai[3] = (float)Main.rand.Next(75, 111) * 0.01f;
45664 }
45667 {
45668 localAI[0] = Main.rand.Next(90, 240);
45672 {
45673 float num10 = (float)Main.rand.Next(50, 151) * 0.01f;
45675 {
45676 num10 = (float)Main.rand.Next(150, 201) * 0.01f;
45677 }
45678 else if (
num9 > 850
f)
45679 {
45680 num10 = (float)Main.rand.Next(100, 151) * 0.01f;
45681 }
45683 int num13 = Main.rand.Next(-50, 51);
45685 {
45686 num13 -= Main.rand.Next(100, 251);
45687 }
45691 }
45692 else
45693 {
45695 float num34 = (float)Main.rand.Next(26, 301) * 0.01f;
45696 int num15 = Main.rand.Next(-100, 101);
45697 int num16 = Main.rand.Next(-100, 101);
45701 }
45703 }
45704 }
45707 velocity.X = (velocity.X * (float)(
num18 - 1) +
num) / (
float)
num18;
45708 velocity.Y = (velocity.Y * (float)(
num18 - 1) +
num12) / (
float)
num18;
45710 {
45715 {
45716 if (Main.tile[
num20,
j] !=
null && ((Main.tile[
num20,
j].nactive() && Main.tileSolid[Main.tile[
num20,
j].type]) || Main.tile[
num20,
j].liquid > 0))
45717 {
45720 {
45721 velocity.Y *= 0.9f;
45722 }
45723 }
45724 }
45725 }
45727 {
45729 bool flag2 =
false;
45733 {
45734 if (Main.tile[
num24,
k] !=
null && Main.tile[
num24,
k].nactive() && Main.tileSolid[Main.tile[
num24,
k].type])
45735 {
45737 }
45738 }
45740 {
45743 {
45744 velocity.Y *= 0.9f;
45745 }
45746 }
45747 }
45749 {
45751 }
45752 else
45753 {
45756 {
45758 }
45760 Vector2
zero = Vector2.Zero;
45761 for (
int l = 0;
l < 200;
l++)
45762 {
45764 if (
nPC.active &&
nPC.damage > 0 && !
nPC.friendly &&
nPC.Hitbox.Distance(
base.Center) <= 100
f)
45765 {
45768 }
45769 }
45771 {
45776 {
45778 }
45779 }
45780 }
45782 {
45784 velocity.X *= -0.2f;
45785 }
45787 {
45789 }
45791 {
45793 }
45797 {
45799 }
45801 {
45803 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.6f, 0.3f, 0.1f);
45804 if (Main.rand.Next(60) == 0)
45805 {
45812 obj3.velocity *= 0
f;
45813 }
45815 }
45816 }
Vector2 DirectionFrom(Vector2 Source)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
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.
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
int height
The height of this Entity's hitbox, in pixels.
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...
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 catchItem
The numerical ID of the item that this NPC becomes when caught. Mainly used for critters that can be...