37142 {
37144 int num = 15;
37152 bool expertMode = Main.expertMode;
37154 float num2 = Utils.Remap(
localAI[3], 0f, 30f, 0f, 1f);
37156 {
37157 float num3 = Main.rand.NextFloat() *
num2 * 3f;
37159 {
37162 }
37163 }
37165 {
37166 Point point =
base.Bottom.ToTileCoordinates();
37173 }
37176 {
37178 }
37181 if (!expertMode)
37182 {
37184 }
37185 if (expertMode && Main.netMode != 1)
37186 {
37188 }
37189 switch ((
int)this.
ai[0])
37190 {
37191 case -1:
37193 break;
37194 case 6:
37195 {
37198 if (Main.netMode != 1)
37199 {
37201 {
37202 this.ai[0] = 0f;
37203 this.ai[1] = 0f;
37206 break;
37207 }
37209 {
37210 this.ai[0] = 8f;
37211 this.ai[1] = 0f;
37214 break;
37215 }
37216 }
37218 {
37220 }
37222 this.ai[1] += 1f;
37224 bool flag2 = base.Top.Y > other.Y + 1600f;
37227 float num5 = this.ai[1] % 600f;
37229 {
37231 }
37232 bool flag3 =
false;
37234 if (
flag2 && this.ai[1] >= (
float)
num6)
37235 {
37237 }
37239 if (!
num4 && this.ai[1] >= (
float)
num7)
37240 {
37242 }
37244 {
37245 this.ai[0] = 7f;
37246 this.ai[1] = 0f;
37249 }
37250 break;
37251 }
37252 case 0:
37253 {
37257 {
37258 this.ai[0] = 6f;
37259 this.ai[1] = 0f;
37262 break;
37263 }
37264 this.ai[1] += 1f;
37269 float num15 = 0.6f;
37271 bool flag5 = vector3.Y <= (float)(100 +
targetData.Height) && vector3.Y >= -200f;
37273 {
37274 velocity.X = 0f;
37275 this.ai[0] = 4f;
37276 this.ai[1] = 0f;
37279 break;
37280 }
37282 {
37283 velocity.X = 0f;
37284 this.ai[0] = 1f;
37285 this.ai[1] = 0f;
37288 break;
37289 }
37290 bool flag6 = this.ai[1] >= 240f;
37292 {
37293 velocity.X = 0f;
37294 this.ai[0] = 2f;
37295 this.ai[1] = 0f;
37298 break;
37299 }
37300 bool flag7 = this.ai[1] >= 90f;
37302 {
37303 velocity.X = 0f;
37304 this.ai[0] = 5f;
37305 this.ai[1] = 0f;
37308 break;
37309 }
37310 bool flag8 = this.ai[1] >= 120f;
37312 bool flag9 = targetData.Type == NPCTargetType.Player && !Main.player[
target].buffImmune[
num16] && Main.player[
target].FindBuffIndex(
num16) == -1;
37314 {
37315 velocity.X = 0f;
37316 this.ai[0] = 3f;
37317 this.ai[1] = 0f;
37320 }
37321 break;
37322 }
37323 case 1:
37324 this.ai[1] += 1f;
37327 if (this.ai[1] >= 80f)
37328 {
37329 this.ai[0] = 0f;
37330 this.ai[1] = 0f;
37332 }
37333 break;
37334 case 4:
37335 this.ai[1] += 1f;
37339 if (this.ai[1] >= 90f)
37340 {
37341 this.ai[0] = 0f;
37342 this.ai[1] = 0f;
37344 }
37345 break;
37346 case 2:
37347 {
37350 this.ai[1] += 1f;
37351 if (this.ai[1] == (
float)(
num9 - 20))
37352 {
37354 }
37355 if (this.ai[1] == (
float)
num9)
37356 {
37358 }
37360 if (Main.netMode != 1 &&
this.ai[1] >= (
float)
num9)
37361 {
37367 sourceTileCoords.Y -= 10;
37370 {
37372 Main.instance.CameraModifiers.Add(
modifier4);
37373 }
37378 {
37380 }
37382 {
37384 }
37385 }
37386 if (this.ai[1] >= 60f)
37387 {
37388 this.ai[0] = 0f;
37389 this.ai[1] = 0f;
37391 }
37392 break;
37393 }
37394 case 3:
37395 if (this.ai[1] == 30f)
37396 {
37398 }
37399 this.ai[1] += 1f;
37401 if ((int)this.ai[1] % 4 == 0 && this.ai[1] >= 28f)
37402 {
37404 Main.instance.CameraModifiers.Add(
modifier5);
37405 if (Main.netMode != 2)
37406 {
37407 Player player = Main.player[Main.myPlayer];
37411 if (!player.dead && player.active && player.FindBuffIndex(
num17) == -1 && (player.Center -
base.Center).Length() < 800f && !player.creativeGodMode)
37412 {
37414 }
37415 }
37416 }
37417 if (this.ai[1] == 30f)
37418 {
37420 }
37421 if (this.ai[1] >= 60f)
37422 {
37423 this.ai[0] = 0f;
37424 this.ai[1] = 0f;
37426 }
37427 break;
37428 case 7:
37429 if (this.ai[1] == 30f)
37430 {
37432 }
37433 this.ai[1] += 1f;
37435 if ((int)this.ai[1] % 4 == 0 && this.ai[1] >= 28f)
37436 {
37438 Main.instance.CameraModifiers.Add(
modifier3);
37439 }
37440 if (this.ai[1] == 40f)
37441 {
37443 if (Main.netMode != 1)
37444 {
37447 }
37448 }
37449 if (this.ai[1] >= 60f)
37450 {
37451 this.ai[0] = 0f;
37452 this.ai[1] = 0f;
37454 }
37455 break;
37456 case 8:
37457 if (this.ai[1] == 30f)
37458 {
37460 }
37461 this.ai[1] += 1f;
37463 if ((int)this.ai[1] % 4 == 0 && this.ai[1] >= 28f)
37464 {
37466 Main.instance.CameraModifiers.Add(
modifier2);
37467 }
37468 if (this.ai[1] >= 40f)
37469 {
37473 if (Main.netMode != 1)
37474 {
37475 NetMessage.SendData(28, -1, -1,
null,
whoAmI, -1f);
37476 }
37477 return;
37478 }
37479 break;
37480 case 5:
37481 if (this.ai[1] == 30f)
37482 {
37484 }
37485 this.ai[1] += 1f;
37487 if ((int)this.ai[1] % 4 == 0 && this.ai[1] >= 28f)
37488 {
37490 Main.instance.CameraModifiers.Add(
modifier);
37491 }
37492 if (this.ai[1] == 30f)
37493 {
37495 if (Main.netMode != 1)
37496 {
37497 for (
int i = 0;
i < 6;
i++)
37498 {
37501 }
37502 }
37503 }
37504 if (this.ai[1] >= 60f)
37505 {
37506 this.ai[0] = 0f;
37507 this.ai[1] = 0f;
37509 }
37510 break;
37511 }
37513 }
static float Clamp(float value, float min, float max)
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
float Distance(Vector2 Other)
static readonly LegacySoundStyle DeerclopsRubbleAttack
static readonly LegacySoundStyle DeerclopsScream
void TargetClosest(bool faceTarget=true)
void AI_123_Deerclops_Movement(bool haltMovement, bool goHome)
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
void SpawnPassiveShadowHands(float lifePercent, int shadowHandDamage)
void HitEffect(int hitDirection=0, double dmg=10.0)
bool ShouldRunAway(ref NPCAimedTarget targetData, bool isChasing)
IEntitySource GetSpawnSource_ForProjectile()
void AI_123_Deerclops_MakeSpikesForward(int AISLOT_PhaseCounter, NPCAimedTarget targetData)
void AI_123_Deerclops_ShootRubbleUp(ref NPCAimedTarget targetData, ref Point sourceTileCoords, int howMany, int distancedByThisManyTiles, float upBiasPerSpike, int whichOne)
void AI_123_Deerclops_MakeSpikesBothSides(int AISLOT_PhaseCounter, NPCAimedTarget targetData)