14030 {
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14103 if (Main.getGoodWorld)
14104 {
14106 }
14107 if ((!Main.player[
target].ZoneLihzhardTemple && !Main.player[
target].ZoneJungle) || (
double)Main.player[
target].Center.Y < Main.worldSurface * 16.0)
14108 {
14110 }
14112 {
14114 return;
14115 }
14117 {
14120 {
14122 }
14124 }
14127 Vector2
vector = nPC.Center + nPC.velocity +
new Vector2(0
f, -9
f *
scale);
14128 vector.X += (float)((
type == 247) ? (-84) : 78) *
scale;
14132 {
14136 {
14138 }
14140 {
14142 }
14144 {
14146 }
14149 {
14151 }
14156 {
14158 velocity.X = x;
14159 velocity.Y = y;
14163 {
14165 }
14167 {
14169 }
14171 {
14173 }
14175 {
14177 if ((
type == 247 &&
base.Center.X + 100
f > Main.player[
target].Center.X) || (
type == 248 &&
base.Center.X - 100
f < Main.player[
target].Center.X))
14178 {
14181 }
14182 else
14183 {
14185 }
14186 }
14187 }
14188 else
14189 {
14191 velocity.X = x *
num8;
14192 velocity.Y = y *
num8;
14195 {
14197 }
14198 }
14199 }
14200 else if (
ai[0] == 1
f)
14201 {
14207 {
14208 for (int i = 0; i < 1; i++)
14209 {
14210 Vector2
vector3 = Main.rand.NextVector2Circular(80
f, 80
f);
14212 Vector2
vector5 = Main.rand.NextVector2Circular(20
f, 20
f);
14214 dust.fadeIn = 1.5f;
14215 dust.scale = 0.5f;
14216 if (Main.getGoodWorld)
14217 {
14218 dust.noLight = true;
14219 }
14220 dust.noGravity = true;
14221 }
14222 }
14224 {
14232 {
14234 }
14236 {
14238 }
14240 {
14242 }
14245 {
14247 }
14248 Vector2
vector6 =
default(Vector2);
14258 {
14260 }
14261 }
14262 }
14263 else if (
ai[0] == 2
f)
14264 {
14265 if (Main.netMode != 1 && Main.getGoodWorld)
14266 {
14267 for (
int j = (
int)(position.X / 16
f) - 1; (float)
j < (
position.X + (
float)
width) / 16
f + 1
f;
j++)
14268 {
14269 for (
int k = (
int)(position.Y / 16
f) - 1; (float)
k < (
position.Y + (
float)
width) / 16
f + 1
f;
k++)
14270 {
14271 if (Main.tile[
j,
k].type == 4)
14272 {
14274 if (Main.netMode == 2)
14275 {
14276 NetMessage.SendTileSquare(-1,
j,
k);
14277 }
14278 }
14279 }
14280 }
14281 }
14284 {
14286 }
14287 if (Main.rand.Next(2) == 0)
14288 {
14290 Vector2
vector8 = Main.rand.NextVector2Circular(20
f, 20
f);
14292 }
14294 {
14296 {
14298 }
14300 {
14302 }
14303 }
14304 else
14305 {
14307 {
14309 }
14311 {
14313 }
14314 }
14316 {
14319 }
14320 }
14321 else
14322 {
14324 {
14325 return;
14326 }
14329 Vector2
vector9 =
default(Vector2);
14338 {
14339 velocity.X +=
num2;
14341 {
14342 velocity.X +=
num2 * 2
f;
14343 }
14344 }
14346 {
14347 velocity.X -=
num2;
14349 {
14350 velocity.X -=
num2 * 2
f;
14351 }
14352 }
14354 {
14355 velocity.Y +=
num2;
14357 {
14358 velocity.Y +=
num2 * 2
f;
14359 }
14360 }
14362 {
14363 velocity.Y -=
num2;
14365 {
14366 velocity.Y -=
num2 * 2
f;
14367 }
14368 }
14371 {
14373 }
14374 }
14375 }
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.
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
static readonly SoundStyle Item14
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...
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...
bool noTileCollide
If true, the npc does not collide with tiles, making the npc pass through tiles freely....
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
int StrikeNPCNoInteraction(int Damage, float knockBack, int hitDirection)