41104 {
41105 if (
localAI[0] == 0f && Main.netMode != 1)
41106 {
41109 ai[2] = Main.rand.Next(7) + 1;
41111 if (Main.rand.Next(180) == 0)
41112 {
41113 Main.npc[num].SetDefaults(-4);
41114 }
41115 else if (Main.rand.Next(10) == 0)
41116 {
41117 Main.npc[num].SetDefaults(-7);
41118 }
41119 else if (Main.rand.Next(3) == 0)
41120 {
41121 Main.npc[num].SetDefaults(-3);
41122 }
41123 Main.npc[num].ai[0] = -999f;
41124 Main.npc[num].netUpdate = true;
41127 ai[1] = Main.npc[num].scale;
41128 }
41130 base.Size =
new Vector2(20f, 20f) *
ai[1];
41136 {
41138 float num2 =
float.PositiveInfinity;
41142 {
41143 zero = targetData.Center -
base.Bottom;
41145 {
41147 }
41150 {
41152 }
41153 }
41155 {
41157 position.X -=
num4;
41158 nPC.position.X -=
num4;
41167 return;
41168 }
41170 {
41171 velocity.Y = ((oldVelocity.Y > 0f) ? 1 : (-1));
41173 }
41174 float num5 = 2f +
Math.
Abs(Main.windSpeedTarget) * 2f;
41176 {
41177 velocity.X += (float)
direction * 0.01f;
41179 {
41181 {
41183 }
41184 else
41185 {
41186 velocity.X += (float)
direction * 0.05f;
41187 }
41188 }
41190 {
41192 }
41193 }
41196 bool flag = true;
41198 bool flag2 =
false;
41200 {
41201 if (Main.tile[
num6, i] ==
null)
41202 {
41204 }
41205 if ((Main.tile[
num6, i].nactive() && Main.tileSolid[Main.tile[
num6, i].type]) || Main.tile[
num6, i].liquid > 0)
41206 {
41208 {
41210 }
41211 flag = false;
41212 break;
41213 }
41214 }
41216 {
41218 float num10 = 0.035f;
41220 {
41221 velocity.Y -=
num10;
41223 {
41224 velocity.Y -=
num10;
41225 }
41226 }
41228 {
41229 velocity.Y +=
num10;
41231 {
41232 velocity.Y +=
num10;
41233 }
41234 }
41235 }
41236 else
41237 {
41238 if (flag)
41239 {
41240 velocity.Y += 0.05f;
41241 }
41242 else
41243 {
41244 velocity.Y -= 0.1f;
41245 }
41247 {
41248 velocity.Y -= 0.2f;
41249 }
41251 {
41252 velocity.Y = 2f;
41253 }
41255 {
41256 velocity.Y = -4f;
41257 }
41258 }
41259 nPC.Center = base.Bottom +
new Vector2(0f, -8f) +
new Vector2(0f, 56f *
ai[1]);
41261 }
41262 else
41263 {
41267 {
41269 position.X -=
num11;
41278 }
41279 }
41280 }
static float Clamp(float value, float min, float max)
static double Abs(double value)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
void TargetClosest(bool faceTarget=true)
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
LegacySoundStyle DeathSound
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)
void HitEffect(int hitDirection=0, double dmg=10.0)
NPC AI_113_WindyBalloon_GetSlaveNPC()