50062 {
50063
50064
50065
50066
50067
50068
50069
50070
50071
50072
50073
50074
50075
50076
50077
50078
50079
50080
50081
50082
50083
50084
50085
50086
50087
50088
50089
50090 if (
localAI[0] == 0
f && Main.netMode != 1)
50091 {
50094 ai[2] = Main.rand.Next(7) + 1;
50096 if (Main.rand.Next(180) == 0)
50097 {
50098 Main.npc[
num].SetDefaults(-4);
50099 }
50100 else if (Main.rand.Next(10) == 0)
50101 {
50102 Main.npc[
num].SetDefaults(-7);
50103 }
50104 else if (Main.rand.Next(3) == 0)
50105 {
50106 Main.npc[
num].SetDefaults(-3);
50107 }
50108 Main.npc[
num].ai[0] = -999
f;
50109 Main.npc[
num].netUpdate =
true;
50112 ai[1] = Main.npc[
num].scale;
50113 }
50115 base.Size =
new Vector2(20
f, 20
f) *
ai[1];
50121 {
50123 float num4 =
float.PositiveInfinity;
50125 Vector2
zero = Vector2.Zero;
50127 {
50128 zero = targetData.Center -
base.Bottom;
50130 {
50132 }
50135 {
50137 }
50138 }
50140 {
50142 position.X -=
num6;
50143 nPC.position.X -=
num6;
50152 return;
50153 }
50155 {
50156 velocity.Y = ((oldVelocity.Y > 0
f) ? 1 : (-1));
50158 }
50159 float num7 = 2
f +
Math.Abs(Main.windSpeedTarget) * 2
f;
50161 {
50164 {
50166 {
50168 }
50169 else
50170 {
50172 }
50173 }
50175 {
50177 }
50178 }
50183 bool flag2 =
false;
50185 {
50186 if (Main.tile[
num8, i] ==
null)
50187 {
50188 Main.tile[
num8, i] =
default(
Tile);
50189 }
50190 if ((Main.tile[
num8, i].nactive() && Main.tileSolid[Main.tile[
num8, i].type]) || Main.tile[
num8, i].liquid > 0)
50191 {
50193 {
50195 }
50197 break;
50198 }
50199 }
50201 {
50203 float num2 = 0.035f;
50205 {
50206 velocity.Y -=
num2;
50208 {
50209 velocity.Y -=
num2;
50210 }
50211 }
50213 {
50214 velocity.Y +=
num2;
50216 {
50217 velocity.Y +=
num2;
50218 }
50219 }
50220 }
50221 else
50222 {
50224 {
50225 velocity.Y += 0.05f;
50226 }
50227 else
50228 {
50229 velocity.Y -= 0.1f;
50230 }
50232 {
50233 velocity.Y -= 0.2f;
50234 }
50236 {
50238 }
50240 {
50242 }
50243 }
50244 nPC.Center = base.Bottom +
new Vector2(0
f, -8
f) +
new Vector2(0
f, 56
f *
ai[1]);
50246 }
50247 else
50248 {
50252 {
50254 position.X -=
num3;
50263 }
50264 }
50265 }
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.
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.
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 life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
SoundStyle? DeathSound
The sound that plays when this npc dies. Set this to an existing T:Terraria.ID.SoundID entry or assig...
NPC AI_113_WindyBalloon_GetSlaveNPC()
void HitEffect(int hitDirection=0, double dmg=10.0, bool? instantKill=null)