Skip to content

Instantly share code, notes, and snippets.

@hakusaro
Created June 30, 2015 17:42
Show Gist options
  • Save hakusaro/d7c68a81889649821818 to your computer and use it in GitHub Desktop.
Save hakusaro/d7c68a81889649821818 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using Terraria.GameContent;
using Terraria.GameContent.Achievements;
using Terraria.Graphics.Shaders;
using Terraria.ID;
namespace Terraria
{
public class Projectile : Entity
{
public bool arrow;
public int numHits;
public bool bobber;
public bool netImportant;
public bool noDropItem;
public static int maxAI = 2;
public bool counterweight;
public float scale = 1f;
public float rotation;
public int type;
public int alpha;
public short glowMask;
public int owner = 255;
public float[] ai = new float[Projectile.maxAI];
public float[] localAI = new float[Projectile.maxAI];
public float gfxOffY;
public float stepSpeed = 1f;
public int aiStyle;
public int timeLeft;
public int soundDelay;
public int damage;
public int spriteDirection = 1;
public bool hostile;
public float knockBack;
public bool friendly;
public int penetrate = 1;
private int[] npcImmune = new int[200];
private bool updatedNPCImmunity;
public int maxPenetrate = 1;
public int identity;
public float light;
public bool netUpdate;
public bool netUpdate2;
public int netSpam;
public Vector2[] oldPos = new Vector2[10];
public float[] oldRot = new float[10];
public int[] oldSpriteDirection = new int[10];
public bool minion;
public float minionSlots;
public int minionPos;
public int restrikeDelay;
public bool tileCollide;
public int extraUpdates;
public int numUpdates;
public bool ignoreWater;
public bool hide;
public bool ownerHitCheck;
public int[] playerImmune = new int[255];
public string miscText = "";
public bool melee;
public bool ranged;
public bool thrown;
public bool magic;
public bool coldDamage;
public bool noEnchantments;
public bool trap;
public bool npcProj;
public int frameCounter;
public int frame;
public bool manualDirectionChange;
public float Opacity
{
get
{
return 1f - (float)this.alpha / 255f;
}
set
{
this.alpha = (int)MathHelper.Clamp((1f - value) * 255f, 0f, 255f);
}
}
public int MaxUpdates
{
get
{
return this.extraUpdates + 1;
}
set
{
this.extraUpdates = value - 1;
}
}
public void SetDefaults(int Type)
{
this.counterweight = false;
this.arrow = false;
this.bobber = false;
this.numHits = 0;
this.netImportant = false;
this.manualDirectionChange = false;
int num = 10;
if (Type >= 0)
{
num = ProjectileID.Sets.TrailCacheLength[Type];
}
if (num != this.oldPos.Length)
{
Array.Resize<Vector2>(ref this.oldPos, num);
Array.Resize<float>(ref this.oldRot, num);
Array.Resize<int>(ref this.oldSpriteDirection, num);
}
for (int i = 0; i < this.oldPos.Length; i++)
{
this.oldPos[i].X = 0f;
this.oldPos[i].Y = 0f;
this.oldRot[i] = 0f;
this.oldSpriteDirection[i] = 0;
}
for (int j = 0; j < Projectile.maxAI; j++)
{
this.ai[j] = 0f;
this.localAI[j] = 0f;
}
for (int k = 0; k < 255; k++)
{
this.playerImmune[k] = 0;
}
for (int l = 0; l < 200; l++)
{
this.npcImmune[l] = 0;
}
this.noDropItem = false;
this.minion = false;
this.minionSlots = 0f;
this.soundDelay = 0;
this.spriteDirection = 1;
this.melee = false;
this.ranged = false;
this.thrown = false;
this.magic = false;
this.ownerHitCheck = false;
this.hide = false;
this.lavaWet = false;
this.wetCount = 0;
this.wet = false;
this.ignoreWater = false;
this.hostile = false;
this.netUpdate = false;
this.netUpdate2 = false;
this.netSpam = 0;
this.numUpdates = 0;
this.extraUpdates = 0;
this.identity = 0;
this.restrikeDelay = 0;
this.light = 0f;
this.penetrate = 1;
this.tileCollide = true;
this.position = Vector2.Zero;
this.velocity = Vector2.Zero;
this.aiStyle = 0;
this.alpha = 0;
this.glowMask = -1;
this.type = Type;
this.active = true;
this.rotation = 0f;
this.scale = 1f;
this.owner = 255;
this.timeLeft = 3600;
this.name = "";
this.friendly = false;
this.damage = 0;
this.knockBack = 0f;
this.miscText = "";
this.coldDamage = false;
this.noEnchantments = false;
this.trap = false;
this.npcProj = false;
this.frame = 0;
this.frameCounter = 0;
if (this.type == 1)
{
this.arrow = true;
this.name = "Wooden Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 2)
{
this.arrow = true;
this.name = "Fire Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 1f;
this.ranged = true;
}
else if (this.type == 3)
{
this.name = "Shuriken";
this.width = 22;
this.height = 22;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 4;
this.thrown = true;
}
else if (this.type == 4)
{
this.arrow = true;
this.name = "Unholy Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 0.35f;
this.penetrate = 5;
this.ranged = true;
}
else if (this.type == 5)
{
this.arrow = true;
this.name = "Jester's Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 0.4f;
this.penetrate = -1;
this.timeLeft = 120;
this.alpha = 100;
this.ignoreWater = true;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 6)
{
this.name = "Enchanted Boomerang";
this.width = 22;
this.height = 22;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.light = 0.4f;
}
else if (this.type == 7 || this.type == 8)
{
this.name = "Vilethorn";
this.width = 28;
this.height = 28;
this.aiStyle = 4;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.alpha = 255;
this.ignoreWater = true;
this.magic = true;
}
else if (this.type == 9)
{
this.name = "Starfury";
this.width = 24;
this.height = 24;
this.aiStyle = 5;
this.friendly = true;
this.penetrate = 2;
this.alpha = 50;
this.scale = 0.8f;
this.tileCollide = false;
this.melee = true;
}
else if (this.type == 10)
{
this.name = "Purification Powder";
this.width = 64;
this.height = 64;
this.aiStyle = 6;
this.friendly = true;
this.tileCollide = false;
this.penetrate = -1;
this.alpha = 255;
this.ignoreWater = true;
}
else if (this.type == 11)
{
this.name = "Vile Powder";
this.width = 48;
this.height = 48;
this.aiStyle = 6;
this.friendly = true;
this.tileCollide = false;
this.penetrate = -1;
this.alpha = 255;
this.ignoreWater = true;
}
else if (this.type == 12)
{
this.name = "Falling Star";
this.width = 16;
this.height = 16;
this.aiStyle = 5;
this.friendly = true;
this.penetrate = -1;
this.alpha = 50;
this.light = 1f;
}
else if (this.type == 13)
{
this.netImportant = true;
this.name = "Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 14)
{
this.name = "Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 15)
{
this.name = "Ball of Fire";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.friendly = true;
this.light = 0.8f;
this.alpha = 100;
this.magic = true;
}
else if (this.type == 16)
{
this.name = "Magic Missile";
this.width = 10;
this.height = 10;
this.aiStyle = 9;
this.friendly = true;
this.light = 0.8f;
this.alpha = 100;
this.magic = true;
}
else if (this.type == 17)
{
this.name = "Dirt Ball";
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.ignoreWater = true;
}
else if (this.type == 18)
{
this.netImportant = true;
this.name = "Shadow Orb";
this.width = 32;
this.height = 32;
this.aiStyle = 11;
this.friendly = true;
this.light = 0.9f;
this.alpha = 150;
this.tileCollide = false;
this.penetrate = -1;
this.timeLeft *= 5;
this.ignoreWater = true;
this.scale = 0.8f;
}
else if (this.type == 19)
{
this.name = "Flamarang";
this.width = 22;
this.height = 22;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.light = 1f;
this.melee = true;
}
else if (this.type == 20)
{
this.name = "Green Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 3;
this.light = 0.75f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.4f;
this.timeLeft = 600;
this.magic = true;
}
else if (this.type == 21)
{
this.name = "Bone";
this.width = 16;
this.height = 16;
this.aiStyle = 2;
this.scale = 1.2f;
this.friendly = true;
this.thrown = true;
}
else if (this.type == 22)
{
this.name = "Water Stream";
this.width = 18;
this.height = 18;
this.aiStyle = 12;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.ignoreWater = true;
this.magic = true;
}
else if (this.type == 23)
{
this.name = "Harpoon";
this.width = 4;
this.height = 4;
this.aiStyle = 13;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.ranged = true;
}
else if (this.type == 24)
{
this.name = "Spiky Ball";
this.width = 14;
this.height = 14;
this.aiStyle = 14;
this.friendly = true;
this.penetrate = 6;
this.thrown = true;
}
else if (this.type == 25)
{
this.name = "Ball 'O Hurt";
this.width = 22;
this.height = 22;
this.aiStyle = 15;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 0.8f;
}
else if (this.type == 26)
{
this.name = "Blue Moon";
this.width = 22;
this.height = 22;
this.aiStyle = 15;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 0.8f;
}
else if (this.type == 27)
{
this.name = "Water Bolt";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.friendly = true;
this.alpha = 255;
this.timeLeft /= 2;
this.penetrate = 10;
this.magic = true;
}
else if (this.type == 28)
{
this.name = "Bomb";
this.width = 22;
this.height = 22;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
}
else if (this.type == 29)
{
this.name = "Dynamite";
this.width = 10;
this.height = 10;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
}
else if (this.type == 30)
{
this.name = "Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.thrown = true;
}
else if (this.type == 31)
{
this.name = "Sand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 32)
{
this.name = "Ivy Whip";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 33)
{
this.name = "Thorn Chakram";
this.width = 38;
this.height = 38;
this.aiStyle = 3;
this.friendly = true;
this.scale = 0.9f;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 34)
{
this.name = "Flamelash";
this.width = 14;
this.height = 14;
this.aiStyle = 9;
this.friendly = true;
this.light = 0.8f;
this.alpha = 100;
this.penetrate = 1;
this.magic = true;
}
else if (this.type == 35)
{
this.name = "Sunfury";
this.width = 22;
this.height = 22;
this.aiStyle = 15;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 0.8f;
}
else if (this.type == 36)
{
this.name = "Meteor Shot";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 2;
this.light = 0.6f;
this.alpha = 255;
this.scale = 1.4f;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 37)
{
this.name = "Sticky Bomb";
this.width = 22;
this.height = 22;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
}
else if (this.type == 38)
{
this.name = "Harpy Feather";
this.width = 14;
this.height = 14;
this.aiStyle = 0;
this.hostile = true;
this.penetrate = -1;
this.aiStyle = 1;
this.tileCollide = true;
}
else if (this.type == 39)
{
this.name = "Mud Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 40)
{
this.name = "Ash Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 41)
{
this.arrow = true;
this.name = "Hellfire Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
this.light = 0.3f;
}
else if (this.type == 42)
{
this.name = "Sand Ball";
this.knockBack = 8f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.extraUpdates = 1;
}
else if (this.type == 43)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 44)
{
this.name = "Demon Sickle";
this.width = 48;
this.height = 48;
this.alpha = 100;
this.light = 0.2f;
this.aiStyle = 18;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = true;
this.scale = 0.9f;
}
else if (this.type == 45)
{
this.name = "Demon Scythe";
this.width = 48;
this.height = 48;
this.alpha = 100;
this.light = 0.2f;
this.aiStyle = 18;
this.friendly = true;
this.penetrate = 5;
this.tileCollide = true;
this.scale = 0.9f;
this.magic = true;
}
else if (this.type == 46)
{
this.name = "Dark Lance";
this.width = 20;
this.height = 20;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.1f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 47)
{
this.name = "Trident";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.1f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 48)
{
this.name = "Throwing Knife";
this.width = 12;
this.height = 12;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 2;
this.thrown = true;
}
else if (this.type == 49)
{
this.name = "Spear";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.2f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 50)
{
this.netImportant = true;
this.name = "Glowstick";
this.width = 6;
this.height = 6;
this.aiStyle = 14;
this.penetrate = -1;
this.alpha = 75;
this.light = 1f;
this.timeLeft *= 5;
}
else if (this.type == 51)
{
this.name = "Seed";
this.width = 8;
this.height = 8;
this.aiStyle = 1;
this.friendly = true;
}
else if (this.type == 52)
{
this.name = "Wooden Boomerang";
this.width = 22;
this.height = 22;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 53)
{
this.netImportant = true;
this.name = "Sticky Glowstick";
this.width = 6;
this.height = 6;
this.aiStyle = 14;
this.penetrate = -1;
this.alpha = 75;
this.light = 1f;
this.timeLeft *= 5;
this.tileCollide = false;
}
else if (this.type == 54)
{
this.name = "Poisoned Knife";
this.width = 12;
this.height = 12;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 2;
this.thrown = true;
}
else if (this.type == 55)
{
this.name = "Stinger";
this.width = 10;
this.height = 10;
this.aiStyle = 0;
this.hostile = true;
this.penetrate = -1;
this.aiStyle = 1;
this.tileCollide = true;
}
else if (this.type == 56)
{
this.name = "Ebonsand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 57)
{
this.name = "Cobalt Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 58)
{
this.name = "Mythril Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.08f;
}
else if (this.type == 59)
{
this.name = "Cobalt Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 0.9f;
}
else if (this.type == 60)
{
this.name = "Mythril Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 0.9f;
}
else if (this.type == 61)
{
this.name = "Adamantite Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.16f;
}
else if (this.type == 62)
{
this.name = "Adamantite Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 0.9f;
}
else if (this.type == 63)
{
this.name = "The Dao of Pow";
this.width = 22;
this.height = 22;
this.aiStyle = 15;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 64)
{
this.name = "Mythril Halberd";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.25f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 65)
{
this.name = "Ebonsand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.penetrate = -1;
this.extraUpdates = 1;
}
else if (this.type == 66)
{
this.name = "Adamantite Glaive";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.27f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 67)
{
this.name = "Pearl Sand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 68)
{
this.name = "Pearl Sand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.penetrate = -1;
this.extraUpdates = 1;
}
else if (this.type == 69)
{
this.name = "Holy Water";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
}
else if (this.type == 70)
{
this.name = "Unholy Water";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
}
else if (this.type == 621)
{
this.name = "Blood Water";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
}
else if (this.type == 71)
{
this.name = "Silt Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 72)
{
this.netImportant = true;
this.name = "Blue Fairy";
this.width = 18;
this.height = 18;
this.aiStyle = 11;
this.friendly = true;
this.light = 0.9f;
this.tileCollide = false;
this.penetrate = -1;
this.timeLeft *= 5;
this.ignoreWater = true;
this.scale = 0.8f;
}
else if (this.type == 73 || this.type == 74)
{
this.netImportant = true;
this.name = "Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
this.light = 0.4f;
}
else if (this.type == 75)
{
this.name = "Happy Bomb";
this.width = 22;
this.height = 22;
this.aiStyle = 16;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 76 || this.type == 77 || this.type == 78)
{
if (this.type == 76)
{
this.width = 10;
this.height = 22;
}
else if (this.type == 77)
{
this.width = 18;
this.height = 24;
}
else
{
this.width = 22;
this.height = 24;
}
this.name = "Note";
this.aiStyle = 21;
this.friendly = true;
this.ranged = true;
this.alpha = 100;
this.light = 0.3f;
this.penetrate = -1;
this.timeLeft = 180;
this.magic = true;
}
else if (this.type == 79)
{
this.name = "Rainbow";
this.width = 10;
this.height = 10;
this.aiStyle = 9;
this.friendly = true;
this.light = 0.8f;
this.alpha = 255;
this.magic = true;
}
else if (this.type == 80)
{
this.name = "Ice Block";
this.width = 16;
this.height = 16;
this.aiStyle = 22;
this.friendly = true;
this.magic = true;
this.tileCollide = false;
this.light = 0.5f;
this.coldDamage = true;
}
else if (this.type == 81)
{
this.name = "Wooden Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.hostile = true;
this.ranged = true;
}
else if (this.type == 82)
{
this.name = "Flaming Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.hostile = true;
this.ranged = true;
}
else if (this.type == 83)
{
this.name = "Eye Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = 3;
this.light = 0.75f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.7f;
this.timeLeft = 600;
this.magic = true;
}
else if (this.type == 84)
{
this.name = "Pink Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = 3;
this.light = 0.75f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.2f;
this.timeLeft = 600;
this.magic = true;
}
else if (this.type == 85)
{
this.name = "Flames";
this.width = 6;
this.height = 6;
this.aiStyle = 23;
this.friendly = true;
this.alpha = 255;
this.penetrate = 3;
this.extraUpdates = 2;
this.ranged = true;
}
else if (this.type == 86)
{
this.netImportant = true;
this.name = "Pink Fairy";
this.width = 18;
this.height = 18;
this.aiStyle = 11;
this.friendly = true;
this.light = 0.9f;
this.tileCollide = false;
this.penetrate = -1;
this.timeLeft *= 5;
this.ignoreWater = true;
this.scale = 0.8f;
}
else if (this.type == 87)
{
this.netImportant = true;
this.name = "Pink Fairy";
this.width = 18;
this.height = 18;
this.aiStyle = 11;
this.friendly = true;
this.light = 0.9f;
this.tileCollide = false;
this.penetrate = -1;
this.timeLeft *= 5;
this.ignoreWater = true;
this.scale = 0.8f;
}
else if (this.type == 88)
{
this.name = "Purple Laser";
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 3;
this.light = 0.75f;
this.alpha = 255;
this.extraUpdates = 4;
this.scale = 1.4f;
this.timeLeft = 600;
this.magic = true;
}
else if (this.type == 89)
{
this.name = "Crystal Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 90)
{
this.name = "Crystal Shard";
this.width = 6;
this.height = 6;
this.aiStyle = 24;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 50;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
this.tileCollide = false;
}
else if (this.type == 91)
{
this.arrow = true;
this.name = "Holy Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 92)
{
this.name = "Hallow Star";
this.width = 24;
this.height = 24;
this.aiStyle = 5;
this.friendly = true;
this.penetrate = 2;
this.alpha = 50;
this.scale = 0.8f;
this.tileCollide = false;
this.magic = true;
}
else if (this.type == 93)
{
this.light = 0.15f;
this.name = "Magic Dagger";
this.width = 12;
this.height = 12;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 2;
this.magic = true;
}
else if (this.type == 94)
{
this.ignoreWater = true;
this.name = "Crystal Storm";
this.width = 8;
this.height = 8;
this.aiStyle = 24;
this.friendly = true;
this.light = 0.5f;
this.alpha = 50;
this.scale = 1.2f;
this.timeLeft = 600;
this.magic = true;
this.tileCollide = true;
this.penetrate = 1;
}
else if (this.type == 95)
{
this.name = "Cursed Flame";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.friendly = true;
this.light = 0.8f;
this.alpha = 100;
this.magic = true;
this.penetrate = 2;
}
else if (this.type == 96)
{
this.name = "Cursed Flame";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.hostile = true;
this.light = 0.8f;
this.alpha = 100;
this.magic = true;
this.penetrate = -1;
this.scale = 0.9f;
this.scale = 1.3f;
}
else if (this.type == 97)
{
this.name = "Cobalt Naginata";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.1f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 98)
{
this.name = "Poison Dart";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
this.trap = true;
}
else if (this.type == 99)
{
this.name = "Boulder";
this.width = 31;
this.height = 31;
this.aiStyle = 25;
this.friendly = true;
this.hostile = true;
this.ranged = true;
this.penetrate = -1;
this.trap = true;
}
else if (this.type == 100)
{
this.name = "Death Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = 3;
this.light = 0.75f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.8f;
this.timeLeft = 2700;
this.magic = true;
}
else if (this.type == 101)
{
this.name = "Eye Fire";
this.width = 6;
this.height = 6;
this.aiStyle = 23;
this.hostile = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 3;
this.magic = true;
}
else if (this.type == 102)
{
this.name = "Bomb";
this.width = 22;
this.height = 22;
this.aiStyle = 16;
this.hostile = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 103)
{
this.arrow = true;
this.name = "Cursed Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 1f;
this.ranged = true;
}
else if (this.type == 104)
{
this.name = "Cursed Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 105)
{
this.name = "Gungnir";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.3f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 106)
{
this.name = "Light Disc";
this.width = 32;
this.height = 32;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.light = 0.4f;
}
else if (this.type == 107)
{
this.name = "Hamdrax";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.1f;
}
else if (this.type == 108)
{
this.name = "Explosives";
this.width = 260;
this.height = 260;
this.aiStyle = 16;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
this.alpha = 255;
this.timeLeft = 2;
this.trap = true;
}
else if (this.type == 109)
{
this.name = "Snow Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.hostile = true;
this.scale = 0.9f;
this.penetrate = -1;
this.coldDamage = true;
this.thrown = true;
}
else if (this.type == 110)
{
this.name = "Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.light = 0.5f;
this.alpha = 255;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 111)
{
this.netImportant = true;
this.name = "Bunny";
this.width = 18;
this.height = 18;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 112)
{
this.netImportant = true;
this.name = "Penguin";
this.width = 18;
this.height = 18;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 113)
{
this.name = "Ice Boomerang";
this.width = 22;
this.height = 22;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.light = 0.4f;
this.coldDamage = true;
}
else if (this.type == 114)
{
this.name = "Unholy Trident";
this.width = 16;
this.height = 16;
this.aiStyle = 27;
this.magic = true;
this.penetrate = 3;
this.light = 0.5f;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 115)
{
this.name = "Unholy Trident";
this.width = 16;
this.height = 16;
this.aiStyle = 27;
this.hostile = true;
this.magic = true;
this.penetrate = -1;
this.light = 0.5f;
this.alpha = 255;
}
else if (this.type == 116)
{
this.name = "Sword Beam";
this.width = 16;
this.height = 16;
this.aiStyle = 27;
this.melee = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 117)
{
this.arrow = true;
this.name = "Bone Arrow";
this.extraUpdates = 2;
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 118)
{
this.name = "Ice Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 28;
this.alpha = 255;
this.melee = true;
this.penetrate = 1;
this.friendly = true;
this.coldDamage = true;
}
else if (this.type == 119)
{
this.name = "Frost Bolt";
this.width = 14;
this.height = 14;
this.aiStyle = 28;
this.alpha = 255;
this.melee = true;
this.penetrate = 2;
this.friendly = true;
}
else if (this.type == 120)
{
this.arrow = true;
this.name = "Frost Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.coldDamage = true;
this.extraUpdates = 1;
}
else if (this.type == 121)
{
this.name = "Amethyst Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 122)
{
this.name = "Topaz Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 123)
{
this.name = "Sapphire Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 124)
{
this.name = "Emerald Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 2;
this.friendly = true;
}
else if (this.type == 125)
{
this.name = "Ruby Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 2;
this.friendly = true;
}
else if (this.type == 126)
{
this.name = "Diamond Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 2;
this.friendly = true;
}
else if (this.type == 127)
{
this.netImportant = true;
this.name = "Turtle";
this.width = 22;
this.height = 22;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 128)
{
this.name = "Frost Blast";
this.width = 14;
this.height = 14;
this.aiStyle = 28;
this.alpha = 255;
this.penetrate = -1;
this.friendly = false;
this.hostile = true;
this.coldDamage = true;
}
else if (this.type == 129)
{
this.name = "Rune Blast";
this.width = 14;
this.height = 14;
this.aiStyle = 28;
this.alpha = 255;
this.penetrate = -1;
this.friendly = false;
this.hostile = true;
this.tileCollide = false;
}
else if (this.type == 130)
{
this.name = "Mushroom Spear";
this.width = 22;
this.height = 22;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.2f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 131)
{
this.name = "Mushroom";
this.width = 22;
this.height = 22;
this.aiStyle = 30;
this.friendly = true;
this.penetrate = 1;
this.tileCollide = false;
this.melee = true;
this.light = 0.5f;
}
else if (this.type == 132)
{
this.name = "Terra Beam";
this.width = 16;
this.height = 16;
this.aiStyle = 27;
this.melee = true;
this.penetrate = 3;
this.light = 0.5f;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 133)
{
this.name = "Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 134)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 135)
{
this.name = "Proximity Mine";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 136)
{
this.name = "Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 137)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 138)
{
this.name = "Proximity Mine";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 139)
{
this.name = "Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 140)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 141)
{
this.name = "Proximity Mine";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 142)
{
this.name = "Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 143)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 144)
{
this.name = "Proximity Mine";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 145)
{
this.name = "Pure Spray";
this.width = 6;
this.height = 6;
this.aiStyle = 31;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 146)
{
this.name = "Hallow Spray";
this.width = 6;
this.height = 6;
this.aiStyle = 31;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 147)
{
this.name = "Corrupt Spray";
this.width = 6;
this.height = 6;
this.aiStyle = 31;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 148)
{
this.name = "Mushroom Spray";
this.width = 6;
this.height = 6;
this.aiStyle = 31;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 149)
{
this.name = "Crimson Spray";
this.width = 6;
this.height = 6;
this.aiStyle = 31;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 150 || this.type == 151 || this.type == 152)
{
this.name = "Nettle Burst";
this.width = 28;
this.height = 28;
this.aiStyle = 4;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.alpha = 255;
this.ignoreWater = true;
this.magic = true;
}
else if (this.type == 153)
{
this.name = "The Rotted Fork";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.1f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 154)
{
this.name = "The Meatball";
this.width = 22;
this.height = 22;
this.aiStyle = 15;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 0.8f;
}
else if (this.type == 155)
{
this.netImportant = true;
this.name = "Beach Ball";
this.width = 44;
this.height = 44;
this.aiStyle = 32;
this.friendly = true;
}
else if (this.type == 156)
{
this.name = "Light Beam";
this.width = 16;
this.height = 16;
this.aiStyle = 27;
this.melee = true;
this.light = 0.5f;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 157)
{
this.name = "Night Beam";
this.width = 32;
this.height = 32;
this.aiStyle = 27;
this.melee = true;
this.light = 0.5f;
this.alpha = 255;
this.friendly = true;
this.scale = 1.2f;
}
else if (this.type == 158)
{
this.name = "Copper Coin";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 159)
{
this.name = "Silver Coin";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 160)
{
this.name = "Gold Coin";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 161)
{
this.name = "Platinum Coin";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 162)
{
this.name = "Cannonball";
this.width = 16;
this.height = 16;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 4;
this.alpha = 255;
}
else if (this.type == 163)
{
this.netImportant = true;
this.name = "Flare";
this.width = 6;
this.height = 6;
this.aiStyle = 33;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 36000;
}
else if (this.type == 164)
{
this.name = "Landmine";
this.width = 128;
this.height = 128;
this.aiStyle = 16;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
this.alpha = 255;
this.timeLeft = 2;
}
else if (this.type == 165)
{
this.netImportant = true;
this.name = "Web";
this.width = 12;
this.height = 12;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 166)
{
this.name = "Snow Ball";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.ranged = true;
this.coldDamage = true;
}
else if (this.type == 167 || this.type == 168 || this.type == 169 || this.type == 170)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 34;
this.friendly = true;
this.ranged = true;
this.timeLeft = 45;
}
else if (this.type == 171 || this.type == 505 || this.type == 506)
{
this.name = "Rope Coil";
this.width = 14;
this.height = 14;
this.aiStyle = 35;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft = 400;
}
else if (this.type == 172)
{
this.arrow = true;
this.name = "Frostburn Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 1f;
this.ranged = true;
this.coldDamage = true;
}
else if (this.type == 173)
{
this.name = "Enchanted Beam";
this.width = 16;
this.height = 16;
this.aiStyle = 27;
this.melee = true;
this.penetrate = 1;
this.light = 0.2f;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 174)
{
this.name = "Ice Spike";
this.alpha = 255;
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.coldDamage = true;
}
else if (this.type == 175)
{
this.name = "Baby Eater";
this.width = 34;
this.height = 34;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 176)
{
this.name = "Jungle Spike";
this.alpha = 255;
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 177)
{
this.name = "Icewater Spit";
this.width = 10;
this.height = 10;
this.aiStyle = 28;
this.alpha = 255;
this.penetrate = -1;
this.friendly = false;
this.hostile = true;
this.coldDamage = true;
}
else if (this.type == 178)
{
this.name = "Confetti";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.penetrate = -1;
this.timeLeft = 2;
}
else if (this.type == 179)
{
this.name = "Slush Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 180)
{
this.name = "Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.light = 0.5f;
this.alpha = 255;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 181)
{
this.name = "Bee";
this.width = 8;
this.height = 8;
this.aiStyle = 36;
this.friendly = true;
this.penetrate = 3;
this.alpha = 255;
this.timeLeft = 600;
this.extraUpdates = 3;
}
else if (this.type == 182)
{
this.light = 0.15f;
this.name = "Possessed Hatchet";
this.width = 30;
this.height = 30;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = 10;
this.melee = true;
this.extraUpdates = 1;
}
else if (this.type == 183)
{
this.name = "Beenade";
this.width = 14;
this.height = 22;
this.aiStyle = 14;
this.penetrate = 1;
this.ranged = true;
this.timeLeft = 180;
this.thrown = true;
this.friendly = true;
}
else if (this.type == 184)
{
this.name = "Poison Dart";
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
this.trap = true;
}
else if (this.type == 185)
{
this.name = "Spiky Ball";
this.width = 14;
this.height = 14;
this.aiStyle = 14;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 900;
this.trap = true;
}
else if (this.type == 186)
{
this.name = "Spear";
this.width = 10;
this.height = 14;
this.aiStyle = 37;
this.friendly = true;
this.tileCollide = false;
this.ignoreWater = true;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 300;
this.trap = true;
}
else if (this.type == 187)
{
this.name = "Flamethrower";
this.width = 6;
this.height = 6;
this.aiStyle = 38;
this.alpha = 255;
this.tileCollide = false;
this.ignoreWater = true;
this.timeLeft = 60;
this.trap = true;
}
else if (this.type == 188)
{
this.name = "Flames";
this.width = 6;
this.height = 6;
this.aiStyle = 23;
this.friendly = true;
this.hostile = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.trap = true;
}
else if (this.type == 189)
{
this.name = "Wasp";
this.width = 8;
this.height = 8;
this.aiStyle = 36;
this.friendly = true;
this.penetrate = 4;
this.alpha = 255;
this.timeLeft = 600;
this.magic = true;
this.extraUpdates = 3;
}
else if (this.type == 190)
{
this.name = "Mechanical Piranha";
this.width = 22;
this.height = 22;
this.aiStyle = 39;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.ranged = true;
}
else if (this.type >= 191 && this.type <= 194)
{
this.netImportant = true;
this.name = "Pygmy";
this.width = 18;
this.height = 18;
this.aiStyle = 26;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
if (this.type == 192)
{
this.scale = 1.025f;
}
if (this.type == 193)
{
this.scale = 1.05f;
}
if (this.type == 194)
{
this.scale = 1.075f;
}
}
else if (this.type == 195)
{
this.tileCollide = false;
this.name = "Pygmy";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
}
else if (this.type == 196)
{
this.name = "Smoke Bomb";
this.width = 16;
this.height = 16;
this.aiStyle = 14;
this.penetrate = -1;
this.scale = 0.8f;
}
else if (this.type == 197)
{
this.netImportant = true;
this.name = "Baby Skeletron Head";
this.width = 42;
this.height = 42;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 198)
{
this.netImportant = true;
this.name = "Baby Hornet";
this.width = 26;
this.height = 26;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 199)
{
this.netImportant = true;
this.name = "Tiki Spirit";
this.width = 28;
this.height = 28;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 200)
{
this.netImportant = true;
this.name = "Pet Lizard";
this.width = 28;
this.height = 28;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 201)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 202)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 203)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 204)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 205)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 206)
{
this.name = "Leaf";
this.width = 14;
this.height = 14;
this.aiStyle = 40;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
this.magic = true;
}
else if (this.type == 207)
{
this.name = "Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 208)
{
this.netImportant = true;
this.name = "Parrot";
this.width = 18;
this.height = 36;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 209)
{
this.name = "Truffle";
this.width = 12;
this.height = 32;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
this.light = 0.5f;
}
else if (this.type == 210)
{
this.netImportant = true;
this.name = "Sapling";
this.width = 14;
this.height = 30;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 211)
{
this.netImportant = true;
this.name = "Wisp";
this.width = 24;
this.height = 24;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
this.light = 1f;
this.ignoreWater = true;
}
else if (this.type == 212)
{
this.name = "Palladium Pike";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.12f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 213)
{
this.name = "Palladium Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 0.92f;
}
else if (this.type == 214)
{
this.name = "Palladium Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 215)
{
this.name = "Orichalcum Halberd";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.27f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 216)
{
this.name = "Orichalcum Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 0.93f;
}
else if (this.type == 217)
{
this.name = "Orichalcum Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.12f;
}
else if (this.type == 218)
{
this.name = "Titanium Trident";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.28f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 219)
{
this.name = "Titanium Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 0.95f;
}
else if (this.type == 220)
{
this.name = "Titanium Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.2f;
}
else if (this.type == 221)
{
this.name = "Flower Petal";
this.width = 20;
this.height = 20;
this.aiStyle = 41;
this.friendly = true;
this.tileCollide = false;
this.ignoreWater = true;
this.timeLeft = 120;
this.penetrate = -1;
this.scale = 1f + (float)Main.rand.Next(30) * 0.01f;
this.extraUpdates = 2;
}
else if (this.type == 222)
{
this.name = "Chlorophyte Partisan";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.3f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 223)
{
this.name = "Chlorophyte Drill";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1f;
}
else if (this.type == 224)
{
this.name = "Chlorophyte Chainsaw";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.1f;
}
else if (this.type == 225)
{
this.arrow = true;
this.penetrate = 2;
this.name = "Chlorophyte Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 226)
{
this.netImportant = true;
this.name = "Crystal Leaf";
this.width = 22;
this.height = 42;
this.aiStyle = 42;
this.friendly = true;
this.tileCollide = false;
this.penetrate = -1;
this.timeLeft *= 5;
this.light = 0.4f;
this.ignoreWater = true;
}
else if (this.type == 227)
{
this.netImportant = true;
this.tileCollide = false;
this.light = 0.1f;
this.name = "Crystal Leaf";
this.width = 14;
this.height = 14;
this.aiStyle = 43;
this.friendly = true;
this.penetrate = 1;
this.timeLeft = 180;
}
else if (this.type == 228)
{
this.tileCollide = false;
this.name = "Spore Cloud";
this.width = 30;
this.height = 30;
this.aiStyle = 44;
this.friendly = true;
this.scale = 1.1f;
this.penetrate = -1;
}
else if (this.type == 229)
{
this.name = "Chlorophyte Orb";
this.width = 30;
this.height = 30;
this.aiStyle = 44;
this.friendly = true;
this.penetrate = -1;
this.light = 0.2f;
}
else if (this.type >= 230 && this.type <= 235)
{
this.netImportant = true;
this.name = "Gem Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 236)
{
this.netImportant = true;
this.name = "Baby Dino";
this.width = 34;
this.height = 34;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 237)
{
this.netImportant = true;
this.name = "Rain Cloud";
this.width = 28;
this.height = 28;
this.aiStyle = 45;
this.penetrate = -1;
}
else if (this.type == 238)
{
this.tileCollide = false;
this.ignoreWater = true;
this.name = "Rain Cloud";
this.width = 54;
this.height = 28;
this.aiStyle = 45;
this.penetrate = -1;
}
else if (this.type == 239)
{
this.ignoreWater = true;
this.name = "Rain";
this.width = 4;
this.height = 40;
this.aiStyle = 45;
this.friendly = true;
this.penetrate = -1;
this.timeLeft = 300;
this.scale = 1.1f;
this.magic = true;
this.extraUpdates = 1;
}
else if (this.type == 240)
{
this.name = "Cannonball";
this.width = 16;
this.height = 16;
this.aiStyle = 2;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
}
else if (this.type == 241)
{
this.name = "Crimsand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 242)
{
this.name = "Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 7;
this.scale = 1.18f;
this.timeLeft = 600;
this.ranged = true;
this.ignoreWater = true;
}
else if (this.type == 243)
{
this.name = "Blood Cloud";
this.width = 28;
this.height = 28;
this.aiStyle = 45;
this.penetrate = -1;
}
else if (this.type == 244)
{
this.tileCollide = false;
this.ignoreWater = true;
this.name = "Blood Cloud";
this.width = 54;
this.height = 28;
this.aiStyle = 45;
this.penetrate = -1;
}
else if (this.type == 245)
{
this.ignoreWater = true;
this.name = "Blood Rain";
this.width = 4;
this.height = 40;
this.aiStyle = 45;
this.friendly = true;
this.penetrate = 2;
this.timeLeft = 300;
this.scale = 1.1f;
this.magic = true;
this.extraUpdates = 1;
}
else if (this.type == 246)
{
this.name = "Stynger";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.alpha = 255;
this.extraUpdates = 1;
}
else if (this.type == 247)
{
this.name = "Flower Pow";
this.width = 34;
this.height = 34;
this.aiStyle = 15;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 248)
{
this.name = "Flower Pow";
this.width = 18;
this.height = 18;
this.aiStyle = 1;
this.friendly = true;
this.melee = true;
}
else if (this.type == 249)
{
this.name = "Stynger";
this.width = 12;
this.height = 12;
this.aiStyle = 2;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 250)
{
this.name = "Rainbow";
this.width = 12;
this.height = 12;
this.aiStyle = 46;
this.penetrate = -1;
this.magic = true;
this.alpha = 255;
this.ignoreWater = true;
this.scale = 1.25f;
}
else if (this.type == 251)
{
this.name = "Rainbow";
this.width = 14;
this.height = 14;
this.aiStyle = 46;
this.friendly = true;
this.penetrate = -1;
this.magic = true;
this.alpha = 255;
this.light = 0.3f;
this.tileCollide = false;
this.ignoreWater = true;
this.scale = 1.25f;
}
else if (this.type == 252)
{
this.name = "Chlorophyte Jackhammer";
this.width = 18;
this.height = 18;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.1f;
}
else if (this.type == 253)
{
this.name = "Ball of Frost";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.friendly = true;
this.light = 0.8f;
this.alpha = 100;
this.magic = true;
}
else if (this.type == 254)
{
this.name = "Magnet Sphere";
this.width = 38;
this.height = 38;
this.aiStyle = 47;
this.magic = true;
this.timeLeft = 660;
this.light = 0.5f;
}
else if (this.type == 255)
{
this.name = "Magnet Sphere";
this.width = 8;
this.height = 8;
this.aiStyle = 48;
this.friendly = true;
this.magic = true;
this.extraUpdates = 100;
this.timeLeft = 100;
}
else if (this.type == 256)
{
this.netImportant = true;
this.tileCollide = false;
this.name = "Skeletron Hand";
this.width = 6;
this.height = 6;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.scale = 1f;
this.timeLeft *= 10;
}
else if (this.type == 257)
{
this.name = "Frost Beam";
this.ignoreWater = true;
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.light = 0.75f;
this.alpha = 255;
this.scale = 1.2f;
this.timeLeft = 600;
this.magic = true;
this.coldDamage = true;
this.extraUpdates = 1;
}
else if (this.type == 258)
{
this.name = "Fireball";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.hostile = true;
this.penetrate = -1;
this.alpha = 100;
this.timeLeft = 300;
}
else if (this.type == 259)
{
this.name = "Eye Beam";
this.ignoreWater = true;
this.tileCollide = false;
this.width = 8;
this.height = 8;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.light = 0.3f;
this.scale = 1.1f;
this.magic = true;
this.extraUpdates = 1;
}
else if (this.type == 260)
{
this.name = "Heat Ray";
this.width = 8;
this.height = 8;
this.aiStyle = 48;
this.friendly = true;
this.magic = true;
this.extraUpdates = 100;
this.timeLeft = 200;
this.penetrate = -1;
}
else if (this.type == 261)
{
this.name = "Boulder";
this.width = 32;
this.height = 34;
this.aiStyle = 14;
this.friendly = true;
this.penetrate = 6;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 262)
{
this.name = "Golem Fist";
this.width = 30;
this.height = 30;
this.aiStyle = 13;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.melee = true;
this.extraUpdates = 1;
}
else if (this.type == 263)
{
this.name = "Ice Sickle";
this.width = 34;
this.height = 34;
this.alpha = 100;
this.light = 0.5f;
this.aiStyle = 18;
this.friendly = true;
this.penetrate = 5;
this.tileCollide = true;
this.scale = 1f;
this.melee = true;
this.timeLeft = 180;
this.coldDamage = true;
}
else if (this.type == 264)
{
this.ignoreWater = true;
this.name = "Rain";
this.width = 4;
this.height = 40;
this.aiStyle = 45;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 120;
this.scale = 1.1f;
this.extraUpdates = 1;
}
else if (this.type == 265)
{
this.name = "Poison Fang";
this.width = 12;
this.height = 12;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
this.magic = true;
this.penetrate = 4;
}
else if (this.type == 266)
{
this.netImportant = true;
this.alpha = 75;
this.name = "Baby Slime";
this.width = 24;
this.height = 16;
this.aiStyle = 26;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
}
else if (this.type == 267)
{
this.alpha = 255;
this.name = "Poison Dart";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 268)
{
this.netImportant = true;
this.name = "Eye Spring";
this.width = 18;
this.height = 32;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 269)
{
this.netImportant = true;
this.name = "Baby Snowman";
this.width = 20;
this.height = 26;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 270)
{
this.name = "Skull";
this.width = 26;
this.height = 26;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
this.magic = true;
this.penetrate = 3;
}
else if (this.type == 271)
{
this.name = "Boxing Glove";
this.width = 20;
this.height = 20;
this.aiStyle = 13;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.melee = true;
this.scale = 1.2f;
}
else if (this.type == 272)
{
this.name = "Bananarang";
this.width = 32;
this.height = 32;
this.aiStyle = 3;
this.friendly = true;
this.scale = 0.9f;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 273)
{
this.name = "Chain Knife";
this.width = 26;
this.height = 26;
this.aiStyle = 13;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.melee = true;
}
else if (this.type == 274)
{
this.name = "Death Sickle";
this.width = 42;
this.height = 42;
this.alpha = 100;
this.light = 0.5f;
this.aiStyle = 18;
this.friendly = true;
this.penetrate = 5;
this.tileCollide = false;
this.scale = 1.1f;
this.melee = true;
this.timeLeft = 180;
}
else if (this.type == 275)
{
this.alpha = 255;
this.name = "Seed";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.hostile = true;
}
else if (this.type == 276)
{
this.alpha = 255;
this.name = "Poison Seed";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.hostile = true;
}
else if (this.type == 277)
{
this.alpha = 255;
this.name = "Thorn Ball";
this.width = 38;
this.height = 38;
this.aiStyle = 14;
this.hostile = true;
}
else if (this.type == 278)
{
this.arrow = true;
this.name = "Ichor Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 1f;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 279)
{
this.name = "Ichor Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.25f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 280)
{
this.name = "Golden Shower";
this.width = 32;
this.height = 32;
this.aiStyle = 12;
this.friendly = true;
this.alpha = 255;
this.penetrate = 5;
this.extraUpdates = 2;
this.ignoreWater = true;
this.magic = true;
}
else if (this.type == 281)
{
this.name = "Explosive Bunny";
this.width = 28;
this.height = 28;
this.aiStyle = 49;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
}
else if (this.type == 282)
{
this.arrow = true;
this.name = "Venom Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 283)
{
this.name = "Venom Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.25f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 284)
{
this.name = "Party Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.3f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 285)
{
this.name = "Nano Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.3f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 286)
{
this.name = "Explosive Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.3f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 287)
{
this.name = "Golden Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.light = 0.5f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.3f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 288)
{
this.name = "Golden Shower";
this.width = 32;
this.height = 32;
this.aiStyle = 12;
this.hostile = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.ignoreWater = true;
this.magic = true;
}
else if (this.type == 289)
{
this.name = "Confetti";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.penetrate = -1;
this.timeLeft = 2;
}
else if (this.type == 290)
{
this.name = "Shadow Beam";
this.width = 4;
this.height = 4;
this.aiStyle = 48;
this.hostile = true;
this.magic = true;
this.extraUpdates = 100;
this.timeLeft = 100;
this.penetrate = -1;
}
else if (this.type == 291)
{
this.name = "Inferno";
this.width = 12;
this.height = 12;
this.aiStyle = 50;
this.hostile = true;
this.alpha = 255;
this.magic = true;
this.tileCollide = false;
this.penetrate = -1;
}
else if (this.type == 292)
{
this.name = "Inferno";
this.width = 130;
this.height = 130;
this.aiStyle = 50;
this.hostile = true;
this.alpha = 255;
this.magic = true;
this.tileCollide = false;
this.penetrate = -1;
}
else if (this.type == 293)
{
this.name = "Lost Soul";
this.width = 12;
this.height = 12;
this.aiStyle = 51;
this.hostile = true;
this.alpha = 255;
this.magic = true;
this.tileCollide = false;
this.penetrate = -1;
this.extraUpdates = 1;
}
else if (this.type == 294)
{
this.name = "Shadow Beam";
this.width = 4;
this.height = 4;
this.aiStyle = 48;
this.friendly = true;
this.magic = true;
this.extraUpdates = 100;
this.timeLeft = 300;
this.penetrate = -1;
}
else if (this.type == 295)
{
this.name = "Inferno";
this.width = 12;
this.height = 12;
this.aiStyle = 50;
this.friendly = true;
this.alpha = 255;
this.magic = true;
this.tileCollide = true;
}
else if (this.type == 296)
{
this.name = "Inferno";
this.width = 150;
this.height = 150;
this.aiStyle = 50;
this.friendly = true;
this.alpha = 255;
this.magic = true;
this.tileCollide = false;
this.penetrate = -1;
}
else if (this.type == 297)
{
this.name = "Lost Soul";
this.width = 12;
this.height = 12;
this.aiStyle = 51;
this.friendly = true;
this.alpha = 255;
this.magic = true;
this.extraUpdates = 1;
}
else if (this.type == 298)
{
this.name = "Spirit Heal";
this.width = 6;
this.height = 6;
this.aiStyle = 52;
this.alpha = 255;
this.magic = true;
this.tileCollide = false;
this.extraUpdates = 3;
}
else if (this.type == 299)
{
this.name = "Shadowflames";
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.magic = true;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 300)
{
this.name = "Paladin's Hammer";
this.width = 38;
this.height = 38;
this.aiStyle = 2;
this.hostile = true;
this.penetrate = -1;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 301)
{
this.name = "Paladin's Hammer";
this.width = 38;
this.height = 38;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.extraUpdates = 2;
}
else if (this.type == 302)
{
this.name = "Sniper Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.light = 0.3f;
this.alpha = 255;
this.extraUpdates = 7;
this.scale = 1.18f;
this.timeLeft = 300;
this.ranged = true;
this.ignoreWater = true;
}
else if (this.type == 303)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.hostile = true;
this.penetrate = -1;
this.ranged = true;
}
else if (this.type == 304)
{
this.name = "Vampire Knife";
this.alpha = 255;
this.width = 30;
this.height = 30;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
this.melee = true;
this.light = 0.2f;
this.ignoreWater = true;
this.extraUpdates = 0;
}
else if (this.type == 305)
{
this.name = "Vampire Heal";
this.width = 6;
this.height = 6;
this.aiStyle = 52;
this.alpha = 255;
this.tileCollide = false;
this.extraUpdates = 10;
}
else if (this.type == 306)
{
this.name = "Eater's Bite";
this.alpha = 255;
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
this.melee = true;
this.ignoreWater = true;
this.extraUpdates = 1;
}
else if (this.type == 307)
{
this.name = "Tiny Eater";
this.width = 16;
this.height = 16;
this.aiStyle = 36;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 600;
this.melee = true;
this.extraUpdates = 3;
}
else if (this.type == 308)
{
this.name = "Frost Hydra";
this.width = 80;
this.height = 74;
this.aiStyle = 53;
this.timeLeft = 7200;
this.light = 0.25f;
this.ignoreWater = true;
this.coldDamage = true;
}
else if (this.type == 309)
{
this.name = "Frost Blast";
this.width = 14;
this.height = 14;
this.aiStyle = 28;
this.alpha = 255;
this.penetrate = 1;
this.friendly = true;
this.extraUpdates = 3;
this.coldDamage = true;
}
else if (this.type == 310)
{
this.netImportant = true;
this.name = "Blue Flare";
this.width = 6;
this.height = 6;
this.aiStyle = 33;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 36000;
}
else if (this.type == 311)
{
this.name = "Candy Corn";
this.width = 10;
this.height = 12;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 3;
this.alpha = 255;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 312)
{
this.name = "Jack 'O Lantern";
this.alpha = 255;
this.width = 32;
this.height = 32;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.timeLeft = 300;
}
else if (this.type == 313)
{
this.netImportant = true;
this.name = "Spider";
this.width = 30;
this.height = 30;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 314)
{
this.netImportant = true;
this.name = "Squashling";
this.width = 24;
this.height = 40;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 315)
{
this.netImportant = true;
this.name = "Bat Hook";
this.width = 14;
this.height = 14;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 316)
{
this.alpha = 255;
this.name = "Bat";
this.width = 16;
this.height = 16;
this.aiStyle = 36;
this.friendly = true;
this.penetrate = 1;
this.timeLeft = 600;
this.magic = true;
}
else if (this.type == 317)
{
this.netImportant = true;
this.name = "Raven";
this.width = 28;
this.height = 28;
this.aiStyle = 54;
this.penetrate = 1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
}
else if (this.type == 318)
{
this.name = "Rotten Egg";
this.width = 12;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.thrown = true;
}
else if (this.type == 319)
{
this.netImportant = true;
this.name = "Black Cat";
this.width = 36;
this.height = 30;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 320)
{
this.name = "Bloody Machete";
this.width = 34;
this.height = 34;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 321)
{
this.name = "Flaming Jack";
this.width = 30;
this.height = 30;
this.aiStyle = 55;
this.friendly = true;
this.melee = true;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 322)
{
this.netImportant = true;
this.name = "Wood Hook";
this.width = 14;
this.height = 14;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 323)
{
this.penetrate = 10;
this.name = "Stake";
this.extraUpdates = 3;
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
this.ranged = true;
this.scale = 0.8f;
}
else if (this.type == 324)
{
this.netImportant = true;
this.name = "Cursed Sapling";
this.width = 26;
this.height = 38;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 325)
{
this.alpha = 255;
this.penetrate = -1;
this.name = "Flaming Wood";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.hostile = true;
this.tileCollide = false;
}
else if (this.type >= 326 && this.type <= 328)
{
this.name = "Greek Fire";
if (this.type == 326)
{
this.width = 14;
this.height = 16;
}
else if (this.type == 327)
{
this.width = 12;
this.height = 14;
}
else
{
this.width = 6;
this.height = 12;
}
this.aiStyle = 14;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 360;
}
else if (this.type == 329)
{
this.name = "Flaming Scythe";
this.width = 80;
this.height = 80;
this.light = 0.25f;
this.aiStyle = 56;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft = 420;
}
else if (this.type == 330)
{
this.name = "Star Anise";
this.width = 22;
this.height = 22;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 6;
this.thrown = true;
}
else if (this.type == 331)
{
this.netImportant = true;
this.name = "Candy Cane Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 332)
{
this.netImportant = true;
this.name = "Christmas Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
this.light = 0.5f;
}
else if (this.type == 333)
{
this.name = "Fruitcake Chakram";
this.width = 38;
this.height = 38;
this.aiStyle = 3;
this.friendly = true;
this.scale = 0.9f;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 334)
{
this.netImportant = true;
this.name = "Puppy";
this.width = 28;
this.height = 28;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 335)
{
this.name = "Ornament";
this.width = 22;
this.height = 22;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
this.melee = true;
}
else if (this.type == 336)
{
this.name = "Pine Needle";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.magic = true;
this.scale = 0.8f;
this.extraUpdates = 1;
}
else if (this.type == 337)
{
this.name = "Blizzard";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.magic = true;
this.tileCollide = false;
this.coldDamage = true;
this.extraUpdates = 1;
}
else if (this.type == 338 || this.type == 339 || this.type == 340 || this.type == 341)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.penetrate = -1;
this.friendly = true;
this.ranged = true;
this.scale = 0.9f;
}
else if (this.type == 342)
{
this.name = "North Pole";
this.width = 22;
this.height = 2;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.1f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.coldDamage = true;
}
else if (this.type == 343)
{
this.alpha = 255;
this.name = "North Pole";
this.width = 10;
this.height = 10;
this.aiStyle = 57;
this.friendly = true;
this.melee = true;
this.scale = 1.1f;
this.penetrate = 3;
this.coldDamage = true;
}
else if (this.type == 344)
{
this.name = "North Pole";
this.width = 26;
this.height = 26;
this.aiStyle = 1;
this.friendly = true;
this.scale = 0.9f;
this.alpha = 255;
this.melee = true;
this.coldDamage = true;
}
else if (this.type == 345)
{
this.name = "Pine Needle";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.scale = 0.8f;
}
else if (this.type == 346)
{
this.name = "Ornament";
this.width = 18;
this.height = 18;
this.aiStyle = 14;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 300;
}
else if (this.type == 347)
{
this.name = "Ornament";
this.width = 6;
this.height = 6;
this.aiStyle = 2;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 348)
{
this.name = "Frost Wave";
this.aiStyle = 1;
this.width = 48;
this.height = 48;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
this.coldDamage = true;
this.extraUpdates = 1;
}
else if (this.type == 349)
{
this.name = "Frost Shard";
this.aiStyle = 1;
this.width = 12;
this.height = 12;
this.hostile = true;
this.penetrate = -1;
this.coldDamage = true;
}
else if (this.type == 350)
{
this.alpha = 255;
this.penetrate = -1;
this.name = "Missile";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.hostile = true;
this.tileCollide = false;
this.timeLeft /= 2;
}
else if (this.type == 351)
{
this.alpha = 255;
this.penetrate = -1;
this.name = "Present";
this.width = 24;
this.height = 24;
this.aiStyle = 58;
this.hostile = true;
this.tileCollide = false;
}
else if (this.type == 352)
{
this.name = "Spike";
this.width = 30;
this.height = 30;
this.aiStyle = 14;
this.hostile = true;
this.penetrate = -1;
this.timeLeft /= 3;
}
else if (this.type == 353)
{
this.netImportant = true;
this.name = "Baby Grinch";
this.width = 18;
this.height = 28;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 354)
{
this.name = "Crimsand Ball";
this.knockBack = 6f;
this.width = 10;
this.height = 10;
this.aiStyle = 10;
this.friendly = true;
this.penetrate = -1;
this.extraUpdates = 1;
}
else if (this.type == 355)
{
this.name = "Venom Fang";
this.width = 12;
this.height = 12;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
this.magic = true;
this.penetrate = 7;
}
else if (this.type == 356)
{
this.name = "Spectre Wrath";
this.width = 6;
this.height = 6;
this.aiStyle = 59;
this.alpha = 255;
this.magic = true;
this.tileCollide = false;
this.extraUpdates = 3;
}
else if (this.type == 357)
{
this.name = "Pulse Bolt";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 6;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 358)
{
this.name = "Water Gun";
this.width = 18;
this.height = 18;
this.aiStyle = 60;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.ignoreWater = true;
}
else if (this.type == 359)
{
this.name = "Frost Bolt";
this.width = 14;
this.height = 14;
this.aiStyle = 28;
this.alpha = 255;
this.magic = true;
this.penetrate = 2;
this.friendly = true;
this.coldDamage = true;
}
else if ((this.type >= 360 && this.type <= 366) || this.type == 381 || this.type == 382)
{
this.name = "Bobber";
this.width = 14;
this.height = 14;
this.aiStyle = 61;
this.penetrate = -1;
this.bobber = true;
}
else if (this.type == 367)
{
this.name = "Obsidian Swordfish";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.scale = 1.1f;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 368)
{
this.name = "Swordfish";
this.width = 18;
this.height = 18;
this.aiStyle = 19;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 369)
{
this.name = "Sawtooth Shark";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 370)
{
this.name = "Love Potion";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
}
else if (this.type == 371)
{
this.name = "Foul Potion";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
}
else if (this.type == 372)
{
this.name = "Fish Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 373)
{
this.netImportant = true;
this.name = "Hornet";
this.width = 24;
this.height = 26;
this.aiStyle = 62;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 374)
{
this.name = "Hornet Stinger";
this.width = 10;
this.height = 10;
this.aiStyle = 0;
this.friendly = true;
this.penetrate = 1;
this.aiStyle = 1;
this.tileCollide = true;
this.scale *= 0.9f;
}
else if (this.type == 375)
{
this.netImportant = true;
this.name = "Flying Imp";
this.width = 34;
this.height = 26;
this.aiStyle = 62;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 376)
{
this.name = "Imp Fireball";
this.width = 12;
this.height = 12;
this.aiStyle = 0;
this.friendly = true;
this.penetrate = -1;
this.aiStyle = 1;
this.tileCollide = true;
this.timeLeft = 100;
this.alpha = 255;
this.extraUpdates = 1;
}
else if (this.type == 377)
{
this.name = "Spider Turret";
this.width = 66;
this.height = 50;
this.aiStyle = 53;
this.timeLeft = 7200;
this.ignoreWater = true;
}
else if (this.type == 378)
{
this.name = "Spider Egg";
this.width = 16;
this.height = 16;
this.aiStyle = 14;
this.friendly = true;
this.penetrate = -1;
this.timeLeft = 60;
this.scale = 0.9f;
}
else if (this.type == 379)
{
this.name = "Baby Spider";
this.width = 14;
this.height = 10;
this.aiStyle = 63;
this.friendly = true;
this.timeLeft = 300;
this.penetrate = 1;
}
else if (this.type == 380)
{
this.netImportant = true;
this.name = "Zephyr Fish";
this.width = 26;
this.height = 26;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 383)
{
this.name = "Anchor";
this.width = 34;
this.height = 34;
this.aiStyle = 3;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
}
else if (this.type == 384)
{
this.name = "Sharknado";
this.width = 150;
this.height = 42;
this.hostile = true;
this.penetrate = -1;
this.aiStyle = 64;
this.tileCollide = false;
this.ignoreWater = true;
this.alpha = 255;
this.timeLeft = 540;
}
else if (this.type == 385)
{
this.name = "Sharknado Bolt";
this.width = 30;
this.height = 30;
this.hostile = true;
this.penetrate = -1;
this.aiStyle = 65;
this.alpha = 255;
this.timeLeft = 300;
}
else if (this.type == 386)
{
this.name = "Cthulunado";
this.width = 150;
this.height = 42;
this.hostile = true;
this.penetrate = -1;
this.aiStyle = 64;
this.tileCollide = false;
this.ignoreWater = true;
this.alpha = 255;
this.timeLeft = 840;
}
else if (this.type == 387)
{
this.netImportant = true;
this.name = "Retanimini";
this.width = 40;
this.height = 20;
this.aiStyle = 66;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 0.5f;
this.tileCollide = false;
this.ignoreWater = true;
this.friendly = true;
}
else if (this.type == 388)
{
this.netImportant = true;
this.name = "Spazmamini";
this.width = 40;
this.height = 20;
this.aiStyle = 66;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 0.5f;
this.tileCollide = false;
this.ignoreWater = true;
this.friendly = true;
}
else if (this.type == 389)
{
this.name = "Mini Retina Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 3;
this.light = 0.75f;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.2f;
this.timeLeft = 600;
}
else if (this.type == 390 || this.type == 391 || this.type == 392)
{
this.name = "Venom Spider";
this.width = 18;
this.height = 18;
this.aiStyle = 26;
this.penetrate = -1;
this.netImportant = true;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 0.75f;
if (this.type == 391)
{
this.name = "Jumper Spider";
}
if (this.type == 392)
{
this.name = "Dangerous Spider";
}
}
else if (this.type == 393 || this.type == 394 || this.type == 395)
{
this.name = "One Eyed Pirate";
this.width = 20;
this.height = 30;
this.aiStyle = 67;
this.penetrate = -1;
this.netImportant = true;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
if (this.type == 394)
{
this.name = "Soulscourge Pirate";
}
if (this.type == 395)
{
this.name = "Pirate Captain";
}
}
else if (this.type == 396)
{
this.name = "Slime Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
this.alpha = 100;
}
else if (this.type == 397)
{
this.name = "Sticky Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.thrown = true;
this.tileCollide = false;
}
else if (this.type == 398)
{
this.netImportant = true;
this.name = "Mini Minotaur";
this.width = 18;
this.height = 38;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 399)
{
this.name = "Molotov Cocktail";
this.width = 14;
this.height = 14;
this.aiStyle = 68;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.thrown = true;
this.noEnchantments = true;
}
else if (this.type >= 400 && this.type <= 402)
{
this.name = "Molotov Fire";
if (this.type == 400)
{
this.width = 14;
this.height = 16;
}
else if (this.type == 401)
{
this.width = 12;
this.height = 14;
}
else
{
this.width = 6;
this.height = 12;
}
this.penetrate = 3;
this.aiStyle = 14;
this.friendly = true;
this.timeLeft = 360;
this.ranged = true;
this.noEnchantments = true;
}
else if (this.type == 403)
{
this.netImportant = true;
this.name = "Track Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 404)
{
this.name = "Flairon";
this.width = 26;
this.height = 26;
this.aiStyle = 69;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.melee = true;
}
else if (this.type == 405)
{
this.name = "Flairon Bubble";
this.width = 14;
this.height = 14;
this.aiStyle = 70;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 90;
this.melee = true;
this.noEnchantments = true;
}
else if (this.type == 406)
{
this.name = "Slime Gun";
this.width = 14;
this.height = 14;
this.aiStyle = 60;
this.alpha = 255;
this.penetrate = -1;
this.extraUpdates = 2;
this.ignoreWater = true;
}
else if (this.type == 407)
{
this.netImportant = true;
this.name = "Tempest";
this.width = 28;
this.height = 40;
this.aiStyle = 62;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.friendly = true;
this.minionSlots = 1f;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 408)
{
this.name = "Mini Sharkron";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.ignoreWater = true;
}
else if (this.type == 409)
{
this.name = "Typhoon";
this.width = 30;
this.height = 30;
this.penetrate = -1;
this.aiStyle = 71;
this.alpha = 255;
this.timeLeft = 360;
this.friendly = true;
this.tileCollide = true;
this.extraUpdates = 2;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 410)
{
this.name = "Bubble";
this.width = 14;
this.height = 14;
this.aiStyle = 72;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 50;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type >= 411 && this.type <= 414)
{
switch (this.type)
{
case 411:
this.name = "Copper Coins";
break;
case 412:
this.name = "Silver Coins";
break;
case 413:
this.name = "Gold Coins";
break;
case 414:
this.name = "Platinum Coins";
break;
}
this.width = 10;
this.height = 10;
this.aiStyle = 10;
}
else if (this.type == 415 || this.type == 416 || this.type == 417 || this.type == 418)
{
this.name = "Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 34;
this.friendly = true;
this.ranged = true;
this.timeLeft = 45;
}
else if (this.type >= 419 && this.type <= 422)
{
this.name = "Firework Fountain";
this.width = 4;
this.height = 4;
this.aiStyle = 73;
this.friendly = true;
}
else if (this.type == 423)
{
this.netImportant = true;
this.name = "UFO";
this.width = 28;
this.height = 28;
this.aiStyle = 62;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.friendly = true;
this.minionSlots = 1f;
this.ignoreWater = true;
}
else if (this.type >= 424 && this.type <= 426)
{
this.name = "Meteor";
this.width = 24;
this.height = 24;
this.aiStyle = 1;
this.friendly = true;
this.magic = true;
this.tileCollide = false;
this.extraUpdates = 2;
}
else if (this.type == 427)
{
this.name = "Vortex Chainsaw";
this.width = 22;
this.height = 56;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.glowMask = 2;
}
else if (this.type == 428)
{
this.name = "Vortex Drill";
this.width = 26;
this.height = 54;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.glowMask = 3;
}
else if (this.type == 429)
{
this.name = "Nebula Chainsaw";
this.width = 18;
this.height = 56;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.glowMask = 7;
}
else if (this.type == 430)
{
this.name = "Nebula Drill";
this.width = 30;
this.height = 54;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.glowMask = 8;
}
else if (this.type == 431)
{
this.name = "Solar Flare Chainsaw";
this.width = 28;
this.height = 64;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 432)
{
this.name = "Solar Flare Drill";
this.width = 30;
this.height = 54;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
}
else if (this.type == 610)
{
this.name = "Stardust Chainsaw";
this.width = 28;
this.height = 64;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.glowMask = 179;
}
else if (this.type == 609)
{
this.name = "Stardust Drill";
this.width = 30;
this.height = 54;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.glowMask = 180;
}
else if (this.type == 433)
{
this.name = "UFO Ray";
this.width = 8;
this.height = 8;
this.aiStyle = 48;
this.friendly = true;
this.extraUpdates = 100;
this.timeLeft = 100;
this.ignoreWater = true;
}
else if (this.type == 434)
{
this.name = "Scutlix Laser";
this.width = 1;
this.height = 1;
this.aiStyle = 74;
this.friendly = true;
this.extraUpdates = 100;
this.penetrate = -1;
}
else if (this.type == 435)
{
this.name = "Electric Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.hostile = true;
this.ignoreWater = true;
}
else if (this.type == 436)
{
this.name = "Brain Scrambling Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.hostile = true;
this.ignoreWater = true;
}
else if (this.type == 437)
{
this.name = "Gigazapper Spearhead";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.hostile = true;
this.extraUpdates = 2;
this.ignoreWater = true;
}
else if (this.type == 438)
{
this.name = "Laser Ray";
this.width = 8;
this.height = 8;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.extraUpdates = 3;
this.ignoreWater = true;
}
else if (this.type == 439)
{
this.name = "Laser Machinegun";
this.width = 22;
this.height = 22;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 440)
{
this.name = "Laser";
this.width = 5;
this.height = 5;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1f;
this.timeLeft = 600;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 441)
{
this.name = "Scutlix Crosshair";
this.width = 1;
this.height = 1;
this.aiStyle = 76;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 442)
{
this.name = "Electrosphere Missile";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.scale = 1f;
this.timeLeft = 600;
this.ranged = true;
}
else if (this.type == 443)
{
this.name = "Electrosphere";
this.width = 80;
this.height = 80;
this.aiStyle = 77;
this.friendly = true;
this.alpha = 255;
this.scale = 1f;
this.ranged = true;
this.ignoreWater = true;
this.tileCollide = false;
this.penetrate = -1;
}
else if (this.type == 444)
{
this.name = "Xenopopper";
this.width = 10;
this.height = 10;
this.aiStyle = 78;
this.friendly = true;
this.alpha = 255;
this.scale = 1f;
this.ranged = true;
this.ignoreWater = true;
this.extraUpdates = 1;
}
else if (this.type == 445)
{
this.name = "Laser Drill";
this.width = 10;
this.height = 10;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.melee = true;
this.ignoreWater = true;
this.ownerHitCheck = true;
}
else if (this.type == 446)
{
this.netImportant = true;
this.name = "Anti-Gravity Hook";
this.width = 14;
this.height = 14;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
this.light = 0.7f;
}
else if (this.type == 447)
{
this.name = "Martian Deathray";
this.width = 30;
this.height = 30;
this.aiStyle = 79;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
this.ignoreWater = true;
this.timeLeft = 240;
}
else if (this.type == 448)
{
this.name = "Martian Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 80;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
}
else if (this.type == 449)
{
this.name = "Saucer Laser";
this.width = 5;
this.height = 5;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.extraUpdates = 1;
this.scale = 1f;
this.timeLeft = 600;
this.ignoreWater = true;
}
else if (this.type == 450)
{
this.name = "Saucer Scrap";
this.width = 14;
this.height = 14;
this.aiStyle = 14;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 360;
}
else if (this.type == 451)
{
this.name = "Influx Waver";
this.width = 16;
this.height = 16;
this.aiStyle = 81;
this.melee = true;
this.penetrate = 3;
this.light = 0.2f;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 452)
{
this.name = "Phantasmal Eye";
this.width = 14;
this.height = 14;
this.aiStyle = 82;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 600;
}
else if (this.type == 453)
{
this.name = "Drill Crosshair";
this.width = 1;
this.height = 1;
this.aiStyle = 76;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 454)
{
this.name = "Phantasmal Sphere";
this.width = 46;
this.height = 46;
this.aiStyle = 83;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 600;
this.tileCollide = false;
}
else if (this.type == 455)
{
this.name = "Phantasmal Deathray";
this.width = 36;
this.height = 36;
this.aiStyle = 84;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 600;
this.tileCollide = false;
}
else if (this.type == 456)
{
this.name = "Moon Leech";
this.width = 16;
this.height = 16;
this.aiStyle = 85;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 600;
this.tileCollide = false;
}
else if (this.type == 459)
{
this.name = "Charged Blaster Orb";
this.width = 22;
this.height = 22;
this.aiStyle = 1;
this.friendly = true;
this.magic = true;
this.alpha = 255;
this.scale = 1f;
this.ignoreWater = true;
this.extraUpdates = 1;
}
else if (this.type == 460)
{
this.name = "Charged Blaster Cannon";
this.width = 14;
this.height = 18;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 461)
{
this.name = "Charged Blaster Laser";
this.width = 18;
this.height = 18;
this.aiStyle = 84;
this.friendly = true;
this.magic = true;
this.penetrate = -1;
this.alpha = 255;
this.tileCollide = false;
this.hide = true;
}
else if (this.type == 462)
{
this.name = "Phantasmal Bolt";
this.width = 8;
this.height = 8;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.extraUpdates = 3;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 463)
{
this.name = "Vicious Powder";
this.width = 48;
this.height = 48;
this.aiStyle = 6;
this.friendly = true;
this.tileCollide = false;
this.penetrate = -1;
this.alpha = 255;
this.ignoreWater = true;
}
else if (this.type == 464)
{
this.name = "Ice Mist";
this.width = 60;
this.height = 60;
this.aiStyle = 86;
this.hostile = true;
this.tileCollide = false;
this.penetrate = -1;
this.alpha = 255;
this.ignoreWater = true;
}
else if (this.type == 467)
{
this.name = "Fireball";
this.width = 40;
this.height = 40;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.extraUpdates = 1;
}
else if (this.type == 468)
{
this.name = "Shadow Fireball";
this.width = 40;
this.height = 40;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.extraUpdates = 1;
}
else if (this.type == 465)
{
this.name = "Lightning Orb";
this.width = 80;
this.height = 80;
this.aiStyle = 88;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 466)
{
this.name = "Lightning Orb Arc";
this.width = 14;
this.height = 14;
this.aiStyle = 88;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.tileCollide = true;
this.extraUpdates = 4;
this.timeLeft = 120 * (this.extraUpdates + 1);
}
else if (this.type == 491)
{
this.name = "Flying Knife";
this.width = 26;
this.height = 26;
this.aiStyle = 9;
this.friendly = true;
this.magic = true;
this.penetrate = -1;
}
else if (this.type == 500)
{
this.name = "Crimson Heart";
this.width = 20;
this.height = 20;
this.aiStyle = 67;
this.penetrate = -1;
this.netImportant = true;
this.timeLeft *= 5;
this.friendly = true;
this.ignoreWater = true;
this.scale = 0.8f;
}
else if (this.type == 499)
{
this.netImportant = true;
this.name = "Baby Face Monster";
this.width = 34;
this.height = 34;
this.aiStyle = 26;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 469)
{
this.alpha = 255;
this.arrow = true;
this.name = "Bee Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 470)
{
this.name = "Sticky Dynamite";
this.width = 10;
this.height = 10;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
}
else if (this.type == 471)
{
this.name = "Bone";
this.width = 16;
this.height = 16;
this.aiStyle = 2;
this.scale = 1.2f;
this.hostile = true;
this.ranged = true;
}
else if (this.type == 472)
{
this.name = "Web spit";
this.width = 8;
this.height = 8;
this.aiStyle = 0;
this.hostile = true;
this.penetrate = -1;
this.aiStyle = 1;
this.tileCollide = true;
this.timeLeft = 50;
}
else if (this.type == 474)
{
this.arrow = true;
this.name = "Bone Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 473)
{
this.netImportant = true;
this.name = "Spelunker Glowstick";
this.width = 8;
this.height = 8;
this.aiStyle = 14;
this.penetrate = -1;
this.alpha = 75;
this.light = 1f;
this.timeLeft *= 2;
}
else if (this.type == 475)
{
this.name = "Vine Rope Coil";
this.width = 14;
this.height = 14;
this.aiStyle = 35;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft = 400;
}
else if (this.type == 476)
{
this.name = "Soul Drain";
this.width = 200;
this.height = 200;
this.aiStyle = -1;
this.friendly = true;
this.tileCollide = false;
this.penetrate = -1;
this.alpha = 255;
this.ignoreWater = true;
this.timeLeft = 3;
}
else if (this.type == 477)
{
this.alpha = 255;
this.name = "Crystal Dart";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 7;
this.extraUpdates = 1;
this.ranged = true;
}
else if (this.type == 478)
{
this.alpha = 255;
this.name = "Cursed Dart";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = true;
this.timeLeft = 300;
this.ranged = true;
}
else if (this.type == 479)
{
this.alpha = 255;
this.name = "Ichor Dart";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 480)
{
this.alpha = 255;
this.name = "Cursed Flame";
this.width = 12;
this.height = 12;
this.penetrate = 3;
this.aiStyle = 14;
this.friendly = true;
this.timeLeft = 120;
this.ranged = true;
this.noEnchantments = true;
}
else if (this.type == 481)
{
this.name = "Chain Guillotine";
this.width = 22;
this.height = 22;
this.aiStyle = 13;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.melee = true;
this.extraUpdates = 0;
}
else if (this.type == 482)
{
this.name = "Cursed Flames";
this.width = 16;
this.height = 200;
this.aiStyle = 87;
this.friendly = true;
this.tileCollide = false;
this.penetrate = 20;
this.alpha = 255;
this.ignoreWater = true;
this.timeLeft = 2700;
}
else if (this.type == 483)
{
this.arrow = true;
this.name = "Seedler";
this.width = 14;
this.height = 14;
this.aiStyle = 14;
this.friendly = true;
this.ranged = true;
}
else if (this.type == 484)
{
this.arrow = true;
this.name = "Seedler";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.extraUpdates = 1;
}
else if (this.type == 485)
{
this.arrow = true;
this.name = "Hellwing";
this.width = 24;
this.height = 24;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.penetrate = -1;
}
else if (this.type >= 486 && this.type <= 489)
{
this.name = "Hook";
if (this.type == 486)
{
this.width = 12;
this.height = 12;
}
else if (this.type == 487)
{
this.width = 22;
this.height = 22;
}
else if (this.type == 488)
{
this.width = 12;
this.height = 12;
this.light = 0.3f;
}
else if (this.type == 489)
{
this.width = 20;
this.height = 16;
}
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 492)
{
this.netImportant = true;
this.name = "Magic Lantern";
this.width = 18;
this.height = 32;
this.aiStyle = 90;
this.friendly = true;
this.penetrate = -1;
this.timeLeft *= 5;
}
else if (this.type == 490)
{
this.name = "Lightning Ritual";
this.width = 14;
this.height = 14;
this.aiStyle = 89;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.tileCollide = false;
this.timeLeft = 600;
this.netImportant = true;
}
else if (this.type == 493 || this.type == 494)
{
this.name = "Crystal Vile Shard";
this.width = 32;
this.height = 32;
this.aiStyle = 4;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.alpha = 255;
this.ignoreWater = true;
this.magic = true;
this.light = 0.2f;
}
else if (this.type == 495)
{
this.arrow = true;
this.name = "Shadowflame Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.penetrate = 3;
}
else if (this.type == 496)
{
this.alpha = 255;
this.name = "Shadowflame";
this.width = 40;
this.height = 40;
this.aiStyle = 91;
this.friendly = true;
this.magic = true;
this.MaxUpdates = 3;
this.penetrate = 3;
}
else if (this.type == 497)
{
this.name = "Shadowflame Knife";
this.width = 30;
this.height = 30;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 3;
this.melee = true;
}
else if (this.type == 498)
{
this.name = "Nail";
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 180;
}
else if (this.type == 501)
{
this.name = "Flask";
this.width = 14;
this.height = 14;
this.aiStyle = 2;
this.scale = 1.1f;
this.hostile = true;
this.ranged = true;
}
else if (this.type == 502)
{
this.name = "Meowmere";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.friendly = true;
this.melee = true;
this.penetrate = 5;
}
else if (this.type == 503)
{
this.name = "Star Wrath";
this.width = 24;
this.height = 24;
this.aiStyle = 5;
this.friendly = true;
this.penetrate = 2;
this.alpha = 255;
this.tileCollide = false;
this.melee = true;
this.extraUpdates = 1;
}
else if (this.type == 504)
{
this.name = "Spark";
this.width = 10;
this.height = 10;
this.aiStyle = 2;
this.friendly = true;
this.magic = true;
this.alpha = 255;
this.penetrate = 2;
}
else if (this.type == 507)
{
this.name = "Javelin";
this.width = 16;
this.height = 16;
this.aiStyle = 1;
this.friendly = true;
this.melee = true;
this.penetrate = 3;
}
else if (this.type == 508)
{
this.name = "Javelin";
this.width = 16;
this.height = 16;
this.aiStyle = 1;
this.hostile = true;
this.melee = true;
this.penetrate = -1;
}
else if (this.type == 509)
{
this.name = "Butcher's Chainsaw";
this.width = 22;
this.height = 22;
this.aiStyle = 20;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ownerHitCheck = true;
this.melee = true;
this.scale = 1.2f;
}
else if (this.type == 510)
{
this.name = "Toxic Flask";
this.width = 18;
this.height = 18;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 1;
this.magic = true;
}
else if (this.type == 511)
{
this.name = "Toxic Cloud";
this.width = 32;
this.height = 32;
this.aiStyle = 92;
this.friendly = true;
this.penetrate = -1;
this.scale = 1.1f;
this.magic = true;
}
else if (this.type == 512)
{
this.name = "Toxic Cloud";
this.width = 40;
this.height = 38;
this.aiStyle = 92;
this.friendly = true;
this.penetrate = -1;
this.scale = 1.1f;
this.magic = true;
}
else if (this.type == 513)
{
this.name = "Toxic Cloud";
this.width = 30;
this.height = 28;
this.aiStyle = 92;
this.friendly = true;
this.penetrate = -1;
this.scale = 1.1f;
this.magic = true;
}
else if (this.type == 514)
{
this.name = "Nail";
this.width = 10;
this.height = 10;
this.aiStyle = 93;
this.friendly = true;
this.penetrate = 3;
this.alpha = 255;
this.ranged = true;
}
else if (this.type == 515)
{
this.netImportant = true;
this.name = "Bouncy Glowstick";
this.width = 6;
this.height = 6;
this.aiStyle = 14;
this.penetrate = -1;
this.alpha = 75;
this.light = 1f;
this.timeLeft *= 5;
}
else if (this.type == 516)
{
this.name = "Bouncy Bomb";
this.width = 22;
this.height = 22;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
}
else if (this.type == 517)
{
this.name = "Bouncy Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.thrown = true;
}
else if (this.type == 518)
{
this.name = "Coin Portal";
this.width = 32;
this.height = 32;
this.aiStyle = 94;
this.friendly = true;
this.alpha = 255;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 519)
{
this.name = "Bomb Fish";
this.width = 24;
this.height = 24;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
}
else if (this.type == 520)
{
this.name = "Frost Daggerfish";
this.width = 22;
this.height = 22;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 3;
this.thrown = true;
}
else if (this.type == 521)
{
this.name = "Crystal Charge";
this.width = 14;
this.height = 14;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 522)
{
this.name = "Crystal Charge";
this.width = 8;
this.height = 8;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 523)
{
this.name = "Toxic Bubble";
this.width = 32;
this.height = 32;
this.aiStyle = 95;
this.alpha = 255;
this.ranged = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 524)
{
this.name = "Ichor Splash";
this.width = 10;
this.height = 10;
this.aiStyle = 96;
this.friendly = true;
this.alpha = 255;
this.penetrate = -1;
this.ignoreWater = true;
this.melee = true;
this.extraUpdates = 5;
}
else if (this.type == 525)
{
this.name = "Flying Piggy Bank";
this.width = 30;
this.height = 24;
this.aiStyle = 97;
this.tileCollide = false;
this.timeLeft = 10800;
}
else if (this.type == 526)
{
this.name = "Energy";
this.width = 8;
this.height = 8;
this.aiStyle = 98;
this.tileCollide = false;
this.timeLeft = 120;
this.alpha = 255;
}
else if (this.type >= 527 && this.type <= 531)
{
this.name = "Tombstone";
this.knockBack = 12f;
this.width = 24;
this.height = 24;
this.aiStyle = 17;
this.penetrate = -1;
}
else if (this.type == 532)
{
this.name = "XBone";
this.width = 16;
this.height = 16;
this.aiStyle = 1;
this.scale = 1f;
this.friendly = true;
this.thrown = true;
this.penetrate = 3;
this.extraUpdates = 1;
}
else if (this.type == 533)
{
this.netImportant = true;
this.name = "Deadly Sphere";
this.width = 20;
this.height = 20;
this.aiStyle = 66;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.minionSlots = 1f;
this.tileCollide = false;
this.ignoreWater = true;
this.friendly = true;
}
else if (this.type == 534)
{
this.extraUpdates = 0;
this.name = "Yoyo";
this.width = 16;
this.height = 16;
this.aiStyle = 99;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 1f;
}
else if (this.type >= 541 && this.type <= 555)
{
this.extraUpdates = 0;
this.name = "Yoyo";
this.width = 16;
this.height = 16;
this.aiStyle = 99;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 1f;
if (this.type == 547)
{
this.scale = 1.1f;
}
if (this.type == 554)
{
this.scale = 1.2f;
}
if (this.type == 555)
{
this.scale = 1.15f;
}
if (this.type == 551 || this.type == 550)
{
this.scale = 1.1f;
}
}
else if (this.type >= 562 && this.type <= 564)
{
this.extraUpdates = 0;
this.name = "Yoyo";
this.width = 16;
this.height = 16;
this.aiStyle = 99;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 1f;
if (this.type == 563)
{
this.scale = 1.05f;
}
if (this.type == 564)
{
this.scale = 1.075f;
}
}
else if (this.type == 603)
{
this.extraUpdates = 0;
this.name = "Terrarian";
this.width = 16;
this.height = 16;
this.aiStyle = 99;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 1.15f;
}
else if (this.type == 604)
{
this.extraUpdates = 0;
this.name = "Terrarian";
this.width = 16;
this.height = 16;
this.aiStyle = 115;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 1.2f;
}
else if (this.type >= 556 && this.type <= 561)
{
this.extraUpdates = 0;
this.name = "Counterweight";
this.width = 10;
this.height = 10;
this.aiStyle = 99;
this.friendly = true;
this.penetrate = -1;
this.melee = true;
this.scale = 1f;
this.counterweight = true;
}
else if (this.type == 535)
{
this.name = "Medusa Ray";
this.width = 18;
this.height = 18;
this.aiStyle = 100;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 536)
{
this.name = "Medusa Ray";
this.width = 10;
this.height = 10;
this.aiStyle = 101;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 537)
{
this.name = "Stardust Laser";
this.width = 22;
this.height = 22;
this.aiStyle = 84;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 240;
this.tileCollide = false;
}
else if (this.type == 538)
{
this.name = "Twinkle";
this.width = 12;
this.height = 12;
this.aiStyle = 14;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 120;
this.extraUpdates = 1;
this.alpha = 255;
}
else if (this.type == 539)
{
this.name = "Flow Invader";
this.width = 18;
this.height = 30;
this.aiStyle = 102;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 600;
}
else if (this.type == 540)
{
this.name = "Starmark";
this.width = 20;
this.height = 20;
this.aiStyle = 103;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 300;
this.alpha = 255;
}
else if (this.type == 565)
{
this.name = "Brain of Confusion";
this.width = 28;
this.height = 28;
this.aiStyle = 104;
this.penetrate = -1;
this.tileCollide = false;
this.ignoreWater = true;
this.alpha = 255;
this.scale = 0.8f;
}
else if (this.type == 566)
{
this.name = "Bee";
this.width = 16;
this.height = 16;
this.aiStyle = 36;
this.friendly = true;
this.penetrate = 4;
this.alpha = 255;
this.timeLeft = 660;
this.extraUpdates = 3;
}
else if (this.type == 567 || this.type == 568)
{
this.name = "Spore";
if (this.type == 567)
{
this.width = 14;
this.height = 14;
}
else
{
this.width = 16;
this.height = 16;
}
this.aiStyle = 105;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 3600;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type >= 569 && this.type <= 571)
{
this.name = "Spore";
this.width = 32;
this.height = 32;
this.aiStyle = 106;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.timeLeft = 3600;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 575)
{
this.name = "Nebula Sphere";
this.width = 24;
this.height = 24;
this.aiStyle = 107;
this.hostile = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft = 420;
this.alpha = 255;
}
else if (this.type == 573)
{
this.name = "Nebula Piercer";
this.width = 18;
this.height = 30;
this.aiStyle = 102;
this.hostile = true;
this.penetrate = -1;
this.timeLeft = 600;
}
else if (this.type == 574)
{
this.name = "Nebula Eye";
this.width = 18;
this.height = 18;
this.aiStyle = 102;
this.hostile = true;
this.timeLeft = 600;
this.tileCollide = false;
}
else if (this.type == 572)
{
this.name = "Poison Spit";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.penetrate = -1;
this.friendly = false;
this.hostile = true;
}
else if (this.type == 576)
{
this.name = "Nebula Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.2f;
this.timeLeft = 600;
}
else if (this.type == 577)
{
this.name = "Vortex Laser";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1.2f;
this.timeLeft = 600;
}
else if (this.type == 578 || this.type == 579)
{
this.name = "Vortex";
this.width = 32;
this.height = 32;
this.aiStyle = 108;
this.friendly = true;
this.alpha = 255;
this.tileCollide = false;
this.ignoreWater = true;
this.hostile = true;
this.hide = true;
}
else if (this.type == 580)
{
this.name = "Vortex Lightning";
this.width = 14;
this.height = 14;
this.aiStyle = 88;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.tileCollide = true;
this.extraUpdates = 4;
this.timeLeft = 600;
}
else if (this.type == 581)
{
this.name = "Alien Goop";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.penetrate = -1;
this.friendly = false;
this.hostile = true;
}
else if (this.type == 582)
{
this.name = "Mechanic's Wrench";
this.width = 20;
this.height = 20;
this.aiStyle = 109;
this.friendly = true;
this.penetrate = -1;
this.MaxUpdates = 2;
}
else if (this.type == 583)
{
this.name = "Syringe";
this.width = 10;
this.height = 10;
this.aiStyle = 2;
this.friendly = true;
this.scale = 0.8f;
}
else if (this.type == 589)
{
this.name = "Christmas Ornament";
this.width = 10;
this.height = 10;
this.aiStyle = 2;
this.friendly = true;
}
else if (this.type == 584)
{
this.name = "Syringe";
this.width = 10;
this.height = 10;
this.aiStyle = 110;
this.friendly = true;
this.scale = 0.8f;
this.penetrate = 3;
}
else if (this.type == 585)
{
this.name = "Skull";
this.width = 26;
this.height = 26;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
this.penetrate = 3;
}
else if (this.type == 586)
{
this.name = "Dryad's ward";
this.width = 26;
this.height = 26;
this.aiStyle = 111;
this.alpha = 255;
this.friendly = true;
this.penetrate = -1;
}
else if (this.type == 587)
{
this.name = "Paintball";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
}
else if (this.type == 588)
{
this.name = "Confetti Grenade";
this.width = 14;
this.height = 14;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
}
else if (this.type == 590)
{
this.name = "Truffle Spore";
this.width = 14;
this.height = 14;
this.aiStyle = 112;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.timeLeft = 900;
this.tileCollide = false;
this.ignoreWater = true;
}
else if (this.type == 591)
{
this.name = "Minecart Laser";
this.width = 8;
this.height = 8;
this.aiStyle = 101;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ignoreWater = true;
}
else if (this.type == 592)
{
this.name = "Laser Ray";
this.width = 8;
this.height = 8;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.extraUpdates = 3;
this.ignoreWater = true;
}
else if (this.type == 593)
{
this.name = "Prophecy's End";
this.width = 16;
this.height = 16;
this.aiStyle = 1;
this.hostile = true;
this.alpha = 255;
this.extraUpdates = 1;
this.ignoreWater = true;
}
else if (this.type == 594)
{
this.name = "Blowup Smoke";
this.width = 40;
this.height = 40;
this.aiStyle = 1;
this.alpha = 255;
this.extraUpdates = 2;
}
else if (this.type == 595)
{
this.name = "Arkhalis";
this.width = 68;
this.height = 64;
this.aiStyle = 75;
this.friendly = true;
this.tileCollide = false;
this.melee = true;
this.penetrate = -1;
this.ownerHitCheck = true;
}
else if (this.type == 596)
{
this.name = "Desert Spirit's Curse";
this.width = 8;
this.height = 8;
this.aiStyle = 107;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.timeLeft = 180;
this.tileCollide = false;
}
else if (this.type == 597)
{
this.name = "Ember Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 2;
this.friendly = true;
}
else if (this.type == 598)
{
this.name = "Bone Javelin";
this.width = 16;
this.height = 16;
this.aiStyle = 113;
this.friendly = true;
this.melee = true;
this.penetrate = -1;
this.alpha = 255;
this.hide = true;
}
else if (this.type == 599)
{
this.name = "Bone Dagger";
this.width = 22;
this.height = 22;
this.aiStyle = 2;
this.friendly = true;
this.penetrate = 6;
this.thrown = true;
}
else if (this.type == 600)
{
this.name = "Portal Gun";
this.width = 14;
this.height = 14;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ignoreWater = true;
}
else if (this.type == 601)
{
this.name = "Portal Bolt";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.friendly = true;
this.extraUpdates = 7;
}
else if (this.type == 602)
{
this.name = "Portal Gate";
this.width = 10;
this.height = 10;
this.aiStyle = 114;
this.alpha = 255;
this.friendly = true;
this.tileCollide = false;
}
else if (this.type == 605)
{
this.name = "Slime Spike";
this.alpha = 255;
this.width = 6;
this.height = 6;
this.aiStyle = 1;
this.hostile = true;
this.penetrate = -1;
}
else if (this.type == 606)
{
this.name = "Laser";
this.width = 5;
this.height = 5;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.extraUpdates = 2;
this.scale = 1f;
this.timeLeft = 600;
this.ignoreWater = true;
}
else if (this.type == 607)
{
this.name = "Solar Flare";
this.width = 10;
this.height = 10;
this.aiStyle = 116;
this.friendly = true;
this.alpha = 255;
this.timeLeft = 600;
this.ignoreWater = true;
this.tileCollide = false;
this.penetrate = -1;
}
else if (this.type == 608)
{
this.name = "Solar Radiance";
this.width = 160;
this.height = 160;
this.aiStyle = 117;
this.friendly = true;
this.alpha = 255;
this.timeLeft = 3;
this.ignoreWater = true;
this.tileCollide = false;
this.penetrate = -1;
this.hide = true;
}
else if (this.type == 611)
{
this.name = "Solar Eruption";
this.width = 16;
this.height = 16;
this.aiStyle = 75;
this.friendly = true;
this.melee = true;
this.penetrate = -1;
this.alpha = 255;
this.hide = true;
this.tileCollide = false;
this.ignoreWater = true;
this.updatedNPCImmunity = true;
}
else if (this.type == 612)
{
this.name = "Solar Eruption";
this.width = 8;
this.height = 8;
this.aiStyle = 117;
this.friendly = true;
this.alpha = 255;
this.ignoreWater = true;
this.timeLeft = 60;
this.tileCollide = false;
this.penetrate = -1;
this.updatedNPCImmunity = true;
}
else if (this.type == 613)
{
this.netImportant = true;
this.name = "Stardust Cell";
this.width = 24;
this.height = 24;
this.aiStyle = 62;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.friendly = true;
this.minionSlots = 1f;
this.ignoreWater = true;
}
else if (this.type == 614)
{
this.name = "Stardust Cell";
this.width = 16;
this.height = 16;
this.aiStyle = 113;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
}
else if (this.type == 615)
{
this.name = "Vortex Beater";
this.width = 22;
this.height = 22;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ranged = true;
this.ignoreWater = true;
}
else if (this.type == 616)
{
this.name = "Vortex Rocket";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = true;
this.penetrate = 1;
this.alpha = 255;
this.ranged = true;
this.extraUpdates = 2;
this.timeLeft = 90 * this.MaxUpdates;
}
else if (this.type == 617)
{
this.name = "Nebula Arcanum";
this.width = 32;
this.height = 32;
this.aiStyle = 118;
this.friendly = true;
this.alpha = 255;
this.ignoreWater = true;
this.hide = true;
this.magic = true;
this.penetrate = 3;
}
else if (this.type == 618)
{
this.name = "Nebula Arcanum";
this.tileCollide = false;
this.width = 18;
this.height = 30;
this.aiStyle = 119;
this.penetrate = -1;
this.timeLeft = 420;
this.magic = true;
this.friendly = true;
}
else if (this.type == 619)
{
this.name = "Nebula Arcanum";
this.width = 14;
this.height = 14;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 620)
{
this.name = "Nebula Arcanum";
this.width = 8;
this.height = 8;
this.aiStyle = 29;
this.alpha = 255;
this.magic = true;
this.penetrate = 1;
this.friendly = true;
}
else if (this.type == 622)
{
this.name = "Blowup Smoke";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.alpha = 255;
this.extraUpdates = 2;
}
else if (this.type == 623)
{
this.netImportant = true;
this.name = "Stardust Guardian";
this.width = 50;
this.height = 80;
this.aiStyle = 120;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.friendly = true;
this.minionSlots = 0f;
this.ignoreWater = true;
this.tileCollide = false;
}
else if (this.type == 624)
{
this.name = "Starburst";
this.width = 8;
this.height = 8;
this.aiStyle = 117;
this.friendly = true;
this.alpha = 255;
this.ignoreWater = true;
this.timeLeft = 60;
this.tileCollide = false;
this.penetrate = -1;
}
else if (this.type >= 625 && this.type <= 628)
{
if (this.type == 625 || this.type == 628)
{
this.netImportant = true;
}
if (this.type == 626 || this.type == 627)
{
this.minionSlots = 0.5f;
}
this.name = "Stardust Dragon";
this.width = 24;
this.height = 24;
this.aiStyle = 121;
this.penetrate = -1;
this.timeLeft *= 5;
this.minion = true;
this.friendly = true;
this.ignoreWater = true;
this.tileCollide = false;
this.alpha = 255;
this.hide = true;
}
else if (this.type == 629)
{
this.name = "Released Energy";
this.width = 8;
this.height = 8;
this.aiStyle = 122;
this.hostile = true;
this.alpha = 255;
this.ignoreWater = true;
this.timeLeft = 3600;
this.tileCollide = false;
this.penetrate = -1;
this.extraUpdates = 2;
}
else if (this.type == 630)
{
this.name = "Phantasm";
this.width = 22;
this.height = 22;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.hide = true;
this.ranged = true;
this.ignoreWater = true;
}
else if (this.type == 631)
{
this.arrow = true;
this.name = "Phantasm";
this.width = 10;
this.height = 10;
this.aiStyle = 122;
this.friendly = true;
this.ranged = true;
this.tileCollide = false;
this.alpha = 255;
this.ignoreWater = true;
this.extraUpdates = 1;
}
else if (this.type == 633)
{
this.name = "Last Prism";
this.width = 14;
this.height = 18;
this.aiStyle = 75;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.magic = true;
this.ignoreWater = true;
}
else if (this.type == 632)
{
this.name = "Last Prism";
this.width = 18;
this.height = 18;
this.aiStyle = 84;
this.friendly = true;
this.magic = true;
this.penetrate = -1;
this.alpha = 255;
this.tileCollide = false;
}
else if (this.type == 634)
{
this.name = "Nebula Blaze";
this.width = 40;
this.height = 40;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.ignoreWater = true;
this.extraUpdates = 2;
this.magic = true;
}
else if (this.type == 635)
{
this.name = "Nebula Blaze Ex";
this.width = 40;
this.height = 40;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.friendly = true;
this.extraUpdates = 3;
this.magic = true;
}
else if (this.type == 636)
{
this.name = "Daybreak";
this.width = 16;
this.height = 16;
this.aiStyle = 113;
this.friendly = true;
this.melee = true;
this.penetrate = -1;
this.alpha = 255;
this.hide = true;
this.MaxUpdates = 2;
}
else if (this.type == 637)
{
this.name = "Bouncy Dynamite";
this.width = 10;
this.height = 10;
this.aiStyle = 16;
this.friendly = true;
this.penetrate = -1;
}
else if (this.type == 638)
{
this.name = "Luminite Bullet";
this.width = 4;
this.height = 4;
this.aiStyle = 1;
this.friendly = true;
this.alpha = 255;
this.extraUpdates = 5;
this.timeLeft = 600;
this.ranged = true;
this.ignoreWater = true;
this.updatedNPCImmunity = true;
this.penetrate = -1;
}
else if (this.type == 639)
{
this.arrow = true;
this.name = "Luminite Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.MaxUpdates = 2;
this.timeLeft = this.MaxUpdates * 45;
this.ignoreWater = true;
this.updatedNPCImmunity = true;
this.alpha = 255;
this.penetrate = 4;
}
else if (this.type == 640)
{
this.name = "Luminite Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.MaxUpdates = 3;
this.timeLeft = 90;
this.ignoreWater = true;
this.updatedNPCImmunity = true;
this.alpha = 255;
this.penetrate = 4;
}
else if (this.type == 642)
{
this.name = "Lunar Portal Laser";
this.width = 18;
this.height = 18;
this.aiStyle = 84;
this.friendly = true;
this.penetrate = -1;
this.alpha = 255;
this.tileCollide = false;
this.updatedNPCImmunity = true;
}
else if (this.type == 641)
{
this.name = "Lunar Portal";
this.width = 32;
this.height = 32;
this.aiStyle = 123;
this.timeLeft = 7200;
this.ignoreWater = true;
this.tileCollide = false;
this.alpha = 255;
this.hide = true;
}
else if (this.type == 643)
{
this.name = "Rainbow Crystal";
this.width = 32;
this.height = 32;
this.aiStyle = 123;
this.timeLeft = 7200;
this.ignoreWater = true;
this.tileCollide = false;
this.alpha = 255;
}
else if (this.type == 644)
{
this.name = "Rainbow Explosion";
this.width = 14;
this.height = 14;
this.aiStyle = 112;
this.penetrate = 1;
this.timeLeft = 900;
this.tileCollide = false;
this.ignoreWater = true;
this.alpha = 255;
}
else if (this.type == 645)
{
this.name = "Lunar Flare";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.magic = true;
this.tileCollide = false;
this.extraUpdates = 5;
this.penetrate = -1;
this.updatedNPCImmunity = true;
}
else if (this.type >= 646 && this.type <= 649)
{
this.name = "Lunar Hook";
this.width = 18;
this.height = 18;
this.aiStyle = 7;
this.friendly = true;
this.penetrate = -1;
this.tileCollide = false;
this.timeLeft *= 10;
}
else if (this.type == 650)
{
this.name = "Suspicious Looking Tentacle";
this.width = 20;
this.height = 20;
this.aiStyle = 124;
this.penetrate = -1;
this.netImportant = true;
this.timeLeft *= 5;
this.friendly = true;
this.ignoreWater = true;
this.tileCollide = false;
this.manualDirectionChange = true;
}
else
{
this.active = false;
}
this.width = (int)((float)this.width * this.scale);
this.height = (int)((float)this.height * this.scale);
this.maxPenetrate = this.penetrate;
}
public static int GetNextSlot()
{
int result = 1000;
for (int i = 0; i < 1000; i++)
{
if (!Main.projectile[i].active)
{
result = i;
break;
}
}
return result;
}
public static int NewProjectile(float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner = 255, float ai0 = 0f, float ai1 = 0f)
{
int num = 1000;
for (int i = 0; i < 1000; i++)
{
if (!Main.projectile[i].active)
{
num = i;
break;
}
}
if (num == 1000)
{
return num;
}
Projectile projectile = Main.projectile[num];
projectile.SetDefaults(Type);
projectile.position.X = X - (float)projectile.width * 0.5f;
projectile.position.Y = Y - (float)projectile.height * 0.5f;
projectile.owner = Owner;
projectile.velocity.X = SpeedX;
projectile.velocity.Y = SpeedY;
projectile.damage = Damage;
projectile.knockBack = KnockBack;
projectile.identity = num;
projectile.gfxOffY = 0f;
projectile.stepSpeed = 1f;
projectile.wet = Collision.WetCollision(projectile.position, projectile.width, projectile.height);
if (projectile.ignoreWater)
{
projectile.wet = false;
}
projectile.honeyWet = Collision.honey;
if (projectile.aiStyle == 1)
{
while (projectile.velocity.X >= 16f || projectile.velocity.X <= -16f || projectile.velocity.Y >= 16f || projectile.velocity.Y < -16f)
{
Projectile expr_10B_cp_0 = projectile;
expr_10B_cp_0.velocity.X = expr_10B_cp_0.velocity.X * 0.97f;
Projectile expr_122_cp_0 = projectile;
expr_122_cp_0.velocity.Y = expr_122_cp_0.velocity.Y * 0.97f;
}
}
if (Owner == Main.myPlayer)
{
if (Type == 206)
{
projectile.ai[0] = (float)Main.rand.Next(-100, 101) * 0.0005f;
projectile.ai[1] = (float)Main.rand.Next(-100, 101) * 0.0005f;
}
else if (Type == 335)
{
projectile.ai[1] = (float)Main.rand.Next(4);
}
else if (Type == 358)
{
projectile.ai[1] = (float)Main.rand.Next(10, 31) * 0.1f;
}
else if (Type == 406)
{
projectile.ai[1] = (float)Main.rand.Next(10, 21) * 0.1f;
}
else
{
projectile.ai[0] = ai0;
projectile.ai[1] = ai1;
}
}
if (Type == 434)
{
projectile.ai[0] = projectile.position.X;
projectile.ai[1] = projectile.position.Y;
}
if (Main.netMode != 0 && Owner == Main.myPlayer)
{
NetMessage.SendData(27, -1, -1, "", num, 0f, 0f, 0f, 0, 0, 0);
}
if (Owner == Main.myPlayer)
{
if (Type == 28)
{
projectile.timeLeft = 180;
}
if (Type == 516)
{
projectile.timeLeft = 180;
}
if (Type == 519)
{
projectile.timeLeft = 180;
}
if (Type == 29)
{
projectile.timeLeft = 300;
}
if (Type == 470)
{
projectile.timeLeft = 300;
}
if (Type == 637)
{
projectile.timeLeft = 300;
}
if (Type == 30)
{
projectile.timeLeft = 180;
}
if (Type == 517)
{
projectile.timeLeft = 180;
}
if (Type == 37)
{
projectile.timeLeft = 180;
}
if (Type == 75)
{
projectile.timeLeft = 180;
}
if (Type == 133)
{
projectile.timeLeft = 180;
}
if (Type == 136)
{
projectile.timeLeft = 180;
}
if (Type == 139)
{
projectile.timeLeft = 180;
}
if (Type == 142)
{
projectile.timeLeft = 180;
}
if (Type == 397)
{
projectile.timeLeft = 180;
}
if (Type == 419)
{
projectile.timeLeft = 600;
}
if (Type == 420)
{
projectile.timeLeft = 600;
}
if (Type == 421)
{
projectile.timeLeft = 600;
}
if (Type == 422)
{
projectile.timeLeft = 600;
}
if (Type == 588)
{
projectile.timeLeft = 180;
}
if (Type == 443)
{
projectile.timeLeft = 300;
}
}
if (Type == 249)
{
projectile.frame = Main.rand.Next(5);
}
return num;
}
public void StatusNPC(int i)
{
if (this.melee && Main.player[this.owner].meleeEnchant > 0 && !this.noEnchantments)
{
int meleeEnchant = (int)Main.player[this.owner].meleeEnchant;
if (meleeEnchant == 1)
{
Main.npc[i].AddBuff(70, 60 * Main.rand.Next(5, 10), false);
}
if (meleeEnchant == 2)
{
Main.npc[i].AddBuff(39, 60 * Main.rand.Next(3, 7), false);
}
if (meleeEnchant == 3)
{
Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false);
}
if (meleeEnchant == 5)
{
Main.npc[i].AddBuff(69, 60 * Main.rand.Next(10, 20), false);
}
if (meleeEnchant == 6)
{
Main.npc[i].AddBuff(31, 60 * Main.rand.Next(1, 4), false);
}
if (meleeEnchant == 8)
{
Main.npc[i].AddBuff(20, 60 * Main.rand.Next(5, 10), false);
}
if (meleeEnchant == 4)
{
Main.npc[i].AddBuff(72, 120, false);
}
}
if (this.type == 195)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(70, 60 * Main.rand.Next(10, 21), false);
}
else
{
Main.npc[i].AddBuff(20, 60 * Main.rand.Next(10, 21), false);
}
}
if (this.type == 567 || this.type == 568)
{
Main.npc[i].AddBuff(20, 60 * Main.rand.Next(5, 11), false);
}
if (this.type == 598)
{
Main.npc[i].AddBuff(169, 900, false);
}
if (this.type == 636)
{
Main.npc[i].AddBuff(189, 300, false);
}
if (this.type == 611)
{
Main.npc[i].AddBuff(189, 300, false);
}
if (this.type == 612)
{
Main.npc[i].AddBuff(189, 300, false);
}
if (this.type == 614)
{
Main.npc[i].AddBuff(183, 900, false);
}
if (this.type == 585)
{
Main.npc[i].AddBuff(153, 60 * Main.rand.Next(5, 11), false);
}
if (this.type == 583)
{
Main.npc[i].AddBuff(20, 60 * Main.rand.Next(3, 6), false);
}
if (this.type == 524)
{
Main.npc[i].AddBuff(69, 60 * Main.rand.Next(3, 8), false);
}
if (this.type == 504 && Main.rand.Next(3) == 0)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, Main.rand.Next(60, 180), false);
}
else
{
Main.npc[i].AddBuff(24, Main.rand.Next(30, 120), false);
}
}
if (this.type == 545 && Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, Main.rand.Next(60, 240), false);
}
if (this.type == 553)
{
Main.npc[i].AddBuff(24, Main.rand.Next(180, 480), false);
}
if (this.type == 552 && Main.rand.Next(3) != 0)
{
Main.npc[i].AddBuff(44, Main.rand.Next(120, 320), false);
}
if (this.type == 495)
{
Main.npc[i].AddBuff(153, Main.rand.Next(120, 300), false);
}
if (this.type == 497)
{
Main.npc[i].AddBuff(153, Main.rand.Next(60, 180), false);
}
if (this.type == 496)
{
Main.npc[i].AddBuff(153, Main.rand.Next(240, 480), false);
}
if (this.type == 476)
{
Main.npc[i].AddBuff(151, 30, false);
}
if (this.type == 523)
{
Main.npc[i].AddBuff(20, 60 * Main.rand.Next(10, 30), false);
}
if (this.type == 478 || this.type == 480)
{
Main.npc[i].AddBuff(39, 60 * Main.rand.Next(3, 7), false);
}
if (this.type == 479)
{
Main.npc[i].AddBuff(69, 60 * Main.rand.Next(7, 15), false);
}
if (this.type == 379)
{
Main.npc[i].AddBuff(70, 60 * Main.rand.Next(4, 7), false);
}
if (this.type >= 390 && this.type <= 392)
{
Main.npc[i].AddBuff(70, 60 * Main.rand.Next(2, 5), false);
}
if (this.type == 374)
{
Main.npc[i].AddBuff(20, 60 * Main.rand.Next(4, 7), false);
}
if (this.type == 376)
{
Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false);
}
if (this.type >= 399 && this.type <= 402)
{
Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false);
}
if (this.type == 295 || this.type == 296)
{
Main.npc[i].AddBuff(24, 60 * Main.rand.Next(8, 16), false);
}
if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn && !this.noEnchantments)
{
Main.npc[i].AddBuff(44, 60 * Main.rand.Next(5, 15), false);
}
if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments)
{
if (Main.rand.Next(7) == 0)
{
Main.npc[i].AddBuff(24, 360, false);
}
else if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, 120, false);
}
else
{
Main.npc[i].AddBuff(24, 60, false);
}
}
if (this.type == 287)
{
Main.npc[i].AddBuff(72, 120, false);
}
if (this.type == 285)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(31, 180, false);
}
else
{
Main.npc[i].AddBuff(31, 60, false);
}
}
if (this.type == 2 && Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, 180, false);
}
if (this.type == 172)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(44, 180, false);
}
}
else if (this.type == 15)
{
if (Main.rand.Next(2) == 0)
{
Main.npc[i].AddBuff(24, 300, false);
}
}
else if (this.type == 253)
{
if (Main.rand.Next(2) == 0)
{
Main.npc[i].AddBuff(44, 480, false);
}
}
else if (this.type == 19)
{
if (Main.rand.Next(5) == 0)
{
Main.npc[i].AddBuff(24, 180, false);
}
}
else if (this.type == 33)
{
if (Main.rand.Next(5) == 0)
{
Main.npc[i].AddBuff(20, 420, false);
}
}
else if (this.type == 34)
{
if (Main.rand.Next(2) == 0)
{
Main.npc[i].AddBuff(24, Main.rand.Next(240, 480), false);
}
}
else if (this.type == 35)
{
if (Main.rand.Next(4) == 0)
{
Main.npc[i].AddBuff(24, 180, false);
}
}
else if (this.type == 54)
{
if (Main.rand.Next(2) == 0)
{
Main.npc[i].AddBuff(20, 600, false);
}
}
else if (this.type == 267)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(20, 3600, false);
}
else
{
Main.npc[i].AddBuff(20, 1800, false);
}
}
else if (this.type == 63)
{
if (Main.rand.Next(5) != 0)
{
Main.npc[i].AddBuff(31, 60 * Main.rand.Next(2, 5), false);
}
}
else if (this.type == 85 || this.type == 188)
{
Main.npc[i].AddBuff(24, 1200, false);
}
else if (this.type == 95 || this.type == 103 || this.type == 104)
{
Main.npc[i].AddBuff(39, 420, false);
}
else if (this.type == 278 || this.type == 279 || this.type == 280)
{
Main.npc[i].AddBuff(69, 600, false);
}
else if (this.type == 282 || this.type == 283)
{
Main.npc[i].AddBuff(70, 600, false);
}
if (this.type == 163 || this.type == 310)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, 600, false);
return;
}
Main.npc[i].AddBuff(24, 300, false);
return;
}
else
{
if (this.type == 98)
{
Main.npc[i].AddBuff(20, 600, false);
return;
}
if (this.type == 184)
{
Main.npc[i].AddBuff(20, 900, false);
return;
}
if (this.type == 265)
{
Main.npc[i].AddBuff(20, 1800, false);
return;
}
if (this.type == 355)
{
Main.npc[i].AddBuff(70, 1800, false);
}
return;
}
}
public void StatusPvP(int i)
{
if (this.melee && Main.player[this.owner].meleeEnchant > 0 && !this.noEnchantments)
{
int meleeEnchant = (int)Main.player[this.owner].meleeEnchant;
if (meleeEnchant == 1)
{
Main.player[i].AddBuff(70, 60 * Main.rand.Next(5, 10), true);
}
if (meleeEnchant == 2)
{
Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7), true);
}
if (meleeEnchant == 3)
{
Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7), true);
}
if (meleeEnchant == 5)
{
Main.player[i].AddBuff(69, 60 * Main.rand.Next(10, 20), true);
}
if (meleeEnchant == 6)
{
Main.player[i].AddBuff(31, 60 * Main.rand.Next(1, 4), true);
}
if (meleeEnchant == 8)
{
Main.player[i].AddBuff(20, 60 * Main.rand.Next(5, 10), true);
}
}
if (this.type == 295 || this.type == 296)
{
Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16), true);
}
if (this.type == 478 || this.type == 480)
{
Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7), true);
}
if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn && !this.noEnchantments)
{
Main.player[i].AddBuff(44, 60 * Main.rand.Next(1, 8), false);
}
if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments)
{
if (Main.rand.Next(4) == 0)
{
Main.player[i].AddBuff(24, 360, true);
}
else if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(24, 240, true);
}
else
{
Main.player[i].AddBuff(24, 120, true);
}
}
if (this.type == 2 && Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(24, 180, false);
}
if (this.type == 172)
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(44, 240, false);
}
}
else if (this.type == 15)
{
if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(24, 300, false);
}
}
else if (this.type == 253)
{
if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(44, 480, false);
}
}
else if (this.type == 19)
{
if (Main.rand.Next(5) == 0)
{
Main.player[i].AddBuff(24, 180, false);
}
}
else if (this.type == 33)
{
if (Main.rand.Next(5) == 0)
{
Main.player[i].AddBuff(20, 420, false);
}
}
else if (this.type == 34)
{
if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(24, 240, false);
}
}
else if (this.type == 35)
{
if (Main.rand.Next(4) == 0)
{
Main.player[i].AddBuff(24, 180, false);
}
}
else if (this.type == 54)
{
if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(20, 600, false);
}
}
else if (this.type == 267)
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(20, 3600, true);
}
else
{
Main.player[i].AddBuff(20, 1800, true);
}
}
else if (this.type == 63)
{
if (Main.rand.Next(3) != 0)
{
Main.player[i].AddBuff(31, 120, true);
}
}
else if (this.type == 85 || this.type == 188)
{
Main.player[i].AddBuff(24, 1200, false);
}
else if (this.type == 95 || this.type == 103 || this.type == 104)
{
Main.player[i].AddBuff(39, 420, true);
}
else if (this.type == 278 || this.type == 279 || this.type == 280)
{
Main.player[i].AddBuff(69, 900, true);
}
else if (this.type == 282 || this.type == 283)
{
Main.player[i].AddBuff(70, 600, true);
}
if (this.type == 163 || this.type == 310)
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(24, 600, true);
return;
}
Main.player[i].AddBuff(24, 300, true);
return;
}
else
{
if (this.type == 265)
{
Main.player[i].AddBuff(20, 1200, true);
return;
}
if (this.type == 355)
{
Main.player[i].AddBuff(70, 1800, true);
}
return;
}
}
public void ghostHurt(int dmg, Vector2 Position)
{
if (!this.magic)
{
return;
}
int num = this.damage / 2;
if (dmg / 2 <= 1)
{
return;
}
int num2 = 1000;
if (Main.player[Main.myPlayer].ghostDmg > (float)num2)
{
return;
}
Main.player[Main.myPlayer].ghostDmg += (float)num;
int[] array = new int[200];
int num3 = 0;
int num4 = 0;
for (int i = 0; i < 200; i++)
{
if (Main.npc[i].CanBeChasedBy(this, false))
{
float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - this.position.X + (float)(this.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - this.position.Y + (float)(this.height / 2));
if (num5 < 800f)
{
if (Collision.CanHit(this.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f)
{
array[num4] = i;
num4++;
}
else if (num4 == 0)
{
array[num3] = i;
num3++;
}
}
}
}
if (num3 == 0 && num4 == 0)
{
return;
}
int num6;
if (num4 > 0)
{
num6 = array[Main.rand.Next(num4)];
}
else
{
num6 = array[Main.rand.Next(num3)];
}
float num7 = 4f;
float num8 = (float)Main.rand.Next(-100, 101);
float num9 = (float)Main.rand.Next(-100, 101);
float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9));
num10 = num7 / num10;
num8 *= num10;
num9 *= num10;
Projectile.NewProjectile(Position.X, Position.Y, num8, num9, 356, num, 0f, this.owner, (float)num6, 0f);
}
public void ghostHeal(int dmg, Vector2 Position)
{
float num = 0.2f;
num -= (float)this.numHits * 0.05f;
if (num <= 0f)
{
return;
}
float num2 = (float)dmg * num;
if ((int)num2 <= 0)
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num2;
if (!this.magic)
{
return;
}
float num3 = 0f;
int num4 = this.owner;
for (int i = 0; i < 255; i++)
{
if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[this.owner].hostile && !Main.player[i].hostile) || Main.player[this.owner].team == Main.player[i].team))
{
float num5 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - this.position.X + (float)(this.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - this.position.Y + (float)(this.height / 2));
if (num5 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num3)
{
num3 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife);
num4 = i;
}
}
}
Projectile.NewProjectile(Position.X, Position.Y, 0f, 0f, 298, 0, 0f, this.owner, (float)num4, num2);
}
public void vampireHeal(int dmg, Vector2 Position)
{
float num = (float)dmg * 0.075f;
if ((int)num == 0)
{
return;
}
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
Main.player[Main.myPlayer].lifeSteal -= num;
int num2 = this.owner;
Projectile.NewProjectile(Position.X, Position.Y, 0f, 0f, 305, 0, 0f, this.owner, (float)num2, num);
}
public void StatusPlayer(int i)
{
if (this.type == 472)
{
Main.player[i].AddBuff(149, Main.rand.Next(30, 150), true);
}
if (this.type == 467)
{
Main.player[i].AddBuff(24, Main.rand.Next(30, 150), true);
}
if (this.type == 581)
{
if (Main.expertMode)
{
Main.player[i].AddBuff(164, Main.rand.Next(300, 540), true);
}
else if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(164, Main.rand.Next(360, 720), true);
}
}
if (this.type == 572 && Main.rand.Next(3) != 0)
{
Main.player[i].AddBuff(20, Main.rand.Next(120, 240), true);
}
if (this.type == 276)
{
if (Main.expertMode)
{
Main.player[i].AddBuff(20, Main.rand.Next(120, 540), true);
}
else if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(20, Main.rand.Next(180, 420), true);
}
}
if (this.type == 436 && Main.rand.Next(5) >= 2)
{
Main.player[i].AddBuff(31, 300, true);
}
if (this.type == 435 && Main.rand.Next(3) != 0)
{
Main.player[i].AddBuff(144, 300, true);
}
if (this.type == 437)
{
Main.player[i].AddBuff(144, 60 * Main.rand.Next(4, 9), true);
}
if (this.type == 348)
{
if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(46, 600, true);
}
else
{
Main.player[i].AddBuff(46, 300, true);
}
if (Main.rand.Next(3) != 0)
{
if (Main.rand.Next(16) == 0)
{
Main.player[i].AddBuff(47, 60, true);
}
else if (Main.rand.Next(12) == 0)
{
Main.player[i].AddBuff(47, 40, true);
}
else if (Main.rand.Next(8) == 0)
{
Main.player[i].AddBuff(47, 20, true);
}
}
}
if (this.type == 349)
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(46, 600, true);
}
else if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(46, 300, true);
}
}
if (this.type >= 399 && this.type <= 402)
{
Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false);
}
if (this.type == 55)
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(20, 600, true);
}
else if (Main.expertMode)
{
Main.player[i].AddBuff(20, Main.rand.Next(60, 300), true);
}
}
if (this.type == 44 && Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(22, 900, true);
}
if (this.type == 293)
{
Main.player[i].AddBuff(80, 60 * Main.rand.Next(2, 7), true);
}
if (this.type == 82 && Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(24, 420, true);
}
if (this.type == 285)
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(31, 180, true);
}
else
{
Main.player[i].AddBuff(31, 60, true);
}
}
if (this.type == 96 || this.type == 101)
{
if (Main.rand.Next(6) == 0)
{
Main.player[i].AddBuff(39, 480, true);
}
else if (Main.rand.Next(4) == 0)
{
Main.player[i].AddBuff(39, 300, true);
}
else if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(39, 180, true);
}
}
else if (this.type == 288)
{
Main.player[i].AddBuff(69, 900, true);
}
else if (this.type == 253 && Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(44, 600, true);
}
if (this.type == 291 || this.type == 292)
{
Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16), true);
}
if (this.type == 98)
{
Main.player[i].AddBuff(20, 600, true);
}
if (this.type == 184)
{
Main.player[i].AddBuff(20, 900, true);
}
if (this.type == 290)
{
Main.player[i].AddBuff(32, 60 * Main.rand.Next(5, 16), true);
}
if (this.type == 174)
{
Main.player[i].AddBuff(46, 1200, true);
if (!Main.player[i].frozen && Main.rand.Next(20) == 0)
{
Main.player[i].AddBuff(47, 90, true);
}
else if (!Main.player[i].frozen && Main.expertMode && Main.rand.Next(20) == 0)
{
Main.player[i].AddBuff(47, 60, true);
}
}
if (this.type == 257)
{
Main.player[i].AddBuff(46, 2700, true);
if (!Main.player[i].frozen && Main.rand.Next(5) == 0)
{
Main.player[i].AddBuff(47, 60, true);
}
}
if (this.type == 177)
{
Main.player[i].AddBuff(46, 1500, true);
if (!Main.player[i].frozen && Main.rand.Next(10) == 0)
{
Main.player[i].AddBuff(47, Main.rand.Next(30, 120), true);
}
}
if (this.type == 176)
{
if (Main.rand.Next(4) == 0)
{
Main.player[i].AddBuff(20, 1200, true);
return;
}
if (Main.rand.Next(2) == 0)
{
Main.player[i].AddBuff(20, 300, true);
}
}
}
public void Damage()
{
if (this.type == 18 || this.type == 72 || this.type == 86 || this.type == 87 || this.aiStyle == 31 || this.aiStyle == 32 || this.type == 226 || this.type == 378 || this.type == 613 || this.type == 650 || (this.type == 434 && this.localAI[0] != 0f) || this.type == 439 || this.type == 444 || (this.type == 451 && ((int)(this.ai[0] - 1f) / this.penetrate == 0 || this.ai[1] < 5f) && this.ai[0] != 0f) || this.type == 500 || this.type == 460 || this.type == 633 || this.type == 600 || this.type == 601 || this.type == 602 || this.type == 535 || (this.type == 631 && this.localAI[1] == 0f))
{
return;
}
if (this.aiStyle == 93 && this.ai[0] != 0f && this.ai[0] != 2f)
{
return;
}
if (this.aiStyle == 10 && this.localAI[1] == -1f)
{
return;
}
if (Main.projPet[this.type] && this.type != 266 && this.type != 407 && this.type != 317 && (this.type != 388 || this.ai[0] != 2f) && (this.type < 390 || this.type > 392) && (this.type < 393 || this.type > 395) && (this.type != 533 || this.ai[0] < 6f || this.ai[0] > 8f) && (this.type < 625 || this.type > 628))
{
return;
}
Rectangle myRect = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
if (this.type == 85 || this.type == 101)
{
int num = 30;
myRect.X -= num;
myRect.Y -= num;
myRect.Width += num * 2;
myRect.Height += num * 2;
}
if (this.type == 188)
{
int num2 = 20;
myRect.X -= num2;
myRect.Y -= num2;
myRect.Width += num2 * 2;
myRect.Height += num2 * 2;
}
if (this.aiStyle == 29)
{
int num3 = 4;
myRect.X -= num3;
myRect.Y -= num3;
myRect.Width += num3 * 2;
myRect.Height += num3 * 2;
}
if (this.friendly && this.owner == Main.myPlayer && !this.npcProj)
{
if ((this.aiStyle == 16 && this.type != 338 && this.type != 339 && this.type != 340 && this.type != 341 && (this.timeLeft <= 1 || this.type == 108 || this.type == 164)) || (this.type == 286 && this.localAI[1] == -1f))
{
int myPlayer = Main.myPlayer;
if (Main.player[myPlayer].active && !Main.player[myPlayer].dead && !Main.player[myPlayer].immune && (!this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.player[myPlayer].position, Main.player[myPlayer].width, Main.player[myPlayer].height)))
{
Rectangle value = new Rectangle((int)Main.player[myPlayer].position.X, (int)Main.player[myPlayer].position.Y, Main.player[myPlayer].width, Main.player[myPlayer].height);
if (myRect.Intersects(value))
{
if (Main.player[myPlayer].position.X + (float)(Main.player[myPlayer].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = -1;
}
else
{
this.direction = 1;
}
int num4 = Main.DamageVar((float)this.damage);
this.StatusPlayer(myPlayer);
Main.player[myPlayer].Hurt(num4, this.direction, true, false, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), false);
if (this.trap)
{
Main.player[myPlayer].trapDebuffSource = true;
if (Main.player[myPlayer].dead)
{
AchievementsHelper.HandleSpecialEvent(Main.player[myPlayer], 4);
}
}
if (Main.netMode != 0)
{
NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), myPlayer, (float)this.direction, (float)num4, 1f, 0, 0, 0);
}
}
}
}
if (this.aiStyle != 45 && this.aiStyle != 92 && this.aiStyle != 105 && this.aiStyle != 106 && this.type != 463 && this.type != 69 && this.type != 70 && this.type != 621 && this.type != 10 && this.type != 11 && this.type != 379 && this.type != 407 && this.type != 476 && this.type != 623 && (this.type < 625 || this.type > 628))
{
int num5 = (int)(this.position.X / 16f);
int num6 = (int)((this.position.X + (float)this.width) / 16f) + 1;
int num7 = (int)(this.position.Y / 16f);
int num8 = (int)((this.position.Y + (float)this.height) / 16f) + 1;
if (num5 < 0)
{
num5 = 0;
}
if (num6 > Main.maxTilesX)
{
num6 = Main.maxTilesX;
}
if (num7 < 0)
{
num7 = 0;
}
if (num8 > Main.maxTilesY)
{
num8 = Main.maxTilesY;
}
AchievementsHelper.CurrentlyMining = true;
for (int i = num5; i < num6; i++)
{
for (int j = num7; j < num8; j++)
{
if (Main.tile[i, j] != null && Main.tileCut[(int)Main.tile[i, j].type] && Main.tile[i, j + 1] != null && Main.tile[i, j + 1].type != 78 && Main.tile[i, j + 1].type != 380)
{
WorldGen.KillTile(i, j, false, false, false);
if (Main.netMode != 0)
{
NetMessage.SendData(17, -1, -1, "", 0, (float)i, (float)j, 0f, 0, 0, 0);
}
}
}
}
if (this.type == 461 || this.type == 632 || this.type == 642)
{
Utils.PlotTileLine(base.Center, base.Center + this.velocity * this.localAI[1], (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles));
}
else if (this.type == 611)
{
Utils.PlotTileLine(base.Center, base.Center + this.velocity, (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles));
}
AchievementsHelper.CurrentlyMining = false;
}
}
if (this.owner == Main.myPlayer)
{
if (this.damage > 0)
{
for (int k = 0; k < 200; k++)
{
bool flag = !this.updatedNPCImmunity || this.npcImmune[k] == 0;
if (Main.npc[k].active && !Main.npc[k].dontTakeDamage && flag && ((this.friendly && (!Main.npc[k].friendly || this.type == 318 || (Main.npc[k].type == 22 && this.owner < 255 && Main.player[this.owner].killGuide) || (Main.npc[k].type == 54 && this.owner < 255 && Main.player[this.owner].killClothier))) || (this.hostile && Main.npc[k].friendly)) && (this.owner < 0 || Main.npc[k].immune[this.owner] == 0 || this.maxPenetrate == 1))
{
bool flag2 = false;
if (this.type == 11 && (Main.npc[k].type == 47 || Main.npc[k].type == 57))
{
flag2 = true;
}
else if (this.type == 31 && Main.npc[k].type == 69)
{
flag2 = true;
}
else if (Main.npc[k].trapImmune && this.trap)
{
flag2 = true;
}
else if (Main.npc[k].immortal && this.npcProj)
{
flag2 = true;
}
if (!flag2 && (Main.npc[k].noTileCollide || !this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.npc[k].position, Main.npc[k].width, Main.npc[k].height)))
{
bool flag3;
if (Main.npc[k].type == 414)
{
Rectangle rect = Main.npc[k].getRect();
int num9 = 8;
rect.X -= num9;
rect.Y -= num9;
rect.Width += num9 * 2;
rect.Height += num9 * 2;
flag3 = this.Colliding(myRect, rect);
}
else
{
flag3 = this.Colliding(myRect, Main.npc[k].getRect());
}
if (flag3)
{
if (this.type == 604)
{
Main.player[this.owner].Counterweight(Main.npc[k].Center, this.damage, this.knockBack);
}
if (Main.npc[k].reflectingProjectiles && this.CanReflect())
{
Main.npc[k].ReflectProjectile(this.whoAmI);
return;
}
int num10 = Main.DamageVar((float)this.damage);
if (this.type == 604)
{
this.friendly = false;
this.ai[1] = 1000f;
}
if ((this.type == 400 || this.type == 401 || this.type == 402) && Main.npc[k].type >= 13 && Main.npc[k].type <= 15)
{
num10 = (int)((double)num10 * 0.65);
if (this.penetrate > 1)
{
this.penetrate--;
}
}
if (this.type == 504)
{
float num11 = (60f - this.ai[0]) / 2f;
this.ai[0] += num11;
}
if (this.aiStyle == 3 && this.type != 301)
{
if (this.ai[0] == 0f)
{
this.velocity.X = -this.velocity.X;
this.velocity.Y = -this.velocity.Y;
this.netUpdate = true;
}
this.ai[0] = 1f;
}
else if (this.type == 582)
{
if (this.ai[0] != 0f)
{
this.direction *= -1;
}
}
else if (this.type == 612)
{
this.direction = Main.player[this.owner].direction;
}
else if (this.type == 624)
{
float num12 = 1f;
if (Main.npc[k].knockBackResist > 0f)
{
num12 = 1f / Main.npc[k].knockBackResist;
}
this.knockBack = 4f * num12;
if (Main.npc[k].Center.X < base.Center.X)
{
this.direction = 1;
}
else
{
this.direction = -1;
}
}
else if (this.aiStyle == 16)
{
if (this.timeLeft > 3)
{
this.timeLeft = 3;
}
if (Main.npc[k].position.X + (float)(Main.npc[k].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
else if (this.aiStyle == 68)
{
if (this.timeLeft > 3)
{
this.timeLeft = 3;
}
if (Main.npc[k].position.X + (float)(Main.npc[k].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
else if (this.aiStyle == 50)
{
if (Main.npc[k].position.X + (float)(Main.npc[k].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
if (this.type == 509)
{
int num13 = Main.rand.Next(2, 6);
for (int l = 0; l < num13; l++)
{
Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
vector += this.velocity * 3f;
vector.Normalize();
vector *= (float)Main.rand.Next(35, 81) * 0.1f;
int num14 = (int)((double)this.damage * 0.5);
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector.X, vector.Y, 504, num14, this.knockBack * 0.2f, this.owner, 0f, 0f);
}
}
if (this.type == 598 || this.type == 636 || this.type == 614)
{
this.ai[0] = 1f;
this.ai[1] = (float)k;
this.velocity = (Main.npc[k].Center - base.Center) * 0.75f;
this.netUpdate = true;
}
if (this.type >= 511 && this.type <= 513)
{
this.timeLeft = 0;
}
if (this.type == 524)
{
this.netUpdate = true;
this.ai[0] += 50f;
}
if (this.aiStyle == 39)
{
if (this.ai[1] == 0f)
{
this.ai[1] = (float)(k + 1);
this.netUpdate = true;
}
if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = 1;
}
else
{
this.direction = -1;
}
}
if (this.type == 41 && this.timeLeft > 1)
{
this.timeLeft = 1;
}
bool flag4 = false;
if (!this.npcProj)
{
if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit)
{
flag4 = true;
}
if (this.ranged && Main.rand.Next(1, 101) <= Main.player[this.owner].rangedCrit)
{
flag4 = true;
}
if (this.magic && Main.rand.Next(1, 101) <= Main.player[this.owner].magicCrit)
{
flag4 = true;
}
if (this.thrown && Main.rand.Next(1, 101) <= Main.player[this.owner].thrownCrit)
{
flag4 = true;
}
}
if (this.aiStyle == 99)
{
Main.player[this.owner].Counterweight(Main.npc[k].Center, this.damage, this.knockBack);
if (Main.npc[k].Center.X < Main.player[this.owner].Center.X)
{
this.direction = -1;
}
else
{
this.direction = 1;
}
if (this.ai[0] >= 0f)
{
Vector2 value2 = base.Center - Main.npc[k].Center;
value2.Normalize();
float scaleFactor = 16f;
this.velocity *= -0.5f;
this.velocity += value2 * scaleFactor;
this.netUpdate = true;
this.localAI[0] += 20f;
if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height))
{
this.localAI[0] += 40f;
num10 = (int)((double)num10 * 0.75);
}
}
}
if (this.aiStyle == 93)
{
if (this.ai[0] == 0f)
{
this.ai[1] = 0f;
int num15 = -k - 1;
this.ai[0] = (float)num15;
this.velocity = Main.npc[k].Center - base.Center;
}
if (this.ai[0] == 2f)
{
num10 = (int)((double)num10 * 1.35);
}
else
{
num10 = (int)((double)num10 * 0.15);
}
}
if (!this.npcProj)
{
int num16 = Item.NPCtoBanner(Main.npc[k].BannerID());
if (num16 >= 0)
{
Main.player[Main.myPlayer].lastCreatureHit = num16;
}
}
if (Main.netMode != 2)
{
int num17 = Item.NPCtoBanner(Main.npc[k].BannerID());
if (num17 > 0 && Main.player[this.owner].NPCBannerBuff[num17])
{
if (Main.expertMode)
{
num10 *= 2;
}
else
{
num10 = (int)((double)num10 * 1.5);
}
}
}
if (Main.expertMode)
{
if ((this.type == 30 || this.type == 28 || this.type == 29 || this.type == 470 || this.type == 517 || this.type == 588 || this.type == 637) && Main.npc[k].type >= 13 && Main.npc[k].type <= 15)
{
num10 /= 5;
}
if (this.type == 280 && ((Main.npc[k].type >= 134 && Main.npc[k].type <= 136) || Main.npc[k].type == 139))
{
num10 = (int)((double)num10 * 0.75);
}
}
if (Main.netMode != 2 && Main.npc[k].type == 439 && this.type >= 0 && this.type <= 651 && ProjectileID.Sets.Homing[this.type])
{
num10 = (int)((float)num10 * 0.75f);
}
if (this.type == 497 && this.penetrate != 1)
{
this.ai[0] = 25f;
float scaleFactor2 = this.velocity.Length();
Vector2 value3 = Main.npc[k].Center - base.Center;
value3.Normalize();
value3 *= scaleFactor2;
this.velocity = -value3 * 0.9f;
this.netUpdate = true;
}
if (this.type == 323 && (Main.npc[k].type == 158 || Main.npc[k].type == 159))
{
num10 *= 10;
}
if (this.type == 294)
{
this.damage = (int)((double)this.damage * 0.8);
}
if (this.type == 477 && this.penetrate > 1)
{
int[] array = new int[10];
int num18 = 0;
int num19 = 700;
int num20 = 20;
for (int m = 0; m < 200; m++)
{
if (m != k && Main.npc[m].CanBeChasedBy(this, false))
{
float num21 = (base.Center - Main.npc[m].Center).Length();
if (num21 > (float)num20 && num21 < (float)num19 && Collision.CanHitLine(base.Center, 1, 1, Main.npc[m].Center, 1, 1))
{
array[num18] = m;
num18++;
if (num18 >= 9)
{
break;
}
}
}
}
if (num18 > 0)
{
num18 = Main.rand.Next(num18);
Vector2 value4 = Main.npc[array[num18]].Center - base.Center;
float scaleFactor3 = this.velocity.Length();
value4.Normalize();
this.velocity = value4 * scaleFactor3;
this.netUpdate = true;
}
}
if (this.type == 261)
{
float num22 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y));
if (num22 < 1f)
{
num22 = 1f;
}
num10 = (int)((float)num10 * num22 / 8f);
}
this.StatusNPC(k);
if (this.type != 221 && this.type != 227 && this.type != 614)
{
Main.player[this.owner].OnHit(Main.npc[k].Center.X, Main.npc[k].Center.Y, Main.npc[k]);
}
if (this.type == 317)
{
this.ai[1] = -1f;
this.netUpdate = true;
}
if (!this.npcProj && !this.hostile && Main.player[this.owner].armorPenetration > 0)
{
num10 += Main.npc[k].checkArmorPenetration(Main.player[this.owner].armorPenetration);
}
int num23;
if (!this.npcProj)
{
num23 = (int)Main.npc[k].StrikeNPC(num10, this.knockBack, this.direction, flag4, false, false);
}
else
{
num23 = (int)Main.npc[k].StrikeNPCNoInteraction(num10, this.knockBack, this.direction, flag4, false, false);
}
if (!this.npcProj && Main.player[this.owner].accDreamCatcher)
{
Main.player[this.owner].addDPS(num23);
}
if (!this.npcProj && !Main.npc[k].immortal)
{
if (this.type == 304 && num23 > 0 && Main.npc[k].lifeMax > 5)
{
this.vampireHeal(num23, new Vector2(Main.npc[k].Center.X, Main.npc[k].Center.Y));
}
if (Main.npc[k].value > 0f && Main.player[this.owner].coins && Main.rand.Next(5) == 0)
{
int num24 = 71;
if (Main.rand.Next(10) == 0)
{
num24 = 72;
}
if (Main.rand.Next(100) == 0)
{
num24 = 73;
}
int num25 = Item.NewItem((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height, num24, 1, false, 0, false);
Main.item[num25].stack = Main.rand.Next(1, 11);
Main.item[num25].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
Main.item[num25].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)this.direction;
if (Main.netMode == 1)
{
NetMessage.SendData(21, -1, -1, "", num25, 0f, 0f, 0f, 0, 0, 0);
}
}
if (num23 > 0 && Main.npc[k].lifeMax > 5 && this.friendly && !this.hostile && this.aiStyle != 59)
{
if (Main.npc[k].canGhostHeal)
{
if (Main.player[this.owner].ghostHeal)
{
this.ghostHeal(num23, new Vector2(Main.npc[k].Center.X, Main.npc[k].Center.Y));
}
if (Main.player[this.owner].ghostHurt)
{
this.ghostHurt(num23, new Vector2(Main.npc[k].Center.X, Main.npc[k].Center.Y));
}
if (Main.player[this.owner].setNebula && Main.player[this.owner].nebulaCD == 0 && Main.rand.Next(3) == 0)
{
Main.player[this.owner].nebulaCD = 30;
int num26 = Utils.SelectRandom<int>(Main.rand, new int[]
{
3453,
3454,
3455
});
int num27 = Item.NewItem((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height, num26, 1, false, 0, false);
Main.item[num27].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
Main.item[num27].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)this.direction;
if (Main.netMode == 1)
{
NetMessage.SendData(21, -1, -1, "", num27, 0f, 0f, 0f, 0, 0, 0);
}
}
}
if (this.melee && Main.player[this.owner].beetleOffense)
{
if (Main.player[this.owner].beetleOrbs == 0)
{
Main.player[this.owner].beetleCounter += (float)(num23 * 3);
}
else if (Main.player[this.owner].beetleOrbs == 1)
{
Main.player[this.owner].beetleCounter += (float)(num23 * 2);
}
else
{
Main.player[this.owner].beetleCounter += (float)num23;
}
Main.player[this.owner].beetleCountdown = 0;
}
if (this.arrow && this.type != 631 && Main.player[this.owner].phantasmTime > 0)
{
Vector2 source = Main.player[this.owner].position + Main.player[this.owner].Size * Utils.RandomVector2(Main.rand, 0f, 1f);
Vector2 vector2 = Main.npc[k].DirectionFrom(source) * 6f;
Projectile.NewProjectile(source.X, source.Y, vector2.X, vector2.Y, 631, this.damage, 0f, this.owner, (float)k, 0f);
Projectile.NewProjectile(source.X, source.Y, vector2.X, vector2.Y, 631, this.damage, 0f, this.owner, (float)k, 15f);
Projectile.NewProjectile(source.X, source.Y, vector2.X, vector2.Y, 631, this.damage, 0f, this.owner, (float)k, 30f);
}
}
}
if (!this.npcProj && this.melee && Main.player[this.owner].meleeEnchant == 7)
{
Projectile.NewProjectile(Main.npc[k].Center.X, Main.npc[k].Center.Y, Main.npc[k].velocity.X, Main.npc[k].velocity.Y, 289, 0, 0f, this.owner, 0f, 0f);
}
if (Main.netMode != 0)
{
if (flag4)
{
NetMessage.SendData(28, -1, -1, "", k, (float)num10, this.knockBack, (float)this.direction, 1, 0, 0);
}
else
{
NetMessage.SendData(28, -1, -1, "", k, (float)num10, this.knockBack, (float)this.direction, 0, 0, 0);
}
}
if (this.type >= 390 && this.type <= 392)
{
this.localAI[1] = 20f;
}
if (this.type == 434)
{
this.numUpdates = 0;
}
else if (this.type == 598 || this.type == 636 || this.type == 614)
{
this.damage = 0;
int num28 = 6;
if (this.type == 614)
{
num28 = 10;
}
if (this.type == 636)
{
num28 = 8;
}
Point[] array2 = new Point[num28];
int num29 = 0;
for (int n = 0; n < 1000; n++)
{
if (n != this.whoAmI && Main.projectile[n].active && Main.projectile[n].owner == Main.myPlayer && Main.projectile[n].type == this.type && Main.projectile[n].ai[0] == 1f && Main.projectile[n].ai[1] == (float)k)
{
array2[num29++] = new Point(n, Main.projectile[n].timeLeft);
if (num29 >= array2.Length)
{
break;
}
}
}
if (num29 >= array2.Length)
{
int num30 = 0;
for (int num31 = 1; num31 < array2.Length; num31++)
{
if (array2[num31].Y < array2[num30].Y)
{
num30 = num31;
}
}
Main.projectile[array2[num30].X].Kill();
}
}
else if (this.type == 632)
{
Main.npc[k].immune[this.owner] = 5;
}
else if (this.type == 514)
{
Main.npc[k].immune[this.owner] = 1;
}
else if (this.type == 617)
{
Main.npc[k].immune[this.owner] = 4;
}
else if (this.type == 611)
{
if (this.localAI[1] <= 0f)
{
Projectile.NewProjectile(Main.npc[k].Center.X, Main.npc[k].Center.Y, 0f, 0f, 612, this.damage, 10f, this.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
}
this.localAI[1] = 4f;
}
else if (this.type == 595)
{
Main.npc[k].immune[this.owner] = 5;
}
else if (this.type >= 625 && this.type <= 628)
{
Main.npc[k].immune[this.owner] = 6;
}
else if (this.type == 286)
{
Main.npc[k].immune[this.owner] = 5;
}
else if (this.type == 514)
{
Main.npc[k].immune[this.owner] = 3;
}
else if (this.type == 443)
{
Main.npc[k].immune[this.owner] = 8;
}
else if (this.type >= 424 && this.type <= 426)
{
Main.npc[k].immune[this.owner] = 5;
}
else if (this.type == 634 || this.type == 635)
{
Main.npc[k].immune[this.owner] = 5;
}
else if (this.type == 246)
{
Main.npc[k].immune[this.owner] = 7;
}
else if (this.type == 249)
{
Main.npc[k].immune[this.owner] = 7;
}
else if (this.type == 190)
{
Main.npc[k].immune[this.owner] = 8;
}
else if (this.type == 409)
{
Main.npc[k].immune[this.owner] = 6;
}
else if (this.type == 407)
{
Main.npc[k].immune[this.owner] = 20;
}
else if (this.type == 311)
{
Main.npc[k].immune[this.owner] = 7;
}
else if (this.type == 582)
{
Main.npc[k].immune[this.owner] = 7;
if (this.ai[0] != 1f)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
}
else
{
if (this.type == 451)
{
if (this.ai[0] == 0f)
{
this.ai[0] += (float)this.penetrate;
}
else
{
this.ai[0] -= (float)(this.penetrate + 1);
}
this.ai[1] = 0f;
this.netUpdate = true;
break;
}
if (this.penetrate != 1)
{
Main.npc[k].immune[this.owner] = 10;
}
}
if (this.penetrate > 0 && this.type != 317)
{
if (this.type == 357)
{
this.damage = (int)((double)this.damage * 0.9);
}
this.penetrate--;
if (this.penetrate == 0)
{
break;
}
}
if (this.aiStyle == 7)
{
this.ai[0] = 1f;
this.damage = 0;
this.netUpdate = true;
}
else if (this.aiStyle == 13)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
else if (this.aiStyle == 69)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
else if (this.type == 607)
{
this.ai[0] = 1f;
this.netUpdate = true;
this.friendly = false;
}
else if (this.type == 638 || this.type == 639 || this.type == 640)
{
this.npcImmune[k] = -1;
Main.npc[k].immune[this.owner] = 0;
this.damage = (int)((double)this.damage * 0.96);
}
else if (this.type == 642)
{
this.npcImmune[k] = 10;
Main.npc[k].immune[this.owner] = 0;
}
else if (this.type == 611 || this.type == 612)
{
this.npcImmune[k] = 6;
Main.npc[k].immune[this.owner] = 4;
}
else if (this.type == 645)
{
this.npcImmune[k] = -1;
Main.npc[k].immune[this.owner] = 0;
if (this.ai[1] != -1f)
{
this.ai[0] = 0f;
this.ai[1] = -1f;
this.netUpdate = true;
}
}
this.numHits++;
}
}
}
}
}
if (this.damage > 0 && Main.player[Main.myPlayer].hostile)
{
for (int num32 = 0; num32 < 255; num32++)
{
if (num32 != this.owner && Main.player[num32].active && !Main.player[num32].dead && !Main.player[num32].immune && Main.player[num32].hostile && this.playerImmune[num32] <= 0 && (Main.player[Main.myPlayer].team == 0 || Main.player[Main.myPlayer].team != Main.player[num32].team) && (!this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.player[num32].position, Main.player[num32].width, Main.player[num32].height)))
{
bool flag5 = this.Colliding(myRect, Main.player[num32].getRect());
if (flag5)
{
if (this.aiStyle == 3)
{
if (this.ai[0] == 0f)
{
this.velocity.X = -this.velocity.X;
this.velocity.Y = -this.velocity.Y;
this.netUpdate = true;
}
this.ai[0] = 1f;
}
else if (this.aiStyle == 16)
{
if (this.timeLeft > 3)
{
this.timeLeft = 3;
}
if (Main.player[num32].position.X + (float)(Main.player[num32].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
else if (this.aiStyle == 68)
{
if (this.timeLeft > 3)
{
this.timeLeft = 3;
}
if (Main.player[num32].position.X + (float)(Main.player[num32].width / 2) < this.position.X + (float)(this.width / 2))
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
if (this.type == 41 && this.timeLeft > 1)
{
this.timeLeft = 1;
}
bool flag6 = false;
if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit)
{
flag6 = true;
}
int num33 = Main.DamageVar((float)this.damage);
if (!Main.player[num32].immune)
{
this.StatusPvP(num32);
}
if (this.type != 221 && this.type != 227 && this.type != 614)
{
Main.player[this.owner].OnHit(Main.player[num32].Center.X, Main.player[num32].Center.Y, Main.player[num32]);
}
int num34 = (int)Main.player[num32].Hurt(num33, this.direction, true, false, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), flag6);
if (num34 > 0 && Main.player[this.owner].ghostHeal && this.friendly && !this.hostile)
{
this.ghostHeal(num34, new Vector2(Main.player[num32].Center.X, Main.player[num32].Center.Y));
}
if (this.type == 304 && num34 > 0)
{
this.vampireHeal(num34, new Vector2(Main.player[num32].Center.X, Main.player[num32].Center.Y));
}
if (this.melee && Main.player[this.owner].meleeEnchant == 7)
{
Projectile.NewProjectile(Main.player[num32].Center.X, Main.player[num32].Center.Y, Main.player[num32].velocity.X, Main.player[num32].velocity.Y, 289, 0, 0f, this.owner, 0f, 0f);
}
if (Main.netMode != 0)
{
if (flag6)
{
NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), num32, (float)this.direction, (float)num33, 1f, 1, 0, 0);
}
else
{
NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), num32, (float)this.direction, (float)num33, 1f, 0, 0, 0);
}
}
this.playerImmune[num32] = 40;
if (this.penetrate > 0)
{
this.penetrate--;
if (this.penetrate == 0)
{
break;
}
}
if (this.aiStyle == 7)
{
this.ai[0] = 1f;
this.damage = 0;
this.netUpdate = true;
}
else if (this.aiStyle == 13)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
else if (this.aiStyle == 69)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
}
}
}
}
}
if (this.type == 10 && Main.netMode != 1)
{
for (int num35 = 0; num35 < 200; num35++)
{
if (Main.npc[num35].active && Main.npc[num35].type == 534)
{
Rectangle value5 = new Rectangle((int)Main.npc[num35].position.X, (int)Main.npc[num35].position.Y, Main.npc[num35].width, Main.npc[num35].height);
if (myRect.Intersects(value5))
{
Main.npc[num35].Transform(441);
}
}
}
}
if (this.type == 11 && Main.netMode != 1)
{
for (int num36 = 0; num36 < 200; num36++)
{
if (Main.npc[num36].active)
{
if (Main.npc[num36].type == 46 || Main.npc[num36].type == 303)
{
Rectangle value6 = new Rectangle((int)Main.npc[num36].position.X, (int)Main.npc[num36].position.Y, Main.npc[num36].width, Main.npc[num36].height);
if (myRect.Intersects(value6))
{
Main.npc[num36].Transform(47);
}
}
else if (Main.npc[num36].type == 55)
{
Rectangle value7 = new Rectangle((int)Main.npc[num36].position.X, (int)Main.npc[num36].position.Y, Main.npc[num36].width, Main.npc[num36].height);
if (myRect.Intersects(value7))
{
Main.npc[num36].Transform(57);
}
}
else if (Main.npc[num36].type == 148 || Main.npc[num36].type == 149)
{
Rectangle value8 = new Rectangle((int)Main.npc[num36].position.X, (int)Main.npc[num36].position.Y, Main.npc[num36].width, Main.npc[num36].height);
if (myRect.Intersects(value8))
{
Main.npc[num36].Transform(168);
}
}
}
}
}
if (this.type == 463 && Main.netMode != 1)
{
for (int num37 = 0; num37 < 200; num37++)
{
if (Main.npc[num37].active)
{
if (Main.npc[num37].type == 46 || Main.npc[num37].type == 303)
{
Rectangle value9 = new Rectangle((int)Main.npc[num37].position.X, (int)Main.npc[num37].position.Y, Main.npc[num37].width, Main.npc[num37].height);
if (myRect.Intersects(value9))
{
Main.npc[num37].Transform(464);
}
}
else if (Main.npc[num37].type == 55)
{
Rectangle value10 = new Rectangle((int)Main.npc[num37].position.X, (int)Main.npc[num37].position.Y, Main.npc[num37].width, Main.npc[num37].height);
if (myRect.Intersects(value10))
{
Main.npc[num37].Transform(465);
}
}
else if (Main.npc[num37].type == 148 || Main.npc[num37].type == 149)
{
Rectangle value11 = new Rectangle((int)Main.npc[num37].position.X, (int)Main.npc[num37].position.Y, Main.npc[num37].width, Main.npc[num37].height);
if (myRect.Intersects(value11))
{
Main.npc[num37].Transform(470);
}
}
}
}
}
if (Main.netMode != 2 && this.hostile && Main.myPlayer < 255 && this.damage > 0)
{
int myPlayer2 = Main.myPlayer;
if (Main.player[myPlayer2].active && !Main.player[myPlayer2].dead && !Main.player[myPlayer2].immune)
{
bool flag7 = this.Colliding(myRect, Main.player[myPlayer2].getRect());
if (flag7)
{
int hitDirection = this.direction;
if (Main.player[myPlayer2].position.X + (float)(Main.player[myPlayer2].width / 2) < this.position.X + (float)(this.width / 2))
{
hitDirection = -1;
}
else
{
hitDirection = 1;
}
int num38 = Main.DamageVar((float)this.damage);
if (!Main.player[myPlayer2].immune)
{
this.StatusPlayer(myPlayer2);
}
if (Main.player[myPlayer2].resistCold && this.coldDamage)
{
num38 = (int)((float)num38 * 0.7f);
}
if (Main.expertMode)
{
num38 = (int)((float)num38 * Main.expertDamage);
}
Main.player[myPlayer2].Hurt(num38 * 2, hitDirection, false, false, Lang.deathMsg(-1, -1, this.whoAmI, -1), false);
if (this.trap)
{
Main.player[myPlayer2].trapDebuffSource = true;
if (Main.player[myPlayer2].dead)
{
AchievementsHelper.HandleSpecialEvent(Main.player[myPlayer2], 4);
}
}
if (this.type == 435)
{
this.penetrate--;
}
if (this.type == 436)
{
this.penetrate--;
}
if (this.type == 437)
{
this.penetrate--;
}
}
}
}
}
public bool Colliding(Rectangle myRect, Rectangle targetRect)
{
if (this.type == 598 && targetRect.Width > 8 && targetRect.Height > 8)
{
targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8);
}
else if (this.type == 614 && targetRect.Width > 8 && targetRect.Height > 8)
{
targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8);
}
else if (this.type == 636 && targetRect.Width > 8 && targetRect.Height > 8)
{
targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8);
}
else if (this.type == 607)
{
myRect.X += (int)this.velocity.X;
myRect.Y += (int)this.velocity.Y;
}
if (myRect.Intersects(targetRect))
{
return true;
}
if (this.type == 461)
{
float num = 0f;
if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), base.Center, base.Center + this.velocity * this.localAI[1], 22f * this.scale, ref num))
{
return true;
}
}
else if (this.type == 642)
{
float num2 = 0f;
if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), base.Center, base.Center + this.velocity * this.localAI[1], 30f * this.scale, ref num2))
{
return true;
}
}
else if (this.type == 632)
{
float num3 = 0f;
if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), base.Center, base.Center + this.velocity * this.localAI[1], 22f * this.scale, ref num3))
{
return true;
}
}
else if (this.type == 455)
{
float num4 = 0f;
if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), base.Center, base.Center + this.velocity * this.localAI[1], 36f * this.scale, ref num4))
{
return true;
}
}
else if (this.type == 611)
{
float num5 = 0f;
if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), base.Center, base.Center + this.velocity, 16f * this.scale, ref num5))
{
return true;
}
}
else if (this.type == 537)
{
float num6 = 0f;
if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), base.Center, base.Center + this.velocity * this.localAI[1], 22f * this.scale, ref num6))
{
return true;
}
}
else if (this.type == 466 || this.type == 580)
{
for (int i = 0; i < this.oldPos.Length; i++)
{
myRect.X = (int)this.oldPos[i].X;
myRect.Y = (int)this.oldPos[i].Y;
if (myRect.Intersects(targetRect))
{
return true;
}
}
}
else if (this.type == 464 && this.ai[1] != 1f)
{
Vector2 value = new Vector2(0f, -720f).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
float scaleFactor = this.ai[0] % 45f / 45f;
Vector2 spinningpoint = value * scaleFactor;
for (int j = 0; j < 6; j++)
{
float num7 = (float)j * 6.28318548f / 6f;
Vector2 center = base.Center + spinningpoint.RotatedBy((double)num7, default(Vector2));
if (Utils.CenteredRectangle(center, new Vector2(30f, 30f)).Intersects(targetRect))
{
return true;
}
}
}
return false;
}
public void ProjLight()
{
if (this.light > 0f)
{
float num = this.light;
float num2 = this.light;
float num3 = this.light;
if (this.type == 446)
{
num *= 0f;
num3 *= 0.8f;
}
else if (this.type == 493 || this.type == 494)
{
num2 *= 0.3f;
}
else if (this.type == 332)
{
num3 *= 0.1f;
num2 *= 0.6f;
}
else if (this.type == 259)
{
num3 *= 0.1f;
}
else if (this.type == 329)
{
num3 *= 0.1f;
num2 *= 0.9f;
}
else if (this.type == 2 || this.type == 82)
{
num2 *= 0.75f;
num3 *= 0.55f;
}
else if (this.type == 172)
{
num2 *= 0.55f;
num *= 0.35f;
}
else if (this.type == 308)
{
num2 *= 0.7f;
num *= 0.1f;
}
else if (this.type == 304)
{
num2 *= 0.2f;
num3 *= 0.1f;
}
else if (this.type == 263)
{
num2 *= 0.7f;
num *= 0.1f;
}
else if (this.type == 274)
{
num2 *= 0.1f;
num *= 0.7f;
}
else if (this.type == 254)
{
num *= 0.1f;
}
else if (this.type == 94)
{
num *= 0.5f;
num2 *= 0f;
}
else if (this.type == 95 || this.type == 96 || this.type == 103 || this.type == 104)
{
num *= 0.35f;
num2 *= 1f;
num3 *= 0f;
}
else if (this.type == 4)
{
num2 *= 0.1f;
num *= 0.5f;
}
else if (this.type == 257)
{
num2 *= 0.9f;
num *= 0.1f;
}
else if (this.type == 9)
{
num2 *= 0.1f;
num3 *= 0.6f;
}
else if (this.type == 488)
{
num = 0.3f;
num3 = 0.25f;
num2 = 0f;
}
else if (this.type == 92)
{
num2 *= 0.6f;
num *= 0.8f;
}
else if (this.type == 93)
{
num2 *= 1f;
num *= 1f;
num3 *= 0.01f;
}
else if (this.type == 12)
{
num *= 0.9f;
num2 *= 0.8f;
num3 *= 0.1f;
}
else if (this.type == 14 || this.type == 110 || this.type == 180 || this.type == 242 || this.type == 302)
{
num2 *= 0.7f;
num3 *= 0.1f;
}
else if (this.type == 15)
{
num2 *= 0.4f;
num3 *= 0.1f;
num = 1f;
}
else if (this.type == 16)
{
num *= 0.1f;
num2 *= 0.4f;
num3 = 1f;
}
else if (this.type == 18)
{
num2 *= 0.1f;
num *= 0.6f;
}
else if (this.type == 19)
{
num2 *= 0.5f;
num3 *= 0.1f;
}
else if (this.type == 20)
{
num *= 0.1f;
num3 *= 0.3f;
}
else if (this.type == 22)
{
num = 0f;
num2 = 0f;
}
else if (this.type == 27)
{
num *= 0f;
num2 *= 0.3f;
num3 = 1f;
}
else if (this.type == 34)
{
num2 *= 0.1f;
num3 *= 0.1f;
}
else if (this.type == 36)
{
num = 0.8f;
num2 *= 0.2f;
num3 *= 0.6f;
}
else if (this.type == 41)
{
num2 *= 0.8f;
num3 *= 0.6f;
}
else if (this.type == 44 || this.type == 45)
{
num3 = 1f;
num *= 0.6f;
num2 *= 0.1f;
}
else if (this.type == 50)
{
num *= 0.7f;
num3 *= 0.8f;
}
else if (this.type == 515)
{
num2 *= 0.6f;
num3 *= 0.85f;
}
else if (this.type == 53)
{
num *= 0.7f;
num2 *= 0.8f;
}
else if (this.type == 473)
{
num *= 1.05f;
num2 *= 0.95f;
num3 *= 0.55f;
}
else if (this.type == 72)
{
num *= 0.45f;
num2 *= 0.75f;
num3 = 1f;
}
else if (this.type == 86)
{
num *= 1f;
num2 *= 0.45f;
num3 = 0.75f;
}
else if (this.type == 87)
{
num *= 0.45f;
num2 = 1f;
num3 *= 0.75f;
}
else if (this.type == 73)
{
num *= 0.4f;
num2 *= 0.6f;
num3 *= 1f;
}
else if (this.type == 74)
{
num *= 1f;
num2 *= 0.4f;
num3 *= 0.6f;
}
else if (this.type == 284)
{
num *= 1f;
num2 *= 0.1f;
num3 *= 0.8f;
}
else if (this.type == 285)
{
num *= 0.1f;
num2 *= 0.5f;
num3 *= 1f;
}
else if (this.type == 286)
{
num *= 1f;
num2 *= 0.5f;
num3 *= 0.1f;
}
else if (this.type == 287)
{
num *= 0.9f;
num2 *= 1f;
num3 *= 0.4f;
}
else if (this.type == 283)
{
num *= 0.8f;
num2 *= 0.1f;
}
else if (this.type == 76 || this.type == 77 || this.type == 78)
{
num *= 1f;
num2 *= 0.3f;
num3 *= 0.6f;
}
else if (this.type == 79)
{
num = (float)Main.DiscoR / 255f;
num2 = (float)Main.DiscoG / 255f;
num3 = (float)Main.DiscoB / 255f;
}
else if (this.type == 80)
{
num *= 0f;
num2 *= 0.8f;
num3 *= 1f;
}
else if (this.type == 83 || this.type == 88)
{
num *= 0.7f;
num2 *= 0f;
num3 *= 1f;
}
else if (this.type == 100)
{
num *= 1f;
num2 *= 0.5f;
num3 *= 0f;
}
else if (this.type == 84 || this.type == 389)
{
num *= 0.8f;
num2 *= 0f;
num3 *= 0.5f;
}
else if (this.type == 89 || this.type == 90)
{
num2 *= 0.2f;
num3 *= 1f;
num *= 0.05f;
}
else if (this.type == 106)
{
num *= 0f;
num2 *= 0.5f;
num3 *= 1f;
}
else if (this.type == 113)
{
num *= 0.25f;
num2 *= 0.75f;
num3 *= 1f;
}
else if (this.type == 114 || this.type == 115)
{
num *= 0.5f;
num2 *= 0.05f;
num3 *= 1f;
}
else if (this.type == 116)
{
num3 *= 0.25f;
}
else if (this.type == 131)
{
num *= 0.1f;
num2 *= 0.4f;
}
else if (this.type == 132 || this.type == 157)
{
num *= 0.2f;
num3 *= 0.6f;
}
else if (this.type == 156)
{
num *= 1f;
num3 *= 0.6f;
num2 = 0f;
}
else if (this.type == 173)
{
num *= 0.3f;
num3 *= 1f;
num2 = 0.4f;
}
else if (this.type == 207)
{
num *= 0.4f;
num3 *= 0.4f;
}
else if (this.type == 253)
{
num = 0f;
num2 *= 0.4f;
}
else if (this.type == 211)
{
num *= 0.5f;
num2 *= 0.9f;
num3 *= 1f;
if (this.localAI[0] == 0f)
{
this.light = 1.5f;
}
else
{
this.light = 1f;
}
}
else if (this.type == 209)
{
float num4 = (255f - (float)this.alpha) / 255f;
num *= 0.3f;
num2 *= 0.4f;
num3 *= 1.75f;
num3 *= num4;
num *= num4;
num2 *= num4;
}
else if (this.type == 226 || (this.type == 227 | this.type == 229))
{
num *= 0.25f;
num2 *= 1f;
num3 *= 0.5f;
}
else if (this.type == 251)
{
num = (float)Main.DiscoR / 255f;
num2 = (float)Main.DiscoG / 255f;
num3 = (float)Main.DiscoB / 255f;
num = (num + 1f) / 2f;
num2 = (num2 + 1f) / 2f;
num3 = (num3 + 1f) / 2f;
num *= this.light;
num2 *= this.light;
num3 *= this.light;
}
else if (this.type == 278 || this.type == 279)
{
num *= 1f;
num2 *= 1f;
num3 *= 0f;
}
Lighting.AddLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), num, num2, num3);
}
}
public Rectangle getRect()
{
return new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
}
public void Update(int i)
{
if (!this.active)
{
return;
}
this.numUpdates = this.extraUpdates;
while (this.numUpdates >= 0)
{
this.numUpdates--;
if (this.type == 640 && this.ai[1] > 0f)
{
this.ai[1] -= 1f;
}
else
{
if (this.position.X <= Main.leftWorld || this.position.X + (float)this.width >= Main.rightWorld || this.position.Y <= Main.topWorld || this.position.Y + (float)this.height >= Main.bottomWorld)
{
this.active = false;
return;
}
if (this.type != 344 && !this.npcProj)
{
if (Main.player[this.owner].frostBurn && (this.melee || this.ranged) && this.friendly && !this.hostile && !this.noEnchantments && Main.rand.Next(2 * (1 + this.extraUpdates)) == 0)
{
int num = Dust.NewDust(this.position, this.width, this.height, 135, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num].noGravity = true;
Main.dust[num].velocity *= 0.7f;
Dust expr_1D3_cp_0 = Main.dust[num];
expr_1D3_cp_0.velocity.Y = expr_1D3_cp_0.velocity.Y - 0.5f;
}
if (this.melee && Main.player[this.owner].meleeEnchant > 0 && !this.noEnchantments)
{
if (Main.player[this.owner].meleeEnchant == 1 && Main.rand.Next(3) == 0)
{
int num2 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f);
Main.dust[num2].noGravity = true;
Main.dust[num2].fadeIn = 1.5f;
Main.dust[num2].velocity *= 0.25f;
}
if (Main.player[this.owner].meleeEnchant == 1)
{
if (Main.rand.Next(3) == 0)
{
int num3 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f);
Main.dust[num3].noGravity = true;
Main.dust[num3].fadeIn = 1.5f;
Main.dust[num3].velocity *= 0.25f;
}
}
else if (Main.player[this.owner].meleeEnchant == 2)
{
if (Main.rand.Next(2) == 0)
{
int num4 = Dust.NewDust(this.position, this.width, this.height, 75, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f);
Main.dust[num4].noGravity = true;
Main.dust[num4].velocity *= 0.7f;
Dust expr_3F5_cp_0 = Main.dust[num4];
expr_3F5_cp_0.velocity.Y = expr_3F5_cp_0.velocity.Y - 0.5f;
}
}
else if (Main.player[this.owner].meleeEnchant == 3)
{
if (Main.rand.Next(2) == 0)
{
int num5 = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f);
Main.dust[num5].noGravity = true;
Main.dust[num5].velocity *= 0.7f;
Dust expr_4C1_cp_0 = Main.dust[num5];
expr_4C1_cp_0.velocity.Y = expr_4C1_cp_0.velocity.Y - 0.5f;
}
}
else if (Main.player[this.owner].meleeEnchant == 4)
{
if (Main.rand.Next(2) == 0)
{
int num6 = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.1f);
Main.dust[num6].noGravity = true;
Dust expr_574_cp_0 = Main.dust[num6];
expr_574_cp_0.velocity.X = expr_574_cp_0.velocity.X / 2f;
Dust expr_592_cp_0 = Main.dust[num6];
expr_592_cp_0.velocity.Y = expr_592_cp_0.velocity.Y / 2f;
}
}
else if (Main.player[this.owner].meleeEnchant == 5)
{
if (Main.rand.Next(2) == 0)
{
int num7 = Dust.NewDust(this.position, this.width, this.height, 169, 0f, 0f, 100, default(Color), 1f);
Dust expr_615_cp_0 = Main.dust[num7];
expr_615_cp_0.velocity.X = expr_615_cp_0.velocity.X + (float)this.direction;
Dust expr_635_cp_0 = Main.dust[num7];
expr_635_cp_0.velocity.Y = expr_635_cp_0.velocity.Y + 0.2f;
Main.dust[num7].noGravity = true;
}
}
else if (Main.player[this.owner].meleeEnchant == 6)
{
if (Main.rand.Next(2) == 0)
{
int num8 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f);
Dust expr_6C6_cp_0 = Main.dust[num8];
expr_6C6_cp_0.velocity.X = expr_6C6_cp_0.velocity.X + (float)this.direction;
Dust expr_6E6_cp_0 = Main.dust[num8];
expr_6E6_cp_0.velocity.Y = expr_6E6_cp_0.velocity.Y + 0.2f;
Main.dust[num8].noGravity = true;
}
}
else if (Main.player[this.owner].meleeEnchant == 7)
{
if (Main.rand.Next(20) == 0)
{
int num9 = Main.rand.Next(139, 143);
int num10 = Dust.NewDust(this.position, this.width, this.height, num9, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f);
Dust expr_796_cp_0 = Main.dust[num10];
expr_796_cp_0.velocity.X = expr_796_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_7CA_cp_0 = Main.dust[num10];
expr_7CA_cp_0.velocity.Y = expr_7CA_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_7FE_cp_0 = Main.dust[num10];
expr_7FE_cp_0.velocity.X = expr_7FE_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Dust expr_82C_cp_0 = Main.dust[num10];
expr_82C_cp_0.velocity.Y = expr_82C_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
Main.dust[num10].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
}
if (Main.rand.Next(40) == 0)
{
int num11 = Main.rand.Next(276, 283);
int num12 = Gore.NewGore(this.position, this.velocity, num11, 1f);
Gore expr_8CA_cp_0 = Main.gore[num12];
expr_8CA_cp_0.velocity.X = expr_8CA_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Gore expr_8FE_cp_0 = Main.gore[num12];
expr_8FE_cp_0.velocity.Y = expr_8FE_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Main.gore[num12].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
Gore expr_961_cp_0 = Main.gore[num12];
expr_961_cp_0.velocity.X = expr_961_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Gore expr_98F_cp_0 = Main.gore[num12];
expr_98F_cp_0.velocity.Y = expr_98F_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
}
}
else if (Main.player[this.owner].meleeEnchant == 8 && Main.rand.Next(4) == 0)
{
int num13 = Dust.NewDust(this.position, this.width, this.height, 46, 0f, 0f, 100, default(Color), 1f);
Main.dust[num13].noGravity = true;
Main.dust[num13].fadeIn = 1.5f;
Main.dust[num13].velocity *= 0.25f;
}
}
if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments && Main.rand.Next(3) != 0)
{
int num14 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y - 4f), this.width + 8, this.height + 8, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num14].scale = 1.5f;
}
Main.dust[num14].noGravity = true;
Dust expr_B34_cp_0 = Main.dust[num14];
expr_B34_cp_0.velocity.X = expr_B34_cp_0.velocity.X * 2f;
Dust expr_B52_cp_0 = Main.dust[num14];
expr_B52_cp_0.velocity.Y = expr_B52_cp_0.velocity.Y * 2f;
}
}
if (this.minion && this.numUpdates == -1 && this.type != 625 && this.type != 628)
{
this.minionPos = Main.player[this.owner].numMinions;
if (Main.player[this.owner].slotsMinions + this.minionSlots > (float)Main.player[this.owner].maxMinions && this.owner == Main.myPlayer)
{
if (this.type == 627 || this.type == 626)
{
Projectile projectile = Main.projectile[(int)this.ai[0]];
if (projectile.type != 625)
{
projectile.localAI[1] = this.localAI[1];
}
projectile = Main.projectile[(int)this.localAI[1]];
projectile.ai[0] = this.ai[0];
projectile.ai[1] = 1f;
projectile.netUpdate = true;
}
this.Kill();
}
else
{
Main.player[this.owner].numMinions++;
Main.player[this.owner].slotsMinions += this.minionSlots;
}
}
float num15 = 1f + Math.Abs(this.velocity.X) / 3f;
if (this.gfxOffY > 0f)
{
this.gfxOffY -= num15 * this.stepSpeed;
if (this.gfxOffY < 0f)
{
this.gfxOffY = 0f;
}
}
else if (this.gfxOffY < 0f)
{
this.gfxOffY += num15 * this.stepSpeed;
if (this.gfxOffY > 0f)
{
this.gfxOffY = 0f;
}
}
if (this.gfxOffY > 16f)
{
this.gfxOffY = 16f;
}
if (this.gfxOffY < -16f)
{
this.gfxOffY = -16f;
}
Vector2 value = this.velocity;
this.oldVelocity = this.velocity;
this.whoAmI = i;
if (this.soundDelay > 0)
{
this.soundDelay--;
}
this.netUpdate = false;
for (int j = 0; j < 255; j++)
{
if (this.playerImmune[j] > 0)
{
this.playerImmune[j]--;
}
}
if (this.updatedNPCImmunity)
{
for (int k = 0; k < 200; k++)
{
if (this.npcImmune[k] > 0)
{
this.npcImmune[k]--;
}
}
}
this.AI();
if (this.owner < 255 && !Main.player[this.owner].active)
{
this.Kill();
}
if (this.type == 242 || this.type == 302 || this.type == 638)
{
this.wet = false;
}
if (!this.ignoreWater)
{
bool flag;
bool flag2;
try
{
flag = Collision.LavaCollision(this.position, this.width, this.height);
flag2 = Collision.WetCollision(this.position, this.width, this.height);
if (flag)
{
this.lavaWet = true;
}
if (Collision.honey)
{
this.honeyWet = true;
}
}
catch
{
this.active = false;
return;
}
if (this.wet && !this.lavaWet)
{
if (this.type == 85 || this.type == 15 || this.type == 34 || this.type == 188)
{
this.Kill();
}
if (this.type == 2)
{
this.type = 1;
this.light = 0f;
}
}
if (this.type == 80)
{
flag2 = false;
this.wet = false;
if (flag && this.ai[0] >= 0f)
{
this.Kill();
}
}
if (flag2)
{
if (this.type != 155 && this.wetCount == 0 && !this.wet)
{
if (!flag)
{
if (this.honeyWet)
{
for (int l = 0; l < 10; l++)
{
int num16 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f);
Dust expr_102A_cp_0 = Main.dust[num16];
expr_102A_cp_0.velocity.Y = expr_102A_cp_0.velocity.Y - 1f;
Dust expr_1048_cp_0 = Main.dust[num16];
expr_1048_cp_0.velocity.X = expr_1048_cp_0.velocity.X * 2.5f;
Main.dust[num16].scale = 1.3f;
Main.dust[num16].alpha = 100;
Main.dust[num16].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
else
{
for (int m = 0; m < 10; m++)
{
int num17 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f);
Dust expr_1133_cp_0 = Main.dust[num17];
expr_1133_cp_0.velocity.Y = expr_1133_cp_0.velocity.Y - 4f;
Dust expr_1151_cp_0 = Main.dust[num17];
expr_1151_cp_0.velocity.X = expr_1151_cp_0.velocity.X * 2.5f;
Main.dust[num17].scale = 1.3f;
Main.dust[num17].alpha = 100;
Main.dust[num17].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
}
else
{
for (int n = 0; n < 10; n++)
{
int num18 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f);
Dust expr_1239_cp_0 = Main.dust[num18];
expr_1239_cp_0.velocity.Y = expr_1239_cp_0.velocity.Y - 1.5f;
Dust expr_1257_cp_0 = Main.dust[num18];
expr_1257_cp_0.velocity.X = expr_1257_cp_0.velocity.X * 2.5f;
Main.dust[num18].scale = 1.3f;
Main.dust[num18].alpha = 100;
Main.dust[num18].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
}
this.wet = true;
}
else if (this.wet)
{
this.wet = false;
if (this.type == 155)
{
this.velocity.Y = this.velocity.Y * 0.5f;
}
else if (this.wetCount == 0)
{
this.wetCount = 10;
if (!this.lavaWet)
{
if (this.honeyWet)
{
for (int num19 = 0; num19 < 10; num19++)
{
int num20 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f);
Dust expr_13AD_cp_0 = Main.dust[num20];
expr_13AD_cp_0.velocity.Y = expr_13AD_cp_0.velocity.Y - 1f;
Dust expr_13CB_cp_0 = Main.dust[num20];
expr_13CB_cp_0.velocity.X = expr_13CB_cp_0.velocity.X * 2.5f;
Main.dust[num20].scale = 1.3f;
Main.dust[num20].alpha = 100;
Main.dust[num20].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
else
{
for (int num21 = 0; num21 < 10; num21++)
{
int num22 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2)), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f);
Dust expr_14B0_cp_0 = Main.dust[num22];
expr_14B0_cp_0.velocity.Y = expr_14B0_cp_0.velocity.Y - 4f;
Dust expr_14CE_cp_0 = Main.dust[num22];
expr_14CE_cp_0.velocity.X = expr_14CE_cp_0.velocity.X * 2.5f;
Main.dust[num22].scale = 1.3f;
Main.dust[num22].alpha = 100;
Main.dust[num22].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
}
else
{
for (int num23 = 0; num23 < 10; num23++)
{
int num24 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f);
Dust expr_15B6_cp_0 = Main.dust[num24];
expr_15B6_cp_0.velocity.Y = expr_15B6_cp_0.velocity.Y - 1.5f;
Dust expr_15D4_cp_0 = Main.dust[num24];
expr_15D4_cp_0.velocity.X = expr_15D4_cp_0.velocity.X * 2.5f;
Main.dust[num24].scale = 1.3f;
Main.dust[num24].alpha = 100;
Main.dust[num24].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
}
}
if (!this.wet)
{
this.lavaWet = false;
this.honeyWet = false;
}
if (this.wetCount > 0)
{
this.wetCount -= 1;
}
}
this.oldPosition = this.position;
this.oldDirection = this.direction;
bool flag3 = false;
if (this.tileCollide)
{
Vector2 velocity = this.velocity;
bool flag4 = true;
int num25 = -1;
int num26 = -1;
if (Main.projPet[this.type])
{
flag4 = false;
if (Main.player[this.owner].position.Y + (float)Main.player[this.owner].height - 12f > this.position.Y + (float)this.height)
{
flag4 = true;
}
}
if (this.type == 500)
{
flag4 = false;
if (Main.player[this.owner].Bottom.Y > base.Bottom.Y + 4f)
{
flag4 = true;
}
}
if (this.aiStyle == 62)
{
flag4 = true;
}
if (this.aiStyle == 66)
{
flag4 = true;
}
if (this.type == 317)
{
flag4 = true;
}
if (this.type == 373)
{
flag4 = true;
}
if (this.aiStyle == 53)
{
flag4 = false;
}
if (this.type == 9 || this.type == 12 || this.type == 15 || this.type == 13 || this.type == 31 || this.type == 39 || this.type == 40)
{
flag4 = false;
}
if (this.type == 24)
{
flag4 = false;
}
if (this.aiStyle == 29 || this.type == 28 || this.aiStyle == 49)
{
num25 = this.width - 8;
num26 = this.height - 8;
}
else if (this.type == 250 || this.type == 267 || this.type == 297 || this.type == 323 || this.type == 3)
{
num25 = 6;
num26 = 6;
}
else if (this.type == 308)
{
num25 = 26;
num26 = this.height;
}
else if (this.type == 261 || this.type == 277)
{
num25 = 26;
num26 = 26;
}
else if (this.type == 481 || this.type == 491 || this.type == 106 || this.type == 262 || this.type == 271 || this.type == 270 || this.type == 272 || this.type == 273 || this.type == 274 || this.type == 280 || this.type == 288 || this.type == 301 || this.type == 320 || this.type == 333 || this.type == 335 || this.type == 343 || this.type == 344 || this.type == 497 || this.type == 496 || this.type == 6 || this.type == 19 || this.type == 113 || this.type == 520 || this.type == 523 || this.type == 585 || this.type == 598 || this.type == 599 || this.type == 636)
{
num25 = 10;
num26 = 10;
}
else if (this.type == 514)
{
num25 = 4;
num26 = 4;
}
else if (this.type == 248 || this.type == 247 || this.type == 507 || this.type == 508)
{
num25 = this.width - 12;
num26 = this.height - 12;
}
else if (this.aiStyle == 18 || this.type == 254)
{
num25 = this.width - 36;
num26 = this.height - 36;
}
else if (this.type == 182 || this.type == 190 || this.type == 33 || this.type == 229 || this.type == 237 || this.type == 243)
{
num25 = this.width - 20;
num26 = this.height - 20;
}
else if (this.aiStyle == 27)
{
num25 = this.width - 12;
num26 = this.height - 12;
}
else if (this.type == 533 && this.ai[0] >= 6f)
{
num25 = this.width + 6;
num26 = this.height + 6;
}
else if (this.type == 582 || this.type == 634 || this.type == 635)
{
num25 = 8;
num26 = 8;
}
else if (this.type == 617)
{
num25 = (int)(20f * this.scale);
num26 = (int)(20f * this.scale);
}
if (((this.type != 440 && this.type != 449 && this.type != 606) || this.ai[1] != 1f) && (this.type != 466 || this.localAI[1] != 1f) && (this.type != 580 || this.localAI[1] <= 0f) && (this.type != 640 || this.localAI[1] <= 0f))
{
if (this.aiStyle == 10)
{
if (this.type == 42 || this.type == 65 || this.type == 68 || this.type == 354 || (this.type == 31 && this.ai[0] == 2f))
{
this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4, 1);
}
else
{
this.velocity = Collision.AnyCollision(this.position, this.velocity, this.width, this.height);
}
}
else
{
Vector2 position = this.position;
int num27 = (num25 != -1) ? num25 : this.width;
int num28 = (num26 != -1) ? num26 : this.height;
if (num26 != -1 || num25 != -1)
{
position = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num27 / 2), this.position.Y + (float)(this.height / 2) - (float)(num28 / 2));
}
if (this.wet)
{
if (this.honeyWet)
{
Vector2 velocity2 = this.velocity;
this.velocity = Collision.TileCollision(position, this.velocity, num27, num28, flag4, flag4, 1);
value = this.velocity * 0.25f;
if (this.velocity.X != velocity2.X)
{
value.X = this.velocity.X;
}
if (this.velocity.Y != velocity2.Y)
{
value.Y = this.velocity.Y;
}
}
else
{
Vector2 velocity3 = this.velocity;
this.velocity = Collision.TileCollision(position, this.velocity, num27, num28, flag4, flag4, 1);
value = this.velocity * 0.5f;
if (this.velocity.X != velocity3.X)
{
value.X = this.velocity.X;
}
if (this.velocity.Y != velocity3.Y)
{
value.Y = this.velocity.Y;
}
}
}
else
{
this.velocity = Collision.TileCollision(position, this.velocity, num27, num28, flag4, flag4, 1);
if (!Main.projPet[this.type])
{
Vector4 vector = Collision.SlopeCollision(position, this.velocity, num27, num28, 0f, true);
Vector2 value2 = this.position - position;
if (position.X != vector.X)
{
flag3 = true;
}
if (position.Y != vector.Y)
{
flag3 = true;
}
if (this.velocity.X != vector.Z)
{
flag3 = true;
}
if (this.velocity.Y != vector.W)
{
flag3 = true;
}
position.X = vector.X;
position.Y = vector.Y;
this.position = position + value2;
this.velocity.X = vector.Z;
this.velocity.Y = vector.W;
}
}
}
}
if (velocity != this.velocity)
{
flag3 = true;
}
if (flag3)
{
if (this.type == 434)
{
this.position += this.velocity;
this.numUpdates = 0;
}
else if (this.type == 601)
{
if (this.owner == Main.myPlayer)
{
PortalHelper.TryPlacingPortal(this, velocity, this.velocity);
}
this.position += this.velocity;
this.Kill();
}
else if (this.type == 451)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
this.netUpdate = true;
this.velocity = velocity / 2f;
}
else if (this.type == 645)
{
this.ai[0] = 0f;
this.ai[1] = -1f;
this.netUpdate = true;
}
else if (this.type == 584)
{
bool flag5 = false;
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.75f;
flag5 = true;
}
if ((this.velocity.Y != velocity.Y && velocity.Y > 2f) || this.velocity.Y == 0f)
{
this.velocity.Y = velocity.Y * -0.75f;
flag5 = true;
}
if (flag5)
{
float num29 = velocity.Length() / this.velocity.Length();
if (num29 == 0f)
{
num29 = 1f;
}
this.velocity /= num29;
this.penetrate--;
}
}
else if (this.type == 532)
{
bool flag6 = false;
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.75f;
flag6 = true;
}
if ((this.velocity.Y != velocity.Y && velocity.Y > 2f) || this.velocity.Y == 0f)
{
this.velocity.Y = velocity.Y * -0.75f;
flag6 = true;
}
if (flag6)
{
float num30 = velocity.Length() / this.velocity.Length();
if (num30 == 0f)
{
num30 = 1f;
}
this.velocity /= num30;
this.penetrate--;
Collision.HitTiles(this.position, velocity, this.width, this.height);
}
}
else if (this.type == 533)
{
float num31 = 1f;
bool flag7 = false;
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -num31;
flag7 = true;
}
if (this.velocity.Y != velocity.Y || this.velocity.Y == 0f)
{
this.velocity.Y = velocity.Y * -num31 * 0.5f;
flag7 = true;
}
if (flag7)
{
float num32 = velocity.Length() / this.velocity.Length();
if (num32 == 0f)
{
num32 = 1f;
}
this.velocity /= num32;
if (this.ai[0] == 7f && (double)this.velocity.Y < -0.1)
{
this.velocity.Y = this.velocity.Y + 0.1f;
}
if (this.ai[0] >= 6f && this.ai[0] < 9f)
{
Collision.HitTiles(this.position, velocity, this.width, this.height);
}
}
}
else if (this.type == 502)
{
this.ai[0] += 1f;
Main.PlaySound(37, (int)this.position.X, (int)this.position.Y, 5 + (int)this.ai[0]);
if (this.ai[0] >= 5f)
{
this.position += this.velocity;
this.Kill();
}
else
{
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
}
Vector2 spinningpoint = new Vector2(0f, -3f - this.ai[0]).RotatedByRandom(3.1415927410125732);
float num33 = 10f + this.ai[0] * 4f;
Vector2 value3 = new Vector2(1.05f, 1f);
for (float num34 = 0f; num34 < num33; num34 += 1f)
{
int num35 = Dust.NewDust(base.Center, 0, 0, 66, 0f, 0f, 0, Color.Transparent, 1f);
Main.dust[num35].position = base.Center;
Main.dust[num35].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num34 / num33), default(Vector2)) * value3 * (0.8f + Main.rand.NextFloat() * 0.4f);
Main.dust[num35].color = Main.hslToRgb(num34 / num33, 1f, 0.5f);
Main.dust[num35].noGravity = true;
Main.dust[num35].scale = 1f + this.ai[0] / 3f;
}
if (Main.myPlayer == this.owner)
{
int width = this.width;
int height = this.height;
int num36 = this.penetrate;
this.position = base.Center;
this.width = (this.height = 40 + 8 * (int)this.ai[0]);
base.Center = this.position;
this.penetrate = -1;
this.Damage();
this.penetrate = num36;
this.position = base.Center;
this.width = width;
this.height = height;
base.Center = this.position;
}
}
else if (this.type == 444)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
this.ai[0] = this.velocity.ToRotation();
}
else if (this.type == 617)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X * 0.35f;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y * 0.35f;
}
}
else if (this.type == 440 || this.type == 449 || this.type == 606)
{
if (this.ai[1] != 1f)
{
this.ai[1] = 1f;
this.position += this.velocity;
this.velocity = velocity;
}
}
else if (this.type == 466 || this.type == 580 || this.type == 640)
{
if (this.localAI[1] < 1f)
{
this.localAI[1] += 2f;
this.position += this.velocity;
this.velocity = Vector2.Zero;
}
}
else if (this.aiStyle == 54)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.6f;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = velocity.Y * -0.6f;
}
}
else if (!Main.projPet[this.type] && this.type != 500 && this.type != 650)
{
if (this.aiStyle == 99)
{
if (this.type >= 556 && this.type <= 561)
{
bool flag8 = false;
if (this.velocity.X != this.oldVelocity.X)
{
flag8 = true;
this.velocity.X = this.oldVelocity.X * -1f;
}
if (this.velocity.Y != this.oldVelocity.Y)
{
flag8 = true;
this.velocity.Y = this.oldVelocity.Y * -1f;
}
if (flag8)
{
Vector2 vector2 = Main.player[this.owner].Center - base.Center;
vector2.Normalize();
vector2 *= this.velocity.Length();
vector2 *= 0.25f;
this.velocity *= 0.75f;
this.velocity += vector2;
if (this.velocity.Length() > 6f)
{
this.velocity *= 0.5f;
}
}
}
}
else if (this.type == 604)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else if (this.type == 379)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.6f;
}
if (this.velocity.Y != velocity.Y && velocity.Y > 2f)
{
this.velocity.Y = velocity.Y * -0.6f;
}
}
else if (this.type == 491)
{
if (this.ai[0] <= 0f)
{
this.ai[0] = -10f;
}
if (this.velocity.X != velocity.X && Math.Abs(velocity.X) > 0f)
{
this.velocity.X = velocity.X * -1f;
}
if (this.velocity.Y != velocity.Y && Math.Abs(velocity.Y) > 0f)
{
this.velocity.Y = velocity.Y * -1f;
}
}
else if ((this.type >= 515 && this.type <= 517) || this.type == 637)
{
if (this.velocity.X != velocity.X && Math.Abs(velocity.X) > 1f)
{
this.velocity.X = velocity.X * -0.9f;
}
if (this.velocity.Y != velocity.Y && Math.Abs(velocity.Y) > 1f)
{
this.velocity.Y = velocity.Y * -0.9f;
}
}
else if (this.type == 409)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -1f;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = velocity.Y * -1f;
}
}
else if (this.type == 254)
{
this.tileCollide = false;
this.velocity = velocity;
if (this.timeLeft > 30)
{
this.timeLeft = 30;
}
}
else if (this.type == 225 && this.penetrate > 0)
{
this.velocity.X = -velocity.X;
this.velocity.Y = -velocity.Y;
this.penetrate--;
}
else if (this.type == 155)
{
if (this.ai[1] > 10f)
{
string text = string.Concat(new object[]
{
this.name,
" was hit ",
this.ai[1],
" times before touching the ground!"
});
if (Main.netMode == 0)
{
Main.NewText(text, 255, 240, 20, false);
}
else if (Main.netMode == 2)
{
NetMessage.SendData(25, -1, -1, text, 255, 255f, 240f, 20f, 0, 0, 0);
}
}
this.ai[1] = 0f;
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.6f;
}
if (this.velocity.Y != velocity.Y && velocity.Y > 2f)
{
this.velocity.Y = velocity.Y * -0.6f;
}
}
else if (this.aiStyle == 33)
{
if (this.localAI[0] == 0f)
{
if (this.wet)
{
this.position += velocity / 2f;
}
else
{
this.position += velocity;
}
this.velocity *= 0f;
this.localAI[0] = 1f;
}
}
else if (this.type != 308)
{
if (this.type == 477)
{
if (this.velocity.Y != velocity.Y || this.velocity.X != velocity.X)
{
this.penetrate--;
if (this.penetrate <= 0)
{
this.Kill();
}
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
if (this.penetrate > 0 && this.owner == Main.myPlayer)
{
int[] array = new int[10];
int num37 = 0;
int num38 = 700;
int num39 = 20;
for (int num40 = 0; num40 < 200; num40++)
{
if (Main.npc[num40].CanBeChasedBy(this, false))
{
float num41 = (base.Center - Main.npc[num40].Center).Length();
if (num41 > (float)num39 && num41 < (float)num38 && Collision.CanHitLine(base.Center, 1, 1, Main.npc[num40].Center, 1, 1))
{
array[num37] = num40;
num37++;
if (num37 >= 9)
{
break;
}
}
}
}
if (num37 > 0)
{
num37 = Main.rand.Next(num37);
Vector2 value4 = Main.npc[array[num37]].Center - base.Center;
float scaleFactor = this.velocity.Length();
value4.Normalize();
this.velocity = value4 * scaleFactor;
this.netUpdate = true;
}
}
}
else if (this.type == 94 || this.type == 496)
{
if (this.velocity.X != velocity.X)
{
if (Math.Abs(this.velocity.X) < 1f)
{
this.velocity.X = -velocity.X;
}
else
{
this.Kill();
}
}
if (this.velocity.Y != velocity.Y)
{
if (Math.Abs(this.velocity.Y) < 1f)
{
this.velocity.Y = -velocity.Y;
}
else
{
this.Kill();
}
}
}
else if (this.type == 311)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
this.ai[1] += 1f;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
this.ai[1] += 1f;
}
if (this.ai[1] > 4f)
{
this.Kill();
}
}
else if (this.type == 312)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
this.ai[1] += 1f;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
this.ai[1] += 1f;
}
}
else if (this.type == 522 || this.type == 620)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else if (this.type == 524)
{
this.ai[0] += 100f;
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else if (this.aiStyle == 93)
{
if (this.velocity != velocity)
{
this.ai[1] = 0f;
this.ai[0] = 1f;
this.netUpdate = true;
this.tileCollide = false;
this.position += this.velocity;
this.velocity = velocity;
this.velocity.Normalize();
this.velocity *= 3f;
}
}
else if (this.type == 281)
{
float num42 = Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y);
if (num42 < 2f || this.ai[1] == 2f)
{
this.ai[1] = 2f;
}
else
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X * 0.5f;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y * 0.5f;
}
}
}
else if (this.type == 290 || this.type == 294)
{
if (this.velocity.X != velocity.X)
{
this.position.X = this.position.X + this.velocity.X;
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.position.Y = this.position.Y + this.velocity.Y;
this.velocity.Y = -velocity.Y;
}
}
else if ((this.type == 181 || this.type == 189 || this.type == 357 || this.type == 566) && this.penetrate > 0)
{
if (this.type == 357)
{
this.damage = (int)((double)this.damage * 0.9);
}
this.penetrate--;
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else if (this.type == 307 && this.ai[1] < 5f)
{
this.ai[1] += 1f;
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else if (this.type == 99)
{
if (this.velocity.Y != velocity.Y && velocity.Y > 5f)
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
this.velocity.Y = -velocity.Y * 0.2f;
}
if (this.velocity.X != velocity.X)
{
this.Kill();
}
}
else if (this.type == 36)
{
if (this.penetrate > 1)
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
this.penetrate--;
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else
{
this.Kill();
}
}
else if (this.aiStyle == 21)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else if (this.aiStyle == 17)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.75f;
}
if (this.velocity.Y != velocity.Y && (double)velocity.Y > 1.5)
{
this.velocity.Y = velocity.Y * -0.7f;
}
}
else if (this.aiStyle == 15)
{
bool flag9 = false;
if (velocity.X != this.velocity.X)
{
if (Math.Abs(velocity.X) > 4f)
{
flag9 = true;
}
this.position.X = this.position.X + this.velocity.X;
this.velocity.X = -velocity.X * 0.2f;
}
if (velocity.Y != this.velocity.Y)
{
if (Math.Abs(velocity.Y) > 4f)
{
flag9 = true;
}
this.position.Y = this.position.Y + this.velocity.Y;
this.velocity.Y = -velocity.Y * 0.2f;
}
this.ai[0] = 1f;
if (flag9)
{
this.netUpdate = true;
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
}
if (this.wet)
{
value = this.velocity;
}
}
else if (this.aiStyle == 39)
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
if (this.type == 33 || this.type == 106)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else
{
this.ai[0] = 1f;
if (this.aiStyle == 3)
{
this.velocity.X = -velocity.X;
this.velocity.Y = -velocity.Y;
}
}
this.netUpdate = true;
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
}
else if (this.aiStyle == 3 || this.aiStyle == 13 || this.aiStyle == 69 || this.aiStyle == 109)
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
if (this.type == 33 || this.type == 106)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
}
else
{
this.ai[0] = 1f;
if ((this.aiStyle == 3 || this.aiStyle == 109) && this.type != 383)
{
this.velocity.X = -velocity.X;
this.velocity.Y = -velocity.Y;
}
}
this.netUpdate = true;
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
}
else if (this.aiStyle == 8 && this.type != 96)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
this.ai[0] += 1f;
if ((this.ai[0] >= 5f && this.type != 253) || (this.type == 253 && this.ai[0] >= 8f))
{
this.position += this.velocity;
this.Kill();
}
else
{
if (this.type == 15 && this.velocity.Y > 4f)
{
if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y * 0.8f;
}
}
else if (this.velocity.Y != velocity.Y)
{
this.velocity.Y = -velocity.Y;
}
if (this.velocity.X != velocity.X)
{
this.velocity.X = -velocity.X;
}
}
}
else if (this.aiStyle == 61)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.3f;
}
if (this.velocity.Y != velocity.Y && velocity.Y > 1f)
{
this.velocity.Y = velocity.Y * -0.3f;
}
}
else if (this.aiStyle == 14)
{
if (this.type == 261 && ((this.velocity.X != velocity.X && (velocity.X < -3f || velocity.X > 3f)) || (this.velocity.Y != velocity.Y && (velocity.Y < -3f || velocity.Y > 3f))))
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
Main.PlaySound(0, (int)base.Center.X, (int)base.Center.Y, 1);
}
if (this.type >= 326 && this.type <= 328 && this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.1f;
}
if (this.type >= 400 && this.type <= 402)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.1f;
}
}
else if (this.type == 50)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.2f;
}
if (this.velocity.Y != velocity.Y && (double)velocity.Y > 1.5)
{
this.velocity.Y = velocity.Y * -0.2f;
}
}
else if (this.type == 185)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.9f;
}
if (this.velocity.Y != velocity.Y && velocity.Y > 1f)
{
this.velocity.Y = velocity.Y * -0.9f;
}
}
else if (this.type == 277)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.9f;
}
if (this.velocity.Y != velocity.Y && velocity.Y > 3f)
{
this.velocity.Y = velocity.Y * -0.9f;
}
}
else if (this.type != 480)
{
if (this.type == 450)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.1f;
}
}
else
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.5f;
}
if (this.velocity.Y != velocity.Y && velocity.Y > 1f)
{
this.velocity.Y = velocity.Y * -0.5f;
}
}
}
}
else if (this.aiStyle == 16)
{
if (this.velocity.X != velocity.X)
{
this.velocity.X = velocity.X * -0.4f;
if (this.type == 29)
{
this.velocity.X = this.velocity.X * 0.8f;
}
}
if (this.velocity.Y != velocity.Y && (double)velocity.Y > 0.7 && this.type != 102)
{
this.velocity.Y = velocity.Y * -0.4f;
if (this.type == 29)
{
this.velocity.Y = this.velocity.Y * 0.8f;
}
}
if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303 || (this.type >= 338 && this.type <= 341))
{
this.velocity *= 0f;
this.alpha = 255;
this.timeLeft = 3;
}
}
else if (this.aiStyle == 68)
{
this.velocity *= 0f;
this.alpha = 255;
this.timeLeft = 3;
}
else if (this.aiStyle != 9 || this.owner == Main.myPlayer)
{
this.position += this.velocity;
this.Kill();
}
}
}
}
}
if (this.aiStyle != 4 && this.aiStyle != 38 && this.aiStyle != 84 && (this.aiStyle != 7 || this.ai[0] != 2f) && ((this.type != 440 && this.type != 449 && this.type != 606) || this.ai[1] != 1f) && (this.aiStyle != 93 || this.ai[0] >= 0f) && this.type != 540)
{
if (this.wet)
{
this.position += value;
}
else
{
this.position += this.velocity;
}
if (Main.projPet[this.type] && this.tileCollide)
{
Vector4 vector3 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, 0f, false);
this.position.X = vector3.X;
this.position.Y = vector3.Y;
this.velocity.X = vector3.Z;
this.velocity.Y = vector3.W;
}
}
if ((this.aiStyle != 3 || this.ai[0] != 1f) && (this.aiStyle != 7 || this.ai[0] != 1f) && (this.aiStyle != 13 || this.ai[0] != 1f) && this.aiStyle != 65 && this.aiStyle != 69 && this.aiStyle != 114 && this.aiStyle != 123 && this.aiStyle != 112 && !this.manualDirectionChange && this.aiStyle != 67 && this.aiStyle != 26 && this.aiStyle != 15)
{
if (this.velocity.X < 0f)
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
if (this.active)
{
this.ProjLight();
if (!this.npcProj && this.friendly && Main.player[this.owner].magicQuiver && this.extraUpdates < 1 && this.arrow)
{
this.extraUpdates = 1;
}
if (this.type == 2 || this.type == 82)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
}
else if (this.type == 172)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f);
}
else if (this.type == 103)
{
int num43 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, 0f, 0f, 100, default(Color), 1f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num43].noGravity = true;
Main.dust[num43].scale *= 2f;
}
}
else if (this.type == 278)
{
int num44 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 169, 0f, 0f, 100, default(Color), 1f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num44].noGravity = true;
Main.dust[num44].scale *= 1.5f;
}
}
else if (this.type == 4)
{
if (Main.rand.Next(5) == 0)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.1f);
}
}
else if (this.type == 5)
{
int num45 = Main.rand.Next(3);
if (num45 == 0)
{
num45 = 15;
}
else if (num45 == 1)
{
num45 = 57;
}
else
{
num45 = 58;
}
Dust.NewDust(this.position, this.width, this.height, num45, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f);
}
this.Damage();
if (this.type == 434 && this.localAI[0] == 0f && this.numUpdates == 0)
{
this.extraUpdates = 1;
this.velocity = Vector2.Zero;
this.localAI[0] = 1f;
this.localAI[1] = 0.9999f;
this.netUpdate = true;
}
if (Main.netMode != 1 && this.type == 99)
{
Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 3);
}
if (ProjectileID.Sets.TrailingMode[this.type] == 0)
{
for (int num46 = this.oldPos.Length - 1; num46 > 0; num46--)
{
this.oldPos[num46] = this.oldPos[num46 - 1];
}
this.oldPos[0] = this.position;
}
else if (ProjectileID.Sets.TrailingMode[this.type] == 1)
{
if (this.frameCounter == 0 || this.oldPos[0] == Vector2.Zero)
{
for (int num47 = this.oldPos.Length - 1; num47 > 0; num47--)
{
this.oldPos[num47] = this.oldPos[num47 - 1];
}
this.oldPos[0] = this.position;
if (this.velocity == Vector2.Zero && this.type == 466)
{
float num48 = this.rotation + 1.57079637f + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num49 = (float)Main.rand.NextDouble() * 2f + 2f;
Vector2 vector4 = new Vector2((float)Math.Cos((double)num48) * num49, (float)Math.Sin((double)num48) * num49);
int num50 = Dust.NewDust(this.oldPos[this.oldPos.Length - 1], 0, 0, 229, vector4.X, vector4.Y, 0, default(Color), 1f);
Main.dust[num50].noGravity = true;
Main.dust[num50].scale = 1.7f;
}
if (this.velocity == Vector2.Zero && this.type == 580)
{
float num51 = this.rotation + 1.57079637f + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num52 = (float)Main.rand.NextDouble() * 2f + 2f;
Vector2 vector5 = new Vector2((float)Math.Cos((double)num51) * num52, (float)Math.Sin((double)num51) * num52);
int num53 = Dust.NewDust(this.oldPos[this.oldPos.Length - 1], 0, 0, 229, vector5.X, vector5.Y, 0, default(Color), 1f);
Main.dust[num53].noGravity = true;
Main.dust[num53].scale = 1.7f;
}
}
}
else if (ProjectileID.Sets.TrailingMode[this.type] == 2)
{
for (int num54 = this.oldPos.Length - 1; num54 > 0; num54--)
{
this.oldPos[num54] = this.oldPos[num54 - 1];
this.oldRot[num54] = this.oldRot[num54 - 1];
this.oldSpriteDirection[num54] = this.oldSpriteDirection[num54 - 1];
}
this.oldPos[0] = this.position;
this.oldRot[0] = this.rotation;
this.oldSpriteDirection[0] = this.spriteDirection;
}
this.timeLeft--;
if (this.timeLeft <= 0)
{
this.Kill();
}
if (this.penetrate == 0)
{
this.Kill();
}
if (!this.active || this.owner != Main.myPlayer)
{
continue;
}
if (this.netUpdate2)
{
this.netUpdate = true;
}
if (!this.active)
{
this.netSpam = 0;
}
if (this.netUpdate)
{
if (this.netSpam < 60)
{
this.netSpam += 5;
NetMessage.SendData(27, -1, -1, "", i, 0f, 0f, 0f, 0, 0, 0);
this.netUpdate2 = false;
}
else
{
this.netUpdate2 = true;
}
}
if (this.netSpam > 0)
{
this.netSpam--;
continue;
}
continue;
}
return;
}
}
this.netUpdate = false;
}
public void FishingCheck()
{
int num = (int)(base.Center.X / 16f);
int num2 = (int)(base.Center.Y / 16f);
if (Main.tile[num, num2].liquid < 0)
{
num2++;
}
bool flag = false;
bool flag2 = false;
int num3 = num;
int num4 = num;
while (num3 > 10 && Main.tile[num3, num2].liquid > 0)
{
if (WorldGen.SolidTile(num3, num2))
{
break;
}
num3--;
}
while (num4 < Main.maxTilesX - 10 && Main.tile[num4, num2].liquid > 0 && !WorldGen.SolidTile(num4, num2))
{
num4++;
}
int num5 = 0;
for (int i = num3; i <= num4; i++)
{
int num6 = num2;
while (Main.tile[i, num6].liquid > 0 && !WorldGen.SolidTile(i, num6) && num6 < Main.maxTilesY - 10)
{
num5++;
num6++;
if (Main.tile[i, num6].lava())
{
flag = true;
}
else if (Main.tile[i, num6].honey())
{
flag2 = true;
}
}
}
if (flag2)
{
num5 = (int)((double)num5 * 1.5);
}
if (num5 < 75)
{
Main.player[this.owner].displayedFishingInfo = "Not Enough Water!";
return;
}
int num7 = Main.player[this.owner].FishingLevel();
if (num7 == 0)
{
return;
}
Main.player[this.owner].displayedFishingInfo = num7 + " Fishing Power";
if (num7 < 0)
{
if (num7 == -1)
{
Main.player[this.owner].displayedFishingInfo = "Warning!";
if ((num < 380 || num > Main.maxTilesX - 380) && num5 > 1000 && !NPC.AnyNPCs(370))
{
this.ai[1] = (float)(Main.rand.Next(-180, -60) - 100);
this.localAI[1] = (float)num7;
this.netUpdate = true;
}
}
return;
}
int num8 = 300;
float num9 = (float)(Main.maxTilesX / 4200);
num9 *= num9;
float num10 = (float)((double)(this.position.Y / 16f - (60f + 10f * num9)) / (Main.worldSurface / 6.0));
if ((double)num10 < 0.25)
{
num10 = 0.25f;
}
if (num10 > 1f)
{
num10 = 1f;
}
num8 = (int)((float)num8 * num10);
float num11 = (float)num5 / (float)num8;
if (num11 < 1f)
{
num7 = (int)((float)num7 * num11);
}
num11 = 1f - num11;
if (num5 < num8)
{
Main.player[this.owner].displayedFishingInfo = string.Concat(new object[]
{
num7,
" (",
-Math.Round((double)(num11 * 100f)),
"%) Fishing Power"
});
}
int num12 = (num7 + 75) / 2;
if (Main.player[this.owner].wet)
{
return;
}
if (Main.rand.Next(100) > num12)
{
return;
}
int num13 = 0;
int num14;
if ((double)num2 < Main.worldSurface * 0.5)
{
num14 = 0;
}
else if ((double)num2 < Main.worldSurface)
{
num14 = 1;
}
else if ((double)num2 < Main.rockLayer)
{
num14 = 2;
}
else if (num2 < Main.maxTilesY - 300)
{
num14 = 3;
}
else
{
num14 = 4;
}
int num15 = 150;
int num16 = num15 / num7;
int num17 = num15 * 2 / num7;
int num18 = num15 * 7 / num7;
int num19 = num15 * 15 / num7;
int num20 = num15 * 30 / num7;
if (num16 < 2)
{
num16 = 2;
}
if (num17 < 3)
{
num17 = 3;
}
if (num18 < 4)
{
num18 = 4;
}
if (num19 < 5)
{
num19 = 5;
}
if (num20 < 6)
{
num20 = 6;
}
bool flag3 = false;
bool flag4 = false;
bool flag5 = false;
bool flag6 = false;
bool flag7 = false;
if (Main.rand.Next(num16) == 0)
{
flag3 = true;
}
if (Main.rand.Next(num17) == 0)
{
flag4 = true;
}
if (Main.rand.Next(num18) == 0)
{
flag5 = true;
}
if (Main.rand.Next(num19) == 0)
{
flag6 = true;
}
if (Main.rand.Next(num20) == 0)
{
flag7 = true;
}
int num21 = 10;
if (Main.player[this.owner].cratePotion)
{
num21 += 10;
}
int num22 = Main.anglerQuestItemNetIDs[Main.anglerQuest];
if (Main.player[this.owner].HasItem(num22))
{
num22 = -1;
}
if (Main.anglerQuestFinished)
{
num22 = -1;
}
if (flag)
{
if (Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].type != 2422)
{
return;
}
if (flag7)
{
num13 = 2331;
}
else if (flag6)
{
num13 = 2312;
}
else if (flag5)
{
num13 = 2315;
}
}
else if (flag2)
{
if (flag5 || (flag4 && Main.rand.Next(2) == 0))
{
num13 = 2314;
}
else if (flag4 && num22 == 2451)
{
num13 = 2451;
}
}
else if (Main.rand.Next(50) > num7 && Main.rand.Next(50) > num7 && num5 < num8)
{
num13 = Main.rand.Next(2337, 2340);
}
else if (Main.rand.Next(100) < num21)
{
if (flag6 || flag7)
{
num13 = 2336;
}
else if (flag5 && Main.player[this.owner].ZoneCorrupt)
{
num13 = 3203;
}
else if (flag5 && Main.player[this.owner].ZoneCrimson)
{
num13 = 3204;
}
else if (flag5 && Main.player[this.owner].ZoneHoly)
{
num13 = 3207;
}
else if (flag5 && Main.player[this.owner].ZoneDungeon)
{
num13 = 3205;
}
else if (flag5 && Main.player[this.owner].ZoneJungle)
{
num13 = 3208;
}
else if (flag5 && num14 == 0)
{
num13 = 3206;
}
else if (flag4)
{
num13 = 2335;
}
else
{
num13 = 2334;
}
}
else if (flag7 && Main.rand.Next(5) == 0)
{
num13 = 2423;
}
else if (flag7 && Main.rand.Next(5) == 0)
{
num13 = 3225;
}
else if (flag7 && Main.rand.Next(10) == 0)
{
num13 = 2420;
}
else if (!flag7 && !flag6 && flag4 && Main.rand.Next(5) == 0)
{
num13 = 3196;
}
else
{
bool flag8 = Main.player[this.owner].ZoneCorrupt;
bool flag9 = Main.player[this.owner].ZoneCrimson;
if (flag8 && flag9)
{
if (Main.rand.Next(2) == 0)
{
flag9 = false;
}
else
{
flag8 = false;
}
}
if (flag8)
{
if (flag7 && Main.hardMode && Main.player[this.owner].ZoneSnow && num14 == 3 && Main.rand.Next(3) != 0)
{
num13 = 2429;
}
else if (flag7 && Main.hardMode && Main.rand.Next(2) == 0)
{
num13 = 3210;
}
else if (flag5)
{
num13 = 2330;
}
else if (flag4 && num22 == 2454)
{
num13 = 2454;
}
else if (flag4 && num22 == 2485)
{
num13 = 2485;
}
else if (flag4 && num22 == 2457)
{
num13 = 2457;
}
else if (flag4)
{
num13 = 2318;
}
}
else if (flag9)
{
if (flag7 && Main.hardMode && Main.player[this.owner].ZoneSnow && num14 == 3 && Main.rand.Next(3) != 0)
{
num13 = 2429;
}
else if (flag7 && Main.hardMode && Main.rand.Next(2) == 0)
{
num13 = 3211;
}
else if (flag4 && num22 == 2477)
{
num13 = 2477;
}
else if (flag4 && num22 == 2463)
{
num13 = 2463;
}
else if (flag4)
{
num13 = 2319;
}
else if (flag3)
{
num13 = 2305;
}
}
else if (Main.player[this.owner].ZoneHoly)
{
if (flag7 && Main.hardMode && Main.player[this.owner].ZoneSnow && num14 == 3 && Main.rand.Next(3) != 0)
{
num13 = 2429;
}
else if (flag7 && Main.hardMode && Main.rand.Next(2) == 0)
{
num13 = 3209;
}
else if (num14 > 1 && flag6)
{
num13 = 2317;
}
else if (num14 > 1 && flag5 && num22 == 2465)
{
num13 = 2465;
}
else if (num14 < 2 && flag5 && num22 == 2468)
{
num13 = 2468;
}
else if (flag5)
{
num13 = 2310;
}
else if (flag4 && num22 == 2471)
{
num13 = 2471;
}
else if (flag4)
{
num13 = 2307;
}
}
if (num13 == 0 && Main.player[this.owner].ZoneSnow)
{
if (num14 < 2 && flag4 && num22 == 2467)
{
num13 = 2467;
}
else if (num14 == 1 && flag4 && num22 == 2470)
{
num13 = 2470;
}
else if (num14 >= 2 && flag4 && num22 == 2484)
{
num13 = 2484;
}
else if (num14 > 1 && flag4 && num22 == 2466)
{
num13 = 2466;
}
else if ((flag3 && Main.rand.Next(12) == 0) || (flag4 && Main.rand.Next(6) == 0))
{
num13 = 3197;
}
else if (flag4)
{
num13 = 2306;
}
else if (flag3)
{
num13 = 2299;
}
else if (num14 > 1 && Main.rand.Next(3) == 0)
{
num13 = 2309;
}
}
if (num13 == 0 && Main.player[this.owner].ZoneJungle)
{
if (Main.hardMode && flag7 && Main.rand.Next(2) == 0)
{
num13 = 3018;
}
else if (num14 == 1 && flag4 && num22 == 2452)
{
num13 = 2452;
}
else if (num14 == 1 && flag4 && num22 == 2483)
{
num13 = 2483;
}
else if (num14 == 1 && flag4 && num22 == 2488)
{
num13 = 2488;
}
else if (num14 >= 1 && flag4 && num22 == 2486)
{
num13 = 2486;
}
else if (num14 > 1 && flag4)
{
num13 = 2311;
}
else if (flag4)
{
num13 = 2313;
}
else if (flag3)
{
num13 = 2302;
}
}
if (num13 == 0 && Main.shroomTiles > 200 && flag4 && num22 == 2475)
{
num13 = 2475;
}
if (num13 == 0)
{
if (num14 <= 1 && (num < 380 || num > Main.maxTilesX - 380) && num5 > 1000)
{
if (flag6 && Main.rand.Next(2) == 0)
{
num13 = 2341;
}
else if (flag6)
{
num13 = 2342;
}
else if (flag5 && Main.rand.Next(5) == 0)
{
num13 = 2438;
}
else if (flag5 && Main.rand.Next(2) == 0)
{
num13 = 2332;
}
else if (flag4 && num22 == 2480)
{
num13 = 2480;
}
else if (flag4 && num22 == 2481)
{
num13 = 2481;
}
else if (flag4)
{
num13 = 2316;
}
else if (flag3 && Main.rand.Next(2) == 0)
{
num13 = 2301;
}
else if (flag3)
{
num13 = 2300;
}
else
{
num13 = 2297;
}
}
else
{
int arg_CB8_0 = Main.sandTiles;
}
}
if (num13 == 0)
{
if (num14 < 2 && flag4 && num22 == 2461)
{
num13 = 2461;
}
else if (num14 == 0 && flag4 && num22 == 2453)
{
num13 = 2453;
}
else if (num14 == 0 && flag4 && num22 == 2473)
{
num13 = 2473;
}
else if (num14 == 0 && flag4 && num22 == 2476)
{
num13 = 2476;
}
else if (num14 < 2 && flag4 && num22 == 2458)
{
num13 = 2458;
}
else if (num14 < 2 && flag4 && num22 == 2459)
{
num13 = 2459;
}
else if (num14 == 0 && flag4)
{
num13 = 2304;
}
else if (num14 > 0 && num14 < 3 && flag4 && num22 == 2455)
{
num13 = 2455;
}
else if (num14 == 1 && flag4 && num22 == 2479)
{
num13 = 2479;
}
else if (num14 == 1 && flag4 && num22 == 2456)
{
num13 = 2456;
}
else if (num14 == 1 && flag4 && num22 == 2474)
{
num13 = 2474;
}
else if (num14 > 1 && flag5 && Main.rand.Next(5) == 0)
{
if (Main.hardMode && Main.rand.Next(2) == 0)
{
num13 = 2437;
}
else
{
num13 = 2436;
}
}
else if (num14 > 1 && flag7)
{
num13 = 2308;
}
else if (num14 > 1 && flag6 && Main.rand.Next(2) == 0)
{
num13 = 2320;
}
else if (num14 > 1 && flag5)
{
num13 = 2321;
}
else if (num14 > 1 && flag4 && num22 == 2478)
{
num13 = 2478;
}
else if (num14 > 1 && flag4 && num22 == 2450)
{
num13 = 2450;
}
else if (num14 > 1 && flag4 && num22 == 2464)
{
num13 = 2464;
}
else if (num14 > 1 && flag4 && num22 == 2469)
{
num13 = 2469;
}
else if (num14 > 2 && flag4 && num22 == 2462)
{
num13 = 2462;
}
else if (num14 > 2 && flag4 && num22 == 2482)
{
num13 = 2482;
}
else if (num14 > 2 && flag4 && num22 == 2472)
{
num13 = 2472;
}
else if (num14 > 2 && flag4 && num22 == 2460)
{
num13 = 2460;
}
else if (num14 > 1 && flag4 && Main.rand.Next(4) != 0)
{
num13 = 2303;
}
else if (num14 > 1 && (flag4 || flag3 || Main.rand.Next(4) == 0))
{
if (Main.rand.Next(4) == 0)
{
num13 = 2303;
}
else
{
num13 = 2309;
}
}
else if (flag4 && num22 == 2487)
{
num13 = 2487;
}
else if (num5 > 1000 && flag3)
{
num13 = 2298;
}
else
{
num13 = 2290;
}
}
}
if (num13 > 0)
{
if (Main.player[this.owner].sonarPotion)
{
Item item = new Item();
item.SetDefaults(num13, false);
item.position = this.position;
ItemText.NewText(item, 1, true, false);
}
float num23 = (float)num7;
this.ai[1] = (float)Main.rand.Next(-240, -90) - num23;
this.localAI[1] = (float)num13;
this.netUpdate = true;
}
}
public bool CanReflect()
{
return this.active && this.friendly && !this.hostile && this.damage > 0 && (this.aiStyle == 1 || this.aiStyle == 2 || this.aiStyle == 8 || this.aiStyle == 21 || this.aiStyle == 24 || this.aiStyle == 28 || this.aiStyle == 29);
}
public float GetPrismHue(float indexing)
{
string name;
if (Main.player[this.owner].active && (name = Main.player[this.owner].name) != null)
{
if (<PrivateImplementationDetails>{FF94C0A6-BDD1-4BB9-BBC5-0F7901F4FB7F}.$$method0x6000040-1 == null)
{
<PrivateImplementationDetails>{FF94C0A6-BDD1-4BB9-BBC5-0F7901F4FB7F}.$$method0x6000040-1 = new Dictionary<string, int>(9)
{
{
"Tsuki",
0
},
{
"Yoraiz0r",
1
},
{
"Ghostar",
2
},
{
"Devalaous",
3
},
{
"Leinfors",
4
},
{
"Aeroblop",
5
},
{
"Doylee",
6
},
{
"Darkhalis",
7
},
{
"Arkhalis",
8
}
};
}
int num;
if (<PrivateImplementationDetails>{FF94C0A6-BDD1-4BB9-BBC5-0F7901F4FB7F}.$$method0x6000040-1.TryGetValue(name, out num))
{
switch (num)
{
case 0:
case 1:
return 0.85f;
case 2:
return 0.33f;
case 3:
return 0.66f + (float)Math.Cos(Main.time / 180.0 * 6.2831854820251465) * 0.1f;
case 4:
return 0.77f;
case 5:
return 0.25f + (float)Math.Cos(Main.time / 180.0 * 6.2831854820251465) * 0.1f;
case 6:
return 0f;
case 7:
case 8:
return 0.75f + (float)Math.Cos(Main.time / 180.0 * 6.2831854820251465) * 0.07f;
}
}
}
return (float)((int)indexing) / 6f;
}
public void ProjectileFixDesperation(int own)
{
int num = this.type;
if (num != 461)
{
switch (num)
{
case 626:
case 627:
case 628:
for (int i = 0; i < 1000; i++)
{
if (Main.projectile[i].owner == this.owner && (float)Main.projectile[i].identity == this.ai[0] && Main.projectile[i].active)
{
this.ai[0] = (float)i;
return;
}
}
return;
case 629:
case 630:
case 631:
return;
case 632:
break;
default:
switch (num)
{
case 642:
case 644:
break;
case 643:
return;
default:
return;
}
break;
}
}
for (int j = 0; j < 1000; j++)
{
if (Main.projectile[j].owner == this.owner && (float)Main.projectile[j].identity == this.ai[1] && Main.projectile[j].active)
{
this.ai[1] = (float)j;
return;
}
}
}
public void AI()
{
if (this.aiStyle == 1)
{
this.AI_001();
return;
}
if (this.aiStyle == 2)
{
if (this.type == 93 && Main.rand.Next(5) == 0)
{
int num = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 0.3f);
Dust expr_A0_cp_0 = Main.dust[num];
expr_A0_cp_0.velocity.X = expr_A0_cp_0.velocity.X * 0.3f;
Dust expr_BD_cp_0 = Main.dust[num];
expr_BD_cp_0.velocity.Y = expr_BD_cp_0.velocity.Y * 0.3f;
}
if (this.type == 304 && this.localAI[0] == 0f)
{
this.localAI[0] += 1f;
this.alpha = 0;
}
if (this.type == 335)
{
this.frame = (int)this.ai[1];
}
if (this.type == 510)
{
this.rotation += Math.Abs(this.velocity.X) * 0.04f * (float)this.direction;
}
else
{
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.03f * (float)this.direction;
}
if (this.type == 162)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
}
this.ai[0] += 1f;
if (this.ai[0] >= 18f)
{
this.velocity.Y = this.velocity.Y + 0.28f;
this.velocity.X = this.velocity.X * 0.99f;
}
if (this.ai[0] > 2f)
{
this.alpha = 0;
if (this.ai[0] == 3f)
{
for (int i = 0; i < 10; i++)
{
int num2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num2].velocity *= 0.5f;
Main.dust[num2].velocity += this.velocity * 0.1f;
}
for (int j = 0; j < 5; j++)
{
int num3 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num3].noGravity = true;
Main.dust[num3].velocity *= 3f;
Main.dust[num3].velocity += this.velocity * 0.2f;
num3 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num3].velocity *= 2f;
Main.dust[num3].velocity += this.velocity * 0.3f;
}
for (int k = 0; k < 1; k++)
{
int num4 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num4].position += this.velocity * 1.25f;
Main.gore[num4].scale = 1.5f;
Main.gore[num4].velocity += this.velocity * 0.5f;
Main.gore[num4].velocity *= 0.02f;
}
}
}
}
else if (this.type == 281)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
}
this.ai[0] += 1f;
if (this.ai[0] >= 18f)
{
this.velocity.Y = this.velocity.Y + 0.28f;
this.velocity.X = this.velocity.X * 0.99f;
}
if (this.ai[0] > 2f)
{
this.alpha = 0;
if (this.ai[0] == 3f)
{
for (int l = 0; l < 10; l++)
{
int num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num5].velocity *= 0.5f;
Main.dust[num5].velocity += this.velocity * 0.1f;
}
for (int m = 0; m < 5; m++)
{
int num6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num6].noGravity = true;
Main.dust[num6].velocity *= 3f;
Main.dust[num6].velocity += this.velocity * 0.2f;
num6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num6].velocity *= 2f;
Main.dust[num6].velocity += this.velocity * 0.3f;
}
for (int n = 0; n < 1; n++)
{
int num7 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num7].position += this.velocity * 1.25f;
Main.gore[num7].scale = 1.5f;
Main.gore[num7].velocity += this.velocity * 0.5f;
Main.gore[num7].velocity *= 0.02f;
}
}
}
}
else if (this.type == 240)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
}
this.ai[0] += 1f;
if (this.ai[0] >= 16f)
{
this.velocity.Y = this.velocity.Y + 0.18f;
this.velocity.X = this.velocity.X * 0.991f;
}
if (this.ai[0] > 2f)
{
this.alpha = 0;
if (this.ai[0] == 3f)
{
for (int num8 = 0; num8 < 7; num8++)
{
int num9 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num9].velocity *= 0.5f;
Main.dust[num9].velocity += this.velocity * 0.1f;
}
for (int num10 = 0; num10 < 3; num10++)
{
int num11 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num11].noGravity = true;
Main.dust[num11].velocity *= 3f;
Main.dust[num11].velocity += this.velocity * 0.2f;
num11 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num11].velocity *= 2f;
Main.dust[num11].velocity += this.velocity * 0.3f;
}
for (int num12 = 0; num12 < 1; num12++)
{
int num13 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num13].position += this.velocity * 1.25f;
Main.gore[num13].scale = 1.25f;
Main.gore[num13].velocity += this.velocity * 0.5f;
Main.gore[num13].velocity *= 0.02f;
}
}
}
}
if (this.type == 497)
{
int num14 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num14].position = (Main.dust[num14].position + base.Center) / 2f;
Main.dust[num14].noGravity = true;
Main.dust[num14].velocity *= 0.3f;
Main.dust[num14].velocity -= this.velocity * 0.1f;
this.ai[0] += 1f;
if (this.ai[0] >= 30f)
{
this.velocity.X = this.velocity.X * 0.99f;
this.velocity.Y = this.velocity.Y + 0.5f;
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
}
else if (this.type == 249)
{
this.ai[0] += 1f;
if (this.ai[0] >= 0f)
{
this.velocity.Y = this.velocity.Y + 0.25f;
}
}
else if (this.type == 347)
{
this.ai[0] += 1f;
if (this.ai[0] >= 5f)
{
this.velocity.Y = this.velocity.Y + 0.25f;
}
}
else if (this.type == 501)
{
this.ai[0] += 1f;
if (this.ai[0] >= 18f)
{
this.velocity.X = this.velocity.X * 0.995f;
this.velocity.Y = this.velocity.Y + 0.2f;
}
}
else if (this.type == 504)
{
this.alpha = 255;
this.ai[0] += 1f;
if (this.ai[0] > 3f)
{
int num15 = 100;
if (this.ai[0] > 20f)
{
int num16 = 40;
float num17 = this.ai[0] - 20f;
num15 = (int)(100f * (1f - num17 / (float)num16));
if (num17 >= (float)num16)
{
this.Kill();
}
}
if (this.ai[0] <= 10f)
{
num15 = (int)this.ai[0] * 10;
}
if (Main.rand.Next(100) < num15)
{
int num18 = Dust.NewDust(this.position, this.width, this.height, 6, 0f, 0f, 150, default(Color), 1f);
Main.dust[num18].position = (Main.dust[num18].position + base.Center) / 2f;
Main.dust[num18].noGravity = true;
Main.dust[num18].velocity *= 2f;
Main.dust[num18].scale *= 1.2f;
Main.dust[num18].velocity += this.velocity;
}
}
if (this.ai[0] >= 20f)
{
this.velocity.X = this.velocity.X * 0.99f;
this.velocity.Y = this.velocity.Y + 0.1f;
}
}
else if (this.type == 69 || this.type == 70 || this.type == 621)
{
this.ai[0] += 1f;
if (this.ai[0] >= 10f)
{
this.velocity.Y = this.velocity.Y + 0.25f;
this.velocity.X = this.velocity.X * 0.99f;
}
}
else if (this.type == 166)
{
this.ai[0] += 1f;
if (this.ai[0] >= 20f)
{
this.velocity.Y = this.velocity.Y + 0.3f;
this.velocity.X = this.velocity.X * 0.98f;
}
}
else if (this.type == 300)
{
if (this.ai[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 1);
}
this.ai[0] += 1f;
if (this.ai[0] >= 60f)
{
this.velocity.Y = this.velocity.Y + 0.2f;
this.velocity.X = this.velocity.X * 0.99f;
}
}
else if (this.type == 306)
{
if (this.alpha <= 200)
{
for (int num19 = 0; num19 < 4; num19++)
{
float num20 = this.velocity.X / 4f * (float)num19;
float num21 = this.velocity.Y / 4f * (float)num19;
int num22 = Dust.NewDust(this.position, this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f);
Main.dust[num22].position.X = base.Center.X - num20;
Main.dust[num22].position.Y = base.Center.Y - num21;
Main.dust[num22].velocity *= 0f;
Main.dust[num22].scale = 0.7f;
}
}
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 0.785f;
}
else if (this.type == 304)
{
this.ai[0] += 1f;
if (this.ai[0] >= 30f)
{
this.alpha += 10;
this.damage = (int)((double)this.damage * 0.9);
this.knockBack = (float)((int)((double)this.knockBack * 0.9));
if (this.alpha >= 255)
{
this.active = false;
}
}
if (this.ai[0] < 30f)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
}
else if (this.type == 370 || this.type == 371)
{
this.ai[0] += 1f;
if (this.ai[0] >= 15f)
{
this.velocity.Y = this.velocity.Y + 0.3f;
this.velocity.X = this.velocity.X * 0.98f;
}
}
else
{
this.ai[0] += 1f;
if (this.ai[0] >= 20f)
{
this.velocity.Y = this.velocity.Y + 0.4f;
this.velocity.X = this.velocity.X * 0.97f;
}
else if (this.type == 48 || this.type == 54 || this.type == 93 || this.type == 520 || this.type == 599)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
if (this.type == 54 && Main.rand.Next(20) == 0)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 0.75f);
return;
}
}
else if (this.aiStyle == 3)
{
if (this.soundDelay == 0 && this.type != 383)
{
this.soundDelay = 8;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 7);
}
if (this.type == 19)
{
for (int num23 = 0; num23 < 2; num23++)
{
int num24 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num24].noGravity = true;
Dust expr_1788_cp_0 = Main.dust[num24];
expr_1788_cp_0.velocity.X = expr_1788_cp_0.velocity.X * 0.3f;
Dust expr_17A6_cp_0 = Main.dust[num24];
expr_17A6_cp_0.velocity.Y = expr_17A6_cp_0.velocity.Y * 0.3f;
}
}
else if (this.type == 33)
{
if (Main.rand.Next(1) == 0)
{
int num25 = Dust.NewDust(this.position, this.width, this.height, 40, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 0, default(Color), 1.4f);
Main.dust[num25].noGravity = true;
}
}
else if (this.type == 320)
{
if (Main.rand.Next(3) == 0)
{
int num26 = Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 0, default(Color), 1.1f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num26].scale = 0.9f;
Main.dust[num26].velocity *= 0.2f;
}
else
{
Main.dust[num26].noGravity = true;
}
}
}
else if (this.type == 6)
{
if (Main.rand.Next(5) == 0)
{
int num27 = Main.rand.Next(3);
if (num27 == 0)
{
num27 = 15;
}
else if (num27 == 1)
{
num27 = 57;
}
else
{
num27 = 58;
}
Dust.NewDust(this.position, this.width, this.height, num27, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 150, default(Color), 0.7f);
}
}
else if (this.type == 113 && Main.rand.Next(1) == 0)
{
int num28 = Dust.NewDust(this.position, this.width, this.height, 76, this.velocity.X * 0.15f, this.velocity.Y * 0.15f, 0, default(Color), 1.1f);
Main.dust[num28].noGravity = true;
Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.05f, this.velocity.Y * 0.05f, 150, default(Color), 0.6f);
}
if (this.ai[0] == 0f)
{
this.ai[1] += 1f;
if (this.type == 106 && this.ai[1] >= 45f)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
this.netUpdate = true;
}
if (this.type == 320 || this.type == 383)
{
if (this.ai[1] >= 10f)
{
this.velocity.Y = this.velocity.Y + 0.5f;
if (this.type == 383 && this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + 0.35f;
}
this.velocity.X = this.velocity.X * 0.95f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
if (this.type == 383 && Vector2.Distance(base.Center, Main.player[this.owner].Center) > 800f)
{
this.ai[0] = 1f;
}
}
}
else if (this.type == 182)
{
if (Main.rand.Next(2) == 0)
{
int num29 = Dust.NewDust(this.position, this.width, this.height, 57, 0f, 0f, 255, default(Color), 0.75f);
Main.dust[num29].velocity *= 0.1f;
Main.dust[num29].noGravity = true;
}
if (this.velocity.X > 0f)
{
this.spriteDirection = 1;
}
else if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
}
float num30 = this.position.X;
float num31 = this.position.Y;
bool flag = false;
if (this.ai[1] > 10f)
{
for (int num32 = 0; num32 < 200; num32++)
{
if (Main.npc[num32].CanBeChasedBy(this, false))
{
float num33 = Main.npc[num32].position.X + (float)(Main.npc[num32].width / 2);
float num34 = Main.npc[num32].position.Y + (float)(Main.npc[num32].height / 2);
float num35 = Math.Abs(this.position.X + (float)(this.width / 2) - num33) + Math.Abs(this.position.Y + (float)(this.height / 2) - num34);
if (num35 < 800f && Collision.CanHit(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), 1, 1, Main.npc[num32].position, Main.npc[num32].width, Main.npc[num32].height))
{
num30 = num33;
num31 = num34;
flag = true;
}
}
}
}
if (!flag)
{
num30 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f;
num31 = this.position.Y + (float)(this.height / 2) + this.velocity.Y * 100f;
if (this.ai[1] >= 30f)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
this.netUpdate = true;
}
}
float num36 = 12f;
float num37 = 0.25f;
Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num38 = num30 - vector.X;
float num39 = num31 - vector.Y;
float num40 = (float)Math.Sqrt((double)(num38 * num38 + num39 * num39));
num40 = num36 / num40;
num38 *= num40;
num39 *= num40;
if (this.velocity.X < num38)
{
this.velocity.X = this.velocity.X + num37;
if (this.velocity.X < 0f && num38 > 0f)
{
this.velocity.X = this.velocity.X + num37 * 2f;
}
}
else if (this.velocity.X > num38)
{
this.velocity.X = this.velocity.X - num37;
if (this.velocity.X > 0f && num38 < 0f)
{
this.velocity.X = this.velocity.X - num37 * 2f;
}
}
if (this.velocity.Y < num39)
{
this.velocity.Y = this.velocity.Y + num37;
if (this.velocity.Y < 0f && num39 > 0f)
{
this.velocity.Y = this.velocity.Y + num37 * 2f;
}
}
else if (this.velocity.Y > num39)
{
this.velocity.Y = this.velocity.Y - num37;
if (this.velocity.Y > 0f && num39 < 0f)
{
this.velocity.Y = this.velocity.Y - num37 * 2f;
}
}
}
else if (this.type == 301)
{
if (this.ai[1] >= 20f)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
this.netUpdate = true;
}
}
else if (this.ai[1] >= 30f)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
this.netUpdate = true;
}
}
else
{
this.tileCollide = false;
float num41 = 9f;
float num42 = 0.4f;
if (this.type == 19)
{
num41 = 13f;
num42 = 0.6f;
}
else if (this.type == 33)
{
num41 = 15f;
num42 = 0.8f;
}
else if (this.type == 182)
{
num41 = 16f;
num42 = 1.2f;
}
else if (this.type == 106)
{
num41 = 16f;
num42 = 1.2f;
}
else if (this.type == 272)
{
num41 = 15f;
num42 = 1f;
}
else if (this.type == 333)
{
num41 = 12f;
num42 = 0.6f;
}
else if (this.type == 301)
{
num41 = 15f;
num42 = 3f;
}
else if (this.type == 320)
{
num41 = 15f;
num42 = 3f;
}
else if (this.type == 383)
{
num41 = 16f;
num42 = 4f;
}
Vector2 vector2 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num43 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector2.X;
float num44 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector2.Y;
float num45 = (float)Math.Sqrt((double)(num43 * num43 + num44 * num44));
if (num45 > 3000f)
{
this.Kill();
}
num45 = num41 / num45;
num43 *= num45;
num44 *= num45;
if (this.type == 383)
{
Vector2 vector3 = new Vector2(num43, num44) - this.velocity;
if (vector3 != Vector2.Zero)
{
Vector2 value = vector3;
value.Normalize();
this.velocity += value * Math.Min(num42, vector3.Length());
}
}
else
{
if (this.velocity.X < num43)
{
this.velocity.X = this.velocity.X + num42;
if (this.velocity.X < 0f && num43 > 0f)
{
this.velocity.X = this.velocity.X + num42;
}
}
else if (this.velocity.X > num43)
{
this.velocity.X = this.velocity.X - num42;
if (this.velocity.X > 0f && num43 < 0f)
{
this.velocity.X = this.velocity.X - num42;
}
}
if (this.velocity.Y < num44)
{
this.velocity.Y = this.velocity.Y + num42;
if (this.velocity.Y < 0f && num44 > 0f)
{
this.velocity.Y = this.velocity.Y + num42;
}
}
else if (this.velocity.Y > num44)
{
this.velocity.Y = this.velocity.Y - num42;
if (this.velocity.Y > 0f && num44 < 0f)
{
this.velocity.Y = this.velocity.Y - num42;
}
}
}
if (Main.myPlayer == this.owner)
{
Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
Rectangle value2 = new Rectangle((int)Main.player[this.owner].position.X, (int)Main.player[this.owner].position.Y, Main.player[this.owner].width, Main.player[this.owner].height);
if (rectangle.Intersects(value2))
{
this.Kill();
}
}
}
if (this.type == 106)
{
this.rotation += 0.3f * (float)this.direction;
return;
}
if (this.type != 383)
{
this.rotation += 0.4f * (float)this.direction;
return;
}
if (this.ai[0] == 0f)
{
Vector2 velocity = this.velocity;
velocity.Normalize();
this.rotation = (float)Math.Atan2((double)velocity.Y, (double)velocity.X) + 1.57f;
return;
}
Vector2 vector4 = base.Center - Main.player[this.owner].Center;
vector4.Normalize();
this.rotation = (float)Math.Atan2((double)vector4.Y, (double)vector4.X) + 1.57f;
return;
}
else if (this.aiStyle == 4)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
if (this.ai[0] == 0f)
{
if (this.type >= 150 && this.type <= 152 && this.ai[1] == 0f && this.alpha == 255 && Main.rand.Next(2) == 0)
{
this.type++;
this.netUpdate = true;
}
this.alpha -= 50;
if (this.type >= 150 && this.type <= 152)
{
this.alpha -= 25;
}
else if (this.type == 493 || this.type == 494)
{
this.alpha -= 50;
}
if (this.alpha <= 0)
{
this.alpha = 0;
this.ai[0] = 1f;
if (this.ai[1] == 0f)
{
this.ai[1] += 1f;
this.position += this.velocity * 1f;
}
if (this.type == 7 && Main.myPlayer == this.owner)
{
int num46 = this.type;
if (this.ai[1] >= 6f)
{
num46++;
}
int num47 = Projectile.NewProjectile(this.position.X + this.velocity.X + (float)(this.width / 2), this.position.Y + this.velocity.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, num46, this.damage, this.knockBack, this.owner, 0f, 0f);
Main.projectile[num47].damage = this.damage;
Main.projectile[num47].ai[1] = this.ai[1] + 1f;
NetMessage.SendData(27, -1, -1, "", num47, 0f, 0f, 0f, 0, 0, 0);
return;
}
if (this.type == 494 && Main.myPlayer == this.owner)
{
int num48 = this.type;
if (this.ai[1] >= (float)(7 + Main.rand.Next(2)))
{
num48--;
}
int num49 = this.damage;
float num50 = this.knockBack;
if (num48 == 493)
{
num49 = (int)((double)this.damage * 1.25);
num50 = this.knockBack * 1.25f;
}
int number = Projectile.NewProjectile(this.position.X + this.velocity.X + (float)(this.width / 2), this.position.Y + this.velocity.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, num48, num49, num50, this.owner, 0f, this.ai[1] + 1f);
NetMessage.SendData(27, -1, -1, "", number, 0f, 0f, 0f, 0, 0, 0);
return;
}
if ((this.type == 150 || this.type == 151) && Main.myPlayer == this.owner)
{
int num51 = this.type;
if (this.type == 150)
{
num51 = 151;
}
else if (this.type == 151)
{
num51 = 150;
}
if (this.ai[1] >= 10f && this.type == 151)
{
num51 = 152;
}
int num52 = Projectile.NewProjectile(this.position.X + this.velocity.X + (float)(this.width / 2), this.position.Y + this.velocity.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, num51, this.damage, this.knockBack, this.owner, 0f, 0f);
Main.projectile[num52].damage = this.damage;
Main.projectile[num52].ai[1] = this.ai[1] + 1f;
NetMessage.SendData(27, -1, -1, "", num52, 0f, 0f, 0f, 0, 0, 0);
return;
}
}
}
else
{
if (this.alpha < 170 && this.alpha + 5 >= 170)
{
if (this.type >= 150 && this.type <= 152)
{
for (int num53 = 0; num53 < 8; num53++)
{
int num54 = Dust.NewDust(this.position, this.width, this.height, 7, this.velocity.X * 0.025f, this.velocity.Y * 0.025f, 200, default(Color), 1.3f);
Main.dust[num54].noGravity = true;
Main.dust[num54].velocity *= 0.5f;
}
}
else if (this.type == 493 || this.type == 494)
{
for (int num55 = 0; num55 < 8; num55++)
{
int num56 = Dust.NewDust(this.position, this.width, this.height, Main.rand.Next(68, 71), this.velocity.X * 0.025f, this.velocity.Y * 0.025f, 200, default(Color), 1.3f);
Main.dust[num56].noGravity = true;
Main.dust[num56].velocity *= 0.5f;
}
}
else
{
for (int num57 = 0; num57 < 3; num57++)
{
Dust.NewDust(this.position, this.width, this.height, 18, this.velocity.X * 0.025f, this.velocity.Y * 0.025f, 170, default(Color), 1.2f);
}
Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, 170, default(Color), 1.1f);
}
}
if (this.type >= 150 && this.type <= 152)
{
this.alpha += 3;
}
else if (this.type == 493 || this.type == 494)
{
this.alpha += 7;
}
else
{
this.alpha += 5;
}
if (this.alpha >= 255)
{
this.Kill();
return;
}
}
}
else if (this.aiStyle == 5)
{
if (this.type == 503)
{
if (base.Center.Y > this.ai[1])
{
this.tileCollide = true;
}
}
else if (this.type == 92)
{
if (this.position.Y > this.ai[1])
{
this.tileCollide = true;
}
}
else
{
if (this.ai[1] == 0f && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[1] = 1f;
this.netUpdate = true;
}
if (this.ai[1] != 0f)
{
this.tileCollide = true;
}
}
if (this.soundDelay == 0)
{
this.soundDelay = 20 + Main.rand.Next(40);
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 9);
}
if (this.type == 503)
{
this.alpha -= 15;
int num58 = 150;
if (base.Center.Y >= this.ai[1])
{
num58 = 0;
}
if (this.alpha < num58)
{
this.alpha = num58;
}
this.localAI[0] += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f * (float)this.direction;
}
else
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
}
this.alpha += (int)(25f * this.localAI[0]);
if (this.alpha > 200)
{
this.alpha = 200;
this.localAI[0] = -1f;
}
if (this.alpha < 0)
{
this.alpha = 0;
this.localAI[0] = 1f;
}
}
if (this.type == 503)
{
this.rotation = this.velocity.ToRotation() - 1.57079637f;
}
else
{
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f * (float)this.direction;
}
if (this.type == 503)
{
if (Main.rand.Next(16) == 0)
{
Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num59 = Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f);
Main.dust[num59].velocity = value3 * 0.66f;
Main.dust[num59].position = base.Center + value3 * 12f;
}
if (Main.rand.Next(48) == 0)
{
int num60 = Gore.NewGore(base.Center, new Vector2(this.velocity.X * 0.2f, this.velocity.Y * 0.2f), 16, 1f);
Main.gore[num60].velocity *= 0.66f;
Main.gore[num60].velocity += this.velocity * 0.3f;
}
}
if (this.ai[1] == 1f || this.type == 92)
{
this.light = 0.9f;
if (Main.rand.Next(10) == 0)
{
Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f);
}
if (Main.rand.Next(20) == 0)
{
Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.2f, this.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f);
return;
}
}
}
else if (this.aiStyle == 6)
{
this.velocity *= 0.95f;
this.ai[0] += 1f;
if (this.ai[0] == 180f)
{
this.Kill();
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
int num61 = 10 + this.type;
if (this.type == 463)
{
num61 = 231;
}
for (int num62 = 0; num62 < 30; num62++)
{
Dust.NewDust(this.position, this.width, this.height, num61, this.velocity.X, this.velocity.Y, 50, default(Color), 1f);
}
}
if (this.type == 10 || this.type == 11 || this.type == 463)
{
int num63 = (int)(this.position.X / 16f) - 1;
int num64 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num65 = (int)(this.position.Y / 16f) - 1;
int num66 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num63 < 0)
{
num63 = 0;
}
if (num64 > Main.maxTilesX)
{
num64 = Main.maxTilesX;
}
if (num65 < 0)
{
num65 = 0;
}
if (num66 > Main.maxTilesY)
{
num66 = Main.maxTilesY;
}
for (int num67 = num63; num67 < num64; num67++)
{
for (int num68 = num65; num68 < num66; num68++)
{
Vector2 vector5;
vector5.X = (float)(num67 * 16);
vector5.Y = (float)(num68 * 16);
if (this.position.X + (float)this.width > vector5.X && this.position.X < vector5.X + 16f && this.position.Y + (float)this.height > vector5.Y && this.position.Y < vector5.Y + 16f && Main.myPlayer == this.owner && Main.tile[num67, num68].active())
{
if (this.type == 10)
{
if (Main.tile[num67, num68].type == 23 || Main.tile[num67, num68].type == 199)
{
Main.tile[num67, num68].type = 2;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 25 || Main.tile[num67, num68].type == 203)
{
Main.tile[num67, num68].type = 1;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 112 || Main.tile[num67, num68].type == 234)
{
Main.tile[num67, num68].type = 53;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 163 || Main.tile[num67, num68].type == 200)
{
Main.tile[num67, num68].type = 161;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 400 || Main.tile[num67, num68].type == 401)
{
Main.tile[num67, num68].type = 396;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 398 || Main.tile[num67, num68].type == 399)
{
Main.tile[num67, num68].type = 397;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
}
else if (this.type == 11 || this.type == 463)
{
if (Main.tile[num67, num68].type == 109)
{
Main.tile[num67, num68].type = 2;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 116)
{
Main.tile[num67, num68].type = 53;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 117)
{
Main.tile[num67, num68].type = 1;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 164)
{
Main.tile[num67, num68].type = 161;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 403)
{
Main.tile[num67, num68].type = 396;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
if (Main.tile[num67, num68].type == 402)
{
Main.tile[num67, num68].type = 397;
WorldGen.SquareTileFrame(num67, num68, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num67, num68, 1);
}
}
}
}
}
}
return;
}
}
else if (this.aiStyle == 7)
{
if (Main.player[this.owner].dead || Main.player[this.owner].stoned || Main.player[this.owner].webbed || Main.player[this.owner].frozen)
{
this.Kill();
return;
}
Vector2 mountedCenter = Main.player[this.owner].MountedCenter;
Vector2 vector6 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num69 = mountedCenter.X - vector6.X;
float num70 = mountedCenter.Y - vector6.Y;
float num71 = (float)Math.Sqrt((double)(num69 * num69 + num70 * num70));
this.rotation = (float)Math.Atan2((double)num70, (double)num69) - 1.57f;
if (this.type == 256)
{
this.rotation = (float)Math.Atan2((double)num70, (double)num69) + 3.92500019f;
}
if (this.type == 446)
{
Lighting.AddLight(mountedCenter, 0f, 0.4f, 0.3f);
this.localAI[0] += 1f;
if (this.localAI[0] >= 28f)
{
this.localAI[0] = 0f;
}
DelegateMethods.v3_1 = new Vector3(0f, 0.4f, 0.3f);
Utils.PlotTileLine(base.Center, mountedCenter, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
}
if (this.type >= 646 && this.type <= 649)
{
Vector3 zero = Vector3.Zero;
switch (this.type)
{
case 646:
zero = new Vector3(0.7f, 0.5f, 0.1f);
break;
case 647:
zero = new Vector3(0f, 0.6f, 0.7f);
break;
case 648:
zero = new Vector3(0.6f, 0.2f, 0.6f);
break;
case 649:
zero = new Vector3(0.6f, 0.6f, 0.9f);
break;
}
Lighting.AddLight(mountedCenter, zero);
Lighting.AddLight(base.Center, zero);
DelegateMethods.v3_1 = zero;
Utils.PlotTileLine(base.Center, mountedCenter, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
}
if (this.ai[0] == 0f)
{
if ((num71 > 300f && this.type == 13) || (num71 > 400f && this.type == 32) || (num71 > 440f && this.type == 73) || (num71 > 440f && this.type == 74) || (num71 > 250f && this.type == 165) || (num71 > 350f && this.type == 256) || (num71 > 500f && this.type == 315) || (num71 > 550f && this.type == 322) || (num71 > 400f && this.type == 331) || (num71 > 550f && this.type == 332) || (num71 > 400f && this.type == 372) || (num71 > 300f && this.type == 396) || (num71 > 550f && this.type >= 646 && this.type <= 649) || (num71 > 480f && this.type >= 486 && this.type <= 489) || (num71 > 500f && this.type == 446))
{
this.ai[0] = 1f;
}
else if (this.type >= 230 && this.type <= 235)
{
int num72 = 300 + (this.type - 230) * 30;
if (num71 > (float)num72)
{
this.ai[0] = 1f;
}
}
Vector2 value4 = base.Center - new Vector2(5f);
Vector2 value5 = base.Center + new Vector2(5f);
Point point = (value4 - new Vector2(16f)).ToTileCoordinates();
Point point2 = (value5 + new Vector2(32f)).ToTileCoordinates();
int num73 = point.X;
int num74 = point2.X;
int num75 = point.Y;
int num76 = point2.Y;
if (num73 < 0)
{
num73 = 0;
}
if (num74 > Main.maxTilesX)
{
num74 = Main.maxTilesX;
}
if (num75 < 0)
{
num75 = 0;
}
if (num76 > Main.maxTilesY)
{
num76 = Main.maxTilesY;
}
for (int num77 = num73; num77 < num74; num77++)
{
int num78 = num75;
while (num78 < num76)
{
if (Main.tile[num77, num78] == null)
{
Main.tile[num77, num78] = new Tile();
}
Vector2 vector7;
vector7.X = (float)(num77 * 16);
vector7.Y = (float)(num78 * 16);
if (value4.X + 10f > vector7.X && value4.X < vector7.X + 16f && value4.Y + 10f > vector7.Y && value4.Y < vector7.Y + 16f && Main.tile[num77, num78].nactive() && (Main.tileSolid[(int)Main.tile[num77, num78].type] || Main.tile[num77, num78].type == 314) && (this.type != 403 || Main.tile[num77, num78].type == 314))
{
if (Main.player[this.owner].grapCount < 10)
{
Main.player[this.owner].grappling[Main.player[this.owner].grapCount] = this.whoAmI;
Main.player[this.owner].grapCount++;
}
if (Main.myPlayer == this.owner)
{
int num79 = 0;
int num80 = -1;
int num81 = 100000;
if (this.type == 73 || this.type == 74)
{
for (int num82 = 0; num82 < 1000; num82++)
{
if (num82 != this.whoAmI && Main.projectile[num82].active && Main.projectile[num82].owner == this.owner && Main.projectile[num82].aiStyle == 7 && Main.projectile[num82].ai[0] == 2f)
{
Main.projectile[num82].Kill();
}
}
}
else
{
int num83 = 3;
if (this.type == 165)
{
num83 = 8;
}
if (this.type == 256)
{
num83 = 2;
}
if (this.type == 372)
{
num83 = 2;
}
if (this.type >= 646 && this.type <= 649)
{
num83 = 4;
}
for (int num84 = 0; num84 < 1000; num84++)
{
if (Main.projectile[num84].active && Main.projectile[num84].owner == this.owner && Main.projectile[num84].aiStyle == 7)
{
if (Main.projectile[num84].timeLeft < num81)
{
num80 = num84;
num81 = Main.projectile[num84].timeLeft;
}
num79++;
}
}
if (num79 > num83)
{
Main.projectile[num80].Kill();
}
}
}
WorldGen.KillTile(num77, num78, true, true, false);
Main.PlaySound(0, num77 * 16, num78 * 16, 1);
this.velocity.X = 0f;
this.velocity.Y = 0f;
this.ai[0] = 2f;
this.position.X = (float)(num77 * 16 + 8 - this.width / 2);
this.position.Y = (float)(num78 * 16 + 8 - this.height / 2);
this.damage = 0;
this.netUpdate = true;
if (Main.myPlayer == this.owner)
{
NetMessage.SendData(13, -1, -1, "", this.owner, 0f, 0f, 0f, 0, 0, 0);
break;
}
break;
}
else
{
num78++;
}
}
if (this.ai[0] == 2f)
{
return;
}
}
return;
}
if (this.ai[0] == 1f)
{
float num85 = 11f;
if (this.type == 32)
{
num85 = 15f;
}
if (this.type == 73 || this.type == 74)
{
num85 = 17f;
}
if (this.type == 315)
{
num85 = 20f;
}
if (this.type == 322)
{
num85 = 22f;
}
if (this.type >= 230 && this.type <= 235)
{
num85 = 11f + (float)(this.type - 230) * 0.75f;
}
if (this.type == 446)
{
num85 = 20f;
}
if (this.type >= 486 && this.type <= 489)
{
num85 = 18f;
}
if (this.type >= 646 && this.type <= 649)
{
num85 = 24f;
}
if (this.type == 332)
{
num85 = 17f;
}
if (num71 < 24f)
{
this.Kill();
}
num71 = num85 / num71;
num69 *= num71;
num70 *= num71;
this.velocity.X = num69;
this.velocity.Y = num70;
return;
}
if (this.ai[0] == 2f)
{
int num86 = (int)(this.position.X / 16f) - 1;
int num87 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num88 = (int)(this.position.Y / 16f) - 1;
int num89 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num86 < 0)
{
num86 = 0;
}
if (num87 > Main.maxTilesX)
{
num87 = Main.maxTilesX;
}
if (num88 < 0)
{
num88 = 0;
}
if (num89 > Main.maxTilesY)
{
num89 = Main.maxTilesY;
}
bool flag2 = true;
for (int num90 = num86; num90 < num87; num90++)
{
for (int num91 = num88; num91 < num89; num91++)
{
if (Main.tile[num90, num91] == null)
{
Main.tile[num90, num91] = new Tile();
}
Vector2 vector8;
vector8.X = (float)(num90 * 16);
vector8.Y = (float)(num91 * 16);
if (this.position.X + (float)(this.width / 2) > vector8.X && this.position.X + (float)(this.width / 2) < vector8.X + 16f && this.position.Y + (float)(this.height / 2) > vector8.Y && this.position.Y + (float)(this.height / 2) < vector8.Y + 16f && Main.tile[num90, num91].nactive() && (Main.tileSolid[(int)Main.tile[num90, num91].type] || Main.tile[num90, num91].type == 314 || Main.tile[num90, num91].type == 5))
{
flag2 = false;
}
}
}
if (flag2)
{
this.ai[0] = 1f;
return;
}
if (Main.player[this.owner].grapCount < 10)
{
Main.player[this.owner].grappling[Main.player[this.owner].grapCount] = this.whoAmI;
Main.player[this.owner].grapCount++;
return;
}
}
}
else if (this.aiStyle == 8)
{
if (this.type == 258 && this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20);
}
if (this.type == 96 && this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20);
}
if (this.type == 27)
{
for (int num92 = 0; num92 < 5; num92++)
{
float num93 = this.velocity.X / 3f * (float)num92;
float num94 = this.velocity.Y / 3f * (float)num92;
int num95 = 4;
int num96 = Dust.NewDust(new Vector2(this.position.X + (float)num95, this.position.Y + (float)num95), this.width - num95 * 2, this.height - num95 * 2, 172, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num96].noGravity = true;
Main.dust[num96].velocity *= 0.1f;
Main.dust[num96].velocity += this.velocity * 0.1f;
Dust expr_47FA_cp_0 = Main.dust[num96];
expr_47FA_cp_0.position.X = expr_47FA_cp_0.position.X - num93;
Dust expr_4815_cp_0 = Main.dust[num96];
expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94;
}
if (Main.rand.Next(5) == 0)
{
int num97 = 4;
int num98 = Dust.NewDust(new Vector2(this.position.X + (float)num97, this.position.Y + (float)num97), this.width - num97 * 2, this.height - num97 * 2, 172, 0f, 0f, 100, default(Color), 0.6f);
Main.dust[num98].velocity *= 0.25f;
Main.dust[num98].velocity += this.velocity * 0.5f;
}
}
else if (this.type == 502)
{
float num99 = (float)Main.DiscoR / 255f;
float num100 = (float)Main.DiscoG / 255f;
float num101 = (float)Main.DiscoB / 255f;
num99 = (0.5f + num99) / 2f;
num100 = (0.5f + num100) / 2f;
num101 = (0.5f + num101) / 2f;
Lighting.AddLight(base.Center, num99, num100, num101);
}
else if (this.type == 95 || this.type == 96)
{
int num102 = Dust.NewDust(new Vector2(this.position.X + this.velocity.X, this.position.Y + this.velocity.Y), this.width, this.height, 75, this.velocity.X, this.velocity.Y, 100, default(Color), 3f * this.scale);
Main.dust[num102].noGravity = true;
}
else if (this.type == 253)
{
for (int num103 = 0; num103 < 2; num103++)
{
int num104 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num104].noGravity = true;
Dust expr_4AB0_cp_0 = Main.dust[num104];
expr_4AB0_cp_0.velocity.X = expr_4AB0_cp_0.velocity.X * 0.3f;
Dust expr_4ACE_cp_0 = Main.dust[num104];
expr_4ACE_cp_0.velocity.Y = expr_4ACE_cp_0.velocity.Y * 0.3f;
}
}
else
{
for (int num105 = 0; num105 < 2; num105++)
{
int num106 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num106].noGravity = true;
Dust expr_4B7B_cp_0 = Main.dust[num106];
expr_4B7B_cp_0.velocity.X = expr_4B7B_cp_0.velocity.X * 0.3f;
Dust expr_4B99_cp_0 = Main.dust[num106];
expr_4B99_cp_0.velocity.Y = expr_4B99_cp_0.velocity.Y * 0.3f;
}
}
if (this.type != 27 && this.type != 96 && this.type != 258)
{
this.ai[1] += 1f;
}
if (this.ai[1] >= 20f)
{
this.velocity.Y = this.velocity.Y + 0.2f;
}
if (this.type == 502)
{
this.rotation = this.velocity.ToRotation() + 1.57079637f;
if (this.velocity.X != 0f)
{
this.spriteDirection = (this.direction = Math.Sign(this.velocity.X));
}
}
else
{
this.rotation += 0.3f * (float)this.direction;
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
return;
}
}
else if (this.aiStyle == 9)
{
if (this.type == 491)
{
if (Main.rand.Next(2) == 0)
{
int num107 = Main.rand.Next(3);
if (num107 == 0)
{
num107 = 15;
}
else if (num107 == 1)
{
num107 = 57;
}
else
{
num107 = 58;
}
int num108 = Dust.NewDust(this.position, this.width, this.height, num107, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 255, default(Color), 0.7f);
Main.dust[num108].velocity *= 0.25f;
Main.dust[num108].position = (Main.dust[num108].position + this.position) / 2f;
}
}
else if (this.type == 34)
{
int num109 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 3.5f);
Main.dust[num109].noGravity = true;
Main.dust[num109].velocity *= 1.4f;
num109 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1.5f);
}
else if (this.type == 79)
{
if (this.soundDelay == 0 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 2f)
{
this.soundDelay = 10;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 9);
}
for (int num110 = 0; num110 < 1; num110++)
{
int num111 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2.5f);
Main.dust[num111].velocity *= 0.1f;
Main.dust[num111].velocity += this.velocity * 0.2f;
Main.dust[num111].position.X = this.position.X + (float)(this.width / 2) + 4f + (float)Main.rand.Next(-2, 3);
Main.dust[num111].position.Y = this.position.Y + (float)(this.height / 2) + (float)Main.rand.Next(-2, 3);
Main.dust[num111].noGravity = true;
}
}
else
{
if (this.soundDelay == 0 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 2f)
{
this.soundDelay = 10;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 9);
}
int num112 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 2f);
Main.dust[num112].velocity *= 0.3f;
Main.dust[num112].position.X = this.position.X + (float)(this.width / 2) + 4f + (float)Main.rand.Next(-4, 5);
Main.dust[num112].position.Y = this.position.Y + (float)(this.height / 2) + (float)Main.rand.Next(-4, 5);
Main.dust[num112].noGravity = true;
}
if (Main.myPlayer == this.owner && this.ai[0] <= 0f)
{
if (Main.player[this.owner].channel)
{
float num113 = 12f;
if (this.type == 16)
{
num113 = 15f;
}
if (this.type == 491)
{
num113 = 20f;
}
Vector2 vector9 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num114 = (float)Main.mouseX + Main.screenPosition.X - vector9.X;
float num115 = (float)Main.mouseY + Main.screenPosition.Y - vector9.Y;
if (Main.player[this.owner].gravDir == -1f)
{
num115 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector9.Y;
}
float num116 = (float)Math.Sqrt((double)(num114 * num114 + num115 * num115));
num116 = (float)Math.Sqrt((double)(num114 * num114 + num115 * num115));
if (this.ai[0] < 0f)
{
this.ai[0] += 1f;
}
if (this.type == 491 && num116 < 100f)
{
if (this.velocity.Length() < num113)
{
this.velocity *= 1.1f;
if (this.velocity.Length() > num113)
{
this.velocity.Normalize();
this.velocity *= num113;
}
}
if (this.ai[0] == 0f)
{
this.ai[0] = -10f;
}
}
else if (num116 > num113)
{
num116 = num113 / num116;
num114 *= num116;
num115 *= num116;
int num117 = (int)(num114 * 1000f);
int num118 = (int)(this.velocity.X * 1000f);
int num119 = (int)(num115 * 1000f);
int num120 = (int)(this.velocity.Y * 1000f);
if (num117 != num118 || num119 != num120)
{
this.netUpdate = true;
}
if (this.type == 491)
{
Vector2 value6 = new Vector2(num114, num115);
this.velocity = (this.velocity * 4f + value6) / 5f;
}
else
{
this.velocity.X = num114;
this.velocity.Y = num115;
}
}
else
{
int num121 = (int)(num114 * 1000f);
int num122 = (int)(this.velocity.X * 1000f);
int num123 = (int)(num115 * 1000f);
int num124 = (int)(this.velocity.Y * 1000f);
if (num121 != num122 || num123 != num124)
{
this.netUpdate = true;
}
this.velocity.X = num114;
this.velocity.Y = num115;
}
}
else if (this.ai[0] <= 0f)
{
this.netUpdate = true;
if (this.type != 491)
{
float num125 = 12f;
Vector2 vector10 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num126 = (float)Main.mouseX + Main.screenPosition.X - vector10.X;
float num127 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y;
if (Main.player[this.owner].gravDir == -1f)
{
num127 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y;
}
float num128 = (float)Math.Sqrt((double)(num126 * num126 + num127 * num127));
if (num128 == 0f || this.ai[0] < 0f)
{
vector10 = new Vector2(Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2), Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2));
num126 = this.position.X + (float)this.width * 0.5f - vector10.X;
num127 = this.position.Y + (float)this.height * 0.5f - vector10.Y;
num128 = (float)Math.Sqrt((double)(num126 * num126 + num127 * num127));
}
num128 = num125 / num128;
num126 *= num128;
num127 *= num128;
this.velocity.X = num126;
this.velocity.Y = num127;
if (this.velocity.X == 0f && this.velocity.Y == 0f)
{
this.Kill();
}
}
this.ai[0] = 1f;
}
}
if (this.type == 491)
{
this.localAI[0] += 1f;
if (this.ai[0] > 0f && this.localAI[0] > 15f)
{
this.tileCollide = false;
Vector2 vector11 = Main.player[this.owner].Center - base.Center;
if (vector11.Length() < 20f)
{
this.Kill();
}
vector11.Normalize();
vector11 *= 25f;
this.velocity = (this.velocity * 5f + vector11) / 6f;
}
if (this.ai[0] < 0f || (this.velocity.X == 0f && this.velocity.Y == 0f))
{
this.rotation += 0.3f;
}
else if (this.ai[0] > 0f)
{
this.rotation += 0.3f * (float)this.direction;
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
}
else if (this.type == 34)
{
this.rotation += 0.3f * (float)this.direction;
}
else if (this.velocity.X != 0f || this.velocity.Y != 0f)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 2.355f;
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
return;
}
}
else if (this.aiStyle == 10)
{
if (this.type == 31 && this.ai[0] != 2f)
{
if (Main.rand.Next(2) == 0)
{
int num129 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, this.velocity.Y / 2f, 0, default(Color), 1f);
Dust expr_5991_cp_0 = Main.dust[num129];
expr_5991_cp_0.velocity.X = expr_5991_cp_0.velocity.X * 0.4f;
}
}
else if (this.type == 39)
{
if (Main.rand.Next(2) == 0)
{
int num130 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 38, 0f, this.velocity.Y / 2f, 0, default(Color), 1f);
Dust expr_5A2B_cp_0 = Main.dust[num130];
expr_5A2B_cp_0.velocity.X = expr_5A2B_cp_0.velocity.X * 0.4f;
}
}
else if (this.type >= 411 && this.type <= 414)
{
if (Main.rand.Next(3) == 0)
{
int num131 = 9;
if (this.type == 412 || this.type == 414)
{
num131 = 11;
}
if (this.type == 413)
{
num131 = 19;
}
int num132 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num131, 0f, this.velocity.Y / 2f, 0, default(Color), 1f);
Main.dust[num132].noGravity = true;
Main.dust[num132].velocity -= this.velocity * 0.5f;
}
}
else if (this.type == 40)
{
if (Main.rand.Next(2) == 0)
{
int num133 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, this.velocity.Y / 2f, 0, default(Color), 1f);
Main.dust[num133].velocity *= 0.4f;
}
}
else if (this.type == 42 || this.type == 31)
{
if (Main.rand.Next(2) == 0)
{
int num134 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, 0f, 0, default(Color), 1f);
Dust expr_5C54_cp_0 = Main.dust[num134];
expr_5C54_cp_0.velocity.X = expr_5C54_cp_0.velocity.X * 0.4f;
}
}
else if (this.type == 56 || this.type == 65)
{
if (Main.rand.Next(2) == 0)
{
int num135 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 0, default(Color), 1f);
Dust expr_5CEC_cp_0 = Main.dust[num135];
expr_5CEC_cp_0.velocity.X = expr_5CEC_cp_0.velocity.X * 0.4f;
}
}
else if (this.type == 67 || this.type == 68)
{
if (Main.rand.Next(2) == 0)
{
int num136 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51, 0f, 0f, 0, default(Color), 1f);
Dust expr_5D84_cp_0 = Main.dust[num136];
expr_5D84_cp_0.velocity.X = expr_5D84_cp_0.velocity.X * 0.4f;
}
}
else if (this.type == 71)
{
if (Main.rand.Next(2) == 0)
{
int num137 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53, 0f, 0f, 0, default(Color), 1f);
Dust expr_5E12_cp_0 = Main.dust[num137];
expr_5E12_cp_0.velocity.X = expr_5E12_cp_0.velocity.X * 0.4f;
}
}
else if (this.type == 179)
{
if (Main.rand.Next(2) == 0)
{
int num138 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 149, 0f, 0f, 0, default(Color), 1f);
Dust expr_5EA6_cp_0 = Main.dust[num138];
expr_5EA6_cp_0.velocity.X = expr_5EA6_cp_0.velocity.X * 0.4f;
}
}
else if (this.type == 241 || this.type == 354)
{
if (Main.rand.Next(2) == 0)
{
int num139 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, 0f, 0, default(Color), 1f);
Dust expr_5F41_cp_0 = Main.dust[num139];
expr_5F41_cp_0.velocity.X = expr_5F41_cp_0.velocity.X * 0.4f;
}
}
else if (this.type != 109 && Main.rand.Next(20) == 0)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, 0f, 0f, 0, default(Color), 1f);
}
this.tileCollide = true;
this.localAI[1] = 0f;
if (Main.myPlayer == this.owner && this.ai[0] == 0f)
{
this.tileCollide = false;
if (Main.player[this.owner].channel)
{
this.localAI[1] = -1f;
float num140 = 12f;
Vector2 vector12 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num141 = (float)Main.mouseX + Main.screenPosition.X - vector12.X;
float num142 = (float)Main.mouseY + Main.screenPosition.Y - vector12.Y;
if (Main.player[this.owner].gravDir == -1f)
{
num142 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector12.Y;
}
float num143 = (float)Math.Sqrt((double)(num141 * num141 + num142 * num142));
num143 = (float)Math.Sqrt((double)(num141 * num141 + num142 * num142));
if (num143 > num140)
{
num143 = num140 / num143;
num141 *= num143;
num142 *= num143;
if (num141 != this.velocity.X || num142 != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity.X = num141;
this.velocity.Y = num142;
}
else
{
if (num141 != this.velocity.X || num142 != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity.X = num141;
this.velocity.Y = num142;
}
}
else
{
this.ai[0] = 1f;
this.netUpdate = true;
}
}
if (this.ai[0] == 1f && this.type != 109)
{
if (this.type == 42 || this.type == 65 || this.type == 68 || this.type == 354)
{
this.ai[1] += 1f;
if (this.ai[1] >= 60f)
{
this.ai[1] = 60f;
this.velocity.Y = this.velocity.Y + 0.2f;
}
}
else
{
this.velocity.Y = this.velocity.Y + 0.41f;
}
}
else if (this.ai[0] == 2f && this.type != 109)
{
this.velocity.Y = this.velocity.Y + 0.2f;
if ((double)this.velocity.X < -0.04)
{
this.velocity.X = this.velocity.X + 0.04f;
}
else if ((double)this.velocity.X > 0.04)
{
this.velocity.X = this.velocity.X - 0.04f;
}
else
{
this.velocity.X = 0f;
}
}
this.rotation += 0.1f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else if (this.aiStyle == 11)
{
if (this.type == 72 || this.type == 86 || this.type == 87)
{
if (this.velocity.X > 0f)
{
this.spriteDirection = -1;
}
else if (this.velocity.X < 0f)
{
this.spriteDirection = 1;
}
this.rotation = this.velocity.X * 0.1f;
this.frameCounter++;
if (this.frameCounter >= 4)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 4)
{
this.frame = 0;
}
if (Main.rand.Next(6) == 0)
{
int num144 = 56;
if (this.type == 86)
{
num144 = 73;
}
else if (this.type == 87)
{
num144 = 74;
}
int num145 = Dust.NewDust(this.position, this.width, this.height, num144, 0f, 0f, 200, default(Color), 0.8f);
Main.dust[num145].velocity *= 0.3f;
Main.dust[num145].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cLight, Main.player[this.owner]);
}
}
else
{
this.rotation += 0.02f;
}
if (Main.myPlayer == this.owner)
{
if (this.type == 72)
{
if (Main.player[Main.myPlayer].blueFairy)
{
this.timeLeft = 2;
}
}
else if (this.type == 86)
{
if (Main.player[Main.myPlayer].redFairy)
{
this.timeLeft = 2;
}
}
else if (this.type == 87)
{
if (Main.player[Main.myPlayer].greenFairy)
{
this.timeLeft = 2;
}
}
else if (Main.player[Main.myPlayer].lightOrb)
{
this.timeLeft = 2;
}
}
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
float num146 = 3f;
if (this.type == 72 || this.type == 86 || this.type == 87)
{
num146 = 3.75f;
}
Vector2 vector13 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num147 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector13.X;
float num148 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector13.Y;
int num149 = 70;
if (this.type == 18)
{
if (Main.player[this.owner].controlUp)
{
num148 = Main.player[this.owner].position.Y - 40f - vector13.Y;
num147 -= 6f;
num149 = 4;
}
else if (Main.player[this.owner].controlDown)
{
num148 = Main.player[this.owner].position.Y + (float)Main.player[this.owner].height + 40f - vector13.Y;
num147 -= 6f;
num149 = 4;
}
}
float num150 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148));
num150 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148));
if (this.type == 72 || this.type == 86 || this.type == 87)
{
num149 = 40;
}
if (num150 > 800f)
{
this.position.X = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - (float)(this.width / 2);
this.position.Y = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - (float)(this.height / 2);
return;
}
if (num150 > (float)num149)
{
num150 = num146 / num150;
num147 *= num150;
num148 *= num150;
this.velocity.X = num147;
this.velocity.Y = num148;
return;
}
this.velocity.X = 0f;
this.velocity.Y = 0f;
return;
}
else if (this.aiStyle == 12)
{
if (this.type == 288 && this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
if (this.type == 280 || this.type == 288)
{
this.scale -= 0.002f;
if (this.scale <= 0f)
{
this.Kill();
}
if (this.type == 288)
{
this.ai[0] = 4f;
}
if (this.ai[0] <= 3f)
{
this.ai[0] += 1f;
return;
}
this.velocity.Y = this.velocity.Y + 0.075f;
for (int num151 = 0; num151 < 3; num151++)
{
float num152 = this.velocity.X / 3f * (float)num151;
float num153 = this.velocity.Y / 3f * (float)num151;
int num154 = 14;
int num155 = Dust.NewDust(new Vector2(this.position.X + (float)num154, this.position.Y + (float)num154), this.width - num154 * 2, this.height - num154 * 2, 170, 0f, 0f, 100, default(Color), 1f);
Main.dust[num155].noGravity = true;
Main.dust[num155].velocity *= 0.1f;
Main.dust[num155].velocity += this.velocity * 0.5f;
Dust expr_6A04_cp_0 = Main.dust[num155];
expr_6A04_cp_0.position.X = expr_6A04_cp_0.position.X - num152;
Dust expr_6A1F_cp_0 = Main.dust[num155];
expr_6A1F_cp_0.position.Y = expr_6A1F_cp_0.position.Y - num153;
}
if (Main.rand.Next(8) == 0)
{
int num156 = 16;
int num157 = Dust.NewDust(new Vector2(this.position.X + (float)num156, this.position.Y + (float)num156), this.width - num156 * 2, this.height - num156 * 2, 170, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num157].velocity *= 0.25f;
Main.dust[num157].velocity += this.velocity * 0.5f;
return;
}
}
else
{
this.scale -= 0.02f;
if (this.scale <= 0f)
{
this.Kill();
}
if (this.ai[0] > 3f)
{
this.velocity.Y = this.velocity.Y + 0.2f;
for (int num158 = 0; num158 < 1; num158++)
{
for (int num159 = 0; num159 < 3; num159++)
{
float num160 = this.velocity.X / 3f * (float)num159;
float num161 = this.velocity.Y / 3f * (float)num159;
int num162 = 6;
int num163 = Dust.NewDust(new Vector2(this.position.X + (float)num162, this.position.Y + (float)num162), this.width - num162 * 2, this.height - num162 * 2, 172, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num163].noGravity = true;
Main.dust[num163].velocity *= 0.3f;
Main.dust[num163].velocity += this.velocity * 0.5f;
Dust expr_6C6A_cp_0 = Main.dust[num163];
expr_6C6A_cp_0.position.X = expr_6C6A_cp_0.position.X - num160;
Dust expr_6C85_cp_0 = Main.dust[num163];
expr_6C85_cp_0.position.Y = expr_6C85_cp_0.position.Y - num161;
}
if (Main.rand.Next(8) == 0)
{
int num164 = 6;
int num165 = Dust.NewDust(new Vector2(this.position.X + (float)num164, this.position.Y + (float)num164), this.width - num164 * 2, this.height - num164 * 2, 172, 0f, 0f, 100, default(Color), 0.75f);
Main.dust[num165].velocity *= 0.5f;
Main.dust[num165].velocity += this.velocity * 0.5f;
}
}
return;
}
this.ai[0] += 1f;
return;
}
}
else if (this.aiStyle == 13)
{
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
if (this.type != 481)
{
Main.player[this.owner].itemAnimation = 5;
Main.player[this.owner].itemTime = 5;
}
if (this.alpha == 0)
{
if (this.position.X + (float)(this.width / 2) > Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2))
{
Main.player[this.owner].ChangeDir(1);
}
else
{
Main.player[this.owner].ChangeDir(-1);
}
}
if (this.type == 481)
{
if (this.ai[0] == 0f)
{
this.extraUpdates = 0;
}
else
{
this.extraUpdates = 1;
}
}
Vector2 vector14 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num166 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector14.X;
float num167 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector14.Y;
float num168 = (float)Math.Sqrt((double)(num166 * num166 + num167 * num167));
if (this.ai[0] == 0f)
{
if (num168 > 700f)
{
this.ai[0] = 1f;
}
else if (this.type == 262 && num168 > 500f)
{
this.ai[0] = 1f;
}
else if (this.type == 271 && num168 > 200f)
{
this.ai[0] = 1f;
}
else if (this.type == 273 && num168 > 150f)
{
this.ai[0] = 1f;
}
else if (this.type == 481 && num168 > 350f)
{
this.ai[0] = 1f;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
this.ai[1] += 1f;
if (this.ai[1] > 5f)
{
this.alpha = 0;
}
if (this.type == 262 && this.ai[1] > 8f)
{
this.ai[1] = 8f;
}
if (this.type == 271 && this.ai[1] > 8f)
{
this.ai[1] = 8f;
}
if (this.type == 273 && this.ai[1] > 8f)
{
this.ai[1] = 8f;
}
if (this.type == 481 && this.ai[1] > 8f)
{
this.ai[1] = 8f;
}
if (this.type == 404 && this.ai[1] > 8f)
{
this.ai[1] = 0f;
}
if (this.ai[1] >= 10f)
{
this.ai[1] = 15f;
this.velocity.Y = this.velocity.Y + 0.3f;
}
if (this.type == 262 && this.velocity.X < 0f)
{
this.spriteDirection = -1;
}
else if (this.type == 262)
{
this.spriteDirection = 1;
}
if (this.type == 271 && this.velocity.X < 0f)
{
this.spriteDirection = -1;
return;
}
if (this.type == 271)
{
this.spriteDirection = 1;
return;
}
}
else if (this.ai[0] == 1f)
{
this.tileCollide = false;
this.rotation = (float)Math.Atan2((double)num167, (double)num166) - 1.57f;
float num169 = 20f;
if (this.type == 262)
{
num169 = 30f;
}
if (num168 < 50f)
{
this.Kill();
}
num168 = num169 / num168;
num166 *= num168;
num167 *= num168;
this.velocity.X = num166;
this.velocity.Y = num167;
if (this.type == 262 && this.velocity.X < 0f)
{
this.spriteDirection = 1;
}
else if (this.type == 262)
{
this.spriteDirection = -1;
}
if (this.type == 271 && this.velocity.X < 0f)
{
this.spriteDirection = 1;
return;
}
if (this.type == 271)
{
this.spriteDirection = -1;
return;
}
}
}
else if (this.aiStyle == 14)
{
if (this.type == 473 && Main.netMode != 2)
{
this.localAI[0] += 1f;
if (this.localAI[0] >= 10f)
{
this.localAI[0] = 0f;
int num170 = 30;
if ((base.Center - Main.player[Main.myPlayer].Center).Length() < (float)(Main.screenWidth + num170 * 16))
{
int num171 = (int)base.Center.X / 16;
int num172 = (int)base.Center.Y / 16;
for (int num173 = num171 - num170; num173 <= num171 + num170; num173++)
{
for (int num174 = num172 - num170; num174 <= num172 + num170; num174++)
{
if (Main.rand.Next(4) == 0)
{
Vector2 vector15 = new Vector2((float)(num171 - num173), (float)(num172 - num174));
if (vector15.Length() < (float)num170 && num173 > 0 && num173 < Main.maxTilesX - 1 && num174 > 0 && num174 < Main.maxTilesY - 1 && Main.tile[num173, num174] != null && Main.tile[num173, num174].active())
{
bool flag3 = false;
if (Main.tile[num173, num174].type == 185 && Main.tile[num173, num174].frameY == 18)
{
if (Main.tile[num173, num174].frameX >= 576 && Main.tile[num173, num174].frameX <= 882)
{
flag3 = true;
}
}
else if (Main.tile[num173, num174].type == 186 && Main.tile[num173, num174].frameX >= 864 && Main.tile[num173, num174].frameX <= 1170)
{
flag3 = true;
}
if (flag3 || Main.tileSpelunker[(int)Main.tile[num173, num174].type] || (Main.tileAlch[(int)Main.tile[num173, num174].type] && Main.tile[num173, num174].type != 82))
{
int num175 = Dust.NewDust(new Vector2((float)(num173 * 16), (float)(num174 * 16)), 16, 16, 204, 0f, 0f, 150, default(Color), 0.3f);
Main.dust[num175].fadeIn = 0.75f;
Main.dust[num175].velocity *= 0.1f;
Main.dust[num175].noLight = true;
}
}
}
}
}
}
}
}
if (this.type == 352)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
}
this.alpha += (int)(25f * this.localAI[1]);
if (this.alpha <= 0)
{
this.alpha = 0;
this.localAI[1] = 1f;
}
else if (this.alpha >= 255)
{
this.alpha = 255;
this.localAI[1] = -1f;
}
this.scale += this.localAI[1] * 0.01f;
}
if (this.type == 346)
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 1);
}
this.frame = (int)this.ai[1];
if (this.owner == Main.myPlayer && this.timeLeft == 1)
{
for (int num176 = 0; num176 < 5; num176++)
{
float num177 = 10f;
Vector2 vector16 = new Vector2(base.Center.X, base.Center.Y);
float num178 = (float)Main.rand.Next(-20, 21);
float num179 = (float)Main.rand.Next(-20, 0);
float num180 = (float)Math.Sqrt((double)(num178 * num178 + num179 * num179));
num180 = num177 / num180;
num178 *= num180;
num179 *= num180;
num178 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
num179 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
Projectile.NewProjectile(vector16.X, vector16.Y, num178, num179, 347, 40, 0f, Main.myPlayer, 0f, this.ai[1]);
}
}
}
if (this.type == 196)
{
int num181 = Main.rand.Next(1, 3);
for (int num182 = 0; num182 < num181; num182++)
{
int num183 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num183].alpha += Main.rand.Next(100);
Main.dust[num183].velocity *= 0.3f;
Dust expr_78AB_cp_0 = Main.dust[num183];
expr_78AB_cp_0.velocity.X = expr_78AB_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.025f;
Dust expr_78D9_cp_0 = Main.dust[num183];
expr_78D9_cp_0.velocity.Y = expr_78D9_cp_0.velocity.Y - (0.4f + (float)Main.rand.Next(-3, 14) * 0.15f);
Main.dust[num183].fadeIn = 1.25f + (float)Main.rand.Next(20) * 0.15f;
}
}
if (this.type == 53)
{
try
{
Vector2 value7 = Collision.TileCollision(this.position, this.velocity, this.width, this.height, false, false, 1);
this.velocity != value7;
int num184 = (int)(this.position.X / 16f) - 1;
int num185 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num186 = (int)(this.position.Y / 16f) - 1;
int num187 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num184 < 0)
{
num184 = 0;
}
if (num185 > Main.maxTilesX)
{
num185 = Main.maxTilesX;
}
if (num186 < 0)
{
num186 = 0;
}
if (num187 > Main.maxTilesY)
{
num187 = Main.maxTilesY;
}
for (int num188 = num184; num188 < num185; num188++)
{
for (int num189 = num186; num189 < num187; num189++)
{
if (Main.tile[num188, num189] != null && Main.tile[num188, num189].nactive() && (Main.tileSolid[(int)Main.tile[num188, num189].type] || (Main.tileSolidTop[(int)Main.tile[num188, num189].type] && Main.tile[num188, num189].frameY == 0)))
{
Vector2 vector17;
vector17.X = (float)(num188 * 16);
vector17.Y = (float)(num189 * 16);
if (this.position.X + (float)this.width > vector17.X && this.position.X < vector17.X + 16f && this.position.Y + (float)this.height > vector17.Y && this.position.Y < vector17.Y + 16f)
{
this.velocity.X = 0f;
this.velocity.Y = -0.2f;
}
}
}
}
}
catch
{
}
}
if (this.type == 277)
{
if (this.alpha > 0)
{
this.alpha -= 30;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (Main.expertMode)
{
float scaleFactor = 12f;
int num190 = (int)Player.FindClosest(base.Center, 1, 1);
Vector2 value8 = Main.player[num190].Center - base.Center;
value8.Normalize();
value8 *= scaleFactor;
int num191 = 200;
this.velocity.X = (this.velocity.X * (float)(num191 - 1) + value8.X) / (float)num191;
if (this.velocity.Length() > 16f)
{
this.velocity.Normalize();
this.velocity *= 16f;
}
}
}
if (this.type == 261 || this.type == 277)
{
this.ai[0] += 1f;
if (this.ai[0] > 15f)
{
this.ai[0] = 15f;
if (this.velocity.Y == 0f && this.velocity.X != 0f)
{
this.velocity.X = this.velocity.X * 0.97f;
if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01)
{
this.Kill();
}
}
this.velocity.Y = this.velocity.Y + 0.2f;
}
this.rotation += this.velocity.X * 0.05f;
}
else if (this.type == 378)
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
this.localAI[0] += 1f;
}
Rectangle rectangle2 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
for (int num192 = 0; num192 < 200; num192++)
{
if (Main.npc[num192].CanBeChasedBy(this, true))
{
Rectangle value9 = new Rectangle((int)Main.npc[num192].position.X, (int)Main.npc[num192].position.Y, Main.npc[num192].width, Main.npc[num192].height);
if (rectangle2.Intersects(value9))
{
this.Kill();
return;
}
}
}
this.ai[0] += 1f;
if (this.ai[0] > 10f)
{
this.ai[0] = 90f;
if (this.velocity.Y == 0f && this.velocity.X != 0f)
{
this.velocity.X = this.velocity.X * 0.96f;
if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01)
{
this.Kill();
}
}
this.velocity.Y = this.velocity.Y + 0.2f;
}
this.rotation += this.velocity.X * 0.1f;
}
else if (this.type == 483)
{
this.ai[0] += 1f;
if (this.ai[0] > 5f)
{
if (this.owner == Main.myPlayer && this.ai[0] > (float)Main.rand.Next(20, 130))
{
this.Kill();
}
if (this.velocity.Y == 0f && this.velocity.X != 0f)
{
this.velocity.X = this.velocity.X * 0.97f;
if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01)
{
this.velocity.X = 0f;
this.netUpdate = true;
}
}
this.velocity.Y = this.velocity.Y + 0.3f;
this.velocity.X = this.velocity.X * 0.99f;
}
this.rotation += this.velocity.X * 0.05f;
}
else if (this.type == 538)
{
this.ai[0] += 1f;
if (this.ai[0] > 60f || this.velocity.Y >= 0f)
{
this.alpha += 6;
this.velocity *= 0.5f;
}
else if (this.ai[0] > 5f)
{
this.velocity.Y = this.velocity.Y + 0.1f;
this.velocity.X = this.velocity.X * 1.025f;
this.alpha -= 23;
this.scale = 0.8f * (255f - (float)this.alpha) / 255f;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.alpha >= 255 && this.ai[0] > 5f)
{
this.Kill();
return;
}
}
else
{
this.ai[0] += 1f;
if (this.ai[0] > 5f)
{
this.ai[0] = 5f;
if (this.velocity.Y == 0f && this.velocity.X != 0f)
{
this.velocity.X = this.velocity.X * 0.97f;
if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01)
{
this.velocity.X = 0f;
this.netUpdate = true;
}
}
this.velocity.Y = this.velocity.Y + 0.2f;
}
this.rotation += this.velocity.X * 0.1f;
}
if (this.type == 538)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 7);
}
if (this.velocity.Y < 0f && this.ai[0] < 60f)
{
if (Main.rand.Next(4) == 0)
{
int num193 = Dust.NewDust(this.position, this.width, this.height, 180, 0f, 0f, 100, default(Color), 1f);
Main.dust[num193].position = base.Center;
Main.dust[num193].scale += (float)Main.rand.Next(50) * 0.01f;
Main.dust[num193].noGravity = true;
Dust expr_838F_cp_0 = Main.dust[num193];
expr_838F_cp_0.velocity.Y = expr_838F_cp_0.velocity.Y - 2f;
}
if (Main.rand.Next(6) == 0)
{
int num194 = Dust.NewDust(this.position, this.width, this.height, 176, 0f, 0f, 100, default(Color), 1f);
Main.dust[num194].position = base.Center;
Main.dust[num194].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
Main.dust[num194].noGravity = true;
Main.dust[num194].velocity *= 0.1f;
}
}
}
if (this.type == 450)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 13);
}
if (Main.rand.Next(2) == 0)
{
int num195 = Dust.NewDust(this.position, this.width, this.height, 228, 0f, 0f, 100, default(Color), 1f);
Dust expr_84FE_cp_0 = Main.dust[num195];
expr_84FE_cp_0.position.X = expr_84FE_cp_0.position.X - 2f;
Dust expr_851C_cp_0 = Main.dust[num195];
expr_851C_cp_0.position.Y = expr_851C_cp_0.position.Y + 2f;
Main.dust[num195].scale += (float)Main.rand.Next(50) * 0.01f;
Main.dust[num195].noGravity = true;
Dust expr_856F_cp_0 = Main.dust[num195];
expr_856F_cp_0.velocity.Y = expr_856F_cp_0.velocity.Y - 2f;
}
if (Main.rand.Next(4) == 0)
{
int num196 = Dust.NewDust(this.position, this.width, this.height, 228, 0f, 0f, 100, default(Color), 1f);
Dust expr_85DA_cp_0 = Main.dust[num196];
expr_85DA_cp_0.position.X = expr_85DA_cp_0.position.X - 2f;
Dust expr_85F8_cp_0 = Main.dust[num196];
expr_85F8_cp_0.position.Y = expr_85F8_cp_0.position.Y + 2f;
Main.dust[num196].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
Main.dust[num196].noGravity = true;
Main.dust[num196].velocity *= 0.1f;
}
if (++this.frameCounter >= 3)
{
this.frameCounter = 0;
if (++this.frame >= 5)
{
this.frame = 0;
}
}
if ((double)this.velocity.Y < 0.25 && (double)this.velocity.Y > 0.15)
{
this.velocity.X = this.velocity.X * 0.8f;
}
this.rotation = -this.velocity.X * 0.05f;
}
if (this.type == 480)
{
this.alpha = 255;
int num197 = Dust.NewDust(this.position, this.width, this.height, 75, 0f, 0f, 100, default(Color), 1f);
Dust expr_8762_cp_0 = Main.dust[num197];
expr_8762_cp_0.position.X = expr_8762_cp_0.position.X - 2f;
Dust expr_8780_cp_0 = Main.dust[num197];
expr_8780_cp_0.position.Y = expr_8780_cp_0.position.Y + 2f;
Main.dust[num197].scale += (float)Main.rand.Next(50) * 0.01f;
Main.dust[num197].noGravity = true;
Dust expr_87D3_cp_0 = Main.dust[num197];
expr_87D3_cp_0.velocity.Y = expr_87D3_cp_0.velocity.Y - 2f;
if (Main.rand.Next(2) == 0)
{
int num198 = Dust.NewDust(this.position, this.width, this.height, 75, 0f, 0f, 100, default(Color), 1f);
Dust expr_883B_cp_0 = Main.dust[num198];
expr_883B_cp_0.position.X = expr_883B_cp_0.position.X - 2f;
Dust expr_8859_cp_0 = Main.dust[num198];
expr_8859_cp_0.position.Y = expr_8859_cp_0.position.Y + 2f;
Main.dust[num198].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
Main.dust[num198].noGravity = true;
Main.dust[num198].velocity *= 0.1f;
}
}
if ((this.type >= 326 && this.type <= 328) || (this.type >= 400 && this.type <= 402))
{
if (this.wet)
{
this.Kill();
}
if (this.ai[1] == 0f && this.type >= 326 && this.type <= 328)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 13);
}
int num199 = Dust.NewDust(this.position, this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Dust expr_89A6_cp_0 = Main.dust[num199];
expr_89A6_cp_0.position.X = expr_89A6_cp_0.position.X - 2f;
Dust expr_89C4_cp_0 = Main.dust[num199];
expr_89C4_cp_0.position.Y = expr_89C4_cp_0.position.Y + 2f;
Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f;
Main.dust[num199].noGravity = true;
Dust expr_8A17_cp_0 = Main.dust[num199];
expr_8A17_cp_0.velocity.Y = expr_8A17_cp_0.velocity.Y - 2f;
if (Main.rand.Next(2) == 0)
{
int num200 = Dust.NewDust(this.position, this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Dust expr_8A7E_cp_0 = Main.dust[num200];
expr_8A7E_cp_0.position.X = expr_8A7E_cp_0.position.X - 2f;
Dust expr_8A9C_cp_0 = Main.dust[num200];
expr_8A9C_cp_0.position.Y = expr_8A9C_cp_0.position.Y + 2f;
Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
Main.dust[num200].noGravity = true;
Main.dust[num200].velocity *= 0.1f;
}
if ((double)this.velocity.Y < 0.25 && (double)this.velocity.Y > 0.15)
{
this.velocity.X = this.velocity.X * 0.8f;
}
this.rotation = -this.velocity.X * 0.05f;
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
return;
}
}
else if (this.aiStyle == 15)
{
if (this.type == 25)
{
if (Main.rand.Next(15) == 0)
{
Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.3f);
}
}
else if (this.type == 26)
{
int num201 = Dust.NewDust(this.position, this.width, this.height, 172, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, default(Color), 1.5f);
Main.dust[num201].noGravity = true;
Dust expr_8C6E_cp_0 = Main.dust[num201];
expr_8C6E_cp_0.velocity.X = expr_8C6E_cp_0.velocity.X / 2f;
Dust expr_8C8C_cp_0 = Main.dust[num201];
expr_8C8C_cp_0.velocity.Y = expr_8C8C_cp_0.velocity.Y / 2f;
}
else if (this.type == 35)
{
int num202 = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, default(Color), 3f);
Main.dust[num202].noGravity = true;
Dust expr_8D1B_cp_0 = Main.dust[num202];
expr_8D1B_cp_0.velocity.X = expr_8D1B_cp_0.velocity.X * 2f;
Dust expr_8D39_cp_0 = Main.dust[num202];
expr_8D39_cp_0.velocity.Y = expr_8D39_cp_0.velocity.Y * 2f;
}
else if (this.type == 154)
{
int num203 = Dust.NewDust(this.position, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140, default(Color), 1.5f);
Main.dust[num203].noGravity = true;
Main.dust[num203].velocity *= 0.25f;
}
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
Main.player[this.owner].itemAnimation = 10;
Main.player[this.owner].itemTime = 10;
if (this.position.X + (float)(this.width / 2) > Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2))
{
Main.player[this.owner].ChangeDir(1);
this.direction = 1;
}
else
{
Main.player[this.owner].ChangeDir(-1);
this.direction = -1;
}
Vector2 mountedCenter2 = Main.player[this.owner].MountedCenter;
Vector2 vector18 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num204 = mountedCenter2.X - vector18.X;
float num205 = mountedCenter2.Y - vector18.Y;
float num206 = (float)Math.Sqrt((double)(num204 * num204 + num205 * num205));
if (this.ai[0] == 0f)
{
float num207 = 160f;
if (this.type == 63)
{
num207 *= 1.5f;
}
if (this.type == 247)
{
num207 *= 1.5f;
}
this.tileCollide = true;
if (num206 > num207)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
else if (!Main.player[this.owner].channel)
{
if (this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y * 0.9f;
}
this.velocity.Y = this.velocity.Y + 1f;
this.velocity.X = this.velocity.X * 0.9f;
}
}
else if (this.ai[0] == 1f)
{
float num208 = 14f / Main.player[this.owner].meleeSpeed;
float num209 = 0.9f / Main.player[this.owner].meleeSpeed;
float num210 = 300f;
if (this.type == 63)
{
num210 *= 1.5f;
num208 *= 1.5f;
num209 *= 1.5f;
}
if (this.type == 247)
{
num210 *= 1.5f;
num208 = 15.9f;
num209 *= 2f;
}
Math.Abs(num204);
Math.Abs(num205);
if (this.ai[1] == 1f)
{
this.tileCollide = false;
}
if (!Main.player[this.owner].channel || num206 > num210 || !this.tileCollide)
{
this.ai[1] = 1f;
if (this.tileCollide)
{
this.netUpdate = true;
}
this.tileCollide = false;
if (num206 < 20f)
{
this.Kill();
}
}
if (!this.tileCollide)
{
num209 *= 2f;
}
int num211 = 60;
if (this.type == 247)
{
num211 = 100;
}
if (num206 > (float)num211 || !this.tileCollide)
{
num206 = num208 / num206;
num204 *= num206;
num205 *= num206;
new Vector2(this.velocity.X, this.velocity.Y);
float num212 = num204 - this.velocity.X;
float num213 = num205 - this.velocity.Y;
float num214 = (float)Math.Sqrt((double)(num212 * num212 + num213 * num213));
num214 = num209 / num214;
num212 *= num214;
num213 *= num214;
this.velocity.X = this.velocity.X * 0.98f;
this.velocity.Y = this.velocity.Y * 0.98f;
this.velocity.X = this.velocity.X + num212;
this.velocity.Y = this.velocity.Y + num213;
}
else
{
if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 6f)
{
this.velocity.X = this.velocity.X * 0.96f;
this.velocity.Y = this.velocity.Y + 0.2f;
}
if (Main.player[this.owner].velocity.X == 0f)
{
this.velocity.X = this.velocity.X * 0.96f;
}
}
}
if (this.type != 247)
{
this.rotation = (float)Math.Atan2((double)num205, (double)num204) - this.velocity.X * 0.1f;
return;
}
if (this.velocity.X < 0f)
{
this.rotation -= (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f;
}
else
{
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f;
}
float num215 = this.position.X;
float num216 = this.position.Y;
float num217 = 600f;
bool flag4 = false;
if (this.owner == Main.myPlayer)
{
this.localAI[1] += 1f;
if (this.localAI[1] > 20f)
{
this.localAI[1] = 20f;
for (int num218 = 0; num218 < 200; num218++)
{
if (Main.npc[num218].CanBeChasedBy(this, false))
{
float num219 = Main.npc[num218].position.X + (float)(Main.npc[num218].width / 2);
float num220 = Main.npc[num218].position.Y + (float)(Main.npc[num218].height / 2);
float num221 = Math.Abs(this.position.X + (float)(this.width / 2) - num219) + Math.Abs(this.position.Y + (float)(this.height / 2) - num220);
if (num221 < num217 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num218].position, Main.npc[num218].width, Main.npc[num218].height))
{
num217 = num221;
num215 = num219;
num216 = num220;
flag4 = true;
}
}
}
}
}
if (flag4)
{
this.localAI[1] = 0f;
float num222 = 14f;
vector18 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
num204 = num215 - vector18.X;
num205 = num216 - vector18.Y;
num206 = (float)Math.Sqrt((double)(num204 * num204 + num205 * num205));
num206 = num222 / num206;
num204 *= num206;
num205 *= num206;
Projectile.NewProjectile(vector18.X, vector18.Y, num204, num205, 248, (int)((double)this.damage / 1.5), this.knockBack / 2f, Main.myPlayer, 0f, 0f);
return;
}
}
else if (this.aiStyle == 16)
{
if (this.type == 108 || this.type == 164)
{
this.ai[0] += 1f;
if (this.ai[0] > 3f)
{
this.Kill();
}
}
if (this.type != 37 && this.type != 397 && this.type != 470)
{
if (this.type != 519)
{
goto IL_990C;
}
}
try
{
int num223 = (int)(this.position.X / 16f) - 1;
int num224 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num225 = (int)(this.position.Y / 16f) - 1;
int num226 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num223 < 0)
{
num223 = 0;
}
if (num224 > Main.maxTilesX)
{
num224 = Main.maxTilesX;
}
if (num225 < 0)
{
num225 = 0;
}
if (num226 > Main.maxTilesY)
{
num226 = Main.maxTilesY;
}
for (int num227 = num223; num227 < num224; num227++)
{
for (int num228 = num225; num228 < num226; num228++)
{
if (Main.tile[num227, num228] != null && Main.tile[num227, num228].nactive() && (Main.tileSolid[(int)Main.tile[num227, num228].type] || (Main.tileSolidTop[(int)Main.tile[num227, num228].type] && Main.tile[num227, num228].frameY == 0)))
{
Vector2 vector19;
vector19.X = (float)(num227 * 16);
vector19.Y = (float)(num228 * 16);
if (this.position.X + (float)this.width - 4f > vector19.X && this.position.X + 4f < vector19.X + 16f && this.position.Y + (float)this.height - 4f > vector19.Y && this.position.Y + 4f < vector19.Y + 16f)
{
this.velocity.X = 0f;
this.velocity.Y = -0.2f;
}
}
}
}
}
catch
{
}
IL_990C:
if (this.type == 519)
{
this.localAI[1] += 1f;
float num229 = 180f - this.localAI[1];
if (num229 < 0f)
{
num229 = 0f;
}
this.frameCounter++;
if (num229 < 15f)
{
this.frameCounter++;
}
if ((float)this.frameCounter >= (num229 / 10f + 6f) / 2f)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
}
if (this.type == 102)
{
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
}
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
}
this.frameCounter++;
if (this.frameCounter > 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 1)
{
this.frame = 0;
}
if (this.velocity.Y == 0f)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 128;
this.height = 128;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.damage = 40;
this.knockBack = 8f;
this.timeLeft = 3;
this.netUpdate = true;
}
}
if (this.type == 303 && this.timeLeft <= 3 && this.hostile)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 128;
this.height = 128;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
}
if (this.owner == Main.myPlayer && this.timeLeft <= 3)
{
this.tileCollide = false;
this.ai[1] = 0f;
this.alpha = 255;
if (this.type == 28 || this.type == 37 || this.type == 75 || this.type == 516 || this.type == 519)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 128;
this.height = 128;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.damage = 100;
this.knockBack = 8f;
}
else if (this.type == 29 || this.type == 470 || this.type == 637)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 250;
this.height = 250;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.damage = 250;
this.knockBack = 10f;
}
else if (this.type == 30 || this.type == 397 || this.type == 517 || this.type == 588)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 128;
this.height = 128;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.knockBack = 8f;
}
else if (this.type == 133 || this.type == 134 || this.type == 135 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 338 || this.type == 339)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 128;
this.height = 128;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.knockBack = 8f;
}
else if (this.type == 139 || this.type == 140 || this.type == 141 || this.type == 142 || this.type == 143 || this.type == 144 || this.type == 340 || this.type == 341)
{
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 200;
this.height = 200;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.knockBack = 10f;
}
}
else
{
if (this.type != 30 && this.type != 517 && this.type != 588 && this.type != 397 && this.type != 108 && this.type != 133 && this.type != 134 && this.type != 135 && this.type != 136 && this.type != 137 && this.type != 138 && this.type != 139 && this.type != 140 && this.type != 141 && this.type != 142 && this.type != 143 && this.type != 144 && this.type != 164 && this.type != 303 && this.type < 338 && this.type < 341)
{
this.damage = 0;
}
if (this.type == 338 || this.type == 339 || this.type == 340 || this.type == 341)
{
this.localAI[1] += 1f;
if (this.localAI[1] > 6f)
{
this.alpha = 0;
}
else
{
this.alpha = (int)(255f - 42f * this.localAI[1]) + 100;
if (this.alpha > 255)
{
this.alpha = 255;
}
}
for (int num230 = 0; num230 < 2; num230++)
{
float num231 = 0f;
float num232 = 0f;
if (num230 == 1)
{
num231 = this.velocity.X * 0.5f;
num232 = this.velocity.Y * 0.5f;
}
if (this.localAI[1] > 9f)
{
if (Main.rand.Next(2) == 0)
{
int num233 = Dust.NewDust(new Vector2(this.position.X + 3f + num231, this.position.Y + 3f + num232) - this.velocity * 0.5f, this.width - 8, this.height - 8, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num233].scale *= 1.4f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num233].velocity *= 0.2f;
Main.dust[num233].noGravity = true;
}
if (Main.rand.Next(2) == 0)
{
int num234 = Dust.NewDust(new Vector2(this.position.X + 3f + num231, this.position.Y + 3f + num232) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num234].fadeIn = 0.5f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num234].velocity *= 0.05f;
}
}
}
float num235 = this.position.X;
float num236 = this.position.Y;
float num237 = 600f;
bool flag5 = false;
this.ai[0] += 1f;
if (this.ai[0] > 30f)
{
this.ai[0] = 30f;
for (int num238 = 0; num238 < 200; num238++)
{
if (Main.npc[num238].CanBeChasedBy(this, false))
{
float num239 = Main.npc[num238].position.X + (float)(Main.npc[num238].width / 2);
float num240 = Main.npc[num238].position.Y + (float)(Main.npc[num238].height / 2);
float num241 = Math.Abs(this.position.X + (float)(this.width / 2) - num239) + Math.Abs(this.position.Y + (float)(this.height / 2) - num240);
if (num241 < num237 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num238].position, Main.npc[num238].width, Main.npc[num238].height))
{
num237 = num241;
num235 = num239;
num236 = num240;
flag5 = true;
}
}
}
}
if (!flag5)
{
num235 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f;
num236 = this.position.Y + (float)(this.height / 2) + this.velocity.Y * 100f;
}
float num242 = 16f;
Vector2 vector20 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num243 = num235 - vector20.X;
float num244 = num236 - vector20.Y;
float num245 = (float)Math.Sqrt((double)(num243 * num243 + num244 * num244));
num245 = num242 / num245;
num243 *= num245;
num244 *= num245;
this.velocity.X = (this.velocity.X * 11f + num243) / 12f;
this.velocity.Y = (this.velocity.Y * 11f + num244) / 12f;
}
else if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303)
{
if (Math.Abs(this.velocity.X) >= 8f || Math.Abs(this.velocity.Y) >= 8f)
{
for (int num246 = 0; num246 < 2; num246++)
{
float num247 = 0f;
float num248 = 0f;
if (num246 == 1)
{
num247 = this.velocity.X * 0.5f;
num248 = this.velocity.Y * 0.5f;
}
int num249 = Dust.NewDust(new Vector2(this.position.X + 3f + num247, this.position.Y + 3f + num248) - this.velocity * 0.5f, this.width - 8, this.height - 8, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num249].velocity *= 0.2f;
Main.dust[num249].noGravity = true;
num249 = Dust.NewDust(new Vector2(this.position.X + 3f + num247, this.position.Y + 3f + num248) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num249].velocity *= 0.05f;
}
}
if (Math.Abs(this.velocity.X) < 15f && Math.Abs(this.velocity.Y) < 15f)
{
this.velocity *= 1.1f;
}
}
else if (this.type == 133 || this.type == 136 || this.type == 139 || this.type == 142)
{
int num250 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num250].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num250].velocity *= 0.2f;
Main.dust[num250].noGravity = true;
}
else if (this.type == 135 || this.type == 138 || this.type == 141 || this.type == 144)
{
if ((double)this.velocity.X > -0.2 && (double)this.velocity.X < 0.2 && (double)this.velocity.Y > -0.2 && (double)this.velocity.Y < 0.2)
{
this.alpha += 2;
if (this.alpha > 200)
{
this.alpha = 200;
}
}
else
{
this.alpha = 0;
int num251 = Dust.NewDust(new Vector2(this.position.X + 3f, this.position.Y + 3f) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num251].scale *= 1.6f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num251].velocity *= 0.05f;
Main.dust[num251].noGravity = true;
}
}
else if (this.type != 30 && this.type != 517 && this.type != 397 && this.type != 519 && this.type != 588 && Main.rand.Next(2) == 0)
{
int num252 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num252].noGravity = true;
Main.dust[num252].position = base.Center + new Vector2(0f, (float)(-(float)this.height / 2)).RotatedBy((double)this.rotation, default(Vector2)) * 1.1f;
Main.rand.Next(2);
num252 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num252].noGravity = true;
Main.dust[num252].position = base.Center + new Vector2(0f, (float)(-(float)this.height / 2 - 6)).RotatedBy((double)this.rotation, default(Vector2)) * 1.1f;
}
}
this.ai[0] += 1f;
if (this.type == 338 || this.type == 339 || this.type == 340 || this.type == 341)
{
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)) - 1.57f;
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
}
else if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
else if (this.type == 135 || this.type == 138 || this.type == 141 || this.type == 144)
{
this.velocity.Y = this.velocity.Y + 0.2f;
this.velocity *= 0.97f;
if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1)
{
this.velocity.X = 0f;
}
if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1)
{
this.velocity.Y = 0f;
}
}
else if (this.type == 133 || this.type == 136 || this.type == 139 || this.type == 142)
{
if (this.ai[0] > 15f)
{
if (this.velocity.Y == 0f)
{
this.velocity.X = this.velocity.X * 0.95f;
}
this.velocity.Y = this.velocity.Y + 0.2f;
}
}
else if (((this.type == 30 || this.type == 397 || this.type == 517 || this.type == 588) && this.ai[0] > 10f) || (this.type != 30 && this.type != 397 && this.type != 517 && this.type != 588 && this.ai[0] > 5f))
{
this.ai[0] = 10f;
if (this.velocity.Y == 0f && this.velocity.X != 0f)
{
this.velocity.X = this.velocity.X * 0.97f;
if (this.type == 29 || this.type == 470 || this.type == 637)
{
this.velocity.X = this.velocity.X * 0.99f;
}
if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01)
{
this.velocity.X = 0f;
this.netUpdate = true;
}
}
this.velocity.Y = this.velocity.Y + 0.2f;
}
if (this.type == 519)
{
this.rotation += this.velocity.X * 0.06f;
return;
}
if (this.type != 134 && this.type != 137 && this.type != 140 && this.type != 143 && this.type != 303 && (this.type < 338 || this.type > 341))
{
this.rotation += this.velocity.X * 0.1f;
return;
}
}
else if (this.aiStyle == 17)
{
if (this.velocity.Y == 0f)
{
this.velocity.X = this.velocity.X * 0.98f;
}
this.rotation += this.velocity.X * 0.1f;
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.owner == Main.myPlayer)
{
int num253 = (int)((this.position.X + (float)(this.width / 2)) / 16f);
int num254 = (int)((this.position.Y + (float)this.height - 4f) / 16f);
if (Main.tile[num253, num254] != null && !Main.tile[num253, num254].active())
{
int num255 = 0;
if (this.type >= 201 && this.type <= 205)
{
num255 = this.type - 200;
}
if (this.type >= 527 && this.type <= 531)
{
num255 = this.type - 527 + 6;
}
WorldGen.PlaceTile(num253, num254, 85, false, false, this.owner, num255);
if (Main.tile[num253, num254].active())
{
if (Main.netMode != 0)
{
NetMessage.SendData(17, -1, -1, "", 1, (float)num253, (float)num254, 85f, num255, 0, 0);
}
int num256 = Sign.ReadSign(num253, num254, true);
if (num256 >= 0)
{
Sign.TextSign(num256, this.miscText);
}
this.Kill();
return;
}
}
}
}
else if (this.aiStyle == 18)
{
if (this.ai[1] == 0f && this.type == 44)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
}
if (this.type != 263 && this.type != 274)
{
this.rotation += (float)this.direction * 0.8f;
this.ai[0] += 1f;
if (this.ai[0] >= 30f)
{
if (this.ai[0] < 100f)
{
this.velocity *= 1.06f;
}
else
{
this.ai[0] = 200f;
}
}
for (int num257 = 0; num257 < 2; num257++)
{
int num258 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, 0f, 0f, 100, default(Color), 1f);
Main.dust[num258].noGravity = true;
}
return;
}
if (this.type == 274 && this.velocity.X < 0f)
{
this.spriteDirection = -1;
}
this.rotation += (float)this.direction * 0.05f;
this.rotation += (float)this.direction * 0.5f * ((float)this.timeLeft / 180f);
if (this.type == 274)
{
this.velocity *= 0.96f;
return;
}
this.velocity *= 0.95f;
return;
}
else if (this.aiStyle == 19)
{
Vector2 vector21 = Main.player[this.owner].RotatedRelativePoint(Main.player[this.owner].MountedCenter, true);
this.direction = Main.player[this.owner].direction;
Main.player[this.owner].heldProj = this.whoAmI;
Main.player[this.owner].itemTime = Main.player[this.owner].itemAnimation;
this.position.X = vector21.X - (float)(this.width / 2);
this.position.Y = vector21.Y - (float)(this.height / 2);
if (!Main.player[this.owner].frozen)
{
if (this.type == 46)
{
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.6f;
}
else
{
this.ai[0] += 1.4f;
}
}
else if (this.type == 105)
{
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 2.4f;
}
else
{
this.ai[0] += 2.1f;
}
}
else if (this.type == 367)
{
this.spriteDirection = -this.direction;
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.6f;
}
else
{
this.ai[0] += 1.5f;
}
}
else if (this.type == 368)
{
this.spriteDirection = -this.direction;
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.5f;
}
else
{
this.ai[0] += 1.4f;
}
}
else if (this.type == 222)
{
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 2.4f;
if (this.localAI[0] == 0f && Main.myPlayer == this.owner)
{
this.localAI[0] = 1f;
Projectile.NewProjectile(base.Center.X + this.velocity.X * this.ai[0], base.Center.Y + this.velocity.Y * this.ai[0], this.velocity.X, this.velocity.Y, 228, this.damage, this.knockBack, this.owner, 0f, 0f);
}
}
else
{
this.ai[0] += 2.1f;
}
}
else if (this.type == 342)
{
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 2.4f;
if (this.localAI[0] == 0f && Main.myPlayer == this.owner)
{
this.localAI[0] = 1f;
if (Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, new Vector2(base.Center.X + this.velocity.X * this.ai[0], base.Center.Y + this.velocity.Y * this.ai[0]), this.width, this.height))
{
Projectile.NewProjectile(base.Center.X + this.velocity.X * this.ai[0], base.Center.Y + this.velocity.Y * this.ai[0], this.velocity.X * 2.4f, this.velocity.Y * 2.4f, 343, (int)((double)this.damage * 0.8), this.knockBack * 0.85f, this.owner, 0f, 0f);
}
}
}
else
{
this.ai[0] += 2.1f;
}
}
else if (this.type == 47)
{
if (this.ai[0] == 0f)
{
this.ai[0] = 4f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.2f;
}
else
{
this.ai[0] += 0.9f;
}
}
else if (this.type == 153)
{
this.spriteDirection = -this.direction;
if (this.ai[0] == 0f)
{
this.ai[0] = 4f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.5f;
}
else
{
this.ai[0] += 1.3f;
}
}
else if (this.type == 49)
{
if (this.ai[0] == 0f)
{
this.ai[0] = 4f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.1f;
}
else
{
this.ai[0] += 0.85f;
}
}
else if (this.type == 64 || this.type == 215)
{
this.spriteDirection = -this.direction;
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.9f;
}
else
{
this.ai[0] += 1.7f;
}
}
else if (this.type == 66 || this.type == 97 || this.type == 212 || this.type == 218)
{
this.spriteDirection = -this.direction;
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 2.1f;
}
else
{
this.ai[0] += 1.9f;
}
}
else if (this.type == 130)
{
this.spriteDirection = -this.direction;
if (this.ai[0] == 0f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3)
{
this.ai[0] -= 1.3f;
}
else
{
this.ai[0] += 1f;
}
}
}
this.position += this.velocity * this.ai[0];
if (this.type == 130)
{
if (this.ai[1] == 0f || this.ai[1] == 4f || this.ai[1] == 8f || this.ai[1] == 12f || this.ai[1] == 16f || this.ai[1] == 20f || this.ai[1] == 24f)
{
Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, 131, this.damage / 3, 0f, this.owner, 0f, 0f);
}
this.ai[1] += 1f;
}
if (Main.player[this.owner].itemAnimation == 0)
{
this.Kill();
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 2.355f;
if (this.spriteDirection == -1)
{
this.rotation -= 1.57f;
}
if (this.type == 46)
{
if (Main.rand.Next(5) == 0)
{
Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.4f);
}
int num259 = Dust.NewDust(this.position, this.width, this.height, 27, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.2f);
Main.dust[num259].noGravity = true;
Dust expr_C4D5_cp_0 = Main.dust[num259];
expr_C4D5_cp_0.velocity.X = expr_C4D5_cp_0.velocity.X / 2f;
Dust expr_C4F5_cp_0 = Main.dust[num259];
expr_C4F5_cp_0.velocity.Y = expr_C4F5_cp_0.velocity.Y / 2f;
num259 = Dust.NewDust(this.position - this.velocity * 2f, this.width, this.height, 27, 0f, 0f, 150, default(Color), 1.4f);
Dust expr_C569_cp_0 = Main.dust[num259];
expr_C569_cp_0.velocity.X = expr_C569_cp_0.velocity.X / 5f;
Dust expr_C589_cp_0 = Main.dust[num259];
expr_C589_cp_0.velocity.Y = expr_C589_cp_0.velocity.Y / 5f;
return;
}
if (this.type == 105)
{
if (Main.rand.Next(3) == 0)
{
int num260 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 57, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 200, default(Color), 1.2f);
Main.dust[num260].velocity += this.velocity * 0.3f;
Main.dust[num260].velocity *= 0.2f;
}
if (Main.rand.Next(4) == 0)
{
int num261 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 43, 0f, 0f, 254, default(Color), 0.3f);
Main.dust[num261].velocity += this.velocity * 0.5f;
Main.dust[num261].velocity *= 0.5f;
return;
}
}
else if (this.type == 153)
{
int num262 = Dust.NewDust(this.position - this.velocity * 3f, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140, default(Color), 1f);
Main.dust[num262].noGravity = true;
Main.dust[num262].fadeIn = 1.25f;
Main.dust[num262].velocity *= 0.25f;
return;
}
}
else if (this.aiStyle == 20)
{
if (this.type == 252)
{
this.frameCounter++;
if (this.frameCounter >= 4)
{
this.frameCounter = 0;
this.frame++;
}
if (this.frame > 3)
{
this.frame = 0;
}
}
if (this.type == 509)
{
this.frameCounter++;
if (this.frameCounter >= 2)
{
this.frameCounter = 0;
this.frame++;
}
if (this.frame > 1)
{
this.frame = 0;
}
}
if (this.soundDelay <= 0)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 22);
this.soundDelay = 30;
}
Vector2 vector22 = Main.player[this.owner].RotatedRelativePoint(Main.player[this.owner].MountedCenter, true);
if (Main.myPlayer == this.owner)
{
if (Main.player[this.owner].channel)
{
float num263 = Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].shootSpeed * this.scale;
Vector2 vector23 = vector22;
float num264 = (float)Main.mouseX + Main.screenPosition.X - vector23.X;
float num265 = (float)Main.mouseY + Main.screenPosition.Y - vector23.Y;
if (Main.player[this.owner].gravDir == -1f)
{
num265 = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector23.Y;
}
float num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265));
num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265));
num266 = num263 / num266;
num264 *= num266;
num265 *= num266;
if (num264 != this.velocity.X || num265 != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity.X = num264;
this.velocity.Y = num265;
}
else
{
this.Kill();
}
}
if (this.velocity.X > 0f)
{
Main.player[this.owner].ChangeDir(1);
}
else if (this.velocity.X < 0f)
{
Main.player[this.owner].ChangeDir(-1);
}
this.spriteDirection = this.direction;
Main.player[this.owner].ChangeDir(this.direction);
Main.player[this.owner].heldProj = this.whoAmI;
Main.player[this.owner].itemTime = 2;
Main.player[this.owner].itemAnimation = 2;
this.position.X = vector22.X - (float)(this.width / 2);
this.position.Y = vector22.Y - (float)(this.height / 2);
this.rotation = (float)(Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.5700000524520874);
if (Main.player[this.owner].direction == 1)
{
Main.player[this.owner].itemRotation = (float)Math.Atan2((double)(this.velocity.Y * (float)this.direction), (double)(this.velocity.X * (float)this.direction));
}
else
{
Main.player[this.owner].itemRotation = (float)Math.Atan2((double)(this.velocity.Y * (float)this.direction), (double)(this.velocity.X * (float)this.direction));
}
this.velocity.X = this.velocity.X * (1f + (float)Main.rand.Next(-3, 4) * 0.01f);
if (Main.rand.Next(6) == 0)
{
int num267 = Dust.NewDust(this.position + this.velocity * (float)Main.rand.Next(6, 10) * 0.1f, this.width, this.height, 31, 0f, 0f, 80, default(Color), 1.4f);
Dust expr_CCB5_cp_0 = Main.dust[num267];
expr_CCB5_cp_0.position.X = expr_CCB5_cp_0.position.X - 4f;
Main.dust[num267].noGravity = true;
Main.dust[num267].velocity *= 0.2f;
Main.dust[num267].velocity.Y = (float)(-(float)Main.rand.Next(7, 13)) * 0.15f;
return;
}
}
else if (this.aiStyle == 21)
{
this.rotation = this.velocity.X * 0.1f;
this.spriteDirection = -this.direction;
if (Main.rand.Next(3) == 0)
{
int num268 = Dust.NewDust(this.position, this.width, this.height, 27, 0f, 0f, 80, default(Color), 1f);
Main.dust[num268].noGravity = true;
Main.dust[num268].velocity *= 0.2f;
}
if (this.ai[1] == 1f)
{
this.ai[1] = 0f;
Main.harpNote = this.ai[0];
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 26);
return;
}
}
else if (this.aiStyle == 22)
{
if (this.velocity.X == 0f && this.velocity.Y == 0f)
{
this.alpha = 255;
}
if (this.ai[1] < 0f)
{
if (this.velocity.X > 0f)
{
this.rotation += 0.3f;
}
else
{
this.rotation -= 0.3f;
}
int num269 = (int)(this.position.X / 16f) - 1;
int num270 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num271 = (int)(this.position.Y / 16f) - 1;
int num272 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num269 < 0)
{
num269 = 0;
}
if (num270 > Main.maxTilesX)
{
num270 = Main.maxTilesX;
}
if (num271 < 0)
{
num271 = 0;
}
if (num272 > Main.maxTilesY)
{
num272 = Main.maxTilesY;
}
int num273 = (int)this.position.X + 4;
int num274 = (int)this.position.Y + 4;
for (int num275 = num269; num275 < num270; num275++)
{
for (int num276 = num271; num276 < num272; num276++)
{
if (Main.tile[num275, num276] != null && Main.tile[num275, num276].active() && Main.tile[num275, num276].type != 127 && Main.tileSolid[(int)Main.tile[num275, num276].type] && !Main.tileSolidTop[(int)Main.tile[num275, num276].type])
{
Vector2 vector24;
vector24.X = (float)(num275 * 16);
vector24.Y = (float)(num276 * 16);
if ((float)(num273 + 8) > vector24.X && (float)num273 < vector24.X + 16f && (float)(num274 + 8) > vector24.Y && (float)num274 < vector24.Y + 16f)
{
this.Kill();
}
}
}
}
int num277 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f);
Main.dust[num277].noGravity = true;
Main.dust[num277].velocity *= 0.3f;
return;
}
if (this.ai[0] < 0f)
{
if (this.ai[0] == -1f)
{
for (int num278 = 0; num278 < 10; num278++)
{
int num279 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1.1f);
Main.dust[num279].noGravity = true;
Main.dust[num279].velocity *= 1.3f;
}
}
else if (Main.rand.Next(30) == 0)
{
int num280 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 100, default(Color), 1f);
Main.dust[num280].velocity *= 0.2f;
}
int num281 = (int)this.position.X / 16;
int num282 = (int)this.position.Y / 16;
if (Main.tile[num281, num282] == null || !Main.tile[num281, num282].active())
{
this.Kill();
}
this.ai[0] -= 1f;
if (this.ai[0] <= -900f && (Main.myPlayer == this.owner || Main.netMode == 2) && Main.tile[num281, num282].active() && Main.tile[num281, num282].type == 127)
{
WorldGen.KillTile(num281, num282, false, false, false);
if (Main.netMode == 1)
{
NetMessage.SendData(17, -1, -1, "", 0, (float)num281, (float)num282, 0f, 0, 0, 0);
}
this.Kill();
return;
}
}
else
{
int num283 = (int)(this.position.X / 16f) - 1;
int num284 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num285 = (int)(this.position.Y / 16f) - 1;
int num286 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num283 < 0)
{
num283 = 0;
}
if (num284 > Main.maxTilesX)
{
num284 = Main.maxTilesX;
}
if (num285 < 0)
{
num285 = 0;
}
if (num286 > Main.maxTilesY)
{
num286 = Main.maxTilesY;
}
int num287 = (int)this.position.X + 4;
int num288 = (int)this.position.Y + 4;
for (int num289 = num283; num289 < num284; num289++)
{
for (int num290 = num285; num290 < num286; num290++)
{
if (Main.tile[num289, num290] != null && Main.tile[num289, num290].nactive() && Main.tile[num289, num290].type != 127 && Main.tileSolid[(int)Main.tile[num289, num290].type] && !Main.tileSolidTop[(int)Main.tile[num289, num290].type])
{
Vector2 vector25;
vector25.X = (float)(num289 * 16);
vector25.Y = (float)(num290 * 16);
if ((float)(num287 + 8) > vector25.X && (float)num287 < vector25.X + 16f && (float)(num288 + 8) > vector25.Y && (float)num288 < vector25.Y + 16f)
{
this.Kill();
}
}
}
}
if (this.lavaWet)
{
this.Kill();
}
if (this.active)
{
int num291 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f);
Main.dust[num291].noGravity = true;
Main.dust[num291].velocity *= 0.3f;
int num292 = (int)this.ai[0];
int num293 = (int)this.ai[1];
if (WorldGen.SolidTile(num292, num293))
{
if (Math.Abs(this.velocity.X) > Math.Abs(this.velocity.Y))
{
if (base.Center.Y < (float)(num293 * 16 + 8) && !WorldGen.SolidTile(num292, num293 - 1))
{
num293--;
}
else if (!WorldGen.SolidTile(num292, num293 + 1))
{
num293++;
}
else if (!WorldGen.SolidTile(num292, num293 - 1))
{
num293--;
}
else if (base.Center.X < (float)(num292 * 16 + 8) && !WorldGen.SolidTile(num292 - 1, num293))
{
num292--;
}
else if (!WorldGen.SolidTile(num292 + 1, num293))
{
num292++;
}
else if (!WorldGen.SolidTile(num292 - 1, num293))
{
num292--;
}
}
else if (base.Center.X < (float)(num292 * 16 + 8) && !WorldGen.SolidTile(num292 - 1, num293))
{
num292--;
}
else if (!WorldGen.SolidTile(num292 + 1, num293))
{
num292++;
}
else if (!WorldGen.SolidTile(num292 - 1, num293))
{
num292--;
}
else if (base.Center.Y < (float)(num293 * 16 + 8) && !WorldGen.SolidTile(num292, num293 - 1))
{
num293--;
}
else if (!WorldGen.SolidTile(num292, num293 + 1))
{
num293++;
}
else if (!WorldGen.SolidTile(num292, num293 - 1))
{
num293--;
}
}
if (this.velocity.X > 0f)
{
this.rotation += 0.3f;
}
else
{
this.rotation -= 0.3f;
}
if (Main.myPlayer == this.owner)
{
int num294 = (int)((this.position.X + (float)(this.width / 2)) / 16f);
int num295 = (int)((this.position.Y + (float)(this.height / 2)) / 16f);
bool flag6 = false;
if (num294 == num292 && num295 == num293)
{
flag6 = true;
}
if (((this.velocity.X <= 0f && num294 <= num292) || (this.velocity.X >= 0f && num294 >= num292)) && ((this.velocity.Y <= 0f && num295 <= num293) || (this.velocity.Y >= 0f && num295 >= num293)))
{
flag6 = true;
}
if (flag6)
{
if (WorldGen.PlaceTile(num292, num293, 127, false, false, this.owner, 0))
{
if (Main.netMode == 1)
{
NetMessage.SendData(17, -1, -1, "", 1, (float)((int)this.ai[0]), (float)((int)this.ai[1]), 127f, 0, 0, 0);
}
this.damage = 0;
this.ai[0] = -1f;
this.velocity *= 0f;
this.alpha = 255;
this.position.X = (float)(num292 * 16);
this.position.Y = (float)(num293 * 16);
this.netUpdate = true;
return;
}
this.ai[1] = -1f;
return;
}
}
}
}
}
else
{
if (this.aiStyle == 23)
{
if (this.type == 188 && this.ai[0] < 8f)
{
this.ai[0] = 8f;
}
if (this.timeLeft > 60)
{
this.timeLeft = 60;
}
if (this.ai[0] > 7f)
{
float num296 = 1f;
if (this.ai[0] == 8f)
{
num296 = 0.25f;
}
else if (this.ai[0] == 9f)
{
num296 = 0.5f;
}
else if (this.ai[0] == 10f)
{
num296 = 0.75f;
}
this.ai[0] += 1f;
int num297 = 6;
if (this.type == 101)
{
num297 = 75;
}
if (num297 == 6 || Main.rand.Next(2) == 0)
{
for (int num298 = 0; num298 < 1; num298++)
{
int num299 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num297, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f);
if (Main.rand.Next(3) != 0 || (num297 == 75 && Main.rand.Next(3) == 0))
{
Main.dust[num299].noGravity = true;
Main.dust[num299].scale *= 3f;
Dust expr_DC2B_cp_0 = Main.dust[num299];
expr_DC2B_cp_0.velocity.X = expr_DC2B_cp_0.velocity.X * 2f;
Dust expr_DC4B_cp_0 = Main.dust[num299];
expr_DC4B_cp_0.velocity.Y = expr_DC4B_cp_0.velocity.Y * 2f;
}
if (this.type == 188)
{
Main.dust[num299].scale *= 1.25f;
}
else
{
Main.dust[num299].scale *= 1.5f;
}
Dust expr_DCB0_cp_0 = Main.dust[num299];
expr_DCB0_cp_0.velocity.X = expr_DCB0_cp_0.velocity.X * 1.2f;
Dust expr_DCD0_cp_0 = Main.dust[num299];
expr_DCD0_cp_0.velocity.Y = expr_DCD0_cp_0.velocity.Y * 1.2f;
Main.dust[num299].scale *= num296;
if (num297 == 75)
{
Main.dust[num299].velocity += this.velocity;
if (!Main.dust[num299].noGravity)
{
Main.dust[num299].velocity *= 0.5f;
}
}
}
}
}
else
{
this.ai[0] += 1f;
}
this.rotation += 0.3f * (float)this.direction;
return;
}
if (this.aiStyle == 24)
{
this.light = this.scale * 0.5f;
this.rotation += this.velocity.X * 0.2f;
this.ai[1] += 1f;
if (this.type == 94)
{
if (Main.rand.Next(4) == 0)
{
int num300 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 70, 0f, 0f, 0, default(Color), 1f);
Main.dust[num300].noGravity = true;
Main.dust[num300].velocity *= 0.5f;
Main.dust[num300].scale *= 0.9f;
}
this.velocity *= 0.985f;
if (this.ai[1] > 130f)
{
this.scale -= 0.05f;
if ((double)this.scale <= 0.2)
{
this.scale = 0.2f;
this.Kill();
return;
}
}
}
else
{
this.velocity *= 0.96f;
if (this.ai[1] > 15f)
{
this.scale -= 0.05f;
if ((double)this.scale <= 0.2)
{
this.scale = 0.2f;
this.Kill();
return;
}
}
}
}
else
{
if (this.aiStyle == 25)
{
if (this.ai[0] != 0f && this.velocity.Y <= 0f && this.velocity.X == 0f)
{
float num301 = 0.5f;
int i2 = (int)((this.position.X - 8f) / 16f);
int num302 = (int)(this.position.Y / 16f);
bool flag7 = false;
bool flag8 = false;
if (WorldGen.SolidTile(i2, num302) || WorldGen.SolidTile(i2, num302 + 1))
{
flag7 = true;
}
i2 = (int)((this.position.X + (float)this.width + 8f) / 16f);
if (WorldGen.SolidTile(i2, num302) || WorldGen.SolidTile(i2, num302 + 1))
{
flag8 = true;
}
if (flag7)
{
this.velocity.X = num301;
}
else if (flag8)
{
this.velocity.X = -num301;
}
else
{
i2 = (int)((this.position.X - 8f - 16f) / 16f);
num302 = (int)(this.position.Y / 16f);
flag7 = false;
flag8 = false;
if (WorldGen.SolidTile(i2, num302) || WorldGen.SolidTile(i2, num302 + 1))
{
flag7 = true;
}
i2 = (int)((this.position.X + (float)this.width + 8f + 16f) / 16f);
if (WorldGen.SolidTile(i2, num302) || WorldGen.SolidTile(i2, num302 + 1))
{
flag8 = true;
}
if (flag7)
{
this.velocity.X = num301;
}
else if (flag8)
{
this.velocity.X = -num301;
}
else
{
i2 = (int)((this.position.X + 4f) / 16f);
num302 = (int)((this.position.Y + (float)this.height + 8f) / 16f);
if (WorldGen.SolidTile(i2, num302) || WorldGen.SolidTile(i2, num302 + 1))
{
flag7 = true;
}
if (!flag7)
{
this.velocity.X = num301;
}
else
{
this.velocity.X = -num301;
}
}
}
}
this.rotation += this.velocity.X * 0.06f;
this.ai[0] = 1f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
if (this.velocity.Y <= 6f)
{
if (this.velocity.X > 0f && this.velocity.X < 7f)
{
this.velocity.X = this.velocity.X + 0.05f;
}
if (this.velocity.X < 0f && this.velocity.X > -7f)
{
this.velocity.X = this.velocity.X - 0.05f;
}
}
this.velocity.Y = this.velocity.Y + 0.3f;
return;
}
if (this.aiStyle == 26)
{
this.AI_026();
return;
}
if (this.aiStyle == 27)
{
if (this.type == 115)
{
this.ai[0] += 1f;
if (this.ai[0] < 30f)
{
this.velocity *= 1.125f;
}
}
if (this.type == 115 && this.localAI[1] < 5f)
{
this.localAI[1] = 5f;
for (int num303 = 5; num303 < 25; num303++)
{
float num304 = this.velocity.X * (30f / (float)num303);
float num305 = this.velocity.Y * (30f / (float)num303);
num304 *= 80f;
num305 *= 80f;
int num306 = Dust.NewDust(new Vector2(this.position.X - num304, this.position.Y - num305), 8, 8, 27, this.oldVelocity.X, this.oldVelocity.Y, 100, default(Color), 0.9f);
Main.dust[num306].velocity *= 0.25f;
Main.dust[num306].velocity -= this.velocity * 5f;
}
}
if (this.localAI[1] > 7f && this.type == 173)
{
int num307 = Main.rand.Next(3);
if (num307 == 0)
{
num307 = 15;
}
else if (num307 == 1)
{
num307 = 57;
}
else
{
num307 = 58;
}
int num308 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, num307, 0f, 0f, 100, default(Color), 1.25f);
Main.dust[num308].velocity *= 0.1f;
}
if (this.localAI[1] > 7f && this.type == 132)
{
int num309 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, 107, this.oldVelocity.X, this.oldVelocity.Y, 100, default(Color), 1.25f);
Main.dust[num309].velocity *= -0.25f;
num309 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, 107, this.oldVelocity.X, this.oldVelocity.Y, 100, default(Color), 1.25f);
Main.dust[num309].velocity *= -0.25f;
Main.dust[num309].position -= this.velocity * 0.5f;
}
if (this.localAI[1] < 15f)
{
this.localAI[1] += 1f;
}
else
{
if (this.type == 114 || this.type == 115)
{
int num310 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 4f), 8, 8, 27, this.oldVelocity.X, this.oldVelocity.Y, 100, default(Color), 0.6f);
Main.dust[num310].velocity *= -0.25f;
}
else if (this.type == 116)
{
int num311 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 5f + 2f, this.position.Y + 2f - this.velocity.Y * 5f), 8, 8, 64, this.oldVelocity.X, this.oldVelocity.Y, 100, default(Color), 1.5f);
Main.dust[num311].velocity *= -0.25f;
Main.dust[num311].noGravity = true;
}
if (this.localAI[0] == 0f)
{
this.scale -= 0.02f;
this.alpha += 30;
if (this.alpha >= 250)
{
this.alpha = 255;
this.localAI[0] = 1f;
}
}
else if (this.localAI[0] == 1f)
{
this.scale += 0.02f;
this.alpha -= 30;
if (this.alpha <= 0)
{
this.alpha = 0;
this.localAI[0] = 0f;
}
}
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
if (this.type == 132)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 60);
}
else
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
}
}
if (this.type == 157)
{
this.rotation += (float)this.direction * 0.4f;
this.spriteDirection = this.direction;
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 0.785f;
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
return;
}
}
else if (this.aiStyle == 28)
{
if (this.type == 177)
{
for (int num312 = 0; num312 < 3; num312++)
{
int num313 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 137, this.velocity.X, this.velocity.Y, Main.rand.Next(0, 101), default(Color), 1f + (float)Main.rand.Next(-20, 40) * 0.01f);
Main.dust[num313].noGravity = true;
Main.dust[num313].velocity *= 0.3f;
}
}
if (this.type == 118)
{
for (int num314 = 0; num314 < 2; num314++)
{
int num315 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f);
Main.dust[num315].noGravity = true;
Main.dust[num315].velocity *= 0.3f;
}
}
if (this.type == 119 || this.type == 128 || this.type == 359)
{
for (int num316 = 0; num316 < 3; num316++)
{
int num317 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f);
Main.dust[num317].noGravity = true;
Main.dust[num317].velocity *= 0.3f;
}
}
if (this.type == 309)
{
for (int num318 = 0; num318 < 3; num318++)
{
int num319 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 185, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f);
Main.dust[num319].noGravity = true;
Main.dust[num319].velocity *= 0.3f;
}
}
if (this.type == 129)
{
for (int num320 = 0; num320 < 6; num320++)
{
int num321 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 106, this.velocity.X, this.velocity.Y, 100, default(Color), 1f);
Main.dust[num321].noGravity = true;
Main.dust[num321].velocity *= 0.1f + (float)Main.rand.Next(4) * 0.1f;
Main.dust[num321].scale *= 1f + (float)Main.rand.Next(5) * 0.1f;
}
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 28);
return;
}
}
else if (this.aiStyle == 29)
{
if (this.type == 619)
{
int num322 = (int)this.ai[0];
for (int num323 = 0; num323 < 3; num323++)
{
int num324 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 254, this.velocity.X, this.velocity.Y, num322, default(Color), 1.2f);
Main.dust[num324].position = (Main.dust[num324].position + base.Center) / 2f;
Main.dust[num324].noGravity = true;
Main.dust[num324].velocity *= 0.5f;
}
for (int num325 = 0; num325 < 2; num325++)
{
int num324 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 255, this.velocity.X, this.velocity.Y, num322, default(Color), 0.4f);
if (num325 == 0)
{
Main.dust[num324].position = (Main.dust[num324].position + base.Center * 5f) / 6f;
}
else if (num325 == 1)
{
Main.dust[num324].position = (Main.dust[num324].position + (base.Center + this.velocity / 2f) * 5f) / 6f;
}
Main.dust[num324].velocity *= 0.1f;
Main.dust[num324].noGravity = true;
Main.dust[num324].fadeIn = 1f;
}
return;
}
if (this.type == 620)
{
int num326 = (int)this.ai[0];
this.ai[1] += 1f;
float num327 = (60f - this.ai[1]) / 60f;
if (this.ai[1] > 40f)
{
this.Kill();
}
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 18f)
{
this.velocity.Y = 18f;
}
this.velocity.X = this.velocity.X * 0.98f;
for (int num328 = 0; num328 < 2; num328++)
{
int num329 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num326, this.velocity.X, this.velocity.Y, 50, default(Color), 1.1f);
Main.dust[num329].position = (Main.dust[num329].position + base.Center) / 2f;
Main.dust[num329].noGravity = true;
Main.dust[num329].velocity *= 0.3f;
Main.dust[num329].scale *= num327;
}
for (int num330 = 0; num330 < 1; num330++)
{
int num329 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num326, this.velocity.X, this.velocity.Y, 50, default(Color), 0.6f);
Main.dust[num329].position = (Main.dust[num329].position + base.Center * 5f) / 6f;
Main.dust[num329].velocity *= 0.1f;
Main.dust[num329].noGravity = true;
Main.dust[num329].fadeIn = 0.9f * num327;
Main.dust[num329].scale *= num327;
}
return;
}
if (this.type == 521)
{
for (int num331 = 0; num331 < 3; num331++)
{
int num332 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 254, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f);
Main.dust[num332].position = (Main.dust[num332].position + base.Center) / 2f;
Main.dust[num332].noGravity = true;
Main.dust[num332].velocity *= 0.5f;
}
for (int num333 = 0; num333 < 2; num333++)
{
int num332 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 255, this.velocity.X, this.velocity.Y, 50, default(Color), 0.4f);
if (num333 == 0)
{
Main.dust[num332].position = (Main.dust[num332].position + base.Center * 5f) / 6f;
}
else if (num333 == 1)
{
Main.dust[num332].position = (Main.dust[num332].position + (base.Center + this.velocity / 2f) * 5f) / 6f;
}
Main.dust[num332].velocity *= 0.1f;
Main.dust[num332].noGravity = true;
Main.dust[num332].fadeIn = 1f;
}
return;
}
if (this.type == 522)
{
this.ai[1] += 1f;
float num334 = (60f - this.ai[1]) / 60f;
if (this.ai[1] > 40f)
{
this.Kill();
}
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 18f)
{
this.velocity.Y = 18f;
}
this.velocity.X = this.velocity.X * 0.98f;
for (int num335 = 0; num335 < 2; num335++)
{
int num336 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 254, this.velocity.X, this.velocity.Y, 50, default(Color), 1.1f);
Main.dust[num336].position = (Main.dust[num336].position + base.Center) / 2f;
Main.dust[num336].noGravity = true;
Main.dust[num336].velocity *= 0.3f;
Main.dust[num336].scale *= num334;
}
for (int num337 = 0; num337 < 1; num337++)
{
int num336 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 255, this.velocity.X, this.velocity.Y, 50, default(Color), 0.6f);
Main.dust[num336].position = (Main.dust[num336].position + base.Center * 5f) / 6f;
Main.dust[num336].velocity *= 0.1f;
Main.dust[num336].noGravity = true;
Main.dust[num336].fadeIn = 0.9f * num334;
Main.dust[num336].scale *= num334;
}
return;
}
int num338 = this.type - 121 + 86;
if (this.type == 597)
{
num338 = 262;
}
for (int num339 = 0; num339 < 2; num339++)
{
int num340 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num338, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f);
Main.dust[num340].noGravity = true;
Main.dust[num340].velocity *= 0.3f;
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
return;
}
}
else if (this.aiStyle == 30)
{
this.velocity *= 0.8f;
this.rotation += 0.2f;
this.alpha += 4;
if (this.alpha >= 255)
{
this.Kill();
return;
}
}
else
{
if (this.aiStyle == 31)
{
int num341 = 110;
int conversionType = 0;
if (this.type == 146)
{
num341 = 111;
conversionType = 2;
}
if (this.type == 147)
{
num341 = 112;
conversionType = 1;
}
if (this.type == 148)
{
num341 = 113;
conversionType = 3;
}
if (this.type == 149)
{
num341 = 114;
conversionType = 4;
}
if (this.owner == Main.myPlayer)
{
WorldGen.Convert((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, conversionType, 2);
}
if (this.timeLeft > 133)
{
this.timeLeft = 133;
}
if (this.ai[0] > 7f)
{
float num342 = 1f;
if (this.ai[0] == 8f)
{
num342 = 0.2f;
}
else if (this.ai[0] == 9f)
{
num342 = 0.4f;
}
else if (this.ai[0] == 10f)
{
num342 = 0.6f;
}
else if (this.ai[0] == 11f)
{
num342 = 0.8f;
}
this.ai[0] += 1f;
for (int num343 = 0; num343 < 1; num343++)
{
int num344 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num341, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f);
Main.dust[num344].noGravity = true;
Main.dust[num344].scale *= 1.75f;
Dust expr_FC8C_cp_0 = Main.dust[num344];
expr_FC8C_cp_0.velocity.X = expr_FC8C_cp_0.velocity.X * 2f;
Dust expr_FCAC_cp_0 = Main.dust[num344];
expr_FCAC_cp_0.velocity.Y = expr_FCAC_cp_0.velocity.Y * 2f;
Main.dust[num344].scale *= num342;
}
}
else
{
this.ai[0] += 1f;
}
this.rotation += 0.3f * (float)this.direction;
return;
}
if (this.aiStyle == 32)
{
this.timeLeft = 10;
this.ai[0] += 1f;
if (this.ai[0] >= 20f)
{
this.ai[0] = 15f;
for (int num345 = 0; num345 < 255; num345++)
{
Rectangle rectangle3 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
if (Main.player[num345].active)
{
Rectangle value10 = new Rectangle((int)Main.player[num345].position.X, (int)Main.player[num345].position.Y, Main.player[num345].width, Main.player[num345].height);
if (rectangle3.Intersects(value10))
{
this.ai[0] = 0f;
this.velocity.Y = -4.5f;
if (this.velocity.X > 2f)
{
this.velocity.X = 2f;
}
if (this.velocity.X < -2f)
{
this.velocity.X = -2f;
}
this.velocity.X = (this.velocity.X + (float)Main.player[num345].direction * 1.75f) / 2f;
this.velocity.X = this.velocity.X + Main.player[num345].velocity.X * 3f;
this.velocity.Y = this.velocity.Y + Main.player[num345].velocity.Y;
if (this.velocity.X > 6f)
{
this.velocity.X = 6f;
}
if (this.velocity.X < -6f)
{
this.velocity.X = -6f;
}
this.netUpdate = true;
this.ai[1] += 1f;
}
}
}
}
if (this.velocity.X == 0f && this.velocity.Y == 0f)
{
this.Kill();
}
this.rotation += 0.02f * this.velocity.X;
if (this.velocity.Y == 0f)
{
this.velocity.X = this.velocity.X * 0.98f;
}
else if (this.wet)
{
this.velocity.X = this.velocity.X * 0.99f;
}
else
{
this.velocity.X = this.velocity.X * 0.995f;
}
if ((double)this.velocity.X > -0.03 && (double)this.velocity.X < 0.03)
{
this.velocity.X = 0f;
}
if (this.wet)
{
this.ai[1] = 0f;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y * 0.95f;
}
this.velocity.Y = this.velocity.Y - 0.1f;
if (this.velocity.Y < -4f)
{
this.velocity.Y = -4f;
}
if (this.velocity.X == 0f)
{
this.Kill();
}
}
else
{
this.velocity.Y = this.velocity.Y + 0.1f;
}
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.aiStyle == 33)
{
if (this.alpha > 0)
{
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
float num346 = 4f;
float num347 = this.ai[0];
float num348 = this.ai[1];
if (num347 == 0f && num348 == 0f)
{
num347 = 1f;
}
float num349 = (float)Math.Sqrt((double)(num347 * num347 + num348 * num348));
num349 = num346 / num349;
num347 *= num349;
num348 *= num349;
if (this.alpha < 70)
{
int num350 = 127;
if (this.type == 310)
{
num350 = 187;
}
int num351 = Dust.NewDust(new Vector2(this.position.X, this.position.Y - 2f), 6, 6, num350, this.velocity.X, this.velocity.Y, 100, default(Color), 1.6f);
Main.dust[num351].noGravity = true;
Dust expr_102A1_cp_0 = Main.dust[num351];
expr_102A1_cp_0.position.X = expr_102A1_cp_0.position.X - num347 * 1f;
Dust expr_102C6_cp_0 = Main.dust[num351];
expr_102C6_cp_0.position.Y = expr_102C6_cp_0.position.Y - num348 * 1f;
Dust expr_102EB_cp_0 = Main.dust[num351];
expr_102EB_cp_0.velocity.X = expr_102EB_cp_0.velocity.X - num347;
Dust expr_1030A_cp_0 = Main.dust[num351];
expr_1030A_cp_0.velocity.Y = expr_1030A_cp_0.velocity.Y - num348;
}
if (this.localAI[0] == 0f)
{
this.ai[0] = this.velocity.X;
this.ai[1] = this.velocity.Y;
this.localAI[1] += 1f;
if (this.localAI[1] >= 30f)
{
this.velocity.Y = this.velocity.Y + 0.09f;
this.localAI[1] = 30f;
}
}
else
{
if (!Collision.SolidCollision(this.position, this.width, this.height))
{
this.localAI[0] = 0f;
this.localAI[1] = 30f;
}
this.damage = 0;
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
this.rotation = (float)Math.Atan2((double)this.ai[1], (double)this.ai[0]) + 1.57f;
return;
}
if (this.aiStyle == 34)
{
this.rotation = this.velocity.ToRotation() + 1.57079637f;
if (this.ai[1] == 1f)
{
this.ai[0] += 1f;
if (this.ai[0] == 1f)
{
for (int num352 = 0; num352 < 8; num352++)
{
int num353 = Dust.NewDust(this.position, this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.8f);
Main.dust[num353].noGravity = true;
Main.dust[num353].velocity *= 3f;
Main.dust[num353].fadeIn = 0.5f;
Main.dust[num353].position += this.velocity / 2f;
Main.dust[num353].velocity += this.velocity / 4f + Main.player[this.owner].velocity * 0.1f;
}
}
if (this.ai[0] > 2f)
{
int num354 = Dust.NewDust(new Vector2(this.position.X + 2f, this.position.Y + 20f), 8, 8, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num354].noGravity = true;
Main.dust[num354].velocity *= 0.2f;
Main.dust[num354].position = Main.dust[num354].position.RotatedBy((double)this.rotation, base.Center);
num354 = Dust.NewDust(new Vector2(this.position.X + 2f, this.position.Y + 15f), 8, 8, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num354].noGravity = true;
Main.dust[num354].velocity *= 0.2f;
Main.dust[num354].position = Main.dust[num354].position.RotatedBy((double)this.rotation, base.Center);
num354 = Dust.NewDust(new Vector2(this.position.X + 2f, this.position.Y + 10f), 8, 8, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num354].noGravity = true;
Main.dust[num354].velocity *= 0.2f;
Main.dust[num354].position = Main.dust[num354].position.RotatedBy((double)this.rotation, base.Center);
return;
}
}
else
{
if (this.type < 415 || this.type > 418)
{
int num355 = Dust.NewDust(new Vector2(this.position.X + 2f, this.position.Y + 20f), 8, 8, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num355].noGravity = true;
Main.dust[num355].velocity *= 0.2f;
Main.dust[num355].position = Main.dust[num355].position.RotatedBy((double)this.rotation, base.Center);
return;
}
this.ai[0] += 1f;
if (this.ai[0] > 4f)
{
int num356 = Dust.NewDust(new Vector2(this.position.X + 2f, this.position.Y + 20f), 8, 8, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num356].noGravity = true;
Main.dust[num356].velocity *= 0.2f;
Main.dust[num356].position = Main.dust[num356].position.RotatedBy((double)this.rotation, base.Center);
return;
}
}
}
else if (this.aiStyle == 35)
{
this.ai[0] += 1f;
if (this.ai[0] > 30f)
{
this.velocity.Y = this.velocity.Y + 0.2f;
this.velocity.X = this.velocity.X * 0.985f;
if (this.velocity.Y > 14f)
{
this.velocity.Y = 14f;
}
}
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * (float)this.direction * 0.02f;
if (this.owner == Main.myPlayer)
{
Vector2 vector26 = Collision.TileCollision(this.position, this.velocity, this.width, this.height, true, true, 1);
bool flag9 = false;
if (vector26 != this.velocity)
{
flag9 = true;
}
else
{
int num357 = (int)(base.Center.X + this.velocity.X) / 16;
int num358 = (int)(base.Center.Y + this.velocity.Y) / 16;
if (Main.tile[num357, num358] != null && Main.tile[num357, num358].active() && Main.tile[num357, num358].bottomSlope())
{
flag9 = true;
this.position.Y = (float)(num358 * 16 + 16 + 8);
this.position.X = (float)(num357 * 16 + 8);
}
}
if (flag9)
{
int num359 = 213;
if (this.type == 475)
{
num359 = 353;
}
if (this.type == 506)
{
num359 = 366;
}
if (this.type == 505)
{
num359 = 365;
}
int num360 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int num361 = (int)(this.position.Y + (float)(this.height / 2)) / 16;
this.position += vector26;
int num362 = 10;
if (Main.tile[num360, num361] != null)
{
while (Main.tile[num360, num361] != null && Main.tile[num360, num361].active())
{
if (!Main.tileRope[(int)Main.tile[num360, num361].type])
{
break;
}
num361++;
}
while (num362 > 0)
{
num362--;
if (Main.tile[num360, num361] == null)
{
break;
}
if (Main.tile[num360, num361].active() && (Main.tileCut[(int)Main.tile[num360, num361].type] || Main.tile[num360, num361].type == 165))
{
WorldGen.KillTile(num360, num361, false, false, false);
NetMessage.SendData(17, -1, -1, "", 0, (float)num360, (float)num361, 0f, 0, 0, 0);
}
if (!Main.tile[num360, num361].active())
{
WorldGen.PlaceTile(num360, num361, num359, false, false, -1, 0);
NetMessage.SendData(17, -1, -1, "", 1, (float)num360, (float)num361, (float)num359, 0, 0, 0);
this.ai[1] += 1f;
}
else
{
num362 = 0;
}
num361++;
}
this.Kill();
return;
}
}
}
}
else if (this.aiStyle == 36)
{
if (this.type != 307 && this.wet && !this.honeyWet)
{
this.Kill();
}
if (this.alpha > 0)
{
this.alpha -= 50;
}
else
{
this.extraUpdates = 0;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.type == 307)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f;
this.frameCounter++;
if (this.frameCounter >= 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 2)
{
this.frame = 0;
}
for (int num363 = 0; num363 < 3; num363++)
{
float num364 = this.velocity.X / 3f * (float)num363;
float num365 = this.velocity.Y / 3f * (float)num363;
int num366 = Dust.NewDust(this.position, this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f);
Main.dust[num366].position.X = base.Center.X - num364;
Main.dust[num366].position.Y = base.Center.Y - num365;
Main.dust[num366].velocity *= 0f;
Main.dust[num366].scale = 0.5f;
}
}
else
{
if (this.type == 316)
{
if (this.velocity.X > 0f)
{
this.spriteDirection = -1;
}
else if (this.velocity.X < 0f)
{
this.spriteDirection = 1;
}
}
else if (this.velocity.X > 0f)
{
this.spriteDirection = 1;
}
else if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
}
this.rotation = this.velocity.X * 0.1f;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 3)
{
this.frame = 0;
}
}
float num367 = this.position.X;
float num368 = this.position.Y;
float num369 = 100000f;
bool flag10 = false;
this.ai[0] += 1f;
if (this.ai[0] > 30f)
{
this.ai[0] = 30f;
for (int num370 = 0; num370 < 200; num370++)
{
if (Main.npc[num370].CanBeChasedBy(this, false) && (!Main.npc[num370].wet || this.type == 307))
{
float num371 = Main.npc[num370].position.X + (float)(Main.npc[num370].width / 2);
float num372 = Main.npc[num370].position.Y + (float)(Main.npc[num370].height / 2);
float num373 = Math.Abs(this.position.X + (float)(this.width / 2) - num371) + Math.Abs(this.position.Y + (float)(this.height / 2) - num372);
if (num373 < 800f && num373 < num369 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num370].position, Main.npc[num370].width, Main.npc[num370].height))
{
num369 = num373;
num367 = num371;
num368 = num372;
flag10 = true;
}
}
}
}
if (!flag10)
{
num367 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f;
num368 = this.position.Y + (float)(this.height / 2) + this.velocity.Y * 100f;
}
else if (this.type == 307)
{
this.friendly = true;
}
float num374 = 6f;
float num375 = 0.1f;
if (this.type == 189)
{
num374 = 7f;
num375 = 0.15f;
}
if (this.type == 307)
{
num374 = 9f;
num375 = 0.2f;
}
if (this.type == 316)
{
num374 = 10f;
num375 = 0.25f;
}
if (this.type == 566)
{
num374 = 6.8f;
num375 = 0.14f;
}
Vector2 vector27 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num376 = num367 - vector27.X;
float num377 = num368 - vector27.Y;
float num378 = (float)Math.Sqrt((double)(num376 * num376 + num377 * num377));
num378 = num374 / num378;
num376 *= num378;
num377 *= num378;
if (this.velocity.X < num376)
{
this.velocity.X = this.velocity.X + num375;
if (this.velocity.X < 0f && num376 > 0f)
{
this.velocity.X = this.velocity.X + num375 * 2f;
}
}
else if (this.velocity.X > num376)
{
this.velocity.X = this.velocity.X - num375;
if (this.velocity.X > 0f && num376 < 0f)
{
this.velocity.X = this.velocity.X - num375 * 2f;
}
}
if (this.velocity.Y < num377)
{
this.velocity.Y = this.velocity.Y + num375;
if (this.velocity.Y < 0f && num377 > 0f)
{
this.velocity.Y = this.velocity.Y + num375 * 2f;
return;
}
}
else if (this.velocity.Y > num377)
{
this.velocity.Y = this.velocity.Y - num375;
if (this.velocity.Y > 0f && num377 < 0f)
{
this.velocity.Y = this.velocity.Y - num375 * 2f;
return;
}
}
}
else if (this.aiStyle == 37)
{
if (this.ai[1] == 0f)
{
this.ai[1] = this.position.Y - 5f;
}
if (this.ai[0] == 0f)
{
if (Collision.SolidCollision(this.position, this.width, this.height))
{
this.velocity.Y = this.velocity.Y * -1f;
this.ai[0] += 1f;
return;
}
float num379 = this.position.Y - this.ai[1];
if (num379 > 300f)
{
this.velocity.Y = this.velocity.Y * -1f;
this.ai[0] += 1f;
return;
}
}
else if (Collision.SolidCollision(this.position, this.width, this.height) || this.position.Y < this.ai[1])
{
this.Kill();
return;
}
}
else if (this.aiStyle == 38)
{
this.ai[0] += 1f;
if (this.ai[0] >= 6f)
{
this.ai[0] = 0f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 34);
if (Main.myPlayer == this.owner)
{
Projectile.NewProjectile(this.position.X, this.position.Y, this.velocity.X, this.velocity.Y, 188, this.damage, this.knockBack, this.owner, 0f, 0f);
return;
}
}
}
else if (this.aiStyle == 39)
{
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
if (this.alpha == 0)
{
Main.player[this.owner].itemAnimation = 5;
Main.player[this.owner].itemTime = 5;
if (this.position.X + (float)(this.width / 2) > Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2))
{
Main.player[this.owner].ChangeDir(1);
}
else
{
Main.player[this.owner].ChangeDir(-1);
}
}
Vector2 vector28 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num380 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector28.X;
float num381 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector28.Y;
float num382 = (float)Math.Sqrt((double)(num380 * num380 + num381 * num381));
if (!Main.player[this.owner].channel && this.alpha == 0)
{
this.ai[0] = 1f;
this.ai[1] = -1f;
}
if (this.ai[1] > 0f && num382 > 1500f)
{
this.ai[1] = 0f;
this.ai[0] = 1f;
}
if (this.ai[1] > 0f)
{
this.tileCollide = false;
int num383 = (int)this.ai[1] - 1;
if (Main.npc[num383].active && Main.npc[num383].life > 0)
{
float num384 = 16f;
vector28 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
num380 = Main.npc[num383].position.X + (float)(Main.npc[num383].width / 2) - vector28.X;
num381 = Main.npc[num383].position.Y + (float)(Main.npc[num383].height / 2) - vector28.Y;
num382 = (float)Math.Sqrt((double)(num380 * num380 + num381 * num381));
if (num382 < num384)
{
this.velocity.X = num380;
this.velocity.Y = num381;
if (num382 > num384 / 2f)
{
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
}
}
else
{
num382 = num384 / num382;
num380 *= num382;
num381 *= num382;
this.velocity.X = num380;
this.velocity.Y = num381;
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
}
this.ai[0] = 1f;
}
else
{
this.ai[1] = 0f;
float num385 = this.position.X;
float num386 = this.position.Y;
float num387 = 3000f;
int num388 = -1;
for (int num389 = 0; num389 < 200; num389++)
{
if (Main.npc[num389].CanBeChasedBy(this, false))
{
float num390 = Main.npc[num389].position.X + (float)(Main.npc[num389].width / 2);
float num391 = Main.npc[num389].position.Y + (float)(Main.npc[num389].height / 2);
float num392 = Math.Abs(this.position.X + (float)(this.width / 2) - num390) + Math.Abs(this.position.Y + (float)(this.height / 2) - num391);
if (num392 < num387 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num389].position, Main.npc[num389].width, Main.npc[num389].height))
{
num387 = num392;
num385 = num390;
num386 = num391;
num388 = num389;
}
}
}
if (num388 >= 0)
{
float num393 = 16f;
vector28 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
num380 = num385 - vector28.X;
num381 = num386 - vector28.Y;
num382 = (float)Math.Sqrt((double)(num380 * num380 + num381 * num381));
num382 = num393 / num382;
num380 *= num382;
num381 *= num382;
this.velocity.X = num380;
this.velocity.Y = num381;
this.ai[0] = 0f;
this.ai[1] = (float)(num388 + 1);
}
}
}
else if (this.ai[0] == 0f)
{
if (num382 > 700f)
{
this.ai[0] = 1f;
}
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
}
else if (this.ai[0] == 1f)
{
this.tileCollide = false;
if (this.velocity.X < 0f)
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
float num394 = 20f;
if (num382 < 70f)
{
this.Kill();
}
num382 = num394 / num382;
num380 *= num382;
num381 *= num382;
this.velocity.X = num380;
this.velocity.Y = num381;
}
this.frameCounter++;
if (this.frameCounter >= 4)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 4)
{
this.frame = 0;
return;
}
}
else
{
if (this.aiStyle == 40)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 3f)
{
this.localAI[0] = 100f;
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 5)
{
this.frame = 0;
}
this.velocity.X = this.velocity.X + this.ai[0];
this.velocity.Y = this.velocity.Y + this.ai[1];
this.localAI[1] += 1f;
if (this.localAI[1] == 50f)
{
this.localAI[1] = 51f;
this.ai[0] = (float)Main.rand.Next(-100, 101) * 6E-05f;
this.ai[1] = (float)Main.rand.Next(-100, 101) * 6E-05f;
}
if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 16f)
{
this.velocity.X = this.velocity.X * 0.95f;
this.velocity.Y = this.velocity.Y * 0.95f;
}
if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 12f)
{
this.velocity.X = this.velocity.X * 1.05f;
this.velocity.Y = this.velocity.Y * 1.05f;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f;
return;
}
if (this.aiStyle == 41)
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
this.frame = Main.rand.Next(3);
}
this.rotation += this.velocity.X * 0.01f;
return;
}
if (this.aiStyle == 42)
{
if (!Main.player[this.owner].crystalLeaf)
{
this.Kill();
return;
}
this.position.X = Main.player[this.owner].Center.X - (float)(this.width / 2);
this.position.Y = Main.player[this.owner].Center.Y - (float)(this.height / 2) + Main.player[this.owner].gfxOffY - 60f;
if (Main.player[this.owner].gravDir == -1f)
{
this.position.Y = this.position.Y + 120f;
this.rotation = 3.14f;
}
else
{
this.rotation = 0f;
}
this.position.X = (float)((int)this.position.X);
this.position.Y = (float)((int)this.position.Y);
float num395 = (float)Main.mouseTextColor / 200f - 0.35f;
num395 *= 0.2f;
this.scale = num395 + 0.95f;
if (this.owner == Main.myPlayer)
{
if (this.ai[0] != 0f)
{
this.ai[0] -= 1f;
return;
}
float num396 = this.position.X;
float num397 = this.position.Y;
float num398 = 700f;
bool flag11 = false;
for (int num399 = 0; num399 < 200; num399++)
{
if (Main.npc[num399].CanBeChasedBy(this, true))
{
float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2);
float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2);
float num402 = Math.Abs(this.position.X + (float)(this.width / 2) - num400) + Math.Abs(this.position.Y + (float)(this.height / 2) - num401);
if (num402 < num398 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num399].position, Main.npc[num399].width, Main.npc[num399].height))
{
num398 = num402;
num396 = num400;
num397 = num401;
flag11 = true;
}
}
}
if (flag11)
{
float num403 = 12f;
Vector2 vector29 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num404 = num396 - vector29.X;
float num405 = num397 - vector29.Y;
float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405));
num406 = num403 / num406;
num404 *= num406;
num405 *= num406;
Projectile.NewProjectile(base.Center.X - 4f, base.Center.Y, num404, num405, 227, Player.crystalLeafDamage, (float)Player.crystalLeafKB, this.owner, 0f, 0f);
this.ai[0] = 50f;
return;
}
}
}
else
{
if (this.aiStyle == 43)
{
if (this.localAI[1] == 0f)
{
Main.PlaySound(6, (int)this.position.X, (int)this.position.Y, 1);
this.localAI[1] += 1f;
for (int num407 = 0; num407 < 5; num407++)
{
int num408 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f);
Main.dust[num408].noGravity = true;
Main.dust[num408].velocity *= 3f;
Main.dust[num408].scale = 1.5f;
}
}
this.ai[0] = (float)Main.rand.Next(-100, 101) * 0.0025f;
this.ai[1] = (float)Main.rand.Next(-100, 101) * 0.0025f;
if (this.localAI[0] == 0f)
{
this.scale += 0.05f;
if ((double)this.scale > 1.2)
{
this.localAI[0] = 1f;
}
}
else
{
this.scale -= 0.05f;
if ((double)this.scale < 0.8)
{
this.localAI[0] = 0f;
}
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f;
int num409 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f);
Main.dust[num409].noGravity = true;
Main.dust[num409].velocity *= 0.1f;
Main.dust[num409].scale = 1.5f;
return;
}
if (this.aiStyle == 44)
{
if (this.type == 228)
{
this.velocity *= 0.96f;
this.alpha += 4;
if (this.alpha > 255)
{
this.Kill();
}
}
else if (this.type == 229)
{
if (this.ai[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
}
this.ai[0] += 1f;
if (this.ai[0] > 20f)
{
this.velocity.Y = this.velocity.Y + 0.3f;
this.velocity.X = this.velocity.X * 0.98f;
}
}
this.frameCounter++;
if (this.frameCounter > 5)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
return;
}
}
else if (this.aiStyle == 45)
{
if (this.type == 237 || this.type == 243)
{
float num410 = this.ai[0];
float num411 = this.ai[1];
if (num410 != 0f && num411 != 0f)
{
bool flag12 = false;
bool flag13 = false;
if ((this.velocity.X < 0f && base.Center.X < num410) || (this.velocity.X > 0f && base.Center.X > num410))
{
flag12 = true;
}
if ((this.velocity.Y < 0f && base.Center.Y < num411) || (this.velocity.Y > 0f && base.Center.Y > num411))
{
flag13 = true;
}
if (flag12 && flag13)
{
this.Kill();
}
}
this.rotation += this.velocity.X * 0.02f;
this.frameCounter++;
if (this.frameCounter > 4)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 3)
{
this.frame = 0;
return;
}
}
}
else if (this.type == 238 || this.type == 244)
{
this.frameCounter++;
if (this.frameCounter > 8)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 5)
{
this.frame = 0;
}
}
this.ai[1] += 1f;
if (this.type == 244 && this.ai[1] >= 3600f)
{
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
this.Kill();
}
}
else if (this.type == 238 && this.ai[1] >= 7200f)
{
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
this.Kill();
}
}
else
{
this.ai[0] += 1f;
if (this.type == 244)
{
if (this.ai[0] > 10f)
{
this.ai[0] = 0f;
if (this.owner == Main.myPlayer)
{
int num412 = (int)(this.position.X + 14f + (float)Main.rand.Next(this.width - 28));
int num413 = (int)(this.position.Y + (float)this.height + 4f);
Projectile.NewProjectile((float)num412, (float)num413, 0f, 5f, 245, this.damage, 0f, this.owner, 0f, 0f);
}
}
}
else if (this.ai[0] > 8f)
{
this.ai[0] = 0f;
if (this.owner == Main.myPlayer)
{
int num414 = (int)(this.position.X + 14f + (float)Main.rand.Next(this.width - 28));
int num415 = (int)(this.position.Y + (float)this.height + 4f);
Projectile.NewProjectile((float)num414, (float)num415, 0f, 5f, 239, this.damage, 0f, this.owner, 0f, 0f);
}
}
}
this.localAI[0] += 1f;
if (this.localAI[0] >= 10f)
{
this.localAI[0] = 0f;
int num416 = 0;
int num417 = 0;
float num418 = 0f;
int num419 = this.type;
for (int num420 = 0; num420 < 1000; num420++)
{
if (Main.projectile[num420].active && Main.projectile[num420].owner == this.owner && Main.projectile[num420].type == num419 && Main.projectile[num420].ai[1] < 3600f)
{
num416++;
if (Main.projectile[num420].ai[1] > num418)
{
num417 = num420;
num418 = Main.projectile[num420].ai[1];
}
}
}
if (this.type == 244)
{
if (num416 > 1)
{
Main.projectile[num417].netUpdate = true;
Main.projectile[num417].ai[1] = 36000f;
return;
}
}
else if (num416 > 2)
{
Main.projectile[num417].netUpdate = true;
Main.projectile[num417].ai[1] = 36000f;
return;
}
}
}
else
{
if (this.type == 239)
{
this.alpha = 50;
return;
}
if (this.type == 245)
{
this.alpha = 100;
return;
}
if (this.type == 264)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
return;
}
}
}
else if (this.aiStyle == 46)
{
int num421 = 1200;
if (this.type == 250)
{
if (this.owner == Main.myPlayer)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 4f)
{
this.localAI[0] = 3f;
Projectile.NewProjectile(base.Center.X, base.Center.Y, this.velocity.X * 0.001f, this.velocity.Y * 0.001f, 251, this.damage, this.knockBack, this.owner, 0f, 0f);
}
if (this.timeLeft > num421)
{
this.timeLeft = num421;
}
}
float num422 = 1f;
if (this.velocity.Y < 0f)
{
num422 -= this.velocity.Y / 3f;
}
this.ai[0] += num422;
if (this.ai[0] > 30f)
{
this.velocity.Y = this.velocity.Y + 0.5f;
if (this.velocity.Y > 0f)
{
this.velocity.X = this.velocity.X * 0.95f;
}
else
{
this.velocity.X = this.velocity.X * 1.05f;
}
}
float num423 = this.velocity.X;
float num424 = this.velocity.Y;
float num425 = (float)Math.Sqrt((double)(num423 * num423 + num424 * num424));
num425 = 15.95f * this.scale / num425;
num423 *= num425;
num424 *= num425;
this.velocity.X = num423;
this.velocity.Y = num424;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f;
return;
}
if (this.localAI[0] == 0f)
{
if (this.velocity.X > 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f;
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f;
}
this.localAI[0] = 1f;
this.timeLeft = num421;
}
this.velocity.X = this.velocity.X * 0.98f;
this.velocity.Y = this.velocity.Y * 0.98f;
if (this.rotation == 0f)
{
this.alpha = 255;
return;
}
if (this.timeLeft < 10)
{
this.alpha = 255 - (int)(255f * (float)this.timeLeft / 10f);
return;
}
if (this.timeLeft > num421 - 10)
{
int num426 = num421 - this.timeLeft;
this.alpha = 255 - (int)(255f * (float)num426 / 10f);
return;
}
this.alpha = 0;
return;
}
else if (this.aiStyle == 47)
{
if (this.ai[0] == 0f)
{
this.ai[0] = this.velocity.X;
this.ai[1] = this.velocity.Y;
}
if (this.velocity.X > 0f)
{
this.rotation += (Math.Abs(this.velocity.Y) + Math.Abs(this.velocity.X)) * 0.001f;
}
else
{
this.rotation -= (Math.Abs(this.velocity.Y) + Math.Abs(this.velocity.X)) * 0.001f;
}
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 4)
{
this.frame = 0;
}
}
if (Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y)) > 2.0)
{
this.velocity *= 0.98f;
}
for (int num427 = 0; num427 < 1000; num427++)
{
if (num427 != this.whoAmI && Main.projectile[num427].active && Main.projectile[num427].owner == this.owner && Main.projectile[num427].type == this.type && this.timeLeft > Main.projectile[num427].timeLeft && Main.projectile[num427].timeLeft > 30)
{
Main.projectile[num427].timeLeft = 30;
}
}
int[] array = new int[20];
int num428 = 0;
float num429 = 300f;
bool flag14 = false;
for (int num430 = 0; num430 < 200; num430++)
{
if (Main.npc[num430].CanBeChasedBy(this, false))
{
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
float num433 = Math.Abs(this.position.X + (float)(this.width / 2) - num431) + Math.Abs(this.position.Y + (float)(this.height / 2) - num432);
if (num433 < num429 && Collision.CanHit(base.Center, 1, 1, Main.npc[num430].Center, 1, 1))
{
if (num428 < 20)
{
array[num428] = num430;
num428++;
}
flag14 = true;
}
}
}
if (this.timeLeft < 30)
{
flag14 = false;
}
if (flag14)
{
int num434 = Main.rand.Next(num428);
num434 = array[num434];
float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2);
float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2);
this.localAI[0] += 1f;
if (this.localAI[0] > 8f)
{
this.localAI[0] = 0f;
float num437 = 6f;
Vector2 value11 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
value11 += this.velocity * 4f;
float num438 = num435 - value11.X;
float num439 = num436 - value11.Y;
float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439));
num440 = num437 / num440;
num438 *= num440;
num439 *= num440;
Projectile.NewProjectile(value11.X, value11.Y, num438, num439, 255, this.damage, this.knockBack, this.owner, 0f, 0f);
return;
}
}
}
else if (this.aiStyle == 48)
{
if (this.type == 255)
{
for (int num441 = 0; num441 < 4; num441++)
{
Vector2 vector30 = this.position;
vector30 -= this.velocity * ((float)num441 * 0.25f);
this.alpha = 255;
int num442 = Dust.NewDust(vector30, 1, 1, 160, 0f, 0f, 0, default(Color), 1f);
Main.dust[num442].position = vector30;
Dust expr_13A7A_cp_0 = Main.dust[num442];
expr_13A7A_cp_0.position.X = expr_13A7A_cp_0.position.X + (float)(this.width / 2);
Dust expr_13A9E_cp_0 = Main.dust[num442];
expr_13A9E_cp_0.position.Y = expr_13A9E_cp_0.position.Y + (float)(this.height / 2);
Main.dust[num442].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num442].velocity *= 0.2f;
}
return;
}
if (this.type == 433)
{
for (int num443 = 0; num443 < 2; num443++)
{
Vector2 vector31 = this.position;
vector31 -= this.velocity * ((float)num443 * 0.25f);
this.alpha = 255;
int num444 = Dust.NewDust(vector31, 1, 1, 160, 0f, 0f, 0, default(Color), 1f);
Main.dust[num444].position = vector31;
Dust expr_13BB1_cp_0 = Main.dust[num444];
expr_13BB1_cp_0.position.X = expr_13BB1_cp_0.position.X + (float)(this.width / 2);
Dust expr_13BD5_cp_0 = Main.dust[num444];
expr_13BD5_cp_0.position.Y = expr_13BD5_cp_0.position.Y + (float)(this.height / 2);
if (Main.rand.Next(2) == 0)
{
Main.dust[num444].color = Color.LimeGreen;
}
else
{
Main.dust[num444].color = Color.CornflowerBlue;
}
Main.dust[num444].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num444].velocity *= 0.2f;
}
return;
}
if (this.type == 290)
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
}
this.localAI[0] += 1f;
if (this.localAI[0] > 3f)
{
for (int num445 = 0; num445 < 3; num445++)
{
Vector2 vector32 = this.position;
vector32 -= this.velocity * ((float)num445 * 0.3334f);
this.alpha = 255;
int num446 = Dust.NewDust(vector32, 1, 1, 173, 0f, 0f, 0, default(Color), 1f);
Main.dust[num446].position = vector32;
Main.dust[num446].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num446].velocity *= 0.2f;
}
return;
}
}
else if (this.type == 294)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 9f)
{
for (int num447 = 0; num447 < 4; num447++)
{
Vector2 vector33 = this.position;
vector33 -= this.velocity * ((float)num447 * 0.25f);
this.alpha = 255;
int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 1f);
Main.dust[num448].position = vector33;
Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num448].velocity *= 0.2f;
}
return;
}
}
else
{
this.localAI[0] += 1f;
if (this.localAI[0] > 3f)
{
for (int num449 = 0; num449 < 4; num449++)
{
Vector2 vector34 = this.position;
vector34 -= this.velocity * ((float)num449 * 0.25f);
this.alpha = 255;
int num450 = Dust.NewDust(vector34, 1, 1, 162, 0f, 0f, 0, default(Color), 1f);
Main.dust[num450].position = vector34;
Dust expr_13FA8_cp_0 = Main.dust[num450];
expr_13FA8_cp_0.position.X = expr_13FA8_cp_0.position.X + (float)(this.width / 2);
Dust expr_13FCC_cp_0 = Main.dust[num450];
expr_13FCC_cp_0.position.Y = expr_13FCC_cp_0.position.Y + (float)(this.height / 2);
Main.dust[num450].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num450].velocity *= 0.2f;
}
return;
}
}
}
else if (this.aiStyle == 49)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
}
if (this.ai[1] == 1f)
{
if (this.velocity.X > 0f)
{
this.direction = 1;
}
else if (this.velocity.X < 0f)
{
this.direction = -1;
}
this.spriteDirection = this.direction;
this.ai[0] += 1f;
this.rotation += this.velocity.X * 0.05f + (float)this.direction * 0.05f;
if (this.ai[0] >= 18f)
{
this.velocity.Y = this.velocity.Y + 0.28f;
this.velocity.X = this.velocity.X * 0.99f;
}
if ((double)this.velocity.Y > 15.9)
{
this.velocity.Y = 15.9f;
}
if (this.ai[0] > 2f)
{
this.alpha = 0;
if (this.ai[0] == 3f)
{
for (int num451 = 0; num451 < 10; num451++)
{
int num452 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num452].velocity *= 0.5f;
Main.dust[num452].velocity += this.velocity * 0.1f;
}
for (int num453 = 0; num453 < 5; num453++)
{
int num454 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num454].noGravity = true;
Main.dust[num454].velocity *= 3f;
Main.dust[num454].velocity += this.velocity * 0.2f;
num454 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num454].velocity *= 2f;
Main.dust[num454].velocity += this.velocity * 0.3f;
}
for (int num455 = 0; num455 < 1; num455++)
{
int num456 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num456].position += this.velocity * 1.25f;
Main.gore[num456].scale = 1.5f;
Main.gore[num456].velocity += this.velocity * 0.5f;
Main.gore[num456].velocity *= 0.02f;
}
return;
}
}
}
else if (this.ai[1] == 2f)
{
this.rotation = 0f;
this.velocity.X = this.velocity.X * 0.95f;
this.velocity.Y = this.velocity.Y + 0.2f;
return;
}
}
else if (this.aiStyle == 50)
{
if (this.type == 291)
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20);
this.localAI[0] += 1f;
}
bool flag15 = false;
bool flag16 = false;
if (this.velocity.X < 0f && this.position.X < this.ai[0])
{
flag15 = true;
}
if (this.velocity.X > 0f && this.position.X > this.ai[0])
{
flag15 = true;
}
if (this.velocity.Y < 0f && this.position.Y < this.ai[1])
{
flag16 = true;
}
if (this.velocity.Y > 0f && this.position.Y > this.ai[1])
{
flag16 = true;
}
if (flag15 && flag16)
{
this.Kill();
}
for (int num457 = 0; num457 < 10; num457++)
{
int num458 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += this.velocity * 0.1f;
}
return;
}
if (this.type == 295)
{
for (int num459 = 0; num459 < 8; num459++)
{
int num460 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num460].noGravity = true;
Main.dust[num460].velocity *= 0.5f;
Main.dust[num460].velocity += this.velocity * 0.1f;
}
return;
}
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 74);
this.localAI[0] += 1f;
}
this.ai[0] += 1f;
if (this.type == 296)
{
this.ai[0] += 3f;
}
float num461 = 25f;
if (this.ai[0] > 180f)
{
num461 -= (this.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
{
num461 = 0f;
this.Kill();
}
if (this.type == 296)
{
num461 *= 0.7f;
}
int num462 = 0;
while ((float)num462 < num461)
{
float num463 = (float)Main.rand.Next(-10, 11);
float num464 = (float)Main.rand.Next(-10, 11);
float num465 = (float)Main.rand.Next(3, 9);
float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464));
num466 = num465 / num466;
num463 *= num466;
num464 *= num466;
int num467 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num467].noGravity = true;
Main.dust[num467].position.X = base.Center.X;
Main.dust[num467].position.Y = base.Center.Y;
Dust expr_14A1B_cp_0 = Main.dust[num467];
expr_14A1B_cp_0.position.X = expr_14A1B_cp_0.position.X + (float)Main.rand.Next(-10, 11);
Dust expr_14A45_cp_0 = Main.dust[num467];
expr_14A45_cp_0.position.Y = expr_14A45_cp_0.position.Y + (float)Main.rand.Next(-10, 11);
Main.dust[num467].velocity.X = num463;
Main.dust[num467].velocity.Y = num464;
num462++;
}
return;
}
else if (this.aiStyle == 51)
{
if (this.type == 297)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 4f)
{
for (int num468 = 0; num468 < 5; num468++)
{
int num469 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 2f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
}
}
}
else
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
this.localAI[0] += 1f;
}
for (int num470 = 0; num470 < 9; num470++)
{
int num471 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f);
Main.dust[num471].noGravity = true;
Main.dust[num471].velocity *= 0f;
}
}
float num472 = base.Center.X;
float num473 = base.Center.Y;
float num474 = 400f;
bool flag17 = false;
if (this.type == 297)
{
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(this, false) && Collision.CanHit(base.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(this.position.X + (float)(this.width / 2) - num476) + Math.Abs(this.position.Y + (float)(this.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
}
else
{
num474 = 200f;
for (int num479 = 0; num479 < 255; num479++)
{
if (Main.player[num479].active && !Main.player[num479].dead)
{
float num480 = Main.player[num479].position.X + (float)(Main.player[num479].width / 2);
float num481 = Main.player[num479].position.Y + (float)(Main.player[num479].height / 2);
float num482 = Math.Abs(this.position.X + (float)(this.width / 2) - num480) + Math.Abs(this.position.Y + (float)(this.height / 2) - num481);
if (num482 < num474)
{
num474 = num482;
num472 = num480;
num473 = num481;
flag17 = true;
}
}
}
}
if (flag17)
{
float num483 = 3f;
if (this.type == 297)
{
num483 = 6f;
}
Vector2 vector35 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
if (this.type == 297)
{
this.velocity.X = (this.velocity.X * 20f + num484) / 21f;
this.velocity.Y = (this.velocity.Y * 20f + num485) / 21f;
return;
}
this.velocity.X = (this.velocity.X * 100f + num484) / 101f;
this.velocity.Y = (this.velocity.Y * 100f + num485) / 101f;
return;
}
}
else if (this.aiStyle == 52)
{
int num487 = (int)this.ai[0];
float num488 = 4f;
Vector2 vector36 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num489 = Main.player[num487].Center.X - vector36.X;
float num490 = Main.player[num487].Center.Y - vector36.Y;
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
if (num491 < 50f && this.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && this.position.X + (float)this.width > Main.player[num487].position.X && this.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && this.position.Y + (float)this.height > Main.player[num487].position.Y)
{
if (this.owner == Main.myPlayer)
{
int num492 = (int)this.ai[1];
Main.player[num487].HealEffect(num492, false);
Main.player[num487].statLife += num492;
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
{
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
}
NetMessage.SendData(66, -1, -1, "", num487, (float)num492, 0f, 0f, 0, 0, 0);
}
this.Kill();
}
num491 = num488 / num491;
num489 *= num491;
num490 *= num491;
this.velocity.X = (this.velocity.X * 15f + num489) / 16f;
this.velocity.Y = (this.velocity.Y * 15f + num490) / 16f;
if (this.type == 305)
{
for (int num493 = 0; num493 < 3; num493++)
{
float num494 = this.velocity.X * 0.334f * (float)num493;
float num495 = -(this.velocity.Y * 0.334f) * (float)num493;
int num496 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 183, 0f, 0f, 100, default(Color), 1.1f);
Main.dust[num496].noGravity = true;
Main.dust[num496].velocity *= 0f;
Dust expr_15409_cp_0 = Main.dust[num496];
expr_15409_cp_0.position.X = expr_15409_cp_0.position.X - num494;
Dust expr_15428_cp_0 = Main.dust[num496];
expr_15428_cp_0.position.Y = expr_15428_cp_0.position.Y - num495;
}
return;
}
for (int num497 = 0; num497 < 5; num497++)
{
float num498 = this.velocity.X * 0.2f * (float)num497;
float num499 = -(this.velocity.Y * 0.2f) * (float)num497;
int num500 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f);
Main.dust[num500].noGravity = true;
Main.dust[num500].velocity *= 0f;
Dust expr_15520_cp_0 = Main.dust[num500];
expr_15520_cp_0.position.X = expr_15520_cp_0.position.X - num498;
Dust expr_1553F_cp_0 = Main.dust[num500];
expr_1553F_cp_0.position.Y = expr_1553F_cp_0.position.Y - num499;
}
return;
}
else if (this.aiStyle == 53)
{
if (this.localAI[0] == 0f)
{
this.localAI[1] = 1f;
this.localAI[0] = 1f;
this.ai[0] = 120f;
int num501 = 80;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 46);
if (this.type == 308)
{
for (int num502 = 0; num502 < num501; num502++)
{
int num503 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 16f), this.width, this.height - 16, 185, 0f, 0f, 0, default(Color), 1f);
Main.dust[num503].velocity *= 2f;
Main.dust[num503].noGravity = true;
Main.dust[num503].scale *= 1.15f;
}
}
if (this.type == 377)
{
this.frame = 4;
num501 = 40;
for (int num504 = 0; num504 < num501; num504++)
{
int num505 = Dust.NewDust(this.position + Vector2.UnitY * 16f, this.width, this.height - 16, 171, 0f, 0f, 100, default(Color), 1f);
Main.dust[num505].scale = (float)Main.rand.Next(1, 10) * 0.1f;
Main.dust[num505].noGravity = true;
Main.dust[num505].fadeIn = 1.5f;
Main.dust[num505].velocity *= 0.75f;
}
}
}
this.velocity.X = 0f;
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
bool flag18 = false;
float num506 = base.Center.X;
float num507 = base.Center.Y;
float num508 = 1000f;
for (int num509 = 0; num509 < 200; num509++)
{
if (Main.npc[num509].CanBeChasedBy(this, false))
{
float num510 = Main.npc[num509].position.X + (float)(Main.npc[num509].width / 2);
float num511 = Main.npc[num509].position.Y + (float)(Main.npc[num509].height / 2);
float num512 = Math.Abs(this.position.X + (float)(this.width / 2) - num510) + Math.Abs(this.position.Y + (float)(this.height / 2) - num511);
if (num512 < num508 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num509].position, Main.npc[num509].width, Main.npc[num509].height))
{
num508 = num512;
num506 = num510;
num507 = num511;
flag18 = true;
}
}
}
if (flag18)
{
float num513 = num506;
float num514 = num507;
num506 -= base.Center.X;
num507 -= base.Center.Y;
if (num506 < 0f)
{
this.spriteDirection = -1;
}
else
{
this.spriteDirection = 1;
}
int num515;
if (num507 > 0f)
{
num515 = 0;
}
else if (Math.Abs(num507) > Math.Abs(num506) * 3f)
{
num515 = 4;
}
else if (Math.Abs(num507) > Math.Abs(num506) * 2f)
{
num515 = 3;
}
else if (Math.Abs(num506) > Math.Abs(num507) * 3f)
{
num515 = 0;
}
else if (Math.Abs(num506) > Math.Abs(num507) * 2f)
{
num515 = 1;
}
else
{
num515 = 2;
}
if (this.type == 308)
{
this.frame = num515 * 2;
}
else if (this.type == 377)
{
this.frame = num515;
}
if (this.ai[0] > 40f && this.localAI[1] == 0f && this.type == 308)
{
this.frame++;
}
if (this.ai[0] <= 0f)
{
this.localAI[1] = 0f;
this.ai[0] = 60f;
if (Main.myPlayer == this.owner)
{
float num516 = 6f;
int num517 = 309;
if (this.type == 377)
{
num517 = 378;
num516 = 9f;
}
Vector2 vector37 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
if (num515 == 0)
{
vector37.Y += 12f;
vector37.X += (float)(24 * this.spriteDirection);
}
else if (num515 == 1)
{
vector37.Y += 0f;
vector37.X += (float)(24 * this.spriteDirection);
}
else if (num515 == 2)
{
vector37.Y -= 2f;
vector37.X += (float)(24 * this.spriteDirection);
}
else if (num515 == 3)
{
vector37.Y -= 6f;
vector37.X += (float)(14 * this.spriteDirection);
}
else if (num515 == 4)
{
vector37.Y -= 14f;
vector37.X += (float)(2 * this.spriteDirection);
}
if (this.spriteDirection < 0)
{
vector37.X += 10f;
}
float num518 = num513 - vector37.X;
float num519 = num514 - vector37.Y;
float num520 = (float)Math.Sqrt((double)(num518 * num518 + num519 * num519));
num520 = num516 / num520;
num518 *= num520;
num519 *= num520;
int num521 = this.damage;
Projectile.NewProjectile(vector37.X, vector37.Y, num518, num519, num517, num521, this.knockBack, Main.myPlayer, 0f, 0f);
}
}
}
else if (this.ai[0] <= 60f && (this.frame == 1 || this.frame == 3 || this.frame == 5 || this.frame == 7 || this.frame == 9))
{
this.frame--;
}
if (this.ai[0] > 0f)
{
this.ai[0] -= 1f;
return;
}
}
else if (this.aiStyle == 54)
{
if (this.type == 317)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].raven = false;
}
if (Main.player[Main.myPlayer].raven)
{
this.timeLeft = 2;
}
}
for (int num522 = 0; num522 < 1000; num522++)
{
if (num522 != this.whoAmI && Main.projectile[num522].active && Main.projectile[num522].owner == this.owner && Main.projectile[num522].type == this.type && Math.Abs(this.position.X - Main.projectile[num522].position.X) + Math.Abs(this.position.Y - Main.projectile[num522].position.Y) < (float)this.width)
{
if (this.position.X < Main.projectile[num522].position.X)
{
this.velocity.X = this.velocity.X - 0.05f;
}
else
{
this.velocity.X = this.velocity.X + 0.05f;
}
if (this.position.Y < Main.projectile[num522].position.Y)
{
this.velocity.Y = this.velocity.Y - 0.05f;
}
else
{
this.velocity.Y = this.velocity.Y + 0.05f;
}
}
}
float num523 = this.position.X;
float num524 = this.position.Y;
float num525 = 900f;
bool flag19 = false;
int num526 = 500;
if (this.ai[1] != 0f || this.friendly)
{
num526 = 1400;
}
if (Math.Abs(base.Center.X - Main.player[this.owner].Center.X) + Math.Abs(base.Center.Y - Main.player[this.owner].Center.Y) > (float)num526)
{
this.ai[0] = 1f;
}
if (this.ai[0] == 0f)
{
this.tileCollide = true;
for (int num527 = 0; num527 < 200; num527++)
{
if (Main.npc[num527].CanBeChasedBy(this, false))
{
float num528 = Main.npc[num527].position.X + (float)(Main.npc[num527].width / 2);
float num529 = Main.npc[num527].position.Y + (float)(Main.npc[num527].height / 2);
float num530 = Math.Abs(this.position.X + (float)(this.width / 2) - num528) + Math.Abs(this.position.Y + (float)(this.height / 2) - num529);
if (num530 < num525 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num527].position, Main.npc[num527].width, Main.npc[num527].height))
{
num525 = num530;
num523 = num528;
num524 = num529;
flag19 = true;
}
}
}
}
else
{
this.tileCollide = false;
}
if (!flag19)
{
this.friendly = true;
float num531 = 8f;
if (this.ai[0] == 1f)
{
num531 = 12f;
}
Vector2 vector38 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num532 = Main.player[this.owner].Center.X - vector38.X;
float num533 = Main.player[this.owner].Center.Y - vector38.Y - 60f;
float num534 = (float)Math.Sqrt((double)(num532 * num532 + num533 * num533));
if (num534 < 100f && this.ai[0] == 1f && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
}
if (num534 > 2000f)
{
this.position.X = Main.player[this.owner].Center.X - (float)(this.width / 2);
this.position.Y = Main.player[this.owner].Center.Y - (float)(this.width / 2);
}
if (num534 > 70f)
{
num534 = num531 / num534;
num532 *= num534;
num533 *= num534;
this.velocity.X = (this.velocity.X * 20f + num532) / 21f;
this.velocity.Y = (this.velocity.Y * 20f + num533) / 21f;
}
else
{
if (this.velocity.X == 0f && this.velocity.Y == 0f)
{
this.velocity.X = -0.15f;
this.velocity.Y = -0.05f;
}
this.velocity *= 1.01f;
}
this.friendly = false;
this.rotation = this.velocity.X * 0.05f;
this.frameCounter++;
if (this.frameCounter >= 4)
{
this.frameCounter = 0;
this.frame++;
}
if (this.frame > 3)
{
this.frame = 0;
}
if ((double)Math.Abs(this.velocity.X) > 0.2)
{
this.spriteDirection = -this.direction;
return;
}
}
else
{
if (this.ai[1] == -1f)
{
this.ai[1] = 17f;
}
if (this.ai[1] > 0f)
{
this.ai[1] -= 1f;
}
if (this.ai[1] == 0f)
{
this.friendly = true;
float num535 = 8f;
Vector2 vector39 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num536 = num523 - vector39.X;
float num537 = num524 - vector39.Y;
float num538 = (float)Math.Sqrt((double)(num536 * num536 + num537 * num537));
if (num538 < 100f)
{
num535 = 10f;
}
num538 = num535 / num538;
num536 *= num538;
num537 *= num538;
this.velocity.X = (this.velocity.X * 14f + num536) / 15f;
this.velocity.Y = (this.velocity.Y * 14f + num537) / 15f;
}
else
{
this.friendly = false;
if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 10f)
{
this.velocity *= 1.05f;
}
}
this.rotation = this.velocity.X * 0.05f;
this.frameCounter++;
if (this.frameCounter >= 4)
{
this.frameCounter = 0;
this.frame++;
}
if (this.frame < 4)
{
this.frame = 4;
}
if (this.frame > 7)
{
this.frame = 4;
}
if ((double)Math.Abs(this.velocity.X) > 0.2)
{
this.spriteDirection = -this.direction;
return;
}
}
}
else if (this.aiStyle == 55)
{
this.frameCounter++;
if (this.frameCounter > 0)
{
this.frame++;
this.frameCounter = 0;
if (this.frame > 2)
{
this.frame = 0;
}
}
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.spriteDirection = 1;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
if (this.ai[0] >= 0f && this.ai[0] < 200f)
{
int num539 = (int)this.ai[0];
if (Main.npc[num539].active)
{
float num540 = 8f;
Vector2 vector40 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num541 = Main.npc[num539].position.X - vector40.X;
float num542 = Main.npc[num539].position.Y - vector40.Y;
float num543 = (float)Math.Sqrt((double)(num541 * num541 + num542 * num542));
num543 = num540 / num543;
num541 *= num543;
num542 *= num543;
this.velocity.X = (this.velocity.X * 14f + num541) / 15f;
this.velocity.Y = (this.velocity.Y * 14f + num542) / 15f;
}
else
{
float num544 = 1000f;
for (int num545 = 0; num545 < 200; num545++)
{
if (Main.npc[num545].CanBeChasedBy(this, false))
{
float num546 = Main.npc[num545].position.X + (float)(Main.npc[num545].width / 2);
float num547 = Main.npc[num545].position.Y + (float)(Main.npc[num545].height / 2);
float num548 = Math.Abs(this.position.X + (float)(this.width / 2) - num546) + Math.Abs(this.position.Y + (float)(this.height / 2) - num547);
if (num548 < num544 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num545].position, Main.npc[num545].width, Main.npc[num545].height))
{
num544 = num548;
this.ai[0] = (float)num545;
}
}
}
}
int num549 = 8;
int num550 = Dust.NewDust(new Vector2(this.position.X + (float)num549, this.position.Y + (float)num549), this.width - num549 * 2, this.height - num549 * 2, 6, 0f, 0f, 0, default(Color), 1f);
Main.dust[num550].velocity *= 0.5f;
Main.dust[num550].velocity += this.velocity * 0.5f;
Main.dust[num550].noGravity = true;
Main.dust[num550].noLight = true;
Main.dust[num550].scale = 1.4f;
return;
}
this.Kill();
return;
}
else
{
if (this.aiStyle == 56)
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
this.rotation = this.ai[0];
this.spriteDirection = -(int)this.ai[1];
}
if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 16f)
{
this.velocity *= 1.05f;
}
if (this.velocity.X < 0f)
{
this.direction = -1;
}
else
{
this.direction = 1;
}
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.025f * (float)this.direction;
return;
}
if (this.aiStyle == 57)
{
this.ai[0] += 1f;
if (this.ai[0] > 30f)
{
this.ai[0] = 30f;
this.velocity.Y = this.velocity.Y + 0.25f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
this.velocity.X = this.velocity.X * 0.995f;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.owner == Main.myPlayer)
{
this.localAI[0] += 1f;
if (this.localAI[0] >= 4f)
{
this.localAI[0] = 0f;
int num551 = 0;
for (int num552 = 0; num552 < 1000; num552++)
{
if (Main.projectile[num552].active && Main.projectile[num552].owner == this.owner && Main.projectile[num552].type == 344)
{
num551++;
}
}
float num553 = (float)this.damage * 0.8f;
if (num551 > 100)
{
float num554 = (float)(num551 - 100);
num554 = 1f - num554 / 100f;
num553 *= num554;
}
if (num551 > 100)
{
this.localAI[0] -= 1f;
}
if (num551 > 120)
{
this.localAI[0] -= 1f;
}
if (num551 > 140)
{
this.localAI[0] -= 1f;
}
if (num551 > 150)
{
this.localAI[0] -= 1f;
}
if (num551 > 160)
{
this.localAI[0] -= 1f;
}
if (num551 > 165)
{
this.localAI[0] -= 1f;
}
if (num551 > 170)
{
this.localAI[0] -= 2f;
}
if (num551 > 175)
{
this.localAI[0] -= 3f;
}
if (num551 > 180)
{
this.localAI[0] -= 4f;
}
if (num551 > 185)
{
this.localAI[0] -= 5f;
}
if (num551 > 190)
{
this.localAI[0] -= 6f;
}
if (num551 > 195)
{
this.localAI[0] -= 7f;
}
if (num553 > (float)this.damage * 0.1f)
{
Projectile.NewProjectile(base.Center.X, base.Center.Y, 0f, 0f, 344, (int)num553, this.knockBack * 0.55f, this.owner, 0f, (float)Main.rand.Next(3));
return;
}
}
}
}
else
{
if (this.aiStyle == 58)
{
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[0] == 0f)
{
this.frame = 0;
this.ai[1] += 1f;
if (this.ai[1] > 30f)
{
this.velocity.Y = this.velocity.Y + 0.1f;
}
if (this.velocity.Y >= 0f)
{
this.ai[0] = 1f;
}
}
if (this.ai[0] == 1f)
{
this.frame = 1;
this.velocity.Y = this.velocity.Y + 0.1f;
if (this.velocity.Y > 3f)
{
this.velocity.Y = 3f;
}
this.velocity.X = this.velocity.X * 0.99f;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
return;
}
if (this.aiStyle == 59)
{
this.ai[1] += 1f;
if (this.ai[1] >= 60f)
{
this.friendly = true;
int num555 = (int)this.ai[0];
if (!Main.npc[num555].active)
{
int[] array2 = new int[200];
int num556 = 0;
for (int num557 = 0; num557 < 200; num557++)
{
if (Main.npc[num557].CanBeChasedBy(this, false))
{
float num558 = Math.Abs(Main.npc[num557].position.X + (float)(Main.npc[num557].width / 2) - this.position.X + (float)(this.width / 2)) + Math.Abs(Main.npc[num557].position.Y + (float)(Main.npc[num557].height / 2) - this.position.Y + (float)(this.height / 2));
if (num558 < 800f)
{
array2[num556] = num557;
num556++;
}
}
}
if (num556 == 0)
{
this.Kill();
return;
}
num555 = array2[Main.rand.Next(num556)];
this.ai[0] = (float)num555;
}
float num559 = 4f;
Vector2 vector41 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num560 = Main.npc[num555].Center.X - vector41.X;
float num561 = Main.npc[num555].Center.Y - vector41.Y;
float num562 = (float)Math.Sqrt((double)(num560 * num560 + num561 * num561));
num562 = num559 / num562;
num560 *= num562;
num561 *= num562;
int num563 = 30;
this.velocity.X = (this.velocity.X * (float)(num563 - 1) + num560) / (float)num563;
this.velocity.Y = (this.velocity.Y * (float)(num563 - 1) + num561) / (float)num563;
}
for (int num564 = 0; num564 < 5; num564++)
{
float num565 = this.velocity.X * 0.2f * (float)num564;
float num566 = -(this.velocity.Y * 0.2f) * (float)num564;
int num567 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f);
Main.dust[num567].noGravity = true;
Main.dust[num567].velocity *= 0f;
Dust expr_174E2_cp_0 = Main.dust[num567];
expr_174E2_cp_0.position.X = expr_174E2_cp_0.position.X - num565;
Dust expr_17501_cp_0 = Main.dust[num567];
expr_17501_cp_0.position.Y = expr_17501_cp_0.position.Y - num566;
}
return;
}
if (this.aiStyle == 60)
{
this.scale -= 0.015f;
if (this.scale <= 0f)
{
this.velocity *= 5f;
this.oldVelocity = this.velocity;
this.Kill();
}
if (this.ai[0] <= 3f)
{
this.ai[0] += 1f;
return;
}
int num568 = 103;
if (this.type == 406)
{
num568 = 137;
}
if (this.owner == Main.myPlayer)
{
Rectangle rectangle4 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
for (int num569 = 0; num569 < 200; num569++)
{
if (Main.npc[num569].active && !Main.npc[num569].dontTakeDamage && Main.npc[num569].lifeMax > 1)
{
Rectangle value12 = new Rectangle((int)Main.npc[num569].position.X, (int)Main.npc[num569].position.Y, Main.npc[num569].width, Main.npc[num569].height);
if (rectangle4.Intersects(value12))
{
Main.npc[num569].AddBuff(num568, 1500, false);
this.Kill();
}
}
}
for (int num570 = 0; num570 < 255; num570++)
{
if (num570 != this.owner && Main.player[num570].active && !Main.player[num570].dead)
{
Rectangle value13 = new Rectangle((int)Main.player[num570].position.X, (int)Main.player[num570].position.Y, Main.player[num570].width, Main.player[num570].height);
if (rectangle4.Intersects(value13))
{
Main.player[num570].AddBuff(num568, 1500, false);
this.Kill();
}
}
}
}
this.ai[0] += this.ai[1];
if (this.ai[0] > 30f)
{
this.velocity.Y = this.velocity.Y + 0.1f;
}
if (this.type == 358)
{
for (int num571 = 0; num571 < 1; num571++)
{
for (int num572 = 0; num572 < 6; num572++)
{
float num573 = this.velocity.X / 6f * (float)num572;
float num574 = this.velocity.Y / 6f * (float)num572;
int num575 = 6;
int num576 = Dust.NewDust(new Vector2(this.position.X + (float)num575, this.position.Y + (float)num575), this.width - num575 * 2, this.height - num575 * 2, 211, 0f, 0f, 75, default(Color), 1.2f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num576].alpha += 25;
}
if (Main.rand.Next(2) == 0)
{
Main.dust[num576].alpha += 25;
}
if (Main.rand.Next(2) == 0)
{
Main.dust[num576].alpha += 25;
}
Main.dust[num576].noGravity = true;
Main.dust[num576].velocity *= 0.3f;
Main.dust[num576].velocity += this.velocity * 0.5f;
Main.dust[num576].position = base.Center;
Dust expr_17994_cp_0 = Main.dust[num576];
expr_17994_cp_0.position.X = expr_17994_cp_0.position.X - num573;
Dust expr_179B3_cp_0 = Main.dust[num576];
expr_179B3_cp_0.position.Y = expr_179B3_cp_0.position.Y - num574;
Main.dust[num576].velocity *= 0.2f;
}
if (Main.rand.Next(4) == 0)
{
int num577 = 6;
int num578 = Dust.NewDust(new Vector2(this.position.X + (float)num577, this.position.Y + (float)num577), this.width - num577 * 2, this.height - num577 * 2, 211, 0f, 0f, 75, default(Color), 0.65f);
Main.dust[num578].velocity *= 0.5f;
Main.dust[num578].velocity += this.velocity * 0.5f;
}
}
}
if (this.type == 406)
{
int num579 = 175;
Color newColor = new Color(0, 80, 255, 100);
for (int num580 = 0; num580 < 6; num580++)
{
Vector2 vector42 = this.velocity * (float)num580 / 6f;
int num581 = 6;
int num582 = Dust.NewDust(this.position + Vector2.One * 6f, this.width - num581 * 2, this.height - num581 * 2, 4, 0f, 0f, num579, newColor, 1.2f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num582].alpha += 25;
}
if (Main.rand.Next(2) == 0)
{
Main.dust[num582].alpha += 25;
}
if (Main.rand.Next(2) == 0)
{
Main.dust[num582].alpha += 25;
}
Main.dust[num582].noGravity = true;
Main.dust[num582].velocity *= 0.3f;
Main.dust[num582].velocity += this.velocity * 0.5f;
Main.dust[num582].position = base.Center;
Dust expr_17C70_cp_0 = Main.dust[num582];
expr_17C70_cp_0.position.X = expr_17C70_cp_0.position.X - vector42.X;
Dust expr_17C94_cp_0 = Main.dust[num582];
expr_17C94_cp_0.position.Y = expr_17C94_cp_0.position.Y - vector42.Y;
Main.dust[num582].velocity *= 0.2f;
}
if (Main.rand.Next(4) == 0)
{
int num583 = 6;
int num584 = Dust.NewDust(this.position + Vector2.One * 6f, this.width - num583 * 2, this.height - num583 * 2, 4, 0f, 0f, num579, newColor, 1.2f);
Main.dust[num584].velocity *= 0.5f;
Main.dust[num584].velocity += this.velocity * 0.5f;
return;
}
}
}
else if (this.aiStyle == 61)
{
this.timeLeft = 60;
if (Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].fishingPole == 0)
{
this.Kill();
}
else if (Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].shoot != this.type)
{
this.Kill();
}
else if (Main.player[this.owner].pulley)
{
this.Kill();
}
else if (Main.player[this.owner].dead)
{
this.Kill();
}
if (this.ai[1] > 0f && this.localAI[1] >= 0f)
{
this.localAI[1] = -1f;
if (!this.lavaWet && !this.honeyWet)
{
for (int num585 = 0; num585 < 100; num585++)
{
int num586 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y - 10f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f);
Dust expr_17F1F_cp_0 = Main.dust[num586];
expr_17F1F_cp_0.velocity.Y = expr_17F1F_cp_0.velocity.Y - 4f;
Dust expr_17F3F_cp_0 = Main.dust[num586];
expr_17F3F_cp_0.velocity.X = expr_17F3F_cp_0.velocity.X * 2.5f;
Main.dust[num586].scale = 0.8f;
Main.dust[num586].alpha = 100;
Main.dust[num586].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 0);
}
}
if (this.ai[0] >= 1f)
{
if (this.ai[0] == 2f)
{
this.ai[0] += 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
if (!this.lavaWet && !this.honeyWet)
{
for (int num587 = 0; num587 < 100; num587++)
{
int num588 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y - 10f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f);
Dust expr_180A8_cp_0 = Main.dust[num588];
expr_180A8_cp_0.velocity.Y = expr_180A8_cp_0.velocity.Y - 4f;
Dust expr_180C8_cp_0 = Main.dust[num588];
expr_180C8_cp_0.velocity.X = expr_180C8_cp_0.velocity.X * 2.5f;
Main.dust[num588].scale = 0.8f;
Main.dust[num588].alpha = 100;
Main.dust[num588].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 0);
}
}
if (this.localAI[0] < 100f)
{
this.localAI[0] += 1f;
}
this.tileCollide = false;
float num589 = 15.9f;
int num590 = 10;
Vector2 vector43 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num591 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector43.X;
float num592 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector43.Y;
float num593 = (float)Math.Sqrt((double)(num591 * num591 + num592 * num592));
if (num593 > 3000f)
{
this.Kill();
}
num593 = num589 / num593;
num591 *= num593;
num592 *= num593;
this.velocity.X = (this.velocity.X * (float)(num590 - 1) + num591) / (float)num590;
this.velocity.Y = (this.velocity.Y * (float)(num590 - 1) + num592) / (float)num590;
if (Main.myPlayer == this.owner)
{
Rectangle rectangle5 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
Rectangle value14 = new Rectangle((int)Main.player[this.owner].position.X, (int)Main.player[this.owner].position.Y, Main.player[this.owner].width, Main.player[this.owner].height);
if (rectangle5.Intersects(value14))
{
if (this.ai[1] > 0f && this.ai[1] < 3601f)
{
int num594 = (int)this.ai[1];
Item item = new Item();
item.SetDefaults(num594, false);
if (num594 == 3196)
{
int num595 = Main.player[this.owner].FishingLevel();
int minValue = (num595 / 20 + 3) / 2;
int num596 = (num595 / 10 + 6) / 2;
if (Main.rand.Next(50) < num595)
{
num596++;
}
if (Main.rand.Next(100) < num595)
{
num596++;
}
if (Main.rand.Next(150) < num595)
{
num596++;
}
if (Main.rand.Next(200) < num595)
{
num596++;
}
int stack = Main.rand.Next(minValue, num596 + 1);
item.stack = stack;
}
if (num594 == 3197)
{
int num597 = Main.player[this.owner].FishingLevel();
int minValue2 = (num597 / 4 + 15) / 2;
int num598 = (num597 / 2 + 30) / 2;
if (Main.rand.Next(50) < num597)
{
num598 += 4;
}
if (Main.rand.Next(100) < num597)
{
num598 += 4;
}
if (Main.rand.Next(150) < num597)
{
num598 += 4;
}
if (Main.rand.Next(200) < num597)
{
num598 += 4;
}
int stack2 = Main.rand.Next(minValue2, num598 + 1);
item.stack = stack2;
}
Item item2 = Main.player[this.owner].GetItem(this.owner, item, false, false);
if (item2.stack > 0)
{
int number2 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num594, 1, false, 0, true);
if (Main.netMode == 1)
{
NetMessage.SendData(21, -1, -1, "", number2, 1f, 0f, 0f, 0, 0, 0);
}
}
else
{
item.position.X = base.Center.X - (float)(item.width / 2);
item.position.Y = base.Center.Y - (float)(item.height / 2);
item.active = true;
ItemText.NewText(item, 0, false, false);
}
}
this.Kill();
}
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
return;
}
bool flag20 = false;
Vector2 vector44 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num599 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector44.X;
float num600 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector44.Y;
this.rotation = (float)Math.Atan2((double)num600, (double)num599) + 1.57f;
float num601 = (float)Math.Sqrt((double)(num599 * num599 + num600 * num600));
if (num601 > 900f)
{
this.ai[0] = 1f;
}
if (this.wet)
{
this.rotation = 0f;
this.velocity.X = this.velocity.X * 0.9f;
int num602 = (int)(base.Center.X + (float)((this.width / 2 + 8) * this.direction)) / 16;
int num603 = (int)(base.Center.Y / 16f);
float arg_18826_0 = this.position.Y / 16f;
int num604 = (int)((this.position.Y + (float)this.height) / 16f);
if (Main.tile[num602, num603] == null)
{
Main.tile[num602, num603] = new Tile();
}
if (Main.tile[num602, num604] == null)
{
Main.tile[num602, num604] = new Tile();
}
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y * 0.5f;
}
num602 = (int)(base.Center.X / 16f);
num603 = (int)(base.Center.Y / 16f);
float num605 = this.position.Y + (float)this.height;
if (Main.tile[num602, num603 - 1] == null)
{
Main.tile[num602, num603 - 1] = new Tile();
}
if (Main.tile[num602, num603] == null)
{
Main.tile[num602, num603] = new Tile();
}
if (Main.tile[num602, num603 + 1] == null)
{
Main.tile[num602, num603 + 1] = new Tile();
}
if (Main.tile[num602, num603 - 1].liquid > 0)
{
num605 = (float)(num603 * 16);
num605 -= (float)(Main.tile[num602, num603 - 1].liquid / 16);
}
else if (Main.tile[num602, num603].liquid > 0)
{
num605 = (float)((num603 + 1) * 16);
num605 -= (float)(Main.tile[num602, num603].liquid / 16);
}
else if (Main.tile[num602, num603 + 1].liquid > 0)
{
num605 = (float)((num603 + 2) * 16);
num605 -= (float)(Main.tile[num602, num603 + 1].liquid / 16);
}
if (base.Center.Y > num605)
{
this.velocity.Y = this.velocity.Y - 0.1f;
if (this.velocity.Y < -8f)
{
this.velocity.Y = -8f;
}
if (base.Center.Y + this.velocity.Y < num605)
{
this.velocity.Y = num605 - base.Center.Y;
}
}
else
{
this.velocity.Y = num605 - base.Center.Y;
}
if ((double)this.velocity.Y >= -0.01 && (double)this.velocity.Y <= 0.01)
{
flag20 = true;
}
}
else
{
if (this.velocity.Y == 0f)
{
this.velocity.X = this.velocity.X * 0.95f;
}
this.velocity.X = this.velocity.X * 0.98f;
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 15.9f)
{
this.velocity.Y = 15.9f;
}
}
if (this.ai[1] != 0f)
{
flag20 = true;
}
if (flag20)
{
if (this.ai[1] == 0f && Main.myPlayer == this.owner)
{
int num606 = Main.player[this.owner].FishingLevel();
if (num606 == -9000)
{
this.localAI[1] += 5f;
this.localAI[1] += (float)Main.rand.Next(1, 3);
if (this.localAI[1] > 660f)
{
this.localAI[1] = 0f;
this.FishingCheck();
return;
}
}
else
{
if (Main.rand.Next(300) < num606)
{
this.localAI[1] += (float)Main.rand.Next(1, 3);
}
this.localAI[1] += (float)(num606 / 30);
this.localAI[1] += (float)Main.rand.Next(1, 3);
if (Main.rand.Next(60) == 0)
{
this.localAI[1] += 60f;
}
if (this.localAI[1] > 660f)
{
this.localAI[1] = 0f;
this.FishingCheck();
return;
}
}
}
else if (this.ai[1] < 0f)
{
if (this.velocity.Y == 0f || (this.honeyWet && (double)this.velocity.Y >= -0.01 && (double)this.velocity.Y <= 0.01))
{
this.velocity.Y = (float)Main.rand.Next(100, 500) * 0.015f;
this.velocity.X = (float)Main.rand.Next(-100, 101) * 0.015f;
this.wet = false;
this.lavaWet = false;
this.honeyWet = false;
}
this.ai[1] += (float)Main.rand.Next(1, 5);
if (this.ai[1] >= 0f)
{
this.ai[1] = 0f;
this.localAI[1] = 0f;
this.netUpdate = true;
return;
}
}
}
}
else
{
if (this.aiStyle == 62)
{
this.AI_062();
return;
}
if (this.aiStyle == 63)
{
if (!Main.player[this.owner].active)
{
this.active = false;
return;
}
Vector2 value15 = this.position;
bool flag21 = false;
float num607 = 500f;
for (int num608 = 0; num608 < 200; num608++)
{
NPC nPC = Main.npc[num608];
if (nPC.CanBeChasedBy(this, false))
{
float num609 = Vector2.Distance(nPC.Center, base.Center);
if (((Vector2.Distance(base.Center, value15) > num609 && num609 < num607) || !flag21) && Collision.CanHit(this.position, this.width, this.height, nPC.position, nPC.width, nPC.height))
{
num607 = num609;
value15 = nPC.Center;
flag21 = true;
}
}
}
if (!flag21)
{
this.velocity.X = this.velocity.X * 0.95f;
}
else
{
float num610 = 5f;
float num611 = 0.08f;
if (this.velocity.Y == 0f)
{
bool flag22 = false;
if (base.Center.Y - 50f > value15.Y)
{
flag22 = true;
}
if (flag22)
{
this.velocity.Y = -6f;
}
}
else
{
num610 = 8f;
num611 = 0.12f;
}
this.velocity.X = this.velocity.X + (float)Math.Sign(value15.X - base.Center.X) * num611;
if (this.velocity.X < -num610)
{
this.velocity.X = -num610;
}
if (this.velocity.X > num610)
{
this.velocity.X = num610;
}
}
float num612 = 0f;
Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref num612, ref this.gfxOffY, 1, false, 0);
if (this.velocity.Y != 0f)
{
this.frame = 3;
}
else
{
if (Math.Abs(this.velocity.X) > 0.2f)
{
this.frameCounter++;
}
if (this.frameCounter >= 9)
{
this.frameCounter = 0;
}
if (this.frameCounter >= 6)
{
this.frame = 2;
}
else if (this.frameCounter >= 3)
{
this.frame = 1;
}
else
{
this.frame = 0;
}
}
if (this.velocity.X != 0f)
{
this.direction = Math.Sign(this.velocity.X);
}
this.spriteDirection = -this.direction;
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
return;
}
}
else if (this.aiStyle == 64)
{
int num613 = 10;
int num614 = 15;
float num615 = 1f;
int num616 = 150;
int num617 = 42;
if (this.type == 386)
{
num613 = 16;
num614 = 16;
num615 = 1.5f;
}
if (this.velocity.X != 0f)
{
this.direction = (this.spriteDirection = -Math.Sign(this.velocity.X));
}
this.frameCounter++;
if (this.frameCounter > 2)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 6)
{
this.frame = 0;
}
if (this.localAI[0] == 0f && Main.myPlayer == this.owner)
{
this.localAI[0] = 1f;
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.scale = ((float)(num613 + num614) - this.ai[1]) * num615 / (float)(num614 + num613);
this.width = (int)((float)num616 * this.scale);
this.height = (int)((float)num617 * this.scale);
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.netUpdate = true;
}
if (this.ai[1] != -1f)
{
this.scale = ((float)(num613 + num614) - this.ai[1]) * num615 / (float)(num614 + num613);
this.width = (int)((float)num616 * this.scale);
this.height = (int)((float)num617 * this.scale);
}
if (!Collision.SolidCollision(this.position, this.width, this.height))
{
this.alpha -= 30;
if (this.alpha < 60)
{
this.alpha = 60;
}
if (this.type == 386 && this.alpha < 100)
{
this.alpha = 100;
}
}
else
{
this.alpha += 30;
if (this.alpha > 150)
{
this.alpha = 150;
}
}
if (this.ai[0] > 0f)
{
this.ai[0] -= 1f;
}
if (this.ai[0] == 1f && this.ai[1] > 0f && this.owner == Main.myPlayer)
{
this.netUpdate = true;
Vector2 center = base.Center;
center.Y -= (float)num617 * this.scale / 2f;
float num618 = ((float)(num613 + num614) - this.ai[1] + 1f) * num615 / (float)(num614 + num613);
center.Y -= (float)num617 * num618 / 2f;
center.Y += 2f;
Projectile.NewProjectile(center.X, center.Y, this.velocity.X, this.velocity.Y, this.type, this.damage, this.knockBack, this.owner, 10f, this.ai[1] - 1f);
int num619 = 4;
if (this.type == 386)
{
num619 = 2;
}
if ((int)this.ai[1] % num619 == 0 && this.ai[1] != 0f)
{
int num620 = 372;
if (this.type == 386)
{
num620 = 373;
}
int num621 = NPC.NewNPC((int)center.X, (int)center.Y, num620, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num621].velocity = this.velocity;
Main.npc[num621].netUpdate = true;
if (this.type == 386)
{
Main.npc[num621].ai[2] = (float)this.width;
Main.npc[num621].ai[3] = -1.5f;
}
}
}
if (this.ai[0] <= 0f)
{
float num622 = 0.104719758f;
float num623 = (float)this.width / 5f;
if (this.type == 386)
{
num623 *= 2f;
}
float num624 = (float)(Math.Cos((double)(num622 * -(double)this.ai[0])) - 0.5) * num623;
this.position.X = this.position.X - num624 * (float)(-(float)this.direction);
this.ai[0] -= 1f;
num624 = (float)(Math.Cos((double)(num622 * -(double)this.ai[0])) - 0.5) * num623;
this.position.X = this.position.X + num624 * (float)(-(float)this.direction);
return;
}
}
else if (this.aiStyle == 65)
{
if (this.ai[1] > 0f)
{
int num625 = (int)this.ai[1] - 1;
if (num625 < 255)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 10f)
{
int num626 = 6;
for (int num627 = 0; num627 < num626; num627++)
{
Vector2 vector45 = Vector2.Normalize(this.velocity) * new Vector2((float)this.width / 2f, (float)this.height) * 0.75f;
vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + base.Center;
Vector2 value16 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8);
int num628 = Dust.NewDust(vector45 + value16, 0, 0, 172, value16.X * 2f, value16.Y * 2f, 100, default(Color), 1.4f);
Main.dust[num628].noGravity = true;
Main.dust[num628].noLight = true;
Main.dust[num628].velocity /= 4f;
Main.dust[num628].velocity -= this.velocity;
}
this.alpha -= 5;
if (this.alpha < 100)
{
this.alpha = 100;
}
this.rotation += this.velocity.X * 0.1f;
this.frame = (int)(this.localAI[0] / 3f) % 3;
}
Vector2 value17 = Main.player[num625].Center - base.Center;
float num629 = 4f;
num629 += this.localAI[0] / 20f;
this.velocity = Vector2.Normalize(value17) * num629;
if (value17.Length() < 50f)
{
this.Kill();
}
}
}
else
{
float num630 = 0.209439516f;
float num631 = 4f;
float num632 = (float)(Math.Cos((double)(num630 * this.ai[0])) - 0.5) * num631;
this.velocity.Y = this.velocity.Y - num632;
this.ai[0] += 1f;
num632 = (float)(Math.Cos((double)(num630 * this.ai[0])) - 0.5) * num631;
this.velocity.Y = this.velocity.Y + num632;
this.localAI[0] += 1f;
if (this.localAI[0] > 10f)
{
this.alpha -= 5;
if (this.alpha < 100)
{
this.alpha = 100;
}
this.rotation += this.velocity.X * 0.1f;
this.frame = (int)(this.localAI[0] / 3f) % 3;
}
}
if (this.wet)
{
this.position.Y = this.position.Y - 16f;
this.Kill();
return;
}
}
else if (this.aiStyle == 66)
{
float num633 = 0f;
float num634 = 0f;
float num635 = 0f;
float num636 = 0f;
if (this.type == 387 || this.type == 388)
{
num633 = 700f;
num634 = 800f;
num635 = 1200f;
num636 = 150f;
if (Main.player[this.owner].dead)
{
Main.player[this.owner].twinsMinion = false;
}
if (Main.player[this.owner].twinsMinion)
{
this.timeLeft = 2;
}
}
if (this.type == 533)
{
num633 = 1500f;
num634 = 900f;
num635 = 1500f;
num636 = 450f;
if (Main.player[this.owner].dead)
{
Main.player[this.owner].DeadlySphereMinion = false;
}
if (Main.player[this.owner].DeadlySphereMinion)
{
this.timeLeft = 2;
}
}
float num637 = 0.05f;
for (int num638 = 0; num638 < 1000; num638++)
{
bool flag23 = (Main.projectile[num638].type == 387 || Main.projectile[num638].type == 388) && (this.type == 387 || this.type == 388);
if (!flag23)
{
flag23 = (this.type == 533 && Main.projectile[num638].type == 533);
}
if (num638 != this.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == this.owner && flag23 && Math.Abs(this.position.X - Main.projectile[num638].position.X) + Math.Abs(this.position.Y - Main.projectile[num638].position.Y) < (float)this.width)
{
if (this.position.X < Main.projectile[num638].position.X)
{
this.velocity.X = this.velocity.X - num637;
}
else
{
this.velocity.X = this.velocity.X + num637;
}
if (this.position.Y < Main.projectile[num638].position.Y)
{
this.velocity.Y = this.velocity.Y - num637;
}
else
{
this.velocity.Y = this.velocity.Y + num637;
}
}
}
if (this.type == 533)
{
if ((int)this.ai[0] % 3 != 2)
{
Lighting.AddLight(base.Center, 0.8f, 0.3f, 0.1f);
}
else
{
Lighting.AddLight(base.Center, 0.3f, 0.5f, 0.7f);
}
}
bool flag24 = false;
if (this.ai[0] == 2f && this.type == 388)
{
this.ai[1] += 1f;
this.extraUpdates = 1;
this.rotation = this.velocity.ToRotation() + 3.14159274f;
this.frameCounter++;
if (this.frameCounter > 1)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 2)
{
this.frame = 0;
}
if (this.ai[1] > 40f)
{
this.ai[1] = 1f;
this.ai[0] = 0f;
this.extraUpdates = 0;
this.numUpdates = 0;
this.netUpdate = true;
}
else
{
flag24 = true;
}
}
if (this.type == 533 && this.ai[0] >= 3f && this.ai[0] <= 5f)
{
int num639 = 2;
flag24 = true;
this.velocity *= 0.9f;
this.ai[1] += 1f;
int num640 = (int)this.ai[1] / num639 + (int)(this.ai[0] - 3f) * 8;
if (num640 < 4)
{
this.frame = 17 + num640;
}
else if (num640 < 5)
{
this.frame = 0;
}
else if (num640 < 8)
{
this.frame = 1 + num640 - 5;
}
else if (num640 < 11)
{
this.frame = 11 - num640;
}
else if (num640 < 12)
{
this.frame = 0;
}
else if (num640 < 16)
{
this.frame = num640 - 2;
}
else if (num640 < 20)
{
this.frame = 29 - num640;
}
else if (num640 < 21)
{
this.frame = 0;
}
else
{
this.frame = num640 - 4;
}
if (this.ai[1] > (float)(num639 * 8))
{
this.ai[0] -= 3f;
this.ai[1] = 0f;
}
}
if (this.type == 533 && this.ai[0] >= 6f && this.ai[0] <= 8f)
{
this.ai[1] += 1f;
this.MaxUpdates = 2;
if (this.ai[0] == 7f)
{
this.rotation = this.velocity.ToRotation() + 3.14159274f;
}
else
{
this.rotation += 0.5235988f;
}
int num641 = 0;
switch ((int)this.ai[0])
{
case 6:
this.frame = 5;
num641 = 40;
break;
case 7:
this.frame = 13;
num641 = 30;
break;
case 8:
this.frame = 17;
num641 = 30;
break;
}
if (this.ai[1] > (float)num641)
{
this.ai[1] = 1f;
this.ai[0] -= 6f;
this.localAI[0] += 1f;
this.extraUpdates = 0;
this.numUpdates = 0;
this.netUpdate = true;
}
else
{
flag24 = true;
}
if (this.ai[0] == 8f)
{
for (int num642 = 0; num642 < 4; num642++)
{
int num643 = Utils.SelectRandom<int>(Main.rand, new int[]
{
226,
228,
75
});
int num644 = Dust.NewDust(base.Center, 0, 0, num643, 0f, 0f, 0, default(Color), 1f);
Dust dust = Main.dust[num644];
Vector2 value18 = Vector2.One.RotatedBy((double)((float)num642 * 1.57079637f), default(Vector2)).RotatedBy((double)this.rotation, default(Vector2));
dust.position = base.Center + value18 * 10f;
dust.velocity = value18 * 1f;
dust.scale = 0.6f + Main.rand.NextFloat() * 0.5f;
dust.noGravity = true;
}
}
}
if (flag24)
{
return;
}
Vector2 vector46 = this.position;
bool flag25 = false;
if (this.ai[0] != 1f && (this.type == 387 || this.type == 388))
{
this.tileCollide = true;
}
if (this.type == 533 && this.ai[0] < 9f)
{
this.tileCollide = true;
}
if (this.tileCollide && WorldGen.SolidTile(Framing.GetTileSafely((int)base.Center.X / 16, (int)base.Center.Y / 16)))
{
this.tileCollide = false;
}
for (int num645 = 0; num645 < 200; num645++)
{
NPC nPC2 = Main.npc[num645];
if (nPC2.CanBeChasedBy(this, false))
{
float num646 = Vector2.Distance(nPC2.Center, base.Center);
if (((Vector2.Distance(base.Center, vector46) > num646 && num646 < num633) || !flag25) && Collision.CanHitLine(this.position, this.width, this.height, nPC2.position, nPC2.width, nPC2.height))
{
num633 = num646;
vector46 = nPC2.Center;
flag25 = true;
}
}
}
float num647 = num634;
if (flag25)
{
num647 = num635;
}
Player player = Main.player[this.owner];
if (Vector2.Distance(player.Center, base.Center) > num647)
{
if (this.type == 387 || this.type == 388)
{
this.ai[0] = 1f;
}
if (this.type == 533 && this.ai[0] < 9f)
{
this.ai[0] += (float)(3 * (3 - (int)(this.ai[0] / 3f)));
}
this.tileCollide = false;
this.netUpdate = true;
}
if ((this.type == 388 || this.type == 387) && flag25 && this.ai[0] == 0f)
{
Vector2 vector47 = vector46 - base.Center;
float num648 = vector47.Length();
vector47.Normalize();
if (num648 > 200f)
{
float scaleFactor2 = 6f;
if (this.type == 388)
{
scaleFactor2 = 8f;
}
vector47 *= scaleFactor2;
this.velocity = (this.velocity * 40f + vector47) / 41f;
}
else
{
float num649 = 4f;
vector47 *= -num649;
this.velocity = (this.velocity * 40f + vector47) / 41f;
}
}
else
{
bool flag26 = false;
if (!flag26)
{
flag26 = (this.ai[0] == 1f && (this.type == 387 || this.type == 388));
}
if (!flag26)
{
flag26 = (this.ai[0] >= 9f && this.type == 533);
}
float num650 = 6f;
if (this.type == 533)
{
num650 = 12f;
}
if (flag26)
{
num650 = 15f;
}
Vector2 center2 = base.Center;
Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f);
float num651 = vector48.Length();
if (num651 > 200f && num650 < 8f)
{
num650 = 8f;
}
if (num651 < num636 && flag26 && !Collision.SolidCollision(this.position, this.width, this.height))
{
if (this.type == 387 || this.type == 388)
{
this.ai[0] = 0f;
}
if (this.type == 533)
{
this.ai[0] -= 9f;
}
this.netUpdate = true;
}
if (num651 > 2000f)
{
this.position.X = Main.player[this.owner].Center.X - (float)(this.width / 2);
this.position.Y = Main.player[this.owner].Center.Y - (float)(this.height / 2);
this.netUpdate = true;
}
if (num651 > 70f)
{
vector48.Normalize();
vector48 *= num650;
this.velocity = (this.velocity * 40f + vector48) / 41f;
}
else if (this.velocity.X == 0f && this.velocity.Y == 0f)
{
this.velocity.X = -0.15f;
this.velocity.Y = -0.05f;
}
}
if (this.type == 388)
{
this.rotation = this.velocity.ToRotation() + 3.14159274f;
}
if (this.type == 387)
{
if (flag25)
{
this.rotation = (vector46 - base.Center).ToRotation() + 3.14159274f;
}
else
{
this.rotation = this.velocity.ToRotation() + 3.14159274f;
}
}
if (this.type == 533 && (this.ai[0] < 3f || this.ai[0] >= 9f))
{
this.rotation += this.velocity.X * 0.04f;
}
if (this.type == 388 || this.type == 387)
{
this.frameCounter++;
if (this.frameCounter > 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 2)
{
this.frame = 0;
}
}
else if (this.type == 533)
{
if (this.ai[0] < 3f || this.ai[0] >= 9f)
{
this.frameCounter++;
if (this.frameCounter >= 24)
{
this.frameCounter = 0;
}
int num652 = this.frameCounter / 4;
this.frame = 4 + num652;
int num653 = (int)this.ai[0];
switch (num653)
{
case 0:
break;
case 1:
goto IL_1AB7D;
case 2:
goto IL_1AB98;
default:
switch (num653)
{
case 9:
break;
case 10:
goto IL_1AB7D;
case 11:
goto IL_1AB98;
default:
goto IL_1ABC2;
}
break;
}
this.frame = 4 + num652;
goto IL_1ABC2;
IL_1AB7D:
num652 = this.frameCounter / 8;
this.frame = 14 + num652;
goto IL_1ABC2;
IL_1AB98:
num652 = this.frameCounter / 3;
if (num652 >= 4)
{
num652 -= 4;
}
this.frame = 17 + num652;
}
IL_1ABC2:
if (this.ai[0] == 2f && Main.rand.Next(2) == 0)
{
for (int num654 = 0; num654 < 4; num654++)
{
if (Main.rand.Next(2) != 0)
{
int num655 = Utils.SelectRandom<int>(Main.rand, new int[]
{
226,
228,
75
});
int num656 = Dust.NewDust(base.Center, 0, 0, num655, 0f, 0f, 0, default(Color), 1f);
Dust dust2 = Main.dust[num656];
Vector2 value19 = Vector2.One.RotatedBy((double)((float)num654 * 1.57079637f), default(Vector2)).RotatedBy((double)this.rotation, default(Vector2));
dust2.position = base.Center + value19 * 10f;
dust2.velocity = value19 * 1f;
dust2.scale = 0.3f + Main.rand.NextFloat() * 0.5f;
dust2.noGravity = true;
dust2.customData = this;
dust2.noLight = true;
}
}
}
}
if (this.ai[1] > 0f && (this.type == 387 || this.type == 388))
{
this.ai[1] += (float)Main.rand.Next(1, 4);
}
if (this.ai[1] > 90f && this.type == 387)
{
this.ai[1] = 0f;
this.netUpdate = true;
}
if (this.ai[1] > 40f && this.type == 388)
{
this.ai[1] = 0f;
this.netUpdate = true;
}
if (this.ai[1] > 0f && this.type == 533)
{
this.ai[1] += 1f;
int num657 = 10;
if (this.ai[1] > (float)num657)
{
this.ai[1] = 0f;
this.netUpdate = true;
}
}
if (this.ai[0] == 0f && (this.type == 387 || this.type == 388))
{
if (this.type == 387)
{
float scaleFactor3 = 8f;
int num658 = 389;
if (flag25 && this.ai[1] == 0f)
{
this.ai[1] += 1f;
if (Main.myPlayer == this.owner && Collision.CanHitLine(this.position, this.width, this.height, vector46, 0, 0))
{
Vector2 value20 = vector46 - base.Center;
value20.Normalize();
value20 *= scaleFactor3;
int num659 = Projectile.NewProjectile(base.Center.X, base.Center.Y, value20.X, value20.Y, num658, (int)((float)this.damage * 0.8f), 0f, Main.myPlayer, 0f, 0f);
Main.projectile[num659].timeLeft = 300;
this.netUpdate = true;
}
}
}
if (this.type == 388 && this.ai[1] == 0f && flag25 && num633 < 500f)
{
this.ai[1] += 1f;
if (Main.myPlayer == this.owner)
{
this.ai[0] = 2f;
Vector2 value21 = vector46 - base.Center;
value21.Normalize();
this.velocity = value21 * 8f;
this.netUpdate = true;
return;
}
}
}
else if (this.type == 533 && this.ai[0] < 3f)
{
int num660 = 0;
switch ((int)this.ai[0])
{
case 0:
case 3:
case 6:
num660 = 400;
break;
case 1:
case 4:
case 7:
num660 = 400;
break;
case 2:
case 5:
case 8:
num660 = 600;
break;
}
if (this.ai[1] == 0f && flag25 && num633 < (float)num660)
{
this.ai[1] += 1f;
if (Main.myPlayer == this.owner)
{
if (this.localAI[0] >= 3f)
{
this.ai[0] += 4f;
if (this.ai[0] == 6f)
{
this.ai[0] = 3f;
}
this.localAI[0] = 0f;
return;
}
this.ai[0] += 6f;
Vector2 value22 = vector46 - base.Center;
value22.Normalize();
float scaleFactor4 = (this.ai[0] == 8f) ? 12f : 10f;
this.velocity = value22 * scaleFactor4;
this.netUpdate = true;
return;
}
}
}
}
else if (this.aiStyle == 67)
{
Player player2 = Main.player[this.owner];
if (!player2.active)
{
this.active = false;
return;
}
bool flag27 = this.type == 393 || this.type == 394 || this.type == 395;
if (flag27)
{
if (player2.dead)
{
player2.pirateMinion = false;
}
if (player2.pirateMinion)
{
this.timeLeft = 2;
}
}
if (this.type == 500)
{
if (player2.dead)
{
player2.crimsonHeart = false;
}
if (player2.crimsonHeart)
{
this.timeLeft = 2;
}
}
Vector2 vector49 = player2.Center;
if (flag27)
{
vector49.X -= (float)((15 + player2.width / 2) * player2.direction);
vector49.X -= (float)(this.minionPos * 40 * player2.direction);
}
if (this.type == 500)
{
vector49.X -= (float)((15 + player2.width / 2) * player2.direction);
vector49.X -= (float)(40 * player2.direction);
}
if (this.type == 500)
{
Lighting.AddLight(base.Center, 0.9f, 0.1f, 0.3f);
int num661 = 6;
if (this.frame == 0 || this.frame == 2)
{
num661 = 12;
}
if (++this.frameCounter >= num661)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
this.rotation += this.velocity.X / 20f;
Vector2 vector50 = (-Vector2.UnitY).RotatedBy((double)this.rotation, default(Vector2)).RotatedBy((double)((float)this.direction * 0.2f), default(Vector2));
int num662 = Dust.NewDust(base.Center + vector50 * 10f - new Vector2(4f), 0, 0, 5, vector50.X, vector50.Y, 0, Color.Transparent, 1f);
Main.dust[num662].scale = 1f;
Main.dust[num662].velocity = vector50.RotatedByRandom(0.78539818525314331) * 3.5f;
Main.dust[num662].noGravity = true;
Main.dust[num662].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cLight, Main.player[this.owner]);
}
bool flag28 = true;
if (this.type == 500)
{
flag28 = false;
}
int num663 = -1;
float num664 = 450f;
if (flag27)
{
num664 = 800f;
}
int num665 = 15;
if (this.ai[0] == 0f && flag28)
{
for (int num666 = 0; num666 < 200; num666++)
{
NPC nPC3 = Main.npc[num666];
if (nPC3.CanBeChasedBy(this, false))
{
float num667 = (nPC3.Center - base.Center).Length();
if (num667 < num664)
{
num663 = num666;
num664 = num667;
}
}
}
}
if (this.ai[0] == 1f)
{
this.tileCollide = false;
float num668 = 0.2f;
float num669 = 10f;
int num670 = 200;
if (num669 < Math.Abs(player2.velocity.X) + Math.Abs(player2.velocity.Y))
{
num669 = Math.Abs(player2.velocity.X) + Math.Abs(player2.velocity.Y);
}
Vector2 value23 = player2.Center - base.Center;
float num671 = value23.Length();
if (num671 > 2000f)
{
this.position = player2.Center - new Vector2((float)this.width, (float)this.height) / 2f;
}
if (num671 < (float)num670 && player2.velocity.Y == 0f && this.position.Y + (float)this.height <= player2.position.Y + (float)player2.height && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
this.netUpdate = true;
if (this.velocity.Y < -6f)
{
this.velocity.Y = -6f;
}
}
if (num671 >= 60f)
{
value23.Normalize();
value23 *= num669;
if (this.velocity.X < value23.X)
{
this.velocity.X = this.velocity.X + num668;
if (this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X + num668 * 1.5f;
}
}
if (this.velocity.X > value23.X)
{
this.velocity.X = this.velocity.X - num668;
if (this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X - num668 * 1.5f;
}
}
if (this.velocity.Y < value23.Y)
{
this.velocity.Y = this.velocity.Y + num668;
if (this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + num668 * 1.5f;
}
}
if (this.velocity.Y > value23.Y)
{
this.velocity.Y = this.velocity.Y - num668;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - num668 * 1.5f;
}
}
}
if (this.velocity.X != 0f)
{
this.spriteDirection = Math.Sign(this.velocity.X);
}
if (flag27)
{
this.frameCounter++;
if (this.frameCounter > 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame < 10 | this.frame > 13)
{
this.frame = 10;
}
this.rotation = this.velocity.X * 0.1f;
}
}
if (this.ai[0] == 2f)
{
this.friendly = true;
this.spriteDirection = this.direction;
this.rotation = 0f;
this.frame = 4 + (int)((float)num665 - this.ai[1]) / (num665 / 3);
if (this.velocity.Y != 0f)
{
this.frame += 3;
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
}
this.ai[1] -= 1f;
if (this.ai[1] <= 0f)
{
this.ai[1] = 0f;
this.ai[0] = 0f;
this.friendly = false;
this.netUpdate = true;
return;
}
}
if (num663 >= 0)
{
float num672 = 400f;
float num673 = 20f;
if (flag27)
{
num672 = 700f;
}
if ((double)this.position.Y > Main.worldSurface * 16.0)
{
num672 *= 0.7f;
}
NPC nPC4 = Main.npc[num663];
Vector2 center3 = nPC4.Center;
float num674 = (center3 - base.Center).Length();
Collision.CanHit(this.position, this.width, this.height, nPC4.position, nPC4.width, nPC4.height);
if (num674 < num672)
{
vector49 = center3;
if (center3.Y < base.Center.Y - 30f && this.velocity.Y == 0f)
{
float num675 = Math.Abs(center3.Y - base.Center.Y);
if (num675 < 120f)
{
this.velocity.Y = -10f;
}
else if (num675 < 210f)
{
this.velocity.Y = -13f;
}
else if (num675 < 270f)
{
this.velocity.Y = -15f;
}
else if (num675 < 310f)
{
this.velocity.Y = -17f;
}
else if (num675 < 380f)
{
this.velocity.Y = -18f;
}
}
}
if (num674 < num673)
{
this.ai[0] = 2f;
this.ai[1] = (float)num665;
this.netUpdate = true;
}
}
if (this.ai[0] == 0f && num663 < 0)
{
float num676 = 500f;
if (this.type == 500)
{
num676 = 200f;
}
if (Main.player[this.owner].rocketDelay2 > 0)
{
this.ai[0] = 1f;
this.netUpdate = true;
}
Vector2 vector51 = player2.Center - base.Center;
if (vector51.Length() > 2000f)
{
this.position = player2.Center - new Vector2((float)this.width, (float)this.height) / 2f;
}
else if (vector51.Length() > num676 || Math.Abs(vector51.Y) > 300f)
{
this.ai[0] = 1f;
this.netUpdate = true;
if (this.velocity.Y > 0f && vector51.Y < 0f)
{
this.velocity.Y = 0f;
}
if (this.velocity.Y < 0f && vector51.Y > 0f)
{
this.velocity.Y = 0f;
}
}
}
if (this.ai[0] == 0f)
{
this.tileCollide = true;
float num677 = 0.5f;
float num678 = 4f;
float num679 = 4f;
float num680 = 0.1f;
if (num679 < Math.Abs(player2.velocity.X) + Math.Abs(player2.velocity.Y))
{
num679 = Math.Abs(player2.velocity.X) + Math.Abs(player2.velocity.Y);
num677 = 0.7f;
}
int num681 = 0;
bool flag29 = false;
float num682 = vector49.X - base.Center.X;
if (Math.Abs(num682) > 5f)
{
if (num682 < 0f)
{
num681 = -1;
if (this.velocity.X > -num678)
{
this.velocity.X = this.velocity.X - num677;
}
else
{
this.velocity.X = this.velocity.X - num680;
}
}
else
{
num681 = 1;
if (this.velocity.X < num678)
{
this.velocity.X = this.velocity.X + num677;
}
else
{
this.velocity.X = this.velocity.X + num680;
}
}
flag29 = true;
}
else
{
this.velocity.X = this.velocity.X * 0.9f;
if (Math.Abs(this.velocity.X) < num677 * 2f)
{
this.velocity.X = 0f;
}
}
if (num681 != 0)
{
int num683 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int num684 = (int)this.position.Y / 16;
num683 += num681;
num683 += (int)this.velocity.X;
for (int num685 = num684; num685 < num684 + this.height / 16 + 1; num685++)
{
if (WorldGen.SolidTile(num683, num685))
{
flag29 = true;
}
}
}
if (this.type == 500 && this.velocity.X != 0f)
{
flag29 = true;
}
Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY, 1, false, 0);
if (this.velocity.Y == 0f && flag29)
{
int num686 = 0;
while (num686 < 3)
{
int num687 = (int)(this.position.X + (float)(this.width / 2)) / 16;
if (num686 == 0)
{
num687 = (int)this.position.X / 16;
}
if (num686 == 2)
{
num687 = (int)(this.position.X + (float)this.width) / 16;
}
int num688 = (int)(this.position.Y + (float)this.height) / 16 + 1;
if (WorldGen.SolidTile(num687, num688) || Main.tile[num687, num688].halfBrick())
{
goto IL_1C16F;
}
if (Main.tile[num687, num688].slope() > 0)
{
goto Block_1931;
}
IL_1C28D:
num686++;
continue;
Block_1931:
try
{
IL_1C16F:
num687 = (int)(this.position.X + (float)(this.width / 2)) / 16;
num688 = (int)(this.position.Y + (float)(this.height / 2)) / 16;
num687 += num681;
num687 += (int)this.velocity.X;
if (!WorldGen.SolidTile(num687, num688 - 1) && !WorldGen.SolidTile(num687, num688 - 2))
{
this.velocity.Y = -5.1f;
}
else if (!WorldGen.SolidTile(num687, num688 - 2))
{
this.velocity.Y = -7.1f;
}
else if (WorldGen.SolidTile(num687, num688 - 5))
{
this.velocity.Y = -11.1f;
}
else if (WorldGen.SolidTile(num687, num688 - 4))
{
this.velocity.Y = -10.1f;
}
else
{
this.velocity.Y = -9.1f;
}
}
catch
{
this.velocity.Y = -9.1f;
}
goto IL_1C28D;
}
}
if (this.velocity.X > num679)
{
this.velocity.X = num679;
}
if (this.velocity.X < -num679)
{
this.velocity.X = -num679;
}
if (this.velocity.X < 0f)
{
this.direction = -1;
}
if (this.velocity.X > 0f)
{
this.direction = 1;
}
if (this.velocity.X > num677 && num681 == 1)
{
this.direction = 1;
}
if (this.velocity.X < -num677 && num681 == -1)
{
this.direction = -1;
}
this.spriteDirection = this.direction;
if (flag27)
{
this.rotation = 0f;
if (this.velocity.Y == 0f)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else if (Math.Abs(this.velocity.X) >= 0.5f)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 10)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 4)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
else if (this.velocity.Y != 0f)
{
this.frameCounter = 0;
this.frame = 14;
}
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
}
}
if (flag27)
{
this.localAI[0] += 1f;
if (this.velocity.X == 0f)
{
this.localAI[0] += 1f;
}
if (this.localAI[0] >= (float)Main.rand.Next(900, 1200))
{
this.localAI[0] = 0f;
for (int num689 = 0; num689 < 6; num689++)
{
int num690 = Dust.NewDust(base.Center + Vector2.UnitX * (float)(-(float)this.direction) * 8f - Vector2.One * 5f + Vector2.UnitY * 8f, 3, 6, 216, (float)(-(float)this.direction), 1f, 0, default(Color), 1f);
Main.dust[num690].velocity /= 2f;
Main.dust[num690].scale = 0.8f;
}
int num691 = Gore.NewGore(base.Center + Vector2.UnitX * (float)(-(float)this.direction) * 8f, Vector2.Zero, Main.rand.Next(580, 583), 1f);
Main.gore[num691].velocity /= 2f;
Main.gore[num691].velocity.Y = Math.Abs(Main.gore[num691].velocity.Y);
Main.gore[num691].velocity.X = -Math.Abs(Main.gore[num691].velocity.X) * (float)this.direction;
return;
}
}
}
else if (this.aiStyle == 68)
{
this.rotation += 0.25f * (float)this.direction;
this.ai[0] += 1f;
if (this.ai[0] >= 3f)
{
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.ai[0] >= 15f)
{
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
this.velocity.X = this.velocity.X * 0.99f;
}
if (this.alpha == 0)
{
Vector2 vector52 = new Vector2(4f, -8f);
float num692 = this.rotation;
if (this.direction == -1)
{
vector52.X = -4f;
}
vector52 = vector52.RotatedBy((double)num692, default(Vector2));
for (int num693 = 0; num693 < 1; num693++)
{
int num694 = Dust.NewDust(base.Center + vector52 - Vector2.One * 5f, 4, 4, 6, 0f, 0f, 0, default(Color), 1f);
Main.dust[num694].scale = 1.5f;
Main.dust[num694].noGravity = true;
Main.dust[num694].velocity = Main.dust[num694].velocity * 0.25f + Vector2.Normalize(vector52) * 1f;
Main.dust[num694].velocity = Main.dust[num694].velocity.RotatedBy((double)(-1.57079637f * (float)this.direction), default(Vector2));
}
}
this.spriteDirection = this.direction;
if (this.owner == Main.myPlayer && this.timeLeft <= 3)
{
this.tileCollide = false;
this.alpha = 255;
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 80;
this.height = 80;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.knockBack = 8f;
}
if (this.wet && this.timeLeft > 3)
{
this.timeLeft = 3;
return;
}
}
else if (this.aiStyle == 69)
{
Vector2 vector53 = Main.player[this.owner].Center - base.Center;
this.rotation = vector53.ToRotation() - 1.57f;
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
Main.player[this.owner].itemAnimation = 10;
Main.player[this.owner].itemTime = 10;
if (vector53.X < 0f)
{
Main.player[this.owner].ChangeDir(1);
this.direction = 1;
}
else
{
Main.player[this.owner].ChangeDir(-1);
this.direction = -1;
}
Main.player[this.owner].itemRotation = (vector53 * -1f * (float)this.direction).ToRotation();
this.spriteDirection = ((vector53.X > 0f) ? -1 : 1);
if (this.ai[0] == 0f && vector53.Length() > 400f)
{
this.ai[0] = 1f;
}
if (this.ai[0] == 1f || this.ai[0] == 2f)
{
float num695 = vector53.Length();
if (num695 > 1500f)
{
this.Kill();
return;
}
if (num695 > 600f)
{
this.ai[0] = 2f;
}
this.tileCollide = false;
float num696 = 20f;
if (this.ai[0] == 2f)
{
num696 = 40f;
}
this.velocity = Vector2.Normalize(vector53) * num696;
if (vector53.Length() < num696)
{
this.Kill();
return;
}
}
this.ai[1] += 1f;
if (this.ai[1] > 5f)
{
this.alpha = 0;
}
if ((int)this.ai[1] % 4 == 0 && this.owner == Main.myPlayer)
{
Vector2 vector54 = vector53 * -1f;
vector54.Normalize();
vector54 *= (float)Main.rand.Next(45, 65) * 0.1f;
vector54 = vector54.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2));
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector54.X, vector54.Y, 405, this.damage, this.knockBack, this.owner, -10f, 0f);
return;
}
}
else
{
if (this.aiStyle == 70)
{
if (this.ai[0] == 0f)
{
float num697 = 500f;
int num698 = -1;
for (int num699 = 0; num699 < 200; num699++)
{
NPC nPC5 = Main.npc[num699];
if (nPC5.CanBeChasedBy(this, false) && Collision.CanHit(this.position, this.width, this.height, nPC5.position, nPC5.width, nPC5.height))
{
float num700 = (nPC5.Center - base.Center).Length();
if (num700 < num697)
{
num698 = num699;
num697 = num700;
}
}
}
this.ai[0] = (float)(num698 + 1);
if (this.ai[0] == 0f)
{
this.ai[0] = -15f;
}
if (this.ai[0] > 0f)
{
float scaleFactor5 = (float)Main.rand.Next(35, 75) / 30f;
this.velocity = (this.velocity * 20f + Vector2.Normalize(Main.npc[(int)this.ai[0] - 1].Center - base.Center + new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101))) * scaleFactor5) / 21f;
this.netUpdate = true;
}
}
else if (this.ai[0] > 0f)
{
Vector2 value24 = Vector2.Normalize(Main.npc[(int)this.ai[0] - 1].Center - base.Center);
this.velocity = (this.velocity * 40f + value24 * 12f) / 41f;
}
else
{
this.ai[0] += 1f;
this.alpha -= 25;
if (this.alpha < 50)
{
this.alpha = 50;
}
this.velocity *= 0.95f;
}
if (this.ai[1] == 0f)
{
this.ai[1] = (float)Main.rand.Next(80, 121) / 100f;
this.netUpdate = true;
}
this.scale = this.ai[1];
return;
}
if (this.aiStyle == 71)
{
this.localAI[1] += 1f;
if (this.localAI[1] > 10f && Main.rand.Next(3) == 0)
{
int num701 = 6;
for (int num702 = 0; num702 < num701; num702++)
{
Vector2 vector55 = Vector2.Normalize(this.velocity) * new Vector2((float)this.width, (float)this.height) / 2f;
vector55 = vector55.RotatedBy((double)(num702 - (num701 / 2 - 1)) * 3.1415926535897931 / (double)((float)num701), default(Vector2)) + base.Center;
Vector2 value25 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8);
int num703 = Dust.NewDust(vector55 + value25, 0, 0, 217, value25.X * 2f, value25.Y * 2f, 100, default(Color), 1.4f);
Main.dust[num703].noGravity = true;
Main.dust[num703].noLight = true;
Main.dust[num703].velocity /= 4f;
Main.dust[num703].velocity -= this.velocity;
}
this.alpha -= 5;
if (this.alpha < 50)
{
this.alpha = 50;
}
this.rotation += this.velocity.X * 0.1f;
this.frame = (int)(this.localAI[1] / 3f) % 3;
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.1f, 0.4f, 0.6f);
}
int num704 = -1;
Vector2 vector56 = base.Center;
float num705 = 500f;
if (this.localAI[0] > 0f)
{
this.localAI[0] -= 1f;
}
if (this.ai[0] == 0f && this.localAI[0] == 0f)
{
for (int num706 = 0; num706 < 200; num706++)
{
NPC nPC6 = Main.npc[num706];
if (nPC6.CanBeChasedBy(this, false) && (this.ai[0] == 0f || this.ai[0] == (float)(num706 + 1)))
{
Vector2 center4 = nPC6.Center;
float num707 = Vector2.Distance(center4, vector56);
if (num707 < num705 && Collision.CanHit(this.position, this.width, this.height, nPC6.position, nPC6.width, nPC6.height))
{
num705 = num707;
vector56 = center4;
num704 = num706;
}
}
}
if (num704 >= 0)
{
this.ai[0] = (float)(num704 + 1);
this.netUpdate = true;
}
}
if (this.localAI[0] == 0f && this.ai[0] == 0f)
{
this.localAI[0] = 30f;
}
bool flag30 = false;
if (this.ai[0] != 0f)
{
int num708 = (int)(this.ai[0] - 1f);
if (Main.npc[num708].active && !Main.npc[num708].dontTakeDamage && Main.npc[num708].immune[this.owner] == 0)
{
float num709 = Main.npc[num708].position.X + (float)(Main.npc[num708].width / 2);
float num710 = Main.npc[num708].position.Y + (float)(Main.npc[num708].height / 2);
float num711 = Math.Abs(this.position.X + (float)(this.width / 2) - num709) + Math.Abs(this.position.Y + (float)(this.height / 2) - num710);
if (num711 < 1000f)
{
flag30 = true;
vector56 = Main.npc[num708].Center;
}
}
else
{
this.ai[0] = 0f;
flag30 = false;
this.netUpdate = true;
}
}
if (flag30)
{
Vector2 v = vector56 - base.Center;
float num712 = this.velocity.ToRotation();
float num713 = v.ToRotation();
double num714 = (double)(num713 - num712);
if (num714 > 3.1415926535897931)
{
num714 -= 6.2831853071795862;
}
if (num714 < -3.1415926535897931)
{
num714 += 6.2831853071795862;
}
this.velocity = this.velocity.RotatedBy(num714 * 0.10000000149011612, default(Vector2));
}
float num715 = this.velocity.Length();
this.velocity.Normalize();
this.velocity *= num715 + 0.0025f;
return;
}
if (this.aiStyle == 72)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 5f)
{
this.alpha -= 25;
if (this.alpha < 50)
{
this.alpha = 50;
}
}
this.velocity *= 0.96f;
if (this.ai[1] == 0f)
{
this.ai[1] = (float)Main.rand.Next(60, 121) / 100f;
this.netUpdate = true;
}
this.scale = this.ai[1];
this.position = base.Center;
int num716 = 14;
int num717 = 14;
this.width = (int)((float)num716 * this.ai[1]);
this.height = (int)((float)num717 * this.ai[1]);
this.position -= new Vector2((float)(this.width / 2), (float)(this.height / 2));
return;
}
if (this.aiStyle == 73)
{
int num718 = (int)this.ai[0];
int num719 = (int)this.ai[1];
Tile tile = Main.tile[num718, num719];
if (tile == null || !tile.active() || tile.type != 338)
{
this.Kill();
return;
}
float num720 = 2f;
float num721 = (float)this.timeLeft / 60f;
if (num721 < 1f)
{
num720 *= num721;
}
if (this.type == 419)
{
for (int num722 = 0; num722 < 2; num722++)
{
Vector2 vector57 = new Vector2(0f, -num720);
vector57 *= 0.85f + (float)Main.rand.NextDouble() * 0.2f;
vector57 = vector57.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2));
int num723 = Dust.NewDust(this.position, this.width, this.height, 222, 0f, 0f, 100, default(Color), 1f);
Dust dust3 = Main.dust[num723];
dust3.scale = 1f + (float)Main.rand.NextDouble() * 0.3f;
dust3.velocity *= 0.5f;
if (dust3.velocity.Y > 0f)
{
Dust expr_1D880_cp_0 = dust3;
expr_1D880_cp_0.velocity.Y = expr_1D880_cp_0.velocity.Y * -1f;
}
dust3.position -= new Vector2((float)(2 + Main.rand.Next(-2, 3)), 0f);
dust3.velocity += vector57;
dust3.scale = 0.6f;
dust3.fadeIn = dust3.scale + 0.2f;
Dust expr_1D906_cp_0 = dust3;
expr_1D906_cp_0.velocity.Y = expr_1D906_cp_0.velocity.Y * 2f;
}
}
if (this.type == 420)
{
for (int num724 = 0; num724 < 2; num724++)
{
Vector2 vector58 = new Vector2(0f, -num720);
vector58 *= 0.85f + (float)Main.rand.NextDouble() * 0.2f;
vector58 = vector58.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2));
int num725 = 219;
if (Main.rand.Next(5) == 0)
{
num725 = 222;
}
int num726 = Dust.NewDust(this.position, this.width, this.height, num725, 0f, 0f, 100, default(Color), 1f);
Dust dust4 = Main.dust[num726];
dust4.scale = 1f + (float)Main.rand.NextDouble() * 0.3f;
dust4.velocity *= 0.5f;
if (dust4.velocity.Y > 0f)
{
Dust expr_1DA77_cp_0 = dust4;
expr_1DA77_cp_0.velocity.Y = expr_1DA77_cp_0.velocity.Y * -1f;
}
dust4.position -= new Vector2((float)(2 + Main.rand.Next(-2, 3)), 0f);
dust4.velocity += vector58;
Dust expr_1DAD7_cp_0 = dust4;
expr_1DAD7_cp_0.velocity.X = expr_1DAD7_cp_0.velocity.X * 0.5f;
dust4.scale = 0.6f;
dust4.fadeIn = dust4.scale + 0.2f;
Dust expr_1DB17_cp_0 = dust4;
expr_1DB17_cp_0.velocity.Y = expr_1DB17_cp_0.velocity.Y * 2f;
}
}
if (this.type == 421)
{
for (int num727 = 0; num727 < 2; num727++)
{
Vector2 vector59 = new Vector2(0f, -num720);
vector59 *= 0.85f + (float)Main.rand.NextDouble() * 0.2f;
vector59 = vector59.RotatedBy((Main.rand.NextDouble() - 0.5) * 0.78539818525314331, default(Vector2));
int num728 = Dust.NewDust(this.position, this.width, this.height, 221, 0f, 0f, 100, default(Color), 1f);
Dust dust5 = Main.dust[num728];
dust5.scale = 1f + (float)Main.rand.NextDouble() * 0.3f;
dust5.velocity *= 0.1f;
if (dust5.velocity.Y > 0f)
{
Dust expr_1DC6A_cp_0 = dust5;
expr_1DC6A_cp_0.velocity.Y = expr_1DC6A_cp_0.velocity.Y * -1f;
}
dust5.position -= new Vector2((float)(2 + Main.rand.Next(-2, 3)), 0f);
dust5.velocity += vector59;
dust5.scale = 0.6f;
dust5.fadeIn = dust5.scale + 0.2f;
Dust expr_1DCF0_cp_0 = dust5;
expr_1DCF0_cp_0.velocity.Y = expr_1DCF0_cp_0.velocity.Y * 2.5f;
}
if (this.timeLeft % 10 == 0)
{
float num729 = 0.85f + (float)Main.rand.NextDouble() * 0.2f;
for (int num730 = 0; num730 < 9; num730++)
{
Vector2 value26 = new Vector2((float)(num730 - 4) / 5f, -num720 * num729);
int num731 = Dust.NewDust(this.position, this.width, this.height, 222, 0f, 0f, 100, default(Color), 1f);
Dust dust6 = Main.dust[num731];
dust6.scale = 0.7f + (float)Main.rand.NextDouble() * 0.3f;
dust6.velocity *= 0f;
if (dust6.velocity.Y > 0f)
{
Dust expr_1DE0C_cp_0 = dust6;
expr_1DE0C_cp_0.velocity.Y = expr_1DE0C_cp_0.velocity.Y * -1f;
}
dust6.position -= new Vector2((float)(2 + Main.rand.Next(-2, 3)), 0f);
dust6.velocity += value26;
dust6.scale = 0.6f;
dust6.fadeIn = dust6.scale + 0.2f;
Dust expr_1DE92_cp_0 = dust6;
expr_1DE92_cp_0.velocity.Y = expr_1DE92_cp_0.velocity.Y * 2f;
}
}
}
if (this.type == 422)
{
for (int num732 = 0; num732 < 2; num732++)
{
Vector2 vector60 = new Vector2(0f, -num720);
vector60 *= 0.85f + (float)Main.rand.NextDouble() * 0.2f;
vector60 = vector60.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2));
int num733 = Dust.NewDust(this.position, this.width, this.height, 219 + Main.rand.Next(5), 0f, 0f, 100, default(Color), 1f);
Dust dust7 = Main.dust[num733];
dust7.scale = 1f + (float)Main.rand.NextDouble() * 0.3f;
dust7.velocity *= 0.5f;
if (dust7.velocity.Y > 0f)
{
Dust expr_1DFF2_cp_0 = dust7;
expr_1DFF2_cp_0.velocity.Y = expr_1DFF2_cp_0.velocity.Y * -1f;
}
dust7.position -= new Vector2((float)(2 + Main.rand.Next(-2, 3)), 0f);
dust7.velocity += vector60;
dust7.scale = 0.6f;
dust7.fadeIn = dust7.scale + 0.2f;
Dust expr_1E078_cp_0 = dust7;
expr_1E078_cp_0.velocity.Y = expr_1E078_cp_0.velocity.Y * 2f;
}
return;
}
}
else if (this.aiStyle == 74)
{
if (this.extraUpdates == 1)
{
this.localAI[0] *= this.localAI[1];
this.localAI[1] -= 0.001f;
if ((double)this.localAI[0] < 0.01)
{
this.Kill();
return;
}
}
}
else
{
if (this.aiStyle == 75)
{
this.AI_075();
return;
}
if (this.aiStyle == 76)
{
Player player3 = Main.player[this.owner];
player3.heldProj = this.whoAmI;
if (this.type == 441)
{
if (player3.mount.Type != 9)
{
this.Kill();
return;
}
}
else if (this.type == 453 && player3.mount.Type != 8)
{
this.Kill();
return;
}
if (Main.myPlayer != this.owner)
{
this.position.X = player3.position.X + this.ai[0];
this.position.Y = player3.position.Y + this.ai[1];
if (this.type == 441)
{
if (!player3.mount.AbilityCharging)
{
player3.mount.StartAbilityCharge(player3);
}
}
else if (this.type == 453 && !player3.mount.AbilityActive)
{
player3.mount.UseAbility(player3, this.position, false);
}
player3.mount.AimAbility(player3, this.position);
return;
}
this.position.X = Main.screenPosition.X + (float)Main.mouseX;
this.position.Y = Main.screenPosition.Y + (float)Main.mouseY;
if (this.ai[0] != this.position.X - player3.position.X || this.ai[1] != this.position.Y - player3.position.Y)
{
this.netUpdate = true;
}
this.ai[0] = this.position.X - player3.position.X;
this.ai[1] = this.position.Y - player3.position.Y;
player3.mount.AimAbility(player3, this.position);
if (!player3.channel)
{
player3.mount.UseAbility(player3, this.position, false);
this.Kill();
return;
}
}
else
{
if (this.aiStyle == 77)
{
if (this.ai[1] == 1f)
{
this.friendly = false;
if (this.alpha < 255)
{
this.alpha += 51;
}
if (this.alpha >= 255)
{
this.alpha = 255;
this.Kill();
return;
}
}
else
{
if (this.alpha > 0)
{
this.alpha -= 50;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
float num734 = 30f;
float num735 = num734 * 4f;
this.ai[0] += 1f;
if (this.ai[0] > num735)
{
this.ai[0] = 0f;
}
Vector2 vector61 = -Vector2.UnitY.RotatedBy((double)(6.28318548f * this.ai[0] / num734), default(Vector2));
float val = 0.75f + vector61.Y * 0.25f;
float val2 = 0.8f - vector61.Y * 0.2f;
float num736 = Math.Max(val, val2);
this.position += new Vector2((float)this.width, (float)this.height) / 2f;
this.width = (this.height = (int)(80f * num736));
this.position -= new Vector2((float)this.width, (float)this.height) / 2f;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frameCounter = 0;
this.frame++;
if (this.frame >= 4)
{
this.frame = 0;
}
}
for (int num737 = 0; num737 < 1; num737++)
{
float num738 = 55f * num736;
float num739 = 11f * num736;
float num740 = 0.5f;
int num741 = Dust.NewDust(this.position, this.width, this.height, 226, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num741].noGravity = true;
Main.dust[num741].velocity *= 2f;
Main.dust[num741].position = ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * (num739 + num740 * (float)Main.rand.NextDouble() * num738) + base.Center;
Main.dust[num741].velocity = Main.dust[num741].velocity / 2f + Vector2.Normalize(Main.dust[num741].position - base.Center);
if (Main.rand.Next(2) == 0)
{
num741 = Dust.NewDust(this.position, this.width, this.height, 226, 0f, 0f, 100, default(Color), 0.9f);
Main.dust[num741].noGravity = true;
Main.dust[num741].velocity *= 1.2f;
Main.dust[num741].position = ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * (num739 + num740 * (float)Main.rand.NextDouble() * num738) + base.Center;
Main.dust[num741].velocity = Main.dust[num741].velocity / 2f + Vector2.Normalize(Main.dust[num741].position - base.Center);
}
if (Main.rand.Next(4) == 0)
{
num741 = Dust.NewDust(this.position, this.width, this.height, 226, 0f, 0f, 100, default(Color), 0.7f);
Main.dust[num741].noGravity = true;
Main.dust[num741].velocity *= 1.2f;
Main.dust[num741].position = ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * (num739 + num740 * (float)Main.rand.NextDouble() * num738) + base.Center;
Main.dust[num741].velocity = Main.dust[num741].velocity / 2f + Vector2.Normalize(Main.dust[num741].position - base.Center);
}
}
return;
}
if (this.aiStyle == 78)
{
if (this.alpha > 0)
{
this.alpha -= 30;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
Vector2 v2 = this.ai[0].ToRotationVector2();
float num742 = this.velocity.ToRotation();
float num743 = v2.ToRotation();
double num744 = (double)(num743 - num742);
if (num744 > 3.1415926535897931)
{
num744 -= 6.2831853071795862;
}
if (num744 < -3.1415926535897931)
{
num744 += 6.2831853071795862;
}
this.velocity = this.velocity.RotatedBy(num744 * 0.05000000074505806, default(Vector2));
this.velocity *= 0.96f;
this.rotation = this.velocity.ToRotation() - 1.57079637f;
if (Main.myPlayer == this.owner && this.timeLeft > 60)
{
this.timeLeft = 60;
return;
}
}
else if (this.aiStyle == 79)
{
bool flag31 = true;
int num745 = (int)this.ai[0] - 1;
if (this.type == 447 && (this.ai[0] == 0f || ((!Main.npc[num745].active || Main.npc[num745].type != 392) && (!Main.npc[num745].active || Main.npc[num745].type != 395 || Main.npc[num745].ai[3] % 120f < 60f || Main.npc[num745].ai[0] != 2f))))
{
flag31 = false;
}
if (!flag31)
{
this.Kill();
return;
}
NPC nPC7 = Main.npc[num745];
float num746 = nPC7.Center.Y + 46f;
int num747 = (int)nPC7.Center.X / 16;
int num748 = (int)num746 / 16;
int num749 = 0;
bool flag32 = Main.tile[num747, num748].nactive() && Main.tileSolid[(int)Main.tile[num747, num748].type] && !Main.tileSolidTop[(int)Main.tile[num747, num748].type];
if (flag32)
{
num749 = 1;
}
else
{
while (num749 < 150 && num748 + num749 < Main.maxTilesY)
{
int num750 = num748 + num749;
bool flag33 = Main.tile[num747, num750].nactive() && Main.tileSolid[(int)Main.tile[num747, num750].type] && !Main.tileSolidTop[(int)Main.tile[num747, num750].type];
if (flag33)
{
num749--;
break;
}
num749++;
}
}
this.position.X = nPC7.Center.X - (float)(this.width / 2);
this.position.Y = num746;
this.height = (num749 + 1) * 16;
int num751 = (int)this.position.Y + this.height;
if (Main.tile[num747, num751 / 16].nactive() && Main.tileSolid[(int)Main.tile[num747, num751 / 16].type] && !Main.tileSolidTop[(int)Main.tile[num747, num751 / 16].type])
{
int num752 = num751 % 16;
this.height -= num752 - 2;
}
if (this.type == 447)
{
for (int num753 = 0; num753 < 2; num753++)
{
int num754 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 16f), this.width, 16, 228, 0f, 0f, 0, default(Color), 1f);
Main.dust[num754].noGravity = true;
Main.dust[num754].velocity *= 0.5f;
Dust expr_1EDFD_cp_0 = Main.dust[num754];
expr_1EDFD_cp_0.velocity.X = expr_1EDFD_cp_0.velocity.X - ((float)num753 - nPC7.velocity.X * 2f / 3f);
Main.dust[num754].scale = 2.8f;
}
if (Main.rand.Next(5) == 0)
{
int num755 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) - (float)(this.width / 2 * Math.Sign(nPC7.velocity.X)) - 4f, this.position.Y + (float)this.height - 16f), 4, 16, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num755].velocity *= 0.5f;
Dust expr_1EF13_cp_0 = Main.dust[num755];
expr_1EF13_cp_0.velocity.X = expr_1EF13_cp_0.velocity.X - nPC7.velocity.X / 2f;
Main.dust[num755].velocity.Y = -Math.Abs(Main.dust[num755].velocity.Y);
}
}
if (this.type == 447 && ++this.frameCounter >= 5)
{
this.frameCounter = 0;
if (++this.frame >= 4)
{
this.frame = 0;
return;
}
}
}
else
{
if (this.aiStyle == 80)
{
if (this.ai[0] == 0f && this.ai[1] > 0f)
{
this.ai[1] -= 1f;
}
else if (this.ai[0] == 0f && this.ai[1] == 0f)
{
this.ai[0] = 1f;
this.ai[1] = (float)Player.FindClosest(this.position, this.width, this.height);
this.netUpdate = true;
float num756 = this.velocity.Length();
this.velocity = Vector2.Normalize(this.velocity) * (num756 + 4f);
for (int num757 = 0; num757 < 8; num757++)
{
Vector2 vector62 = Vector2.UnitX * -8f;
vector62 += -Vector2.UnitY.RotatedBy((double)((float)num757 * 3.14159274f / 4f), default(Vector2)) * new Vector2(2f, 8f);
vector62 = vector62.RotatedBy((double)(this.rotation - 1.57079637f), default(Vector2));
int num758 = Dust.NewDust(base.Center, 0, 0, 228, 0f, 0f, 0, default(Color), 1f);
Main.dust[num758].scale = 1.5f;
Main.dust[num758].noGravity = true;
Main.dust[num758].position = base.Center + vector62;
Main.dust[num758].velocity = this.velocity * 0f;
}
}
else if (this.ai[0] == 1f)
{
this.tileCollide = true;
this.localAI[1] += 1f;
float num759 = 180f;
float num760 = 0f;
float num761 = 30f;
if (this.localAI[1] == num759)
{
this.Kill();
return;
}
if (this.localAI[1] >= num760 && this.localAI[1] < num760 + num761)
{
Vector2 v3 = Main.player[(int)this.ai[1]].Center - base.Center;
float num762 = this.velocity.ToRotation();
float num763 = v3.ToRotation();
double num764 = (double)(num763 - num762);
if (num764 > 3.1415926535897931)
{
num764 -= 6.2831853071795862;
}
if (num764 < -3.1415926535897931)
{
num764 += 6.2831853071795862;
}
this.velocity = this.velocity.RotatedBy(num764 * 0.20000000298023224, default(Vector2));
}
if (this.localAI[1] % 5f == 0f)
{
for (int num765 = 0; num765 < 4; num765++)
{
Vector2 vector63 = Vector2.UnitX * -8f;
vector63 += -Vector2.UnitY.RotatedBy((double)((float)num765 * 3.14159274f / 4f), default(Vector2)) * new Vector2(2f, 4f);
vector63 = vector63.RotatedBy((double)(this.rotation - 1.57079637f), default(Vector2));
int num766 = Dust.NewDust(base.Center, 0, 0, 228, 0f, 0f, 0, default(Color), 1f);
Main.dust[num766].scale = 1.5f;
Main.dust[num766].noGravity = true;
Main.dust[num766].position = base.Center + vector63;
Main.dust[num766].velocity = this.velocity * 0f;
}
}
}
this.rotation = this.velocity.ToRotation() + 1.57079637f;
if (++this.frameCounter >= 3)
{
this.frameCounter = 0;
if (++this.frame >= 3)
{
this.frame = 0;
}
}
int num767 = 0;
while ((float)num767 < 1f + this.ai[0])
{
Vector2 value27 = Vector2.UnitY.RotatedBy((double)this.rotation, default(Vector2)) * 8f * (float)(num767 + 1);
int num768 = Dust.NewDust(base.Center, 0, 0, 228, 0f, 0f, 0, default(Color), 1f);
Main.dust[num768].position = base.Center + value27;
Main.dust[num768].scale = 1f;
Main.dust[num768].noGravity = true;
num767++;
}
for (int num769 = 0; num769 < 255; num769++)
{
Player player4 = Main.player[num769];
if (player4.active && !player4.dead && Vector2.Distance(player4.Center, base.Center) <= 42f)
{
this.Kill();
return;
}
}
return;
}
if (this.aiStyle == 81)
{
int num770 = this.penetrate;
if (this.ai[0] == 0f)
{
this.tileCollide = true;
this.localAI[0] += 1f;
if (this.localAI[0] > 7f)
{
int num771 = Utils.SelectRandom<int>(Main.rand, new int[]
{
226,
229
});
Vector2 center5 = base.Center;
Vector2 vector64 = new Vector2(-16f, 16f);
float num772 = 1f;
vector64 += new Vector2(-16f, 16f);
vector64 = vector64.RotatedBy((double)this.rotation, default(Vector2));
int num773 = 4;
int num774 = Dust.NewDust(center5 + vector64 + Vector2.One * (float)(-(float)num773), num773 * 2, num773 * 2, num771, 0f, 0f, 100, default(Color), num772);
Main.dust[num774].velocity *= 0.1f;
if (Main.rand.Next(6) != 0)
{
Main.dust[num774].noGravity = true;
}
}
float num775 = 0.01f;
int num776 = 5;
int num777 = num776 * 15;
int num778 = 0;
if (this.localAI[0] > 7f)
{
if (this.localAI[1] == 0f)
{
this.scale -= num775;
this.alpha += num776;
if (this.alpha > num777)
{
this.alpha = num777;
this.localAI[1] = 1f;
}
}
else if (this.localAI[1] == 1f)
{
this.scale += num775;
this.alpha -= num776;
if (this.alpha <= num778)
{
this.alpha = num778;
this.localAI[1] = 0f;
}
}
}
this.rotation = this.velocity.ToRotation() + 0.7853982f;
}
else if (this.ai[0] >= (float)1 && this.ai[0] < (float)(1 + num770))
{
this.tileCollide = false;
this.alpha += 15;
this.velocity *= 0.98f;
this.localAI[0] = 0f;
if (this.alpha >= 255)
{
if (this.ai[0] == 1f)
{
this.Kill();
return;
}
int num779 = -1;
Vector2 value28 = base.Center;
float num780 = 250f;
for (int num781 = 0; num781 < 200; num781++)
{
NPC nPC8 = Main.npc[num781];
if (nPC8.CanBeChasedBy(this, false))
{
Vector2 center6 = nPC8.Center;
float num782 = Vector2.Distance(center6, base.Center);
if (num782 < num780)
{
num780 = num782;
value28 = center6;
num779 = num781;
}
}
}
if (num779 >= 0)
{
this.netUpdate = true;
this.ai[0] += (float)num770;
this.position = value28 + ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * 100f - new Vector2((float)this.width, (float)this.height) / 2f;
this.velocity = Vector2.Normalize(value28 - base.Center) * 15f;
this.rotation = this.velocity.ToRotation() + 0.7853982f;
}
else
{
this.Kill();
}
}
if (Main.rand.Next(3) == 0)
{
int num783 = Utils.SelectRandom<int>(Main.rand, new int[]
{
226,
229
});
Vector2 center7 = base.Center;
Vector2 vector65 = new Vector2(-16f, 16f);
vector65 = (vector65 = vector65);
float num784 = 0.6f;
vector65 += new Vector2(-16f, 16f);
vector65 = vector65.RotatedBy((double)this.rotation, default(Vector2));
int num785 = 4;
int num786 = Dust.NewDust(center7 + vector65 + Vector2.One * (float)(-(float)num785), num785 * 2, num785 * 2, num783, 0f, 0f, 100, default(Color), num784);
Main.dust[num786].velocity *= 0.1f;
Main.dust[num786].noGravity = true;
}
}
else if (this.ai[0] >= (float)(1 + num770) && this.ai[0] < (float)(1 + num770 * 2))
{
this.scale = 0.9f;
this.tileCollide = false;
this.rotation = this.velocity.ToRotation() + 0.7853982f;
this.ai[1] += 1f;
if (this.ai[1] >= 15f)
{
this.alpha += 51;
this.velocity *= 0.8f;
if (this.alpha >= 255)
{
this.Kill();
}
}
else
{
this.alpha -= 125;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.velocity *= 0.98f;
}
this.localAI[0] += 1f;
int num787 = Utils.SelectRandom<int>(Main.rand, new int[]
{
226,
229
});
Vector2 center8 = base.Center;
Vector2 vector66 = new Vector2(-16f, 16f);
float num788 = 0.6f;
vector66 += new Vector2(-16f, 16f);
vector66 = vector66.RotatedBy((double)this.rotation, default(Vector2));
int num789 = 4;
int num790 = Dust.NewDust(center8 + vector66 + Vector2.One * (float)(-(float)num789), num789 * 2, num789 * 2, num787, 0f, 0f, 100, default(Color), num788);
Main.dust[num790].velocity *= 0.1f;
Main.dust[num790].noGravity = true;
}
float num791 = (float)this.alpha / 255f;
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.3f * num791, 0.4f * num791, 1f * num791);
return;
}
if (this.aiStyle == 82)
{
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[0] == 0f)
{
this.localAI[0] += 1f;
if (this.localAI[0] >= 45f)
{
this.localAI[0] = 0f;
this.ai[0] = 1f;
this.ai[1] = -this.ai[1];
this.netUpdate = true;
}
this.velocity.X = this.velocity.RotatedBy((double)this.ai[1], default(Vector2)).X;
this.velocity.X = MathHelper.Clamp(this.velocity.X, -6f, 6f);
this.velocity.Y = this.velocity.Y - 0.08f;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - 0.2f;
}
if (this.velocity.Y < -7f)
{
this.velocity.Y = -7f;
}
}
else if (this.ai[0] == 1f)
{
this.localAI[0] += 1f;
if (this.localAI[0] >= 90f)
{
this.localAI[0] = 0f;
this.ai[0] = 2f;
this.ai[1] = (float)Player.FindClosest(this.position, this.width, this.height);
this.netUpdate = true;
}
this.velocity.X = this.velocity.RotatedBy((double)this.ai[1], default(Vector2)).X;
this.velocity.X = MathHelper.Clamp(this.velocity.X, -6f, 6f);
this.velocity.Y = this.velocity.Y - 0.08f;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - 0.2f;
}
if (this.velocity.Y < -7f)
{
this.velocity.Y = -7f;
}
}
else if (this.ai[0] == 2f)
{
Vector2 vector67 = Main.player[(int)this.ai[1]].Center - base.Center;
if (vector67.Length() < 30f)
{
this.Kill();
return;
}
vector67.Normalize();
vector67 *= 14f;
vector67 = Vector2.Lerp(this.velocity, vector67, 0.6f);
if (vector67.Y < 6f)
{
vector67.Y = 6f;
}
float num792 = 0.4f;
if (this.velocity.X < vector67.X)
{
this.velocity.X = this.velocity.X + num792;
if (this.velocity.X < 0f && vector67.X > 0f)
{
this.velocity.X = this.velocity.X + num792;
}
}
else if (this.velocity.X > vector67.X)
{
this.velocity.X = this.velocity.X - num792;
if (this.velocity.X > 0f && vector67.X < 0f)
{
this.velocity.X = this.velocity.X - num792;
}
}
if (this.velocity.Y < vector67.Y)
{
this.velocity.Y = this.velocity.Y + num792;
if (this.velocity.Y < 0f && vector67.Y > 0f)
{
this.velocity.Y = this.velocity.Y + num792;
}
}
else if (this.velocity.Y > vector67.Y)
{
this.velocity.Y = this.velocity.Y - num792;
if (this.velocity.Y > 0f && vector67.Y < 0f)
{
this.velocity.Y = this.velocity.Y - num792;
}
}
}
if (this.alpha < 40)
{
int num793 = Dust.NewDust(base.Center - Vector2.One * 5f, 10, 10, 229, -this.velocity.X / 3f, -this.velocity.Y / 3f, 150, Color.Transparent, 1.2f);
Main.dust[num793].noGravity = true;
}
this.rotation = this.velocity.ToRotation() + 1.57079637f;
return;
}
if (this.aiStyle == 83)
{
if (this.alpha > 200)
{
this.alpha = 200;
}
this.alpha -= 5;
if (this.alpha < 0)
{
this.alpha = 0;
}
float num794 = (float)this.alpha / 255f;
this.scale = 1f - num794;
if (this.ai[0] >= 0f)
{
this.ai[0] += 1f;
}
if (this.ai[0] == -1f)
{
this.frame = 1;
this.extraUpdates = 1;
}
else if (this.ai[0] < 30f)
{
this.position = Main.npc[(int)this.ai[1]].Center - new Vector2((float)this.width, (float)this.height) / 2f - this.velocity;
}
else
{
this.velocity *= 0.96f;
if (++this.frameCounter >= 6)
{
this.frameCounter = 0;
if (++this.frame >= 2)
{
this.frame = 0;
}
}
}
if (this.alpha < 40)
{
for (int num795 = 0; num795 < 2; num795++)
{
float num796 = (float)Main.rand.NextDouble() * 1f - 0.5f;
if (num796 < -0.5f)
{
num796 = -0.5f;
}
if (num796 > 0.5f)
{
num796 = 0.5f;
}
Vector2 value29 = new Vector2((float)(-(float)this.width) * 0.65f * this.scale, 0f).RotatedBy((double)(num796 * 6.28318548f), default(Vector2)).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num797 = Dust.NewDust(base.Center - Vector2.One * 5f, 10, 10, 229, -this.velocity.X / 3f, -this.velocity.Y / 3f, 150, Color.Transparent, 0.7f);
Main.dust[num797].velocity = Vector2.Zero;
Main.dust[num797].position = base.Center + value29;
Main.dust[num797].noGravity = true;
}
return;
}
}
else if (this.aiStyle == 84)
{
Vector2? vector68 = null;
if (this.velocity.HasNaNs() || this.velocity == Vector2.Zero)
{
this.velocity = -Vector2.UnitY;
}
if (this.type == 455 && Main.npc[(int)this.ai[1]].active && Main.npc[(int)this.ai[1]].type == 396)
{
Vector2 value30 = new Vector2(27f, 59f);
Vector2 value31 = Utils.Vector2FromElipse(Main.npc[(int)this.ai[1]].localAI[0].ToRotationVector2(), value30 * Main.npc[(int)this.ai[1]].localAI[1]);
this.position = Main.npc[(int)this.ai[1]].Center + value31 - new Vector2((float)this.width, (float)this.height) / 2f;
}
else if (this.type == 455 && Main.npc[(int)this.ai[1]].active && Main.npc[(int)this.ai[1]].type == 400)
{
Vector2 value32 = new Vector2(30f, 30f);
Vector2 value33 = Utils.Vector2FromElipse(Main.npc[(int)this.ai[1]].localAI[0].ToRotationVector2(), value32 * Main.npc[(int)this.ai[1]].localAI[1]);
this.position = Main.npc[(int)this.ai[1]].Center + value33 - new Vector2((float)this.width, (float)this.height) / 2f;
}
else if (this.type == 537 && Main.npc[(int)this.ai[1]].active && Main.npc[(int)this.ai[1]].type == 411)
{
Vector2 value34 = new Vector2((float)(Main.npc[(int)this.ai[1]].direction * 6), -4f);
this.position = Main.npc[(int)this.ai[1]].Center + value34 - base.Size / 2f + new Vector2(0f, -Main.npc[(int)this.ai[1]].gfxOffY);
}
else if (this.type == 461 && Main.projectile[(int)this.ai[1]].active && Main.projectile[(int)this.ai[1]].type == 460)
{
Vector2 value35 = Vector2.Normalize(Main.projectile[(int)this.ai[1]].velocity);
this.position = Main.projectile[(int)this.ai[1]].Center + value35 * 16f - new Vector2((float)this.width, (float)this.height) / 2f + new Vector2(0f, -Main.projectile[(int)this.ai[1]].gfxOffY);
this.velocity = Vector2.Normalize(Main.projectile[(int)this.ai[1]].velocity);
}
else if (this.type == 642 && Main.projectile[(int)this.ai[1]].active && Main.projectile[(int)this.ai[1]].type == 641)
{
base.Center = Main.projectile[(int)this.ai[1]].Center;
this.velocity = Vector2.Normalize(Main.projectile[(int)this.ai[1]].ai[1].ToRotationVector2());
}
else
{
if (this.type != 632 || !Main.projectile[(int)this.ai[1]].active || Main.projectile[(int)this.ai[1]].type != 633)
{
this.Kill();
return;
}
float num798 = (float)((int)this.ai[0]) - 2.5f;
Vector2 value36 = Vector2.Normalize(Main.projectile[(int)this.ai[1]].velocity);
Projectile projectile = Main.projectile[(int)this.ai[1]];
float num799 = num798 * 0.5235988f;
Vector2 value37 = Vector2.Zero;
float num800;
float y;
float num801;
float scaleFactor6;
if (projectile.ai[0] < 180f)
{
num800 = 1f - projectile.ai[0] / 180f;
y = 20f - projectile.ai[0] / 180f * 14f;
if (projectile.ai[0] < 120f)
{
num801 = 20f - 4f * (projectile.ai[0] / 120f);
this.Opacity = projectile.ai[0] / 120f * 0.4f;
}
else
{
num801 = 16f - 10f * ((projectile.ai[0] - 120f) / 60f);
this.Opacity = 0.4f + (projectile.ai[0] - 120f) / 60f * 0.6f;
}
scaleFactor6 = -22f + projectile.ai[0] / 180f * 20f;
}
else
{
num800 = 0f;
num801 = 1.75f;
y = 6f;
this.Opacity = 1f;
scaleFactor6 = -2f;
}
float num802 = (projectile.ai[0] + num798 * num801) / (num801 * 6f) * 6.28318548f;
num799 = Vector2.UnitY.RotatedBy((double)num802, default(Vector2)).Y * 0.5235988f * num800;
value37 = (Vector2.UnitY.RotatedBy((double)num802, default(Vector2)) * new Vector2(4f, y)).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2));
this.position = projectile.Center + value36 * 16f - base.Size / 2f + new Vector2(0f, -Main.projectile[(int)this.ai[1]].gfxOffY);
this.position += projectile.velocity.ToRotation().ToRotationVector2() * scaleFactor6;
this.position += value37;
this.velocity = Vector2.Normalize(projectile.velocity).RotatedBy((double)num799, default(Vector2));
this.scale = 1.4f * (1f - num800);
this.damage = projectile.damage;
if (projectile.ai[0] >= 180f)
{
this.damage *= 3;
vector68 = new Vector2?(projectile.Center);
}
if (!Collision.CanHitLine(Main.player[this.owner].Center, 0, 0, projectile.Center, 0, 0))
{
vector68 = new Vector2?(Main.player[this.owner].Center);
}
this.friendly = (projectile.ai[0] > 30f);
}
if (this.velocity.HasNaNs() || this.velocity == Vector2.Zero)
{
this.velocity = -Vector2.UnitY;
}
if (this.type == 461)
{
this.ai[0] += 1f;
if (this.ai[0] >= 300f)
{
this.Kill();
return;
}
this.scale = (float)Math.Sin((double)(this.ai[0] * 3.14159274f / 300f)) * 10f;
if (this.scale > 1f)
{
this.scale = 1f;
}
}
if (this.type == 455)
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(29, (int)this.position.X, (int)this.position.Y, 104);
}
float num803 = 1f;
if (Main.npc[(int)this.ai[1]].type == 400)
{
num803 = 0.4f;
}
this.localAI[0] += 1f;
if (this.localAI[0] >= 180f)
{
this.Kill();
return;
}
this.scale = (float)Math.Sin((double)(this.localAI[0] * 3.14159274f / 180f)) * 10f * num803;
if (this.scale > num803)
{
this.scale = num803;
}
}
if (this.type == 642)
{
float num804 = 1f;
this.localAI[0] += 1f;
if (this.localAI[0] >= 50f)
{
this.Kill();
return;
}
this.scale = (float)Math.Sin((double)(this.localAI[0] * 3.14159274f / 50f)) * 10f * num804;
if (this.scale > num804)
{
this.scale = num804;
}
}
if (this.type == 537)
{
float num805 = 0.8f;
this.localAI[0] += 1f;
if (this.localAI[0] >= 60f)
{
this.Kill();
return;
}
this.scale = (float)Math.Sin((double)(this.localAI[0] * 3.14159274f / 60f)) * 10f * num805;
if (this.scale > num805)
{
this.scale = num805;
}
}
float num806 = this.velocity.ToRotation();
if (this.type == 455)
{
num806 += this.ai[0];
}
this.rotation = num806 - 1.57079637f;
this.velocity = num806.ToRotationVector2();
float num807 = 0f;
float scaleFactor7 = 0f;
Vector2 value38 = base.Center;
if (vector68.HasValue)
{
value38 = vector68.Value;
}
if (this.type == 455)
{
num807 = 3f;
scaleFactor7 = (float)this.width;
}
else if (this.type == 461)
{
num807 = 2f;
scaleFactor7 = 0f;
}
else if (this.type == 642)
{
num807 = 2f;
scaleFactor7 = 0f;
}
else if (this.type == 632)
{
num807 = 2f;
scaleFactor7 = 0f;
}
else if (this.type == 537)
{
num807 = 2f;
scaleFactor7 = 0f;
}
float[] array3 = new float[(int)num807];
int num808 = 0;
while ((float)num808 < num807)
{
float num809 = (float)num808 / (num807 - 1f);
Vector2 value39 = value38 + this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * (num809 - 0.5f) * scaleFactor7 * this.scale;
int num810 = (int)value39.X / 16;
int num811 = (int)value39.Y / 16;
Vector2 vector69 = value39 + this.velocity * 16f * 150f;
int num812 = (int)vector69.X / 16;
int num813 = (int)vector69.Y / 16;
Tuple<int, int> tuple;
float num814;
if (!Collision.TupleHitLine(num810, num811, num812, num813, 0, 0, new List<Tuple<int, int>>(), out tuple))
{
num814 = new Vector2((float)Math.Abs(num810 - tuple.Item1), (float)Math.Abs(num811 - tuple.Item2)).Length() * 16f;
}
else if (tuple.Item1 == num812 && tuple.Item2 == num813)
{
num814 = 2400f;
}
else
{
num814 = new Vector2((float)Math.Abs(num810 - tuple.Item1), (float)Math.Abs(num811 - tuple.Item2)).Length() * 16f;
}
array3[num808] = num814;
num808++;
}
float num815 = 0f;
for (int num816 = 0; num816 < array3.Length; num816++)
{
num815 += array3[num816];
}
num815 /= num807;
float amount = 0.5f;
if (this.type == 632)
{
amount = 0.75f;
}
this.localAI[1] = MathHelper.Lerp(this.localAI[1], num815, amount);
if (this.type == 455)
{
Vector2 vector70 = base.Center + this.velocity * (this.localAI[1] - 14f);
for (int num817 = 0; num817 < 2; num817++)
{
float num818 = this.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num819 = (float)Main.rand.NextDouble() * 2f + 2f;
Vector2 vector71 = new Vector2((float)Math.Cos((double)num818) * num819, (float)Math.Sin((double)num818) * num819);
int num820 = Dust.NewDust(vector70, 0, 0, 229, vector71.X, vector71.Y, 0, default(Color), 1f);
Main.dust[num820].noGravity = true;
Main.dust[num820].scale = 1.7f;
}
if (Main.rand.Next(5) == 0)
{
Vector2 value40 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num821 = Dust.NewDust(vector70 + value40 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num821].velocity *= 0.5f;
Main.dust[num821].velocity.Y = -Math.Abs(Main.dust[num821].velocity.Y);
}
DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f);
Utils.PlotTileLine(base.Center, base.Center + this.velocity * this.localAI[1], (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CastLight));
}
else if (this.type == 642)
{
Vector2 vector72 = base.Center + this.velocity * (this.localAI[1] - 14f);
for (int num822 = 0; num822 < 2; num822++)
{
float num823 = this.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num824 = (float)Main.rand.NextDouble() * 2f + 2f;
Vector2 vector73 = new Vector2((float)Math.Cos((double)num823) * num824, (float)Math.Sin((double)num823) * num824);
int num825 = Dust.NewDust(vector72, 0, 0, 229, vector73.X, vector73.Y, 0, default(Color), 1f);
Main.dust[num825].noGravity = true;
Main.dust[num825].scale = 1.7f;
}
if (Main.rand.Next(5) == 0)
{
Vector2 value41 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num826 = Dust.NewDust(vector72 + value41 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num826].velocity *= 0.5f;
Main.dust[num826].velocity.Y = -Math.Abs(Main.dust[num826].velocity.Y);
}
DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f);
Utils.PlotTileLine(base.Center, base.Center + this.velocity * this.localAI[1], (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CastLight));
}
if (this.type == 461)
{
Vector2 vector74 = base.Center + this.velocity * (this.localAI[1] - 8f);
for (int num827 = 0; num827 < 2; num827++)
{
float num828 = this.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num829 = (float)Main.rand.NextDouble() * 0.8f + 1f;
Vector2 vector75 = new Vector2((float)Math.Cos((double)num828) * num829, (float)Math.Sin((double)num828) * num829);
int num830 = Dust.NewDust(vector74, 0, 0, 226, vector75.X, vector75.Y, 0, default(Color), 1f);
Main.dust[num830].noGravity = true;
Main.dust[num830].scale = 1.2f;
}
if (Main.rand.Next(5) == 0)
{
Vector2 value42 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num831 = Dust.NewDust(vector74 + value42 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num831].velocity *= 0.5f;
Main.dust[num831].velocity.Y = -Math.Abs(Main.dust[num831].velocity.Y);
}
DelegateMethods.v3_1 = new Vector3(0.4f, 0.85f, 0.9f);
Utils.PlotTileLine(base.Center, base.Center + this.velocity * this.localAI[1], (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CastLight));
}
if (this.type == 537)
{
Vector2 vector76 = base.Center + this.velocity * (this.localAI[1] - 8f);
for (int num832 = 0; num832 < 2; num832++)
{
float num833 = this.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num834 = (float)Main.rand.NextDouble() * 0.8f + 1f;
Vector2 vector77 = new Vector2((float)Math.Cos((double)num833) * num834, (float)Math.Sin((double)num833) * num834);
int num835 = Dust.NewDust(vector76, 0, 0, 226, vector77.X, vector77.Y, 0, default(Color), 1f);
Main.dust[num835].noGravity = true;
Main.dust[num835].scale = 1.2f;
}
if (Main.rand.Next(5) == 0)
{
Vector2 value43 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num836 = Dust.NewDust(vector76 + value43 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num836].velocity *= 0.5f;
Main.dust[num836].velocity.Y = -Math.Abs(Main.dust[num836].velocity.Y);
}
DelegateMethods.v3_1 = new Vector3(0.4f, 0.85f, 0.9f);
Utils.PlotTileLine(base.Center, base.Center + this.velocity * this.localAI[1], (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CastLight));
}
if (this.type == 632 && Math.Abs(this.localAI[1] - num815) < 100f && this.scale > 0.15f)
{
float prismHue = this.GetPrismHue(this.ai[0]);
Color color = Main.hslToRgb(prismHue, 1f, 0.5f);
color.A = 0;
Vector2 vector78 = base.Center + this.velocity * (this.localAI[1] - 14.5f * this.scale);
float x = Main.rgbToHsl(new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB)).X;
for (int num837 = 0; num837 < 2; num837++)
{
float num838 = this.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num839 = (float)Main.rand.NextDouble() * 0.8f + 1f;
Vector2 vector79 = new Vector2((float)Math.Cos((double)num838) * num839, (float)Math.Sin((double)num838) * num839);
int num840 = Dust.NewDust(vector78, 0, 0, 267, vector79.X, vector79.Y, 0, default(Color), 1f);
Main.dust[num840].color = color;
Main.dust[num840].scale = 1.2f;
if (this.scale > 1f)
{
Main.dust[num840].velocity *= this.scale;
Main.dust[num840].scale *= this.scale;
}
Main.dust[num840].noGravity = true;
if (this.scale != 1.4f)
{
Dust dust8 = Dust.CloneDust(Main.dust[num840]);
dust8.color = Color.White;
dust8.scale /= 2f;
}
float hue = (x + Main.rand.NextFloat() * 0.4f) % 1f;
Main.dust[num840].color = Color.Lerp(color, Main.hslToRgb(hue, 1f, 0.75f), this.scale / 1.4f);
}
if (Main.rand.Next(5) == 0)
{
Vector2 value44 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num841 = Dust.NewDust(vector78 + value44 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num841].velocity *= 0.5f;
Main.dust[num841].velocity.Y = -Math.Abs(Main.dust[num841].velocity.Y);
}
DelegateMethods.v3_1 = color.ToVector3() * 0.3f;
Utils.PlotTileLine(base.Center, base.Center + this.velocity * this.localAI[1], (float)this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CastLight));
return;
}
}
else if (this.aiStyle == 85)
{
Vector2 value45 = new Vector2(0f, 216f);
this.alpha -= 15;
if (this.alpha < 0)
{
this.alpha = 0;
}
int num842 = (int)Math.Abs(this.ai[0]) - 1;
int num843 = (int)this.ai[1];
if (!Main.npc[num842].active || Main.npc[num842].type != 396)
{
this.Kill();
return;
}
this.localAI[0] += 1f;
if (this.localAI[0] >= 330f && this.ai[0] > 0f && Main.netMode != 1)
{
this.ai[0] *= -1f;
this.netUpdate = true;
}
if (Main.netMode != 1 && this.ai[0] > 0f && (!Main.player[(int)this.ai[1]].active || Main.player[(int)this.ai[1]].dead))
{
this.ai[0] *= -1f;
this.netUpdate = true;
}
this.rotation = (Main.npc[(int)Math.Abs(this.ai[0]) - 1].Center - Main.player[(int)this.ai[1]].Center + value45).ToRotation() + 1.57079637f;
if (this.ai[0] > 0f)
{
Vector2 value46 = Main.player[(int)this.ai[1]].Center - base.Center;
if (value46.X != 0f || value46.Y != 0f)
{
this.velocity = Vector2.Normalize(value46) * Math.Min(16f, value46.Length());
}
else
{
this.velocity = Vector2.Zero;
}
if (value46.Length() < 20f && this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
Main.player[num843].AddBuff(145, 600, true);
return;
}
}
else
{
if (this.localAI[1] == 1f)
{
int num844 = Main.player[num843].HasBuff(145);
if (num844 != -1)
{
Main.player[num843].DelBuff(num844);
}
}
Vector2 value47 = Main.npc[(int)Math.Abs(this.ai[0]) - 1].Center - base.Center + value45;
if (value47.X != 0f || value47.Y != 0f)
{
this.velocity = Vector2.Normalize(value47) * Math.Min(16f, value47.Length());
}
else
{
this.velocity = Vector2.Zero;
}
if (value47.Length() < 20f)
{
this.Kill();
return;
}
}
}
else if (this.aiStyle == 86)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 120);
}
this.ai[0] += 1f;
if (this.ai[1] == 1f)
{
if (this.ai[0] >= 130f)
{
this.alpha += 10;
}
else
{
this.alpha -= 10;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha > 255)
{
this.alpha = 255;
}
if (this.ai[0] >= 150f)
{
this.Kill();
return;
}
if (this.ai[0] % 30f == 0f && Main.netMode != 1)
{
Vector2 vector80 = this.rotation.ToRotationVector2();
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector80.X, vector80.Y, 464, this.damage, this.knockBack, this.owner, 0f, 0f);
}
this.rotation += 0.104719758f;
Lighting.AddLight(base.Center, 0.3f, 0.75f, 0.9f);
return;
}
else
{
this.position -= this.velocity;
if (this.ai[0] >= 40f)
{
this.alpha += 3;
}
else
{
this.alpha -= 40;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha > 255)
{
this.alpha = 255;
}
if (this.ai[0] >= 45f)
{
this.Kill();
return;
}
Vector2 value48 = new Vector2(0f, -720f).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
float scaleFactor8 = this.ai[0] % 45f / 45f;
Vector2 spinningpoint = value48 * scaleFactor8;
for (int num845 = 0; num845 < 6; num845++)
{
Vector2 vector81 = base.Center + spinningpoint.RotatedBy((double)((float)num845 * 6.28318548f / 6f), default(Vector2));
Lighting.AddLight(vector81, 0.3f, 0.75f, 0.9f);
for (int num846 = 0; num846 < 2; num846++)
{
int num847 = Dust.NewDust(vector81 + Utils.RandomVector2(Main.rand, -8f, 8f) / 2f, 8, 8, 197, 0f, 0f, 100, Color.Transparent, 1f);
Main.dust[num847].noGravity = true;
}
}
return;
}
}
else
{
if (this.aiStyle == 87)
{
this.position.Y = this.ai[0];
this.height = (int)this.ai[1];
if (base.Center.X > Main.player[this.owner].Center.X)
{
this.direction = 1;
}
else
{
this.direction = -1;
}
this.velocity.X = (float)this.direction * 1E-06f;
if (this.owner == Main.myPlayer)
{
for (int num848 = 0; num848 < 1000; num848++)
{
if (Main.projectile[num848].active && num848 != this.whoAmI && Main.projectile[num848].type == this.type && Main.projectile[num848].owner == this.owner && Main.projectile[num848].timeLeft > this.timeLeft)
{
this.Kill();
return;
}
}
}
float num849 = (float)(this.width * this.height) * 0.0045f;
int num850 = 0;
while ((float)num850 < num849)
{
int num851 = Dust.NewDust(this.position, this.width, this.height, 75, 0f, 0f, 100, default(Color), 1f);
Main.dust[num851].noGravity = true;
Main.dust[num851].velocity *= 0.5f;
Dust expr_22B73_cp_0 = Main.dust[num851];
expr_22B73_cp_0.velocity.Y = expr_22B73_cp_0.velocity.Y - 0.5f;
Main.dust[num851].scale = 1.4f;
Dust expr_22BA7_cp_0 = Main.dust[num851];
expr_22BA7_cp_0.position.X = expr_22BA7_cp_0.position.X + 6f;
Dust expr_22BC7_cp_0 = Main.dust[num851];
expr_22BC7_cp_0.position.Y = expr_22BC7_cp_0.position.Y - 2f;
num850++;
}
return;
}
if (this.aiStyle == 88)
{
if (this.type == 465)
{
if (this.localAI[1] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 121);
this.localAI[1] = 1f;
}
if (this.ai[0] < 180f)
{
this.alpha -= 5;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
else
{
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
this.Kill();
return;
}
}
this.ai[0] += 1f;
if (this.ai[0] % 30f == 0f && this.ai[0] < 180f && Main.netMode != 1)
{
int[] array4 = new int[5];
Vector2[] array5 = new Vector2[5];
int num852 = 0;
float num853 = 2000f;
for (int num854 = 0; num854 < 255; num854++)
{
if (Main.player[num854].active && !Main.player[num854].dead)
{
Vector2 center9 = Main.player[num854].Center;
float num855 = Vector2.Distance(center9, base.Center);
if (num855 < num853 && Collision.CanHit(base.Center, 1, 1, center9, 1, 1))
{
array4[num852] = num854;
array5[num852] = center9;
if (++num852 >= array5.Length)
{
break;
}
}
}
}
for (int num856 = 0; num856 < num852; num856++)
{
Vector2 vector82 = array5[num856] - base.Center;
float ai = (float)Main.rand.Next(100);
Vector2 vector83 = Vector2.Normalize(vector82.RotatedByRandom(0.78539818525314331)) * 7f;
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector83.X, vector83.Y, 466, this.damage, 0f, Main.myPlayer, vector82.ToRotation(), ai);
}
}
Lighting.AddLight(base.Center, 0.4f, 0.85f, 0.9f);
if (++this.frameCounter >= 4)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
if (this.alpha < 150 && this.ai[0] < 180f)
{
for (int num857 = 0; num857 < 1; num857++)
{
float num858 = (float)Main.rand.NextDouble() * 1f - 0.5f;
if (num858 < -0.5f)
{
num858 = -0.5f;
}
if (num858 > 0.5f)
{
num858 = 0.5f;
}
Vector2 value49 = new Vector2((float)(-(float)this.width) * 0.2f * this.scale, 0f).RotatedBy((double)(num858 * 6.28318548f), default(Vector2)).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num859 = Dust.NewDust(base.Center - Vector2.One * 5f, 10, 10, 226, -this.velocity.X / 3f, -this.velocity.Y / 3f, 150, Color.Transparent, 0.7f);
Main.dust[num859].position = base.Center + value49;
Main.dust[num859].velocity = Vector2.Normalize(Main.dust[num859].position - base.Center) * 2f;
Main.dust[num859].noGravity = true;
}
for (int num860 = 0; num860 < 1; num860++)
{
float num861 = (float)Main.rand.NextDouble() * 1f - 0.5f;
if (num861 < -0.5f)
{
num861 = -0.5f;
}
if (num861 > 0.5f)
{
num861 = 0.5f;
}
Vector2 value50 = new Vector2((float)(-(float)this.width) * 0.6f * this.scale, 0f).RotatedBy((double)(num861 * 6.28318548f), default(Vector2)).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num862 = Dust.NewDust(base.Center - Vector2.One * 5f, 10, 10, 226, -this.velocity.X / 3f, -this.velocity.Y / 3f, 150, Color.Transparent, 0.7f);
Main.dust[num862].velocity = Vector2.Zero;
Main.dust[num862].position = base.Center + value50;
Main.dust[num862].noGravity = true;
}
return;
}
}
else if (this.type == 466)
{
this.frameCounter++;
Lighting.AddLight(base.Center, 0.3f, 0.45f, 0.5f);
if (this.velocity == Vector2.Zero)
{
if (this.frameCounter >= this.extraUpdates * 2)
{
this.frameCounter = 0;
bool flag34 = true;
for (int num863 = 1; num863 < this.oldPos.Length; num863++)
{
if (this.oldPos[num863] != this.oldPos[0])
{
flag34 = false;
}
}
if (flag34)
{
this.Kill();
return;
}
}
if (Main.rand.Next(this.extraUpdates) == 0)
{
for (int num864 = 0; num864 < 2; num864++)
{
float num865 = this.rotation + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num866 = (float)Main.rand.NextDouble() * 0.8f + 1f;
Vector2 vector84 = new Vector2((float)Math.Cos((double)num865) * num866, (float)Math.Sin((double)num865) * num866);
int num867 = Dust.NewDust(base.Center, 0, 0, 226, vector84.X, vector84.Y, 0, default(Color), 1f);
Main.dust[num867].noGravity = true;
Main.dust[num867].scale = 1.2f;
}
if (Main.rand.Next(5) == 0)
{
Vector2 value51 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num868 = Dust.NewDust(base.Center + value51 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num868].velocity *= 0.5f;
Main.dust[num868].velocity.Y = -Math.Abs(Main.dust[num868].velocity.Y);
return;
}
}
}
else if (this.frameCounter >= this.extraUpdates * 2)
{
this.frameCounter = 0;
float num869 = this.velocity.Length();
Random random = new Random((int)this.ai[1]);
int num870 = 0;
Vector2 spinningpoint2 = -Vector2.UnitY;
Vector2 vector85;
do
{
int num871 = random.Next();
this.ai[1] = (float)num871;
num871 %= 100;
float f = (float)num871 / 100f * 6.28318548f;
vector85 = f.ToRotationVector2();
if (vector85.Y > 0f)
{
vector85.Y *= -1f;
}
bool flag35 = false;
if (vector85.Y > -0.02f)
{
flag35 = true;
}
if (vector85.X * (float)(this.extraUpdates + 1) * 2f * num869 + this.localAI[0] > 40f)
{
flag35 = true;
}
if (vector85.X * (float)(this.extraUpdates + 1) * 2f * num869 + this.localAI[0] < -40f)
{
flag35 = true;
}
if (!flag35)
{
goto IL_2363F;
}
}
while (num870++ < 100);
this.velocity = Vector2.Zero;
this.localAI[1] = 1f;
goto IL_23647;
IL_2363F:
spinningpoint2 = vector85;
IL_23647:
if (this.velocity != Vector2.Zero)
{
this.localAI[0] += spinningpoint2.X * (float)(this.extraUpdates + 1) * 2f * num869;
this.velocity = spinningpoint2.RotatedBy((double)(this.ai[0] + 1.57079637f), default(Vector2)) * num869;
this.rotation = this.velocity.ToRotation() + 1.57079637f;
return;
}
}
}
else if (this.type == 580)
{
if (this.localAI[1] == 0f && this.ai[0] >= 900f)
{
this.ai[0] -= 1000f;
this.localAI[1] = -1f;
}
this.frameCounter++;
Lighting.AddLight(base.Center, 0.3f, 0.45f, 0.5f);
if (this.velocity == Vector2.Zero)
{
if (this.frameCounter >= this.extraUpdates * 2)
{
this.frameCounter = 0;
bool flag36 = true;
for (int num872 = 1; num872 < this.oldPos.Length; num872++)
{
if (this.oldPos[num872] != this.oldPos[0])
{
flag36 = false;
}
}
if (flag36)
{
this.Kill();
return;
}
}
if (Main.rand.Next(this.extraUpdates) == 0 && (this.velocity != Vector2.Zero || Main.rand.Next((this.localAI[1] == 2f) ? 2 : 6) == 0))
{
for (int num873 = 0; num873 < 2; num873++)
{
float num874 = this.rotation + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num875 = (float)Main.rand.NextDouble() * 0.8f + 1f;
Vector2 vector86 = new Vector2((float)Math.Cos((double)num874) * num875, (float)Math.Sin((double)num874) * num875);
int num876 = Dust.NewDust(base.Center, 0, 0, 226, vector86.X, vector86.Y, 0, default(Color), 1f);
Main.dust[num876].noGravity = true;
Main.dust[num876].scale = 1.2f;
}
if (Main.rand.Next(5) == 0)
{
Vector2 value52 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num877 = Dust.NewDust(base.Center + value52 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num877].velocity *= 0.5f;
Main.dust[num877].velocity.Y = -Math.Abs(Main.dust[num877].velocity.Y);
return;
}
}
}
else if (this.frameCounter >= this.extraUpdates * 2)
{
this.frameCounter = 0;
float num878 = this.velocity.Length();
Random random2 = new Random((int)this.ai[1]);
int num879 = 0;
Vector2 spinningpoint3 = -Vector2.UnitY;
Vector2 vector87;
do
{
int num880 = random2.Next();
this.ai[1] = (float)num880;
num880 %= 100;
float f2 = (float)num880 / 100f * 6.28318548f;
vector87 = f2.ToRotationVector2();
if (vector87.Y > 0f)
{
vector87.Y *= -1f;
}
bool flag37 = false;
if (vector87.Y > -0.02f)
{
flag37 = true;
}
if (vector87.X * (float)(this.extraUpdates + 1) * 2f * num878 + this.localAI[0] > 40f)
{
flag37 = true;
}
if (vector87.X * (float)(this.extraUpdates + 1) * 2f * num878 + this.localAI[0] < -40f)
{
flag37 = true;
}
if (!flag37)
{
goto IL_23BA3;
}
}
while (num879++ < 100);
this.velocity = Vector2.Zero;
if (this.localAI[1] < 1f)
{
this.localAI[1] += 2f;
goto IL_23BAB;
}
goto IL_23BAB;
IL_23BA3:
spinningpoint3 = vector87;
IL_23BAB:
if (this.velocity != Vector2.Zero)
{
this.localAI[0] += spinningpoint3.X * (float)(this.extraUpdates + 1) * 2f * num878;
this.velocity = spinningpoint3.RotatedBy((double)(this.ai[0] + 1.57079637f), default(Vector2)) * num878;
this.rotation = this.velocity.ToRotation() + 1.57079637f;
if (Main.rand.Next(4) == 0 && Main.netMode != 1 && this.localAI[1] == 0f)
{
float num881 = (float)Main.rand.Next(-3, 4) * 1.04719758f / 3f;
Vector2 vector88 = this.ai[0].ToRotationVector2().RotatedBy((double)num881, default(Vector2)) * this.velocity.Length();
if (!Collision.CanHitLine(base.Center, 0, 0, base.Center + vector88 * 50f, 0, 0))
{
Projectile.NewProjectile(base.Center.X - vector88.X, base.Center.Y - vector88.Y, vector88.X, vector88.Y, this.type, this.damage, this.knockBack, this.owner, vector88.ToRotation() + 1000f, this.ai[1]);
return;
}
}
}
}
}
}
else if (this.aiStyle == 89)
{
if (this.ai[1] == -1f)
{
this.alpha += 12;
}
else if (this.ai[0] < 300f)
{
this.alpha -= 5;
}
else
{
this.alpha += 12;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha > 255)
{
this.alpha = 255;
}
this.scale = 1f - (float)this.alpha / 255f;
this.scale *= 0.6f;
this.rotation += 0.0149599658f;
if (this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 123);
}
if (this.alpha == 0)
{
for (int num882 = 0; num882 < 2; num882++)
{
float num883 = (float)Main.rand.Next(2, 4);
float num884 = this.scale;
if (num882 == 1)
{
num884 *= 0.42f;
num883 *= -0.75f;
}
Vector2 value53 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
value53.Normalize();
int num885 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, 0f, 0f, 100, default(Color), 2f);
Main.dust[num885].noGravity = true;
Main.dust[num885].noLight = true;
Main.dust[num885].position = base.Center + value53 * 204f * num884;
if (Main.rand.Next(8) == 0)
{
Main.dust[num885].velocity = value53 * -num883 * 2f;
Main.dust[num885].scale += 0.5f;
}
else
{
Main.dust[num885].velocity = value53 * -num883;
}
}
}
this.ai[0] += 1f;
if (this.ai[0] >= 60f)
{
int arg_2404C_0 = (int)(this.ai[0] - 0f) / 60;
for (int num886 = 0; num886 < 1; num886++)
{
float scaleFactor9 = (float)Main.rand.Next(1, 3);
Vector2 value54 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
value54.Normalize();
int num887 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, 0f, 0f, 100, default(Color), 2f);
Main.dust[num887].noGravity = true;
Main.dust[num887].noLight = true;
Main.dust[num887].position = base.Center;
if (Main.rand.Next(2) == 0)
{
Main.dust[num887].velocity = value54 * scaleFactor9 * 2f;
Main.dust[num887].scale += 0.5f;
}
else
{
Main.dust[num887].velocity = value54 * scaleFactor9;
}
Main.dust[num887].fadeIn = 2f;
}
}
if (this.ai[0] == 300f && this.ai[1] != -1f && Main.netMode != 1)
{
if (!NPC.AnyNPCs(454))
{
this.ai[1] = (float)NPC.NewNPC((int)base.Center.X, (int)base.Center.Y, 454, 0, 0f, 0f, 0f, 0f, 255);
}
else
{
this.ai[1] = (float)NPC.NewNPC((int)base.Center.X, (int)base.Center.Y, 521, 0, 0f, 0f, 0f, 0f, 255);
}
}
else if (this.ai[0] == 320f)
{
this.Kill();
return;
}
bool flag38 = false;
if (this.ai[1] == -1f)
{
if (this.alpha == 255)
{
flag38 = true;
}
}
else
{
flag38 = (this.ai[1] < 0f || !Main.npc[(int)this.ai[1]].active);
if ((flag38 || Main.npc[(int)this.ai[1]].type != 439) && (flag38 || Main.npc[(int)this.ai[1]].type != 454) && (flag38 || Main.npc[(int)this.ai[1]].type != 521))
{
flag38 = true;
}
}
if (flag38)
{
this.Kill();
return;
}
Lighting.AddLight(base.Center, 1.1f, 0.9f, 0.4f);
return;
}
else if (this.aiStyle == 90)
{
if (Main.player[this.owner].dead)
{
this.Kill();
}
if (Main.myPlayer == this.owner && Main.player[this.owner].magicLantern)
{
this.timeLeft = 2;
}
if (this.tileCollide)
{
if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.owner].Center, 1, 1))
{
this.tileCollide = false;
}
else if (!Collision.SolidCollision(this.position, this.width, this.height) && Collision.CanHitLine(this.position, this.width, this.height, Main.player[this.owner].Center, 1, 1))
{
this.tileCollide = true;
}
}
this.direction = Main.player[this.owner].direction;
this.spriteDirection = this.direction;
Lighting.AddLight(this.position, 0.35f, 0.35f, 0.1f);
this.localAI[0] += 1f;
if (this.localAI[0] >= 10f)
{
this.localAI[0] = 0f;
int num888 = 17;
if ((base.Center - Main.player[Main.myPlayer].Center).Length() < (float)(Main.screenWidth + num888 * 16))
{
int num889 = (int)base.Center.X / 16;
int num890 = (int)base.Center.Y / 16;
for (int num891 = num889 - num888; num891 <= num889 + num888; num891++)
{
for (int num892 = num890 - num888; num892 <= num890 + num888; num892++)
{
if (Main.rand.Next(4) == 0)
{
Vector2 vector89 = new Vector2((float)(num889 - num891), (float)(num890 - num892));
if (vector89.Length() < (float)num888 && num891 > 0 && num891 < Main.maxTilesX - 1 && num892 > 0 && num892 < Main.maxTilesY - 1 && Main.tile[num891, num892] != null && Main.tile[num891, num892].active())
{
bool flag39 = false;
if (Main.tile[num891, num892].type == 185 && Main.tile[num891, num892].frameY == 18)
{
if (Main.tile[num891, num892].frameX >= 576 && Main.tile[num891, num892].frameX <= 882)
{
flag39 = true;
}
}
else if (Main.tile[num891, num892].type == 186 && Main.tile[num891, num892].frameX >= 864 && Main.tile[num891, num892].frameX <= 1170)
{
flag39 = true;
}
if (flag39 || Main.tileSpelunker[(int)Main.tile[num891, num892].type] || (Main.tileAlch[(int)Main.tile[num891, num892].type] && Main.tile[num891, num892].type != 82))
{
int num893 = Dust.NewDust(new Vector2((float)(num891 * 16), (float)(num892 * 16)), 16, 16, 204, 0f, 0f, 150, default(Color), 0.3f);
Main.dust[num893].fadeIn = 0.75f;
Main.dust[num893].velocity *= 0.1f;
Main.dust[num893].noLight = true;
}
}
}
}
}
}
}
Vector2 vector90 = Main.player[this.owner].Center - base.Center;
vector90.X += (float)(40 * this.direction);
vector90.Y -= 40f;
float num894 = vector90.Length();
if (num894 > 1000f)
{
base.Center = Main.player[this.owner].Center;
}
float num895 = 3f;
float num896 = 4f;
if (num894 > 200f)
{
num896 += (num894 - 200f) * 0.1f;
this.tileCollide = false;
}
if (num894 < num896)
{
this.velocity *= 0.25f;
num896 = num894;
}
if (vector90.X != 0f || vector90.Y != 0f)
{
vector90.Normalize();
vector90 *= num896;
}
this.velocity = (this.velocity * (num895 - 1f) + vector90) / num895;
if (this.velocity.Length() > 6f)
{
float num897 = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
if ((double)Math.Abs(this.rotation - num897) >= 3.14)
{
if (num897 < this.rotation)
{
this.rotation -= 6.28f;
}
else
{
this.rotation += 6.28f;
}
}
this.rotation = (this.rotation * 4f + num897) / 5f;
this.frameCounter++;
if (this.frameCounter > 4)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 7)
{
this.frame = 4;
}
}
if (this.frame < 4)
{
this.frame = 7;
return;
}
}
else
{
if ((double)this.rotation > 3.14)
{
this.rotation -= 6.28f;
}
if ((double)this.rotation > -0.01 && (double)this.rotation < 0.01)
{
this.rotation = 0f;
}
else
{
this.rotation *= 0.9f;
}
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 3)
{
this.frame = 0;
return;
}
}
}
}
else if (this.aiStyle == 91)
{
Vector2 center10 = base.Center;
this.scale = 1f - this.localAI[0];
this.width = (int)(20f * this.scale);
this.height = this.width;
this.position.X = center10.X - (float)(this.width / 2);
this.position.Y = center10.Y - (float)(this.height / 2);
if ((double)this.localAI[0] < 0.1)
{
this.localAI[0] += 0.01f;
}
else
{
this.localAI[0] += 0.025f;
}
if (this.localAI[0] >= 0.95f)
{
this.Kill();
}
this.velocity.X = this.velocity.X + this.ai[0] * 1.5f;
this.velocity.Y = this.velocity.Y + this.ai[1] * 1.5f;
if (this.velocity.Length() > 16f)
{
this.velocity.Normalize();
this.velocity *= 16f;
}
this.ai[0] *= 1.05f;
this.ai[1] *= 1.05f;
if (this.scale < 1f)
{
int num898 = 0;
while ((float)num898 < this.scale * 10f)
{
int num899 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100, default(Color), 1.1f);
Main.dust[num899].position = (Main.dust[num899].position + base.Center) / 2f;
Main.dust[num899].noGravity = true;
Main.dust[num899].velocity *= 0.1f;
Main.dust[num899].velocity -= this.velocity * (1.3f - this.scale);
Main.dust[num899].fadeIn = (float)(100 + this.owner);
Main.dust[num899].scale += this.scale * 0.75f;
num898++;
}
return;
}
}
else
{
if (this.aiStyle == 92)
{
this.tileCollide = false;
this.ai[1] += 1f;
if (this.ai[1] > 60f)
{
this.ai[0] += 10f;
}
if (this.ai[0] > 255f)
{
this.Kill();
this.ai[0] = 255f;
}
this.alpha = (int)(100.0 + (double)this.ai[0] * 0.7);
this.rotation += this.velocity.X * 0.1f;
this.rotation += (float)this.direction * 0.003f;
this.velocity *= 0.96f;
Rectangle rectangle6 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
for (int num900 = 0; num900 < 1000; num900++)
{
if (num900 != this.whoAmI && Main.projectile[num900].active && Main.projectile[num900].type >= 511 && Main.projectile[num900].type <= 513)
{
Rectangle value55 = new Rectangle((int)Main.projectile[num900].position.X, (int)Main.projectile[num900].position.Y, Main.projectile[num900].width, Main.projectile[num900].height);
if (rectangle6.Intersects(value55))
{
Vector2 vector91 = Main.projectile[num900].Center - base.Center;
if (vector91.X == 0f && vector91.Y == 0f)
{
if (num900 < this.whoAmI)
{
vector91.X = -1f;
vector91.Y = 1f;
}
else
{
vector91.X = 1f;
vector91.Y = -1f;
}
}
vector91.Normalize();
vector91 *= 0.005f;
this.velocity -= vector91;
Main.projectile[num900].velocity += vector91;
}
}
}
return;
}
if (this.aiStyle == 93)
{
if (this.alpha > 0)
{
this.alpha -= 25;
if (this.alpha <= 0)
{
this.alpha = 0;
}
}
if (this.velocity.Y > 18f)
{
this.velocity.Y = 18f;
}
if (this.ai[0] == 0f)
{
this.ai[1] += 1f;
if (this.ai[1] > 20f)
{
this.velocity.Y = this.velocity.Y + 0.1f;
this.velocity.X = this.velocity.X * 0.992f;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
return;
}
this.tileCollide = false;
if (this.ai[0] == 1f)
{
this.tileCollide = false;
this.velocity *= 0.6f;
}
else
{
this.tileCollide = false;
int num901 = (int)(-(int)this.ai[0]);
num901--;
this.position = Main.npc[num901].Center - this.velocity;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
if (!Main.npc[num901].active || Main.npc[num901].life < 0)
{
this.tileCollide = true;
this.ai[0] = 0f;
this.ai[1] = 20f;
this.velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
this.velocity.Normalize();
this.velocity *= 6f;
this.netUpdate = true;
}
else if (this.velocity.Length() > (float)((Main.npc[num901].width + Main.npc[num901].height) / 3))
{
this.velocity *= 0.99f;
}
}
if (this.ai[0] != 0f)
{
this.ai[1] += 1f;
if (this.ai[1] > 90f)
{
this.Kill();
return;
}
}
}
else
{
if (this.aiStyle == 94)
{
if (++this.frameCounter >= 4)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
this.ai[0] += 1f;
if (this.ai[0] <= 40f)
{
this.alpha -= 5;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.velocity *= 0.85f;
if (this.ai[0] == 40f)
{
this.netUpdate = true;
switch (Main.rand.Next(3))
{
case 0:
this.ai[1] = 10f;
break;
case 1:
this.ai[1] = 15f;
break;
case 2:
this.ai[1] = 30f;
break;
}
}
}
else if (this.ai[0] <= 60f)
{
this.velocity = Vector2.Zero;
if (this.ai[0] == 60f)
{
this.netUpdate = true;
}
}
else if (this.ai[0] <= 210f)
{
if (Main.netMode != 1 && (this.localAI[0] += 1f) >= this.ai[1])
{
this.localAI[0] = 0f;
int num902 = Item.NewItem((int)base.Center.X, (int)base.Center.Y, 0, 0, 73, 1, false, 0, false);
Main.item[num902].velocity = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * new Vector2(3f, 2f) * (Main.rand.NextFloat() * 0.5f + 0.5f) - Vector2.UnitY * 1f;
}
if (this.ai[0] == 210f)
{
this.netUpdate = true;
}
}
else
{
this.scale -= 0.0333333351f;
this.alpha += 15;
if (this.ai[0] == 239f)
{
this.netUpdate = true;
}
if (this.ai[0] == 240f)
{
this.Kill();
}
}
if (this.alpha < 90 && Main.rand.Next(3) == 0)
{
Vector2 vector92 = new Vector2((float)this.width, (float)this.height) * this.scale * 0.85f;
vector92 /= 2f;
Vector2 value56 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * vector92;
int num903 = Dust.NewDust(base.Center + value56, 0, 0, 246, 0f, 0f, 0, default(Color), 1f);
Main.dust[num903].position = base.Center + value56;
Main.dust[num903].velocity = Vector2.Zero;
}
float num904 = 0.8f;
float num905 = 0.709803939f;
float num906 = 0.282352954f;
Lighting.AddLight(base.Center, num904 * 0.3f, num905 * 0.3f, num906 * 0.3f);
return;
}
if (this.aiStyle == 95)
{
if (this.localAI[0] > 2f)
{
this.alpha -= 20;
if (this.alpha < 100)
{
this.alpha = 100;
}
}
else
{
this.localAI[0] += 1f;
}
if (this.ai[0] > 30f)
{
if (this.velocity.Y > -8f)
{
this.velocity.Y = this.velocity.Y - 0.05f;
}
this.velocity.X = this.velocity.X * 0.98f;
}
else
{
this.ai[0] += 1f;
}
this.rotation = this.velocity.X * 0.1f;
if (this.wet)
{
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y * 0.98f;
}
if (this.velocity.Y > -8f)
{
this.velocity.Y = this.velocity.Y - 0.2f;
}
this.velocity.X = this.velocity.X * 0.94f;
return;
}
}
else
{
if (this.aiStyle == 96)
{
this.ai[0] += 0.6f;
if (this.ai[0] > 500f)
{
this.Kill();
}
for (int num907 = 0; num907 < 2; num907++)
{
if (Main.rand.Next(3) != 0)
{
int num908 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 170, 0f, 0f, 100, default(Color), 1f);
Main.dust[num908].position = (Main.dust[num908].position + base.Center) / 2f;
Main.dust[num908].noGravity = true;
Main.dust[num908].velocity *= 0.1f;
if (num907 == 1)
{
Main.dust[num908].position += this.velocity / 2f;
}
float num909 = (800f - this.ai[0]) / 800f;
Main.dust[num908].scale *= num909 + 0.1f;
}
}
this.velocity.Y = this.velocity.Y + 0.008f;
return;
}
if (this.aiStyle == 97)
{
this.frameCounter++;
float num910 = 4f;
if ((float)this.frameCounter < num910 * 1f)
{
this.frame = 0;
}
else if ((float)this.frameCounter < num910 * 2f)
{
this.frame = 1;
}
else if ((float)this.frameCounter < num910 * 3f)
{
this.frame = 2;
}
else if ((float)this.frameCounter < num910 * 4f)
{
this.frame = 3;
}
else if ((float)this.frameCounter < num910 * 5f)
{
this.frame = 4;
}
else if ((float)this.frameCounter < num910 * 6f)
{
this.frame = 3;
}
else if ((float)this.frameCounter < num910 * 7f)
{
this.frame = 2;
}
else if ((float)this.frameCounter < num910 * 8f)
{
this.frame = 1;
}
else
{
this.frameCounter = 0;
this.frame = 0;
}
if (this.owner == Main.myPlayer)
{
for (int num911 = 0; num911 < 1000; num911++)
{
if (num911 != this.whoAmI && Main.projectile[num911].active && Main.projectile[num911].owner == this.owner && Main.projectile[num911].type == this.type)
{
if (this.timeLeft >= Main.projectile[num911].timeLeft)
{
Main.projectile[num911].Kill();
}
else
{
this.Kill();
}
}
}
}
if (this.ai[0] == 0f)
{
if ((double)this.velocity.Length() < 0.1)
{
this.velocity.X = 0f;
this.velocity.Y = 0f;
this.ai[0] = 1f;
this.ai[1] = 45f;
return;
}
this.velocity *= 0.94f;
if (this.velocity.X < 0f)
{
this.direction = -1;
}
else
{
this.direction = 1;
}
this.spriteDirection = this.direction;
return;
}
else
{
if (Main.player[this.owner].Center.X < base.Center.X)
{
this.direction = -1;
}
else
{
this.direction = 1;
}
this.spriteDirection = this.direction;
this.ai[1] += 1f;
float num912 = 0.005f;
if (this.ai[1] > 0f)
{
this.velocity.Y = this.velocity.Y - num912;
}
else
{
this.velocity.Y = this.velocity.Y + num912;
}
if (this.ai[1] >= 90f)
{
this.ai[1] *= -1f;
return;
}
}
}
else if (this.aiStyle == 98)
{
Vector2 value57 = new Vector2(this.ai[0], this.ai[1]);
Vector2 vector93 = value57 - base.Center;
if (vector93.Length() < this.velocity.Length())
{
this.Kill();
return;
}
vector93.Normalize();
vector93 *= 15f;
this.velocity = Vector2.Lerp(this.velocity, vector93, 0.1f);
for (int num913 = 0; num913 < 2; num913++)
{
int num914 = Dust.NewDust(base.Center, 0, 0, 228, 0f, 0f, 100, default(Color), 1f);
Main.dust[num914].noGravity = true;
Main.dust[num914].position += new Vector2(4f);
Main.dust[num914].scale += Main.rand.NextFloat() * 1f;
}
return;
}
else
{
if (this.aiStyle == 99 && this.type >= 556 && this.type <= 561)
{
this.AI_099_1();
return;
}
if (this.aiStyle == 99)
{
this.AI_099_2();
return;
}
if (this.aiStyle == 100)
{
Player player5 = Main.player[this.owner];
Vector2 zero2 = Vector2.Zero;
if (this.type == 535)
{
zero2.X = (float)player5.direction * 6f;
zero2.Y = player5.gravDir * -14f;
this.ai[0] += 1f;
int num915 = 0;
if (this.ai[0] >= 60f)
{
num915++;
}
if (this.ai[0] >= 180f)
{
num915++;
}
if (this.ai[0] >= 240f)
{
this.Kill();
return;
}
bool flag40 = false;
if (this.ai[0] == 60f || this.ai[0] == 180f)
{
flag40 = true;
}
bool flag41 = this.ai[0] >= 180f;
if (flag41)
{
if (this.frame < 8)
{
this.frame = 8;
}
if (this.frame >= 12)
{
this.frame = 8;
}
this.frameCounter++;
if (++this.frameCounter >= 5)
{
this.frameCounter = 0;
if (++this.frame >= 12)
{
this.frame = 8;
}
}
}
else if (++this.frameCounter >= 5)
{
this.frameCounter = 0;
if (++this.frame >= 8)
{
this.frame = 0;
}
}
Vector2 center11 = player5.Center;
Vector2 vector94 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - center11;
if (player5.gravDir == -1f)
{
vector94.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - center11.Y;
}
Vector2 velocity2 = new Vector2((float)Math.Sign((vector94.X == 0f) ? ((float)player5.direction) : vector94.X), 0f);
if (velocity2.X != this.velocity.X || velocity2.Y != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity = velocity2;
if (this.soundDelay <= 0 && !flag41)
{
this.soundDelay = 10;
this.soundDelay *= 2;
if (this.ai[0] != 1f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 15);
}
}
if (this.ai[0] == 181f)
{
Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 17);
}
if (this.ai[0] > 10f && !flag41)
{
Vector2 vector95 = base.Center + new Vector2((float)(player5.direction * 2), player5.gravDir * 5f);
float scaleFactor10 = MathHelper.Lerp(30f, 10f, (this.ai[0] - 10f) / 180f);
float num916 = Main.rand.NextFloat() * 6.28318548f;
for (float num917 = 0f; num917 < 1f; num917 += 1f)
{
Vector2 value58 = Vector2.UnitY.RotatedBy((double)(num917 / 1f * 6.28318548f + num916), default(Vector2));
Dust dust9 = Main.dust[Dust.NewDust(vector95, 0, 0, 228, 0f, 0f, 0, default(Color), 1f)];
dust9.position = vector95 + value58 * scaleFactor10;
dust9.noGravity = true;
dust9.customData = player5;
dust9.velocity = value58 * -2f;
}
}
if (this.ai[0] > 180f && this.ai[0] <= 182f)
{
Vector2 vector96 = base.Center + new Vector2((float)(player5.direction * 2), player5.gravDir * 5f);
float scaleFactor11 = MathHelper.Lerp(20f, 30f, (this.ai[0] - 180f) / 182f);
Main.rand.NextFloat();
for (float num918 = 0f; num918 < 10f; num918 += 1f)
{
Vector2 value59 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (Main.rand.NextFloat() * 0.5f + 0.5f);
Dust dust10 = Main.dust[Dust.NewDust(vector96, 0, 0, 228, 0f, 0f, 0, default(Color), 1f)];
dust10.position = vector96 + value59 * scaleFactor11;
dust10.noGravity = true;
dust10.customData = player5;
dust10.velocity = value59 * 4f;
dust10.scale = 0.5f + Main.rand.NextFloat();
}
}
if (Main.myPlayer == this.owner)
{
bool flag42 = !flag40 || player5.CheckMana(player5.inventory[player5.selectedItem].mana, true, false);
bool flag43 = player5.channel && flag42;
if ((!flag41 && !flag43) || this.ai[0] == 180f)
{
Vector2 vector97 = player5.Center + new Vector2((float)(player5.direction * 4), player5.gravDir * 2f);
int num919 = this.damage * (1 + num915);
vector97 = base.Center;
int num920 = 0;
float num921 = 0f;
for (int num922 = 0; num922 < 200; num922++)
{
NPC nPC9 = Main.npc[num922];
if (nPC9.active && base.Distance(nPC9.Center) < 500f && nPC9.CanBeChasedBy(this, false) && Collision.CanHitLine(nPC9.position, nPC9.width, nPC9.height, vector97, 0, 0))
{
Vector2 v4 = nPC9.Center - vector97;
num921 += v4.ToRotation();
num920++;
int num923 = Projectile.NewProjectile(vector97.X, vector97.Y, v4.X, v4.Y, 536, 0, 0f, this.owner, (float)this.whoAmI, 0f);
Main.projectile[num923].Center = nPC9.Center;
Main.projectile[num923].damage = num919;
Main.projectile[num923].Damage();
Main.projectile[num923].damage = 0;
Main.projectile[num923].Center = vector97;
this.ai[0] = 180f;
}
}
if (num920 != 0)
{
num921 /= (float)num920;
}
else
{
num921 = ((player5.direction == 1) ? 0f : 3.14159274f);
}
for (int num924 = 0; num924 < 6; num924++)
{
Vector2 vector98 = Vector2.Zero;
if (Main.rand.Next(4) != 0)
{
vector98 = Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)num921, default(Vector2)) * new Vector2(200f, 50f) * (Main.rand.NextFloat() * 0.7f + 0.3f);
}
else
{
vector98 = Vector2.UnitX.RotatedByRandom(6.2831854820251465) * new Vector2(200f, 50f) * (Main.rand.NextFloat() * 0.7f + 0.3f);
}
Projectile.NewProjectile(vector97.X, vector97.Y, vector98.X, vector98.Y, 536, 0, 0f, this.owner, (float)this.whoAmI, 0f);
}
this.ai[0] = 180f;
this.netUpdate = true;
}
}
Lighting.AddLight(base.Center, 0.9f, 0.75f, 0.1f);
}
this.rotation = ((player5.gravDir == 1f) ? 0f : 3.14159274f);
this.spriteDirection = this.direction;
this.timeLeft = 2;
Vector2 vector99 = Main.OffsetsPlayerOnhand[player5.bodyFrame.Y / 56] * 2f;
if (player5.direction != 1)
{
vector99.X = (float)player5.bodyFrame.Width - vector99.X;
}
vector99 -= (player5.bodyFrame.Size() - new Vector2((float)player5.width, 42f)) / 2f;
base.Center = (player5.position + vector99 + zero2 - this.velocity).Floor();
player5.ChangeDir(this.direction);
player5.heldProj = this.whoAmI;
player5.itemTime = 2;
player5.itemAnimation = 2;
return;
}
if (this.aiStyle == 101)
{
float num925 = 20f;
this.localAI[0] += 1f;
this.alpha = (int)MathHelper.Lerp(0f, 255f, this.localAI[0] / num925);
int num926 = (int)this.ai[0];
int num927 = -1;
int num928 = -1;
int num653 = this.type;
if (num653 != 536)
{
if (num653 == 591)
{
num928 = 1;
}
}
else
{
num927 = 535;
num928 = 0;
}
if (num928 == 1)
{
if (this.localAI[0] >= num925 || num926 < 0 || num926 > 255 || !Main.player[num926].active || Main.player[num926].dead)
{
this.Kill();
return;
}
if (this.type == 591)
{
base.Center = Mount.GetMinecartMechPoint(Main.player[num926], 20, -19) - this.velocity;
this.rotation = this.velocity.ToRotation() + 1.57079637f;
if (Math.Sign(this.velocity.X) != Math.Sign(Main.player[num926].velocity.X) && Main.player[num926].velocity.X != 0f)
{
this.Kill();
return;
}
}
else
{
base.Center = Main.player[num926].Center - this.velocity;
}
}
else if (num928 == 0)
{
if (this.localAI[0] >= num925 || num926 < 0 || num926 > 1000 || !Main.projectile[num926].active || Main.projectile[num926].type != num927)
{
this.Kill();
return;
}
base.Center = Main.projectile[num926].Center - this.velocity;
}
this.rotation = this.velocity.ToRotation() + 1.57079637f;
return;
}
if (this.aiStyle == 102)
{
int num929 = 0;
float num930 = 0f;
float x2 = 0f;
float y2 = 0f;
int num931 = -1;
int num932 = 0;
float num933 = 0f;
bool flag44 = true;
bool flag45 = false;
bool flag46 = false;
int num653 = this.type;
if (num653 != 539)
{
switch (num653)
{
case 573:
num929 = 424;
num930 = 90f;
num933 = 20f;
flag44 = false;
flag45 = true;
break;
case 574:
num929 = 420;
num930 = 180f;
x2 = 0.15f;
y2 = 0.075f;
num933 = 8f;
flag44 = false;
num931 = 576;
num932 = 65;
if (Main.expertMode)
{
num932 = 50;
}
flag46 = true;
break;
}
}
else
{
num929 = 407;
num930 = 210f;
x2 = 0.15f;
y2 = 0.075f;
num933 = 16f;
}
if (flag46)
{
int num934 = (int)this.ai[1];
if (!Main.npc[num934].active || Main.npc[num934].type != num929)
{
this.Kill();
return;
}
this.timeLeft = 2;
}
this.ai[0] += 1f;
if (this.ai[0] < num930)
{
bool flag47 = true;
int num935 = (int)this.ai[1];
if (Main.npc[num935].active && Main.npc[num935].type == num929)
{
if (!flag45 && Main.npc[num935].oldPos[1] != Vector2.Zero)
{
this.position += Main.npc[num935].position - Main.npc[num935].oldPos[1];
}
}
else
{
this.ai[0] = num930;
flag47 = false;
}
if (flag47 && !flag45)
{
this.velocity += new Vector2((float)Math.Sign(Main.npc[num935].Center.X - base.Center.X), (float)Math.Sign(Main.npc[num935].Center.Y - base.Center.Y)) * new Vector2(x2, y2);
if (this.velocity.Length() > 6f)
{
this.velocity *= 6f / this.velocity.Length();
}
}
if (this.type == 539)
{
if (Main.rand.Next(12) == 0)
{
int num936 = Dust.NewDust(base.Center, 8, 8, 180, 0f, 0f, 0, default(Color), 1f);
Main.dust[num936].position = base.Center;
Main.dust[num936].velocity *= 0.2f;
Main.dust[num936].noGravity = true;
}
if (++this.frameCounter >= 4)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
this.rotation = this.velocity.X * 0.1f;
}
if (this.type == 573)
{
if (Main.rand.Next(2) == 0)
{
int num937 = Dust.NewDust(base.Center, 8, 8, 242, 0f, 0f, 0, default(Color), 1f);
Main.dust[num937].position = base.Center;
Main.dust[num937].velocity = this.velocity;
Main.dust[num937].noGravity = true;
Main.dust[num937].scale = 1.5f;
}
this.alpha = 255;
}
if (this.type == 574)
{
if (Main.rand.Next(10) == 0)
{
int num938 = Dust.NewDust(base.Center, 8, 8, 242, 0f, 0f, 0, default(Color), 1f);
Main.dust[num938].position = base.Center;
Main.dust[num938].velocity = this.velocity;
Main.dust[num938].noGravity = true;
Main.dust[num938].scale = 1.5f;
}
if (flag47)
{
int target = Main.npc[num935].target;
float num939 = this.velocity.ToRotation();
if (Collision.CanHitLine(base.Center, 0, 0, Main.player[target].Center, 0, 0))
{
num939 = base.DirectionTo(Main.player[target].Center).ToRotation();
}
this.rotation = this.rotation.AngleLerp(num939 + 1.57079637f, 0.2f);
}
this.frame = 1;
}
}
if (this.ai[0] == num930)
{
bool flag48 = true;
int num940 = -1;
if (!flag44)
{
int num941 = (int)this.ai[1];
if (Main.npc[num941].active && Main.npc[num941].type == num929)
{
num940 = Main.npc[num941].target;
}
else
{
flag48 = false;
}
}
else
{
flag48 = false;
}
if (!flag48)
{
num940 = (int)Player.FindClosest(this.position, this.width, this.height);
}
Vector2 value60 = Main.player[num940].Center - base.Center;
value60.X += (float)Main.rand.Next(-50, 51);
value60.Y += (float)Main.rand.Next(-50, 51);
value60.X *= (float)Main.rand.Next(80, 121) * 0.01f;
value60.Y *= (float)Main.rand.Next(80, 121) * 0.01f;
Vector2 vector100 = Vector2.Normalize(value60);
if (vector100.HasNaNs())
{
vector100 = Vector2.UnitY;
}
if (num931 == -1)
{
this.velocity = vector100 * num933;
this.netUpdate = true;
}
else
{
if (Main.netMode != 1 && Collision.CanHitLine(base.Center, 0, 0, Main.player[num940].Center, 0, 0))
{
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector100.X * num933, vector100.Y * num933, num931, num932, 1f, Main.myPlayer, 0f, 0f);
}
this.ai[0] = 0f;
}
}
if (this.ai[0] >= num930)
{
this.rotation = this.rotation.AngleLerp(this.velocity.ToRotation() + 1.57079637f, 0.4f);
if (this.type == 539)
{
if (++this.frameCounter >= 2)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
if (Main.rand.Next(2) == 0)
{
int num942 = Dust.NewDust(this.position, this.width, this.height, 180, 0f, 0f, 100, default(Color), 1f);
Main.dust[num942].scale += (float)Main.rand.Next(50) * 0.01f;
Main.dust[num942].noGravity = true;
Main.dust[num942].velocity *= 0.1f;
Main.dust[num942].fadeIn = Main.rand.NextFloat() * 1.5f;
}
if (Main.rand.Next(3) == 0)
{
int num943 = Dust.NewDust(this.position, this.width, this.height, 176, 0f, 0f, 100, default(Color), 1f);
Main.dust[num943].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
Main.dust[num943].noGravity = true;
Main.dust[num943].velocity *= 0.1f;
Main.dust[num943].fadeIn = Main.rand.NextFloat() * 1.5f;
}
}
if (this.type == 573)
{
if (Main.rand.Next(4) == 0)
{
int num944 = Dust.NewDust(base.Center, 8, 8, 242, 0f, 0f, 0, default(Color), 1f);
Main.dust[num944].position = base.Center;
Main.dust[num944].velocity *= 0.2f;
Main.dust[num944].noGravity = true;
Main.dust[num944].scale = 1.5f;
}
this.alpha = 0;
return;
}
}
}
else if (this.aiStyle == 103)
{
this.scale = this.ai[1];
this.ai[0] += 1f;
if (this.ai[0] >= 30f)
{
this.alpha += 25;
if (this.alpha >= 250)
{
this.Kill();
return;
}
}
else if (this.ai[0] >= 0f)
{
this.alpha -= 25;
if (this.alpha < 0)
{
this.alpha = 0;
if (this.localAI[1] == 0f && Main.netMode != 1 && this.localAI[0] != 0f)
{
this.localAI[1] = 1f;
NPC.NewNPC((int)base.Center.X, (int)base.Bottom.Y, (int)this.localAI[0], 0, 0f, 0f, 0f, 0f, 255);
return;
}
}
}
}
else
{
if (this.aiStyle == 104)
{
if (this.ai[0] == 1f)
{
this.scale *= 0.995f;
this.alpha += 3;
if (this.alpha >= 250)
{
this.Kill();
}
}
else
{
this.scale *= 1.01f;
this.alpha -= 7;
if (this.alpha < 0)
{
this.alpha = 0;
this.ai[0] = 1f;
}
}
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 3)
{
this.frame = 0;
}
}
this.velocity.Y = this.velocity.Y - 0.03f;
this.velocity.X = this.velocity.X * 0.97f;
return;
}
if (this.aiStyle == 105)
{
float num945 = 1f - (float)this.alpha / 255f;
num945 *= this.scale;
Lighting.AddLight(base.Center, 0.2f * num945, 0.275f * num945, 0.075f * num945);
this.localAI[0] += 1f;
if (this.localAI[0] >= 90f)
{
this.localAI[0] *= -1f;
}
if (this.localAI[0] >= 0f)
{
this.scale += 0.003f;
}
else
{
this.scale -= 0.003f;
}
this.rotation += 0.0025f * this.scale;
float num946 = 1f;
float num947 = 1f;
if (this.identity % 6 == 0)
{
num947 *= -1f;
}
if (this.identity % 6 == 1)
{
num946 *= -1f;
}
if (this.identity % 6 == 2)
{
num947 *= -1f;
num946 *= -1f;
}
if (this.identity % 6 == 3)
{
num947 = 0f;
}
if (this.identity % 6 == 4)
{
num946 = 0f;
}
this.localAI[1] += 1f;
if (this.localAI[1] > 60f)
{
this.localAI[1] = -180f;
}
if (this.localAI[1] >= -60f)
{
this.velocity.X = this.velocity.X + 0.002f * num947;
this.velocity.Y = this.velocity.Y + 0.002f * num946;
}
else
{
this.velocity.X = this.velocity.X - 0.002f * num947;
this.velocity.Y = this.velocity.Y - 0.002f * num946;
}
this.ai[0] += 1f;
if (this.ai[0] > 5400f)
{
this.damage = 0;
this.ai[1] = 1f;
if (this.alpha < 255)
{
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
}
}
else if (this.owner == Main.myPlayer)
{
this.Kill();
}
}
else
{
float num948 = (base.Center - Main.player[this.owner].Center).Length() / 100f;
if (num948 > 4f)
{
num948 *= 1.1f;
}
if (num948 > 5f)
{
num948 *= 1.2f;
}
if (num948 > 6f)
{
num948 *= 1.3f;
}
if (num948 > 7f)
{
num948 *= 1.4f;
}
if (num948 > 8f)
{
num948 *= 1.5f;
}
if (num948 > 9f)
{
num948 *= 1.6f;
}
if (num948 > 10f)
{
num948 *= 1.7f;
}
if (!Main.player[this.owner].sporeSac)
{
num948 += 100f;
}
this.ai[0] += num948;
if (this.alpha > 50)
{
this.alpha -= 10;
if (this.alpha < 50)
{
this.alpha = 50;
}
}
}
bool flag49 = false;
Vector2 center12 = new Vector2(0f, 0f);
float num949 = 280f;
for (int num950 = 0; num950 < 200; num950++)
{
if (Main.npc[num950].CanBeChasedBy(this, false))
{
float num951 = Main.npc[num950].position.X + (float)(Main.npc[num950].width / 2);
float num952 = Main.npc[num950].position.Y + (float)(Main.npc[num950].height / 2);
float num953 = Math.Abs(this.position.X + (float)(this.width / 2) - num951) + Math.Abs(this.position.Y + (float)(this.height / 2) - num952);
if (num953 < num949)
{
num949 = num953;
center12 = Main.npc[num950].Center;
flag49 = true;
}
}
}
if (flag49)
{
Vector2 vector101 = center12 - base.Center;
vector101.Normalize();
vector101 *= 0.75f;
this.velocity = (this.velocity * 10f + vector101) / 11f;
return;
}
if ((double)this.velocity.Length() > 0.2)
{
this.velocity *= 0.98f;
return;
}
}
else if (this.aiStyle == 106)
{
this.rotation += this.velocity.X * 0.02f;
if (this.velocity.X < 0f)
{
this.rotation -= Math.Abs(this.velocity.Y) * 0.02f;
}
else
{
this.rotation += Math.Abs(this.velocity.Y) * 0.02f;
}
this.velocity *= 0.98f;
this.ai[0] += 1f;
if (this.ai[0] >= 60f)
{
if (this.alpha < 255)
{
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
return;
}
}
else if (this.owner == Main.myPlayer)
{
this.Kill();
return;
}
}
else if (this.alpha > 80)
{
this.alpha -= 30;
if (this.alpha < 80)
{
this.alpha = 80;
return;
}
}
}
else if (this.aiStyle == 107)
{
float num954 = 10f;
float scaleFactor12 = 5f;
float num955 = 40f;
if (this.type == 575)
{
if (this.timeLeft > 30 && this.alpha > 0)
{
this.alpha -= 25;
}
if (this.timeLeft > 30 && this.alpha < 128 && Collision.SolidCollision(this.position, this.width, this.height))
{
this.alpha = 128;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (++this.frameCounter > 4)
{
this.frameCounter = 0;
if (++this.frame >= 4)
{
this.frame = 0;
}
}
Lighting.AddLight(base.Center, 0.5f, 0.1f, 0.3f);
}
else if (this.type == 596)
{
num954 = 10f;
scaleFactor12 = 7.5f;
if (this.timeLeft > 30 && this.alpha > 0)
{
this.alpha -= 25;
}
if (this.timeLeft > 30 && this.alpha < 128 && Collision.SolidCollision(this.position, this.width, this.height))
{
this.alpha = 128;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (++this.frameCounter > 4)
{
this.frameCounter = 0;
if (++this.frame >= 4)
{
this.frame = 0;
}
}
float num956 = 0.5f;
if (this.timeLeft < 120)
{
num956 = 1.1f;
}
if (this.timeLeft < 60)
{
num956 = 1.6f;
}
this.ai[1] += 1f;
float arg_282A8_0 = this.ai[1] / 180f;
for (float num957 = 0f; num957 < 3f; num957 += 1f)
{
if (Main.rand.Next(3) != 0)
{
return;
}
Dust dust11 = Main.dust[Dust.NewDust(base.Center, 0, 0, 27, 0f, -2f, 0, default(Color), 1f)];
dust11.position = base.Center + Vector2.UnitY.RotatedBy((double)(num957 * 6.28318548f / 3f + this.ai[1]), default(Vector2)) * 10f;
dust11.noGravity = true;
dust11.velocity = base.DirectionFrom(dust11.position);
dust11.scale = num956;
dust11.fadeIn = 0.5f;
dust11.alpha = 200;
}
if (this.timeLeft < 4)
{
int num958 = 40;
if (Main.expertMode)
{
num958 = 30;
}
this.position = base.Center;
this.width = (this.height = 60);
base.Center = this.position;
this.damage = num958;
for (int num959 = 0; num959 < 10; num959++)
{
Dust dust11 = Main.dust[Dust.NewDust(this.position, this.width, this.height, Utils.SelectRandom<int>(Main.rand, new int[]
{
27,
6
}), 0f, -2f, 0, default(Color), 1f)];
dust11.noGravity = true;
if (dust11.position != base.Center)
{
dust11.velocity = base.DirectionTo(dust11.position) * 3f;
}
}
}
}
int num960 = (int)this.ai[0];
if (num960 >= 0 && Main.player[num960].active && !Main.player[num960].dead)
{
if (base.Distance(Main.player[num960].Center) > num955)
{
Vector2 vector102 = base.DirectionTo(Main.player[num960].Center);
if (vector102.HasNaNs())
{
vector102 = Vector2.UnitY;
}
this.velocity = (this.velocity * (num954 - 1f) + vector102 * scaleFactor12) / num954;
return;
}
}
else
{
if (this.timeLeft > 30)
{
this.timeLeft = 30;
}
if (this.ai[0] != -1f)
{
this.ai[0] = -1f;
this.netUpdate = true;
return;
}
}
}
else if (this.aiStyle == 108)
{
if (this.type == 578 && this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
int num961 = (int)Player.FindClosest(base.Center, 0, 0);
Vector2 vector103 = Main.player[num961].Center - base.Center;
if (vector103 == Vector2.Zero)
{
vector103 = Vector2.UnitY;
}
this.ai[1] = vector103.ToRotation();
this.netUpdate = true;
}
this.ai[0] += 1f;
if (this.ai[0] <= 50f)
{
if (this.type == 579)
{
if (Main.rand.Next(4) == 0)
{
Vector2 vector104 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust12 = Main.dust[Dust.NewDust(base.Center - vector104 * 30f, 0, 0, 229, 0f, 0f, 0, default(Color), 1f)];
dust12.noGravity = true;
dust12.position = base.Center - vector104 * (float)Main.rand.Next(10, 21);
dust12.velocity = vector104.RotatedBy(1.5707963705062866, default(Vector2)) * 4f;
dust12.scale = 0.5f + Main.rand.NextFloat();
dust12.fadeIn = 0.5f;
}
if (Main.rand.Next(4) == 0)
{
Vector2 vector105 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust13 = Main.dust[Dust.NewDust(base.Center - vector105 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust13.noGravity = true;
dust13.position = base.Center - vector105 * 30f;
dust13.velocity = vector105.RotatedBy(-1.5707963705062866, default(Vector2)) * 2f;
dust13.scale = 0.5f + Main.rand.NextFloat();
dust13.fadeIn = 0.5f;
}
}
if (this.type == 578 && Main.rand.Next(2) == 0)
{
Vector2 vector106 = this.ai[1].ToRotationVector2();
Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21);
Vector2 value61 = vector106 * (float)Main.rand.Next(-80, 81);
Vector2 vector108 = value61 - vector107;
vector108 /= 10f;
int num962 = 229;
Dust dust14 = Main.dust[Dust.NewDust(base.Center, 0, 0, num962, 0f, 0f, 0, default(Color), 1f)];
dust14.noGravity = true;
dust14.position = base.Center + vector107;
dust14.velocity = vector108;
dust14.scale = 0.5f + Main.rand.NextFloat();
dust14.fadeIn = 0.5f;
value61 = vector106 * (float)Main.rand.Next(40, 121);
vector108 = value61 - vector107 / 2f;
vector108 /= 10f;
dust14 = Main.dust[Dust.NewDust(base.Center, 0, 0, num962, 0f, 0f, 0, default(Color), 1f)];
dust14.noGravity = true;
dust14.position = base.Center + vector107 / 2f;
dust14.velocity = vector108;
dust14.scale = 1f + Main.rand.NextFloat();
return;
}
}
else if (this.ai[0] <= 90f)
{
this.scale = (this.ai[0] - 50f) / 40f;
this.alpha = 255 - (int)(255f * this.scale);
this.rotation -= 0.157079637f;
if (this.type == 579)
{
if (Main.rand.Next(2) == 0)
{
Vector2 vector109 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust15 = Main.dust[Dust.NewDust(base.Center - vector109 * 30f, 0, 0, 229, 0f, 0f, 0, default(Color), 1f)];
dust15.noGravity = true;
dust15.position = base.Center - vector109 * (float)Main.rand.Next(10, 21);
dust15.velocity = vector109.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust15.scale = 0.5f + Main.rand.NextFloat();
dust15.fadeIn = 0.5f;
dust15.customData = base.Center;
}
if (Main.rand.Next(2) == 0)
{
Vector2 vector110 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust16 = Main.dust[Dust.NewDust(base.Center - vector110 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust16.noGravity = true;
dust16.position = base.Center - vector110 * 30f;
dust16.velocity = vector110.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f;
dust16.scale = 0.5f + Main.rand.NextFloat();
dust16.fadeIn = 0.5f;
dust16.customData = base.Center;
}
}
if (this.type == 578)
{
Vector2 vector111 = this.ai[1].ToRotationVector2();
Vector2 value62 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21);
vector111 *= (float)Main.rand.Next(-80, 81);
Vector2 vector112 = vector111 - value62;
vector112 /= 10f;
int num963 = Utils.SelectRandom<int>(Main.rand, new int[]
{
229,
229
});
Dust dust17 = Main.dust[Dust.NewDust(base.Center, 0, 0, num963, 0f, 0f, 0, default(Color), 1f)];
dust17.noGravity = true;
dust17.position = base.Center + value62;
dust17.velocity = vector112;
dust17.scale = 0.5f + Main.rand.NextFloat();
dust17.fadeIn = 0.5f;
if (this.ai[0] == 90f && Main.netMode != 1)
{
Vector2 vector113 = this.ai[1].ToRotationVector2() * 8f;
float ai2 = (float)Main.rand.Next(80);
Projectile.NewProjectile(base.Center.X - vector113.X, base.Center.Y - vector113.Y, vector113.X, vector113.Y, 580, 15, 1f, Main.myPlayer, this.ai[1], ai2);
return;
}
}
else if (this.type == 579 && this.ai[0] == 90f && Main.netMode != 1)
{
for (int num964 = 0; num964 < 2; num964++)
{
int num965 = NPC.NewNPC((int)base.Center.X, (int)base.Center.Y, 427, this.whoAmI, 0f, 0f, 0f, 0f, 255);
Main.npc[num965].velocity = -Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (float)Main.rand.Next(4, 9) - Vector2.UnitY * 2f;
Main.npc[num965].netUpdate = true;
}
return;
}
}
else
{
if (this.ai[0] > 120f)
{
this.scale = 1f - (this.ai[0] - 120f) / 60f;
this.alpha = 255 - (int)(255f * this.scale);
this.rotation -= 0.104719758f;
if (this.alpha >= 255)
{
this.Kill();
}
for (int num966 = 0; num966 < 2; num966++)
{
int num967 = Main.rand.Next(3);
if (num967 == 0)
{
Vector2 vector114 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * this.scale;
Dust dust18 = Main.dust[Dust.NewDust(base.Center - vector114 * 30f, 0, 0, 229, 0f, 0f, 0, default(Color), 1f)];
dust18.noGravity = true;
dust18.position = base.Center - vector114 * (float)Main.rand.Next(10, 21);
dust18.velocity = vector114.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust18.scale = 0.5f + Main.rand.NextFloat();
dust18.fadeIn = 0.5f;
dust18.customData = base.Center;
}
else if (num967 == 1)
{
Vector2 vector115 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * this.scale;
Dust dust19 = Main.dust[Dust.NewDust(base.Center - vector115 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust19.noGravity = true;
dust19.position = base.Center - vector115 * 30f;
dust19.velocity = vector115.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f;
dust19.scale = 0.5f + Main.rand.NextFloat();
dust19.fadeIn = 0.5f;
dust19.customData = base.Center;
}
}
return;
}
this.scale = 1f;
this.alpha = 0;
this.rotation -= 0.05235988f;
if (Main.rand.Next(2) == 0)
{
Vector2 vector116 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust20 = Main.dust[Dust.NewDust(base.Center - vector116 * 30f, 0, 0, 229, 0f, 0f, 0, default(Color), 1f)];
dust20.noGravity = true;
dust20.position = base.Center - vector116 * (float)Main.rand.Next(10, 21);
dust20.velocity = vector116.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust20.scale = 0.5f + Main.rand.NextFloat();
dust20.fadeIn = 0.5f;
dust20.customData = base.Center;
return;
}
Vector2 vector117 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust21 = Main.dust[Dust.NewDust(base.Center - vector117 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust21.noGravity = true;
dust21.position = base.Center - vector117 * 30f;
dust21.velocity = vector117.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f;
dust21.scale = 0.5f + Main.rand.NextFloat();
dust21.fadeIn = 0.5f;
dust21.customData = base.Center;
return;
}
}
else
{
if (this.aiStyle == 109)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = this.velocity.Length();
}
if (this.ai[0] == 0f)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 30f)
{
this.ai[0] = 1f;
this.localAI[0] = 0f;
return;
}
}
else if (this.ai[0] == 1f)
{
Vector2 value63 = Vector2.Zero;
if (this.type != 582 || !Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].type != 124)
{
this.Kill();
return;
}
value63 = Main.npc[(int)this.ai[1]].Center;
this.tileCollide = false;
float num968 = this.localAI[1];
Vector2 vector118 = value63 - base.Center;
if (vector118.Length() < num968)
{
this.Kill();
return;
}
vector118.Normalize();
vector118 *= num968;
this.velocity = Vector2.Lerp(this.velocity, vector118, 0.04f);
}
this.rotation += 0.314159274f;
return;
}
if (this.aiStyle == 110)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = this.velocity.Length();
}
Vector2 value64 = Vector2.Zero;
if (!Main.npc[(int)this.ai[0]].active || !Main.npc[(int)this.ai[0]].townNPC)
{
this.Kill();
return;
}
value64 = Main.npc[(int)this.ai[0]].Center;
float num969 = this.localAI[1];
Vector2 vector119 = value64 - base.Center;
if (vector119.Length() < num969 || base.Hitbox.Intersects(Main.npc[(int)this.ai[0]].Hitbox))
{
this.Kill();
int num970 = Main.npc[(int)this.ai[0]].lifeMax - Main.npc[(int)this.ai[0]].life;
if (num970 > 20)
{
num970 = 20;
}
if (num970 > 0)
{
Main.npc[(int)this.ai[0]].life += num970;
Main.npc[(int)this.ai[0]].HealEffect(num970, true);
}
return;
}
vector119.Normalize();
vector119 *= num969;
if (vector119.Y < this.velocity.Y)
{
vector119.Y = this.velocity.Y;
}
vector119.Y += 1f;
this.velocity = Vector2.Lerp(this.velocity, vector119, 0.04f);
this.rotation += this.velocity.X * 0.05f;
return;
}
else if (this.aiStyle == 111)
{
if (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].type != 20 || Main.npc[(int)this.ai[1]].ai[0] != 14f)
{
this.Kill();
return;
}
this.ai[0] += 1f;
this.rotation += 0.0104719754f;
this.scale = this.ai[0] / 100f;
if (this.scale > 1f)
{
this.scale = 1f;
}
this.alpha = (int)(255f * (1f - this.scale));
float num971 = 300f;
if (this.ai[0] >= 100f)
{
num971 = MathHelper.Lerp(300f, 600f, (this.ai[0] - 100f) / 200f);
}
if (num971 > 600f)
{
num971 = 600f;
}
if (this.ai[0] >= 500f)
{
this.alpha = (int)MathHelper.Lerp(0f, 255f, (this.ai[0] - 500f) / 100f);
num971 = MathHelper.Lerp(600f, 1200f, (this.ai[0] - 500f) / 100f);
this.rotation += 0.0104719754f;
}
if (Main.rand.Next(4) == 0)
{
float scaleFactor13 = num971;
Vector2 value65 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
float num972 = (float)Main.rand.Next(3, 9);
value65.Normalize();
int num973 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, 0f, 0f, 100, default(Color), 1f);
Main.dust[num973].noGravity = true;
Main.dust[num973].position = base.Center + value65 * scaleFactor13;
if (Main.rand.Next(8) == 0)
{
Main.dust[num973].velocity = value65 * -num972 * 3f;
Main.dust[num973].scale += 0.5f;
}
else
{
Main.dust[num973].velocity = value65 * -num972;
}
}
if (Main.rand.Next(2) == 0)
{
Vector2 value66 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
float num974 = (float)Main.rand.Next(3, 9);
value66.Normalize();
int num975 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num975].noGravity = true;
Main.dust[num975].position = base.Center + value66 * 30f;
if (Main.rand.Next(8) == 0)
{
Main.dust[num975].velocity = value66 * -num974 * 3f;
Main.dust[num975].scale += 0.5f;
}
else
{
Main.dust[num975].velocity = value66 * -num974;
}
}
if (this.ai[0] >= 30f && Main.netMode != 2)
{
Player player6 = Main.player[Main.myPlayer];
if (player6.active && !player6.dead && base.Distance(player6.Center) <= num971 && player6.HasBuff(165) == -1)
{
player6.AddBuff(165, 120, true);
}
}
if (this.ai[0] >= 30f && this.ai[0] % 10f == 0f && Main.netMode != 1)
{
for (int num976 = 0; num976 < 200; num976++)
{
NPC nPC10 = Main.npc[num976];
if (nPC10.type != 488 && nPC10.active && base.Distance(nPC10.Center) <= num971)
{
if (nPC10.townNPC && (nPC10.HasBuff(165) == -1 || nPC10.buffTime[nPC10.HasBuff(165)] <= 20))
{
nPC10.AddBuff(165, 120, false);
}
else if (!nPC10.friendly && nPC10.lifeMax > 5 && !nPC10.dontTakeDamage && (nPC10.HasBuff(186) == -1 || nPC10.buffTime[nPC10.HasBuff(186)] <= 20) && (nPC10.dryadBane || Collision.CanHit(base.Center, 1, 1, nPC10.position, nPC10.width, nPC10.height)))
{
nPC10.AddBuff(186, 120, false);
}
}
}
}
if (this.ai[0] >= 570f)
{
this.Kill();
return;
}
}
else if (this.aiStyle == 112)
{
if (this.type == 590)
{
if (++this.frameCounter >= 4)
{
this.frameCounter = 0;
if (++this.frame >= 3)
{
this.frame = 0;
}
}
if (this.alpha > 0)
{
this.alpha -= 15;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha == 0)
{
float num977 = (float)Main.rand.Next(28, 42) * 0.005f;
num977 += (float)(270 - (int)Main.mouseTextColor) / 500f;
float num978 = 0.1f;
float num979 = 0.3f + num977 / 2f;
float num980 = 0.6f + num977;
float num981 = 0.35f;
num978 *= num981;
num979 *= num981;
num980 *= num981;
Lighting.AddLight(base.Center, num978, num979, num980);
}
this.velocity = new Vector2(0f, (float)Math.Sin((double)(6.28318548f * this.ai[0] / 180f)) * 0.15f);
this.ai[0] += 1f;
if (this.ai[0] >= 180f)
{
this.ai[0] = 0f;
}
}
if (this.type == 644)
{
Color newColor2 = Main.hslToRgb(this.ai[0], 1f, 0.5f);
int num982 = (int)this.ai[1];
if (num982 < 0 || num982 >= 1000 || (!Main.projectile[num982].active && Main.projectile[num982].type != 643))
{
this.ai[1] = -1f;
}
else
{
DelegateMethods.v3_1 = newColor2.ToVector3() * 0.5f;
Utils.PlotTileLine(base.Center, Main.projectile[num982].Center, 8f, new Utils.PerLinePoint(DelegateMethods.CastLight));
}
if (this.localAI[0] == 0f)
{
this.localAI[0] = Main.rand.NextFloat() * 0.8f + 0.8f;
this.direction = ((Main.rand.Next(2) > 0) ? 1 : -1);
}
this.rotation = this.localAI[1] / 40f * 6.28318548f * (float)this.direction;
if (this.alpha > 0)
{
this.alpha -= 8;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha == 0)
{
Lighting.AddLight(base.Center, newColor2.ToVector3() * 0.5f);
}
for (int num983 = 0; num983 < 2; num983++)
{
if (Main.rand.Next(10) == 0)
{
Vector2 value67 = Vector2.UnitY.RotatedBy((double)((float)num983 * 3.14159274f), default(Vector2)).RotatedBy((double)this.rotation, default(Vector2));
Dust dust22 = Main.dust[Dust.NewDust(base.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)];
dust22.noGravity = true;
dust22.noLight = true;
dust22.scale = this.Opacity * this.localAI[0];
dust22.position = base.Center;
dust22.velocity = value67 * 2.5f;
}
}
for (int num984 = 0; num984 < 2; num984++)
{
if (Main.rand.Next(10) == 0)
{
Vector2 value68 = Vector2.UnitY.RotatedBy((double)((float)num984 * 3.14159274f), default(Vector2));
Dust dust23 = Main.dust[Dust.NewDust(base.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)];
dust23.noGravity = true;
dust23.noLight = true;
dust23.scale = this.Opacity * this.localAI[0];
dust23.position = base.Center;
dust23.velocity = value68 * 2.5f;
}
}
if (Main.rand.Next(10) == 0)
{
float scaleFactor14 = 1f + Main.rand.NextFloat() * 2f;
float fadeIn = 1f + Main.rand.NextFloat();
float num985 = 1f + Main.rand.NextFloat();
Vector2 vector120 = Utils.RandomVector2(Main.rand, -1f, 1f);
if (vector120 != Vector2.Zero)
{
vector120.Normalize();
}
vector120 *= 20f + Main.rand.NextFloat() * 100f;
Vector2 vector121 = base.Center + vector120;
Point point3 = vector121.ToTileCoordinates();
bool flag50 = true;
if (!WorldGen.InWorld(point3.X, point3.Y, 0))
{
flag50 = false;
}
if (flag50 && WorldGen.SolidTile(point3.X, point3.Y))
{
flag50 = false;
}
if (flag50)
{
Dust dust24 = Main.dust[Dust.NewDust(vector121, 0, 0, 267, 0f, 0f, 127, newColor2, 1f)];
dust24.noGravity = true;
dust24.position = vector121;
dust24.velocity = -Vector2.UnitY * scaleFactor14 * (Main.rand.NextFloat() * 0.9f + 1.6f);
dust24.fadeIn = fadeIn;
dust24.scale = num985;
dust24.noLight = true;
Dust dust25 = Dust.CloneDust(dust24);
dust25.scale *= 0.65f;
dust25.fadeIn *= 0.65f;
dust25.color = new Color(255, 255, 255, 255);
}
}
this.scale = this.Opacity / 2f * this.localAI[0];
this.velocity = Vector2.Zero;
this.localAI[1] += 1f;
if (this.localAI[1] >= 60f)
{
this.Kill();
return;
}
}
}
else if (this.aiStyle == 113)
{
int num986 = 25;
if (this.type == 614)
{
num986 = 63;
}
if (this.alpha > 0)
{
this.alpha -= num986;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[0] == 0f)
{
bool flag51 = this.type == 614;
if (flag51)
{
int num987 = (int)this.ai[1];
if (!Main.npc[num987].active)
{
this.Kill();
return;
}
this.velocity.ToRotation();
Vector2 vector122 = Main.npc[num987].Center - base.Center;
if (vector122 != Vector2.Zero)
{
vector122.Normalize();
vector122 *= 14f;
}
float num988 = 5f;
this.velocity = (this.velocity * (num988 - 1f) + vector122) / num988;
}
else
{
this.ai[1] += 1f;
if (this.ai[1] >= 45f)
{
float num989 = 0.98f;
float num990 = 0.35f;
if (this.type == 636)
{
num989 = 0.995f;
num990 = 0.15f;
}
this.ai[1] = 45f;
this.velocity.X = this.velocity.X * num989;
this.velocity.Y = this.velocity.Y + num990;
}
this.rotation = this.velocity.ToRotation() + 1.57079637f;
}
}
if (this.ai[0] == 1f)
{
this.ignoreWater = true;
this.tileCollide = false;
int num991 = 15;
if (this.type == 636)
{
num991 = 5 * this.MaxUpdates;
}
bool flag52 = false;
bool flag53 = false;
this.localAI[0] += 1f;
if (this.localAI[0] % 30f == 0f)
{
flag53 = true;
}
int num992 = (int)this.ai[1];
if (this.localAI[0] >= (float)(60 * num991))
{
flag52 = true;
}
else if (num992 < 0 || num992 >= 200)
{
flag52 = true;
}
else if (Main.npc[num992].active && !Main.npc[num992].dontTakeDamage)
{
base.Center = Main.npc[num992].Center - this.velocity * 2f;
this.gfxOffY = Main.npc[num992].gfxOffY;
if (flag53)
{
Main.npc[num992].HitEffect(0, 1.0);
}
}
else
{
flag52 = true;
}
if (flag52)
{
this.Kill();
}
}
if (this.type == 614)
{
Lighting.AddLight(base.Center, 0.2f, 0.6f, 0.7f);
}
if (this.type == 636)
{
Lighting.AddLight(base.Center, 0.8f, 0.7f, 0.4f);
return;
}
}
else if (this.aiStyle == 114)
{
if (Main.netMode == 2 && this.localAI[0] == 0f)
{
PortalHelper.SyncPortalSections(base.Center, 1);
this.localAI[0] = 1f;
}
this.timeLeft = 3;
bool flag54 = false;
if (!Main.player[this.owner].active || Main.player[this.owner].dead || base.Distance(Main.player[this.owner].Center) > 12800f)
{
flag54 = true;
}
if (!flag54 && !WorldGen.InWorld((int)base.Center.X / 16, (int)base.Center.Y / 16, Lighting.offScreenTiles))
{
flag54 = true;
}
if (!flag54 && !PortalHelper.SupportedTilesAreFine(base.Center, this.ai[0]))
{
flag54 = true;
}
if (flag54)
{
this.Kill();
return;
}
Color portalColor = PortalHelper.GetPortalColor(this.owner, (int)this.ai[1]);
this.alpha -= 25;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha == 0)
{
Lighting.AddLight(base.Center + this.velocity * 3f, portalColor.ToVector3() * 0.5f);
}
if (++this.frameCounter >= 6)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
this.rotation = this.ai[0] - 1.57079637f;
return;
}
else if (this.aiStyle == 115)
{
Lighting.AddLight(base.Center, new Vector3(0.075f, 0.3f, 0.15f));
this.velocity *= 0.985f;
this.rotation += this.velocity.X * 0.2f;
if (this.velocity.X > 0f)
{
this.rotation += 0.08f;
}
else
{
this.rotation -= 0.08f;
}
this.ai[1] += 1f;
if (this.ai[1] > 30f)
{
this.alpha += 10;
if (this.alpha >= 255)
{
this.alpha = 255;
this.Kill();
return;
}
}
}
else
{
if (this.aiStyle == 116)
{
if (this.localAI[0] == 0f)
{
this.rotation = this.ai[1];
this.localAI[0] = 1f;
}
Player player7 = Main.player[this.owner];
if (player7.setSolar)
{
this.timeLeft = 2;
}
float num993 = (float)player7.miscCounter / 300f * 12.566371f + this.ai[1];
num993 = MathHelper.WrapAngle(num993);
this.rotation = this.rotation.AngleLerp(num993, 0.05f);
this.alpha -= 15;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.velocity = this.rotation.ToRotationVector2() * 100f - player7.velocity;
base.Center = player7.Center - this.velocity;
return;
}
if (this.aiStyle == 117)
{
this.ai[1] += 0.01f;
this.scale = this.ai[1];
this.ai[0] += 1f;
if (this.ai[0] >= (float)(3 * Main.projFrames[this.type]))
{
this.Kill();
return;
}
if (++this.frameCounter >= 3)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.hide = true;
}
}
this.alpha -= 63;
if (this.alpha < 0)
{
this.alpha = 0;
}
bool flag55 = this.type == 612;
bool flag56 = this.type == 624;
if (flag55)
{
Lighting.AddLight(base.Center, 0.9f, 0.8f, 0.6f);
}
if (this.ai[0] == 1f)
{
this.position = base.Center;
this.width = (this.height = (int)(52f * this.scale));
base.Center = this.position;
this.Damage();
if (flag55)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num994 = 0; num994 < 4; num994++)
{
int num995 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num995].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)this.width / 2f;
}
for (int num996 = 0; num996 < 10; num996++)
{
int num997 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 200, default(Color), 2.7f);
Main.dust[num997].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)this.width / 2f;
Main.dust[num997].noGravity = true;
Main.dust[num997].velocity *= 3f;
num997 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num997].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)this.width / 2f;
Main.dust[num997].velocity *= 2f;
Main.dust[num997].noGravity = true;
Main.dust[num997].fadeIn = 2.5f;
}
for (int num998 = 0; num998 < 5; num998++)
{
int num999 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 0, default(Color), 2.7f);
Main.dust[num999].position = base.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)this.velocity.ToRotation(), default(Vector2)) * (float)this.width / 2f;
Main.dust[num999].noGravity = true;
Main.dust[num999].velocity *= 3f;
}
for (int num1000 = 0; num1000 < 10; num1000++)
{
int num1001 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 0, default(Color), 1.5f);
Main.dust[num1001].position = base.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)this.velocity.ToRotation(), default(Vector2)) * (float)this.width / 2f;
Main.dust[num1001].noGravity = true;
Main.dust[num1001].velocity *= 3f;
}
}
if (flag56)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num1002 = 0; num1002 < 20; num1002++)
{
int num1003 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num1003].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)this.width / 2f;
Main.dust[num1003].velocity *= 2f;
Main.dust[num1003].noGravity = true;
Main.dust[num1003].fadeIn = 2.5f;
}
for (int num1004 = 0; num1004 < 15; num1004++)
{
int num1005 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 0, default(Color), 2.7f);
Main.dust[num1005].position = base.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)this.velocity.ToRotation(), default(Vector2)) * (float)this.width / 2f;
Main.dust[num1005].noGravity = true;
Main.dust[num1005].velocity *= 3f;
}
float num1006 = (float)Main.rand.NextDouble() * 6.28318548f;
float num1007 = (float)Main.rand.NextDouble() * 6.28318548f;
float num1008 = (float)Main.rand.NextDouble() * 6.28318548f;
float num1009 = 7f + (float)Main.rand.NextDouble() * 7f;
float num1010 = 7f + (float)Main.rand.NextDouble() * 7f;
float num1011 = 7f + (float)Main.rand.NextDouble() * 7f;
float num1012 = num1009;
if (num1010 > num1012)
{
num1012 = num1010;
}
if (num1011 > num1012)
{
num1012 = num1011;
}
for (int num1013 = 0; num1013 < 200; num1013++)
{
int num1014 = 135;
float scaleFactor15 = num1012;
if (num1013 > 50)
{
scaleFactor15 = num1010;
}
if (num1013 > 100)
{
scaleFactor15 = num1009;
}
if (num1013 > 150)
{
scaleFactor15 = num1011;
}
int num1015 = Dust.NewDust(this.position, 6, 6, num1014, 0f, 0f, 100, default(Color), 1f);
Vector2 vector123 = Main.dust[num1015].velocity;
Main.dust[num1015].position = base.Center;
vector123.Normalize();
vector123 *= scaleFactor15;
if (num1013 > 150)
{
vector123.Y *= 0.5f;
vector123 = vector123.RotatedBy((double)num1008, default(Vector2));
}
else if (num1013 > 100)
{
vector123.X *= 0.5f;
vector123 = vector123.RotatedBy((double)num1006, default(Vector2));
}
else if (num1013 > 50)
{
vector123.Y *= 0.5f;
vector123 = vector123.RotatedBy((double)num1007, default(Vector2));
}
Main.dust[num1015].velocity *= 0.2f;
Main.dust[num1015].velocity += vector123;
if (num1013 <= 200)
{
Main.dust[num1015].scale = 2f;
Main.dust[num1015].noGravity = true;
Main.dust[num1015].fadeIn = Main.rand.NextFloat() * 2f;
if (Main.rand.Next(4) == 0)
{
Main.dust[num1015].fadeIn = 2.5f;
}
Main.dust[num1015].noLight = true;
if (num1013 < 100)
{
Main.dust[num1015].position += Main.dust[num1015].velocity * 20f;
Main.dust[num1015].velocity *= -1f;
}
}
}
return;
}
}
}
else if (this.aiStyle == 118)
{
this.ai[0] += 1f;
int num1016 = 0;
if (this.velocity.Length() <= 4f)
{
num1016 = 1;
}
this.alpha -= 15;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (num1016 == 0)
{
this.rotation -= 0.104719758f;
if (Main.rand.Next(3) == 0)
{
if (Main.rand.Next(2) == 0)
{
Vector2 vector124 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust26 = Main.dust[Dust.NewDust(base.Center - vector124 * 30f, 0, 0, Utils.SelectRandom<int>(Main.rand, new int[]
{
86,
90
}), 0f, 0f, 0, default(Color), 1f)];
dust26.noGravity = true;
dust26.position = base.Center - vector124 * (float)Main.rand.Next(10, 21);
dust26.velocity = vector124.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust26.scale = 0.5f + Main.rand.NextFloat();
dust26.fadeIn = 0.5f;
dust26.customData = this;
}
else
{
Vector2 vector125 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust27 = Main.dust[Dust.NewDust(base.Center - vector125 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust27.noGravity = true;
dust27.position = base.Center - vector125 * 30f;
dust27.velocity = vector125.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f;
dust27.scale = 0.5f + Main.rand.NextFloat();
dust27.fadeIn = 0.5f;
dust27.customData = this;
}
}
if (this.ai[0] >= 30f)
{
this.velocity *= 0.98f;
this.scale += 0.00744680827f;
this.rotation -= 0.0174532924f;
}
if (this.velocity.Length() < 4.1f)
{
this.velocity.Normalize();
this.velocity *= 4f;
this.ai[0] = 0f;
}
}
else if (num1016 == 1)
{
this.rotation -= 0.104719758f;
for (int num1017 = 0; num1017 < 1; num1017++)
{
if (Main.rand.Next(2) == 0)
{
Vector2 vector126 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust28 = Main.dust[Dust.NewDust(base.Center - vector126 * 30f, 0, 0, 86, 0f, 0f, 0, default(Color), 1f)];
dust28.noGravity = true;
dust28.position = base.Center - vector126 * (float)Main.rand.Next(10, 21);
dust28.velocity = vector126.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust28.scale = 0.9f + Main.rand.NextFloat();
dust28.fadeIn = 0.5f;
dust28.customData = this;
vector126 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
dust28 = Main.dust[Dust.NewDust(base.Center - vector126 * 30f, 0, 0, 90, 0f, 0f, 0, default(Color), 1f)];
dust28.noGravity = true;
dust28.position = base.Center - vector126 * (float)Main.rand.Next(10, 21);
dust28.velocity = vector126.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust28.scale = 0.9f + Main.rand.NextFloat();
dust28.fadeIn = 0.5f;
dust28.customData = this;
dust28.color = Color.Crimson;
}
else
{
Vector2 vector127 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust29 = Main.dust[Dust.NewDust(base.Center - vector127 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust29.noGravity = true;
dust29.position = base.Center - vector127 * (float)Main.rand.Next(20, 31);
dust29.velocity = vector127.RotatedBy(-1.5707963705062866, default(Vector2)) * 5f;
dust29.scale = 0.9f + Main.rand.NextFloat();
dust29.fadeIn = 0.5f;
dust29.customData = this;
}
}
if (this.ai[0] % 30f == 0f && this.ai[0] < 241f && Main.myPlayer == this.owner)
{
Vector2 vector128 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * 12f;
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector128.X, vector128.Y, 618, this.damage, 0f, this.owner, 0f, (float)this.whoAmI);
}
Vector2 vector129 = base.Center;
float num1018 = 800f;
bool flag57 = false;
int num1019 = 0;
if (this.ai[1] == 0f)
{
for (int num1020 = 0; num1020 < 200; num1020++)
{
if (Main.npc[num1020].CanBeChasedBy(this, false))
{
Vector2 center13 = Main.npc[num1020].Center;
if (base.Distance(center13) < num1018 && Collision.CanHit(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), 1, 1, Main.npc[num1020].position, Main.npc[num1020].width, Main.npc[num1020].height))
{
num1018 = base.Distance(center13);
vector129 = center13;
flag57 = true;
num1019 = num1020;
}
}
}
if (flag57)
{
if (this.ai[1] != (float)(num1019 + 1))
{
this.netUpdate = true;
}
this.ai[1] = (float)(num1019 + 1);
}
flag57 = false;
}
if (this.ai[1] != 0f)
{
int num1021 = (int)(this.ai[1] - 1f);
if (Main.npc[num1021].active && Main.npc[num1021].CanBeChasedBy(this, true) && base.Distance(Main.npc[num1021].Center) < 1000f)
{
flag57 = true;
vector129 = Main.npc[num1021].Center;
}
}
if (!this.friendly)
{
flag57 = false;
}
if (flag57)
{
float num1022 = 4f;
Vector2 vector130 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num1023 = vector129.X - vector130.X;
float num1024 = vector129.Y - vector130.Y;
float num1025 = (float)Math.Sqrt((double)(num1023 * num1023 + num1024 * num1024));
num1025 = num1022 / num1025;
num1023 *= num1025;
num1024 *= num1025;
int num1026 = 8;
this.velocity.X = (this.velocity.X * (float)(num1026 - 1) + num1023) / (float)num1026;
this.velocity.Y = (this.velocity.Y * (float)(num1026 - 1) + num1024) / (float)num1026;
}
}
if (this.alpha < 150)
{
Lighting.AddLight(base.Center, 0.7f, 0.2f, 0.6f);
}
if (this.ai[0] >= 600f)
{
this.Kill();
return;
}
}
else if (this.aiStyle == 119)
{
int num1027 = 0;
float num1028 = 0f;
float x3 = 0f;
float y3 = 0f;
bool flag58 = false;
bool flag59 = false;
int num653 = this.type;
if (num653 == 618)
{
num1027 = 617;
num1028 = 420f;
x3 = 0.15f;
y3 = 0.15f;
}
if (flag59)
{
int num1029 = (int)this.ai[1];
if (!Main.projectile[num1029].active || Main.projectile[num1029].type != num1027)
{
this.Kill();
return;
}
this.timeLeft = 2;
}
this.ai[0] += 1f;
if (this.ai[0] < num1028)
{
bool flag60 = true;
int num1030 = (int)this.ai[1];
if (Main.projectile[num1030].active && Main.projectile[num1030].type == num1027)
{
if (!flag58 && Main.projectile[num1030].oldPos[1] != Vector2.Zero)
{
this.position += Main.projectile[num1030].position - Main.projectile[num1030].oldPos[1];
}
if (base.Center.HasNaNs())
{
this.Kill();
return;
}
}
else
{
this.ai[0] = num1028;
flag60 = false;
this.Kill();
}
if (flag60 && !flag58)
{
this.velocity += new Vector2((float)Math.Sign(Main.projectile[num1030].Center.X - base.Center.X), (float)Math.Sign(Main.projectile[num1030].Center.Y - base.Center.Y)) * new Vector2(x3, y3);
if (this.velocity.Length() > 6f)
{
this.velocity *= 6f / this.velocity.Length();
}
}
if (this.type == 618)
{
if (Main.rand.Next(2) == 0)
{
int num1031 = Dust.NewDust(base.Center, 8, 8, 86, 0f, 0f, 0, default(Color), 1f);
Main.dust[num1031].position = base.Center;
Main.dust[num1031].velocity = this.velocity;
Main.dust[num1031].noGravity = true;
Main.dust[num1031].scale = 1.5f;
if (flag60)
{
Main.dust[num1031].customData = Main.projectile[(int)this.ai[1]];
}
}
this.alpha = 255;
return;
}
this.Kill();
return;
}
}
else if (this.aiStyle == 120)
{
Player player8 = Main.player[this.owner];
if (!player8.active)
{
this.active = false;
return;
}
bool flag61 = this.type == 623;
Vector2 vector131 = player8.Center;
float num1032 = 100f;
float num1033 = 300f;
float num1034 = 100f;
float num1035 = 100f;
if (flag61)
{
if (player8.dead)
{
player8.stardustGuardian = false;
}
if (player8.stardustGuardian)
{
this.timeLeft = 2;
}
num1032 = 150f;
num1033 = 250f;
num1034 = 200f;
vector131.X -= (float)((5 + player8.width / 2) * player8.direction);
vector131.Y -= 25f;
Lighting.AddLight(base.Center, 0.9f, 0.9f, 0.7f);
if (this.ai[0] != 3f && this.alpha == 255)
{
this.alpha = 0;
for (int num1036 = 0; num1036 < 30; num1036++)
{
int num1037 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 200, default(Color), 1.7f);
Main.dust[num1037].noGravity = true;
Main.dust[num1037].velocity *= 3f;
num1037 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f);
Main.dust[num1037].velocity *= 2f;
Main.dust[num1037].noGravity = true;
Main.dust[num1037].fadeIn = 2.5f;
}
}
if (this.localAI[0] > 0f)
{
this.localAI[0] -= 1f;
}
}
if (this.ai[0] != 0f)
{
Main.player[this.owner].tankPet = this.whoAmI;
Main.player[this.owner].tankPetReset = false;
}
if (this.ai[0] == 0f)
{
if (player8.HasMinionTarget)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
base.Center = Vector2.Lerp(base.Center, vector131, 0.2f);
this.velocity *= 0.8f;
this.direction = (this.spriteDirection = player8.direction);
if (flag61 && ++this.frameCounter >= 9)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type] - 4)
{
this.frame = 0;
}
}
}
else if (this.ai[0] == 1f)
{
if (player8.HasMinionTarget)
{
vector131 = player8.MinionTargetPoint;
}
else
{
this.ai[0] = 0f;
this.netUpdate = true;
}
int num1038 = -1;
bool flag62 = true;
if (flag61 && Math.Abs(base.Center.X - vector131.X) > num1032 + 20f)
{
flag62 = false;
}
if (flag62)
{
for (int num1039 = 0; num1039 < 200; num1039++)
{
NPC nPC11 = Main.npc[num1039];
if (nPC11.CanBeChasedBy(this, false))
{
float num1040 = base.Distance(nPC11.Center);
if (num1040 < num1033)
{
num1038 = num1039;
}
}
}
}
if (num1038 != -1)
{
NPC nPC12 = Main.npc[num1038];
this.direction = (this.spriteDirection = (nPC12.Center.X > base.Center.X).ToDirectionInt());
float num1041 = Math.Abs(vector131.X - base.Center.X);
float num1042 = Math.Abs(nPC12.Center.X - base.Center.X);
float num1043 = Math.Abs(vector131.Y - base.Center.Y);
float num1044 = Math.Abs(nPC12.Center.Y - base.Bottom.Y);
float num1045 = (float)(nPC12.Center.Y > base.Bottom.Y).ToDirectionInt();
if ((num1041 < num1032 || (vector131.X - base.Center.X) * (float)this.direction < 0f) && num1042 > 20f && num1042 < num1032 - num1041 + 100f)
{
this.velocity.X = this.velocity.X + 0.1f * (float)this.direction;
}
else
{
this.velocity.X = this.velocity.X * 0.7f;
}
if ((num1043 < num1035 || (vector131.Y - base.Bottom.Y) * num1045 < 0f) && num1044 > 10f && num1044 < num1035 - num1043 + 10f)
{
this.velocity.Y = this.velocity.Y + 0.1f * num1045;
}
else
{
this.velocity.Y = this.velocity.Y * 0.7f;
}
if (this.localAI[0] == 0f && this.owner == Main.myPlayer && num1042 < num1034)
{
this.ai[1] = 0f;
this.ai[0] = 2f;
this.netUpdate = true;
this.localAI[0] = 90f;
}
}
else
{
if (Math.Abs(vector131.X - base.Center.X) > num1032 + 40f)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
else if (Math.Abs(vector131.X - base.Center.X) > 20f)
{
this.direction = (this.spriteDirection = (vector131.X > base.Center.X).ToDirectionInt());
this.velocity.X = this.velocity.X + 0.06f * (float)this.direction;
}
else
{
this.velocity.X = this.velocity.X * 0.8f;
this.direction = (this.spriteDirection = (player8.Center.X < base.Center.X).ToDirectionInt());
}
if (Math.Abs(vector131.Y - base.Center.Y) > num1035)
{
this.ai[0] = 3f;
this.netUpdate = true;
}
else if (Math.Abs(vector131.Y - base.Center.Y) > 10f)
{
this.velocity.Y = this.velocity.Y + 0.06f * (float)Math.Sign(vector131.Y - base.Center.Y);
}
else
{
this.velocity.Y = this.velocity.Y * 0.8f;
}
}
if (flag61 && ++this.frameCounter >= 9)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type] - 4)
{
this.frame = 0;
}
}
}
else if (this.ai[0] == 2f)
{
this.velocity.X = this.velocity.X * 0.9f;
this.ai[1] += 1f;
float num1046 = 0f;
if (flag61)
{
num1046 = 20f;
if (this.ai[1] == 10f && this.owner == Main.myPlayer)
{
int num1047 = (int)(20f * Main.player[this.owner].minionDamage);
Projectile.NewProjectile(base.Center.X, base.Center.Y, 0f, 0f, 624, num1047, 6f, this.owner, 0f, 5f);
}
}
if (this.ai[1] >= num1046)
{
this.ai[1] = 0f;
this.ai[0] = 1f;
this.netUpdate = true;
}
if (flag61)
{
if (this.frame < Main.projFrames[this.type] - 4)
{
this.frame = Main.projFrames[this.type] - 1;
this.frameCounter = 0;
}
if (++this.frameCounter >= 5)
{
this.frameCounter = 0;
if (--this.frame < Main.projFrames[this.type] - 5)
{
this.frame = Main.projFrames[this.type] - 1;
}
}
}
}
if (this.ai[0] == 3f)
{
if (player8.HasMinionTarget)
{
vector131 = player8.MinionTargetPoint;
}
else
{
this.ai[0] = 0f;
this.netUpdate = true;
}
if (this.alpha == 0)
{
this.alpha = 255;
for (int num1048 = 0; num1048 < 30; num1048++)
{
int num1049 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 200, default(Color), 1.7f);
Main.dust[num1049].noGravity = true;
Main.dust[num1049].velocity *= 3f;
num1049 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f);
Main.dust[num1049].velocity *= 2f;
Main.dust[num1049].noGravity = true;
Main.dust[num1049].fadeIn = 2.5f;
}
}
else
{
for (int num1050 = 0; num1050 < 2; num1050++)
{
int num1051 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 200, default(Color), 1.7f);
Main.dust[num1051].noGravity = true;
Main.dust[num1051].velocity *= 3f;
Main.dust[num1051].noLight = true;
num1051 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f);
Main.dust[num1051].velocity *= 2f;
Main.dust[num1051].noGravity = true;
Main.dust[num1051].fadeIn = 2.5f;
Main.dust[num1051].noLight = true;
}
}
this.velocity *= 0.7f;
base.Center = Vector2.Lerp(base.Center, vector131, 0.2f);
if (base.Distance(vector131) < 10f)
{
this.ai[0] = 1f;
this.netUpdate = true;
return;
}
}
}
else if (this.aiStyle == 121)
{
Player player9 = Main.player[this.owner];
if ((int)Main.time % 120 == 0)
{
this.netUpdate = true;
}
if (!player9.active)
{
this.active = false;
return;
}
bool flag63 = this.type == 625;
bool flag64 = this.type == 625 || this.type == 626 || this.type == 627 || this.type == 628;
int num1052 = 10;
int num1053 = 10;
float num1054 = 0.01f;
if (flag64)
{
if (player9.dead)
{
player9.stardustDragon = false;
}
if (player9.stardustDragon)
{
this.timeLeft = 2;
}
num1052 = 30;
num1053 = 50;
num1054 = 0.2f;
if (Main.rand.Next(30) == 0)
{
int num1055 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 0, default(Color), 2f);
Main.dust[num1055].noGravity = true;
Main.dust[num1055].fadeIn = 2f;
Point point4 = Main.dust[num1055].position.ToTileCoordinates();
if (WorldGen.InWorld(point4.X, point4.Y, 5) && WorldGen.SolidTile(point4.X, point4.Y))
{
Main.dust[num1055].noLight = true;
}
}
}
if (flag63)
{
Vector2 center14 = player9.Center;
float num1056 = 700f;
float num1057 = 1000f;
int num1058 = -1;
if (base.Distance(center14) > 2000f)
{
base.Center = center14;
this.netUpdate = true;
}
bool flag65 = true;
if (flag65)
{
for (int num1059 = 0; num1059 < 200; num1059++)
{
NPC nPC13 = Main.npc[num1059];
if (nPC13.CanBeChasedBy(this, false) && player9.Distance(nPC13.Center) < num1057)
{
float num1060 = base.Distance(nPC13.Center);
if (num1060 < num1056)
{
num1058 = num1059;
bool arg_2D71A_0 = nPC13.boss;
}
}
}
}
if (num1058 != -1)
{
NPC nPC14 = Main.npc[num1058];
Vector2 vector132 = nPC14.Center - base.Center;
(vector132.X > 0f).ToDirectionInt();
(vector132.Y > 0f).ToDirectionInt();
float scaleFactor16 = 0.4f;
if (vector132.Length() < 600f)
{
scaleFactor16 = 0.6f;
}
if (vector132.Length() < 300f)
{
scaleFactor16 = 0.8f;
}
if (vector132.Length() > nPC14.Size.Length() * 0.75f)
{
this.velocity += Vector2.Normalize(vector132) * scaleFactor16 * 1.5f;
if (Vector2.Dot(this.velocity, vector132) < 0.25f)
{
this.velocity *= 0.8f;
}
}
float num1061 = 30f;
if (this.velocity.Length() > num1061)
{
this.velocity = Vector2.Normalize(this.velocity) * num1061;
}
}
else
{
float num1062 = 0.2f;
Vector2 vector133 = center14 - base.Center;
if (vector133.Length() < 200f)
{
num1062 = 0.12f;
}
if (vector133.Length() < 140f)
{
num1062 = 0.06f;
}
if (vector133.Length() > 100f)
{
if (Math.Abs(center14.X - base.Center.X) > 20f)
{
this.velocity.X = this.velocity.X + num1062 * (float)Math.Sign(center14.X - base.Center.X);
}
if (Math.Abs(center14.Y - base.Center.Y) > 10f)
{
this.velocity.Y = this.velocity.Y + num1062 * (float)Math.Sign(center14.Y - base.Center.Y);
}
}
else if (this.velocity.Length() > 2f)
{
this.velocity *= 0.96f;
}
if (Math.Abs(this.velocity.Y) < 1f)
{
this.velocity.Y = this.velocity.Y - 0.1f;
}
float num1063 = 15f;
if (this.velocity.Length() > num1063)
{
this.velocity = Vector2.Normalize(this.velocity) * num1063;
}
}
this.rotation = this.velocity.ToRotation() + 1.57079637f;
int direction = this.direction;
this.direction = (this.spriteDirection = ((this.velocity.X > 0f) ? 1 : -1));
if (direction != this.direction)
{
this.netUpdate = true;
}
this.position = base.Center;
this.scale = 1f + this.localAI[0] * 0.01f;
this.width = (this.height = (int)((float)num1052 * this.scale));
base.Center = this.position;
if (this.alpha > 0)
{
for (int num1064 = 0; num1064 < 2; num1064++)
{
int num1065 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, 0f, 0f, 100, default(Color), 2f);
Main.dust[num1065].noGravity = true;
Main.dust[num1065].noLight = true;
}
this.alpha -= 42;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
this.damage = (int)((float)num1053 * (1f + this.localAI[0] * num1054) * player9.minionDamage);
return;
}
bool flag66 = false;
Vector2 value69 = Vector2.Zero;
Vector2 arg_2DBC1_0 = Vector2.Zero;
float num1066 = 0f;
float scaleFactor17 = 0f;
float scaleFactor18 = 1f;
if (this.ai[1] == 1f)
{
this.ai[1] = 0f;
this.netUpdate = true;
}
if (flag64 && this.owner != Main.myPlayer && Main.projectile[(int)this.ai[0]].identity != (int)this.ai[0])
{
int num1067 = (int)this.ai[0];
for (int num1068 = 0; num1068 < 1000; num1068++)
{
Projectile projectile2 = Main.projectile[num1068];
if (projectile2 != this && projectile2.owner == this.owner && projectile2.identity == num1067)
{
this.ai[0] = (float)num1067;
break;
}
}
}
if (flag64 && Main.projectile[(int)this.ai[0]].active && (Main.projectile[(int)this.ai[0]].type == 625 || Main.projectile[(int)this.ai[0]].type == 626 || Main.projectile[(int)this.ai[0]].type == 627))
{
flag66 = true;
value69 = Main.projectile[(int)this.ai[0]].Center;
Vector2 arg_2DD4C_0 = Main.projectile[(int)this.ai[0]].velocity;
num1066 = Main.projectile[(int)this.ai[0]].rotation;
scaleFactor18 = Main.projectile[(int)this.ai[0]].scale;
scaleFactor17 = 16f;
int arg_2DD9A_0 = Main.projectile[(int)this.ai[0]].alpha;
Main.projectile[(int)this.ai[0]].localAI[0] = this.localAI[0] + 1f;
if (Main.projectile[(int)this.ai[0]].type != 625)
{
Main.projectile[(int)this.ai[0]].localAI[1] = (float)this.whoAmI;
}
if (this.owner == Main.myPlayer && Main.projectile[(int)this.ai[0]].type == 625 && this.type == 628)
{
Main.projectile[(int)this.ai[0]].Kill();
this.Kill();
return;
}
}
if (!flag66)
{
return;
}
if (this.alpha > 0)
{
for (int num1069 = 0; num1069 < 2; num1069++)
{
int num1070 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 2f);
Main.dust[num1070].noGravity = true;
Main.dust[num1070].noLight = true;
}
}
this.alpha -= 42;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.velocity = Vector2.Zero;
Vector2 vector134 = value69 - base.Center;
if (num1066 != this.rotation)
{
float num1071 = MathHelper.WrapAngle(num1066 - this.rotation);
vector134 = vector134.RotatedBy((double)(num1071 * 0.1f), default(Vector2));
}
this.rotation = vector134.ToRotation() + 1.57079637f;
this.position = base.Center;
this.scale = scaleFactor18;
this.width = (this.height = (int)((float)num1052 * this.scale));
base.Center = this.position;
if (vector134 != Vector2.Zero)
{
base.Center = value69 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18;
}
this.spriteDirection = ((vector134.X > 0f) ? 1 : -1);
this.damage = (int)((float)num1053 * (1f + this.localAI[0] * num1054) * player9.minionDamage);
return;
}
else if (this.aiStyle == 122)
{
int num1072 = (int)this.ai[0];
bool flag67 = false;
if (num1072 == -1 || !Main.npc[num1072].active)
{
flag67 = true;
}
if (flag67)
{
if (this.type == 629)
{
this.Kill();
return;
}
if (this.type == 631 && this.ai[0] != -1f)
{
this.ai[0] = -1f;
this.netUpdate = true;
}
}
if (!flag67 && base.Hitbox.Intersects(Main.npc[num1072].Hitbox))
{
this.Kill();
if (this.type == 631)
{
this.localAI[1] = 1f;
this.Damage();
}
return;
}
if (this.type == 629)
{
Vector2 value70 = Main.npc[num1072].Center - base.Center;
this.velocity = Vector2.Normalize(value70) * 5f;
Dust.QuickDust(base.Center, Color.Red);
}
if (this.type == 631)
{
if (this.ai[1] > 0f)
{
this.ai[1] -= 1f;
this.velocity = Vector2.Zero;
return;
}
if (flag67)
{
if (this.velocity == Vector2.Zero)
{
this.Kill();
}
this.tileCollide = true;
this.alpha += 10;
if (this.alpha > 255)
{
this.Kill();
}
}
else
{
Vector2 value71 = Main.npc[num1072].Center - base.Center;
this.velocity = Vector2.Normalize(value71) * 12f;
this.alpha -= 15;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
this.rotation = this.velocity.ToRotation() - 1.57079637f;
return;
}
}
else if (this.aiStyle == 123)
{
bool flag68 = this.type == 641;
bool flag69 = this.type == 643;
float num1073 = 1000f;
this.velocity = Vector2.Zero;
if (flag68)
{
this.alpha -= 5;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.direction == 0)
{
this.direction = Main.player[this.owner].direction;
}
this.rotation -= (float)this.direction * 6.28318548f / 120f;
this.scale = this.Opacity;
Lighting.AddLight(base.Center, new Vector3(0.3f, 0.9f, 0.7f) * this.Opacity);
if (Main.rand.Next(2) == 0)
{
Vector2 vector135 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust30 = Main.dust[Dust.NewDust(base.Center - vector135 * 30f, 0, 0, 229, 0f, 0f, 0, default(Color), 1f)];
dust30.noGravity = true;
dust30.position = base.Center - vector135 * (float)Main.rand.Next(10, 21);
dust30.velocity = vector135.RotatedBy(1.5707963705062866, default(Vector2)) * 6f;
dust30.scale = 0.5f + Main.rand.NextFloat();
dust30.fadeIn = 0.5f;
dust30.customData = base.Center;
}
if (Main.rand.Next(2) == 0)
{
Vector2 vector136 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust31 = Main.dust[Dust.NewDust(base.Center - vector136 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust31.noGravity = true;
dust31.position = base.Center - vector136 * 30f;
dust31.velocity = vector136.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f;
dust31.scale = 0.5f + Main.rand.NextFloat();
dust31.fadeIn = 0.5f;
dust31.customData = base.Center;
}
if (this.ai[0] < 0f)
{
Vector2 center15 = base.Center;
int num1074 = Dust.NewDust(center15 - Vector2.One * 8f, 16, 16, 229, this.velocity.X / 2f, this.velocity.Y / 2f, 0, default(Color), 1f);
Main.dust[num1074].velocity *= 2f;
Main.dust[num1074].noGravity = true;
Main.dust[num1074].scale = Utils.SelectRandom<float>(Main.rand, new float[]
{
0.8f,
1.65f
});
Main.dust[num1074].customData = this;
}
}
if (flag69)
{
this.alpha -= 5;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.direction == 0)
{
this.direction = Main.player[this.owner].direction;
}
if (++this.frameCounter >= 3)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
if (this.alpha == 0 && Main.rand.Next(15) == 0)
{
Dust dust32 = Main.dust[Dust.NewDust(base.Top, 0, 0, 261, 0f, 0f, 100, default(Color), 1f)];
dust32.velocity.X = 0f;
dust32.noGravity = true;
dust32.fadeIn = 1f;
dust32.position = base.Center + Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (4f * Main.rand.NextFloat() + 26f);
dust32.scale = 0.5f;
}
this.localAI[0] += 1f;
if (this.localAI[0] >= 60f)
{
this.localAI[0] = 0f;
}
}
if (this.ai[0] < 0f)
{
this.ai[0] += 1f;
if (flag68)
{
this.ai[1] -= (float)this.direction * 0.3926991f / 50f;
}
}
if (this.ai[0] == 0f)
{
int num1075 = -1;
float num1076 = num1073;
for (int num1077 = 0; num1077 < 200; num1077++)
{
NPC nPC15 = Main.npc[num1077];
if (nPC15.CanBeChasedBy(this, false))
{
float num1078 = base.Distance(nPC15.Center);
if (num1078 < num1076 && Collision.CanHitLine(base.Center, 0, 0, nPC15.Center, 0, 0))
{
num1076 = num1078;
num1075 = num1077;
}
}
}
if (num1075 != -1)
{
this.ai[0] = 1f;
this.ai[1] = (float)num1075;
this.netUpdate = true;
return;
}
}
if (this.ai[0] > 0f)
{
int num1079 = (int)this.ai[1];
if (!Main.npc[num1079].CanBeChasedBy(this, false))
{
this.ai[0] = 0f;
this.ai[1] = 0f;
this.netUpdate = true;
return;
}
this.ai[0] += 1f;
float num1080 = 30f;
if (flag69)
{
num1080 = 5f;
}
if (this.ai[0] >= num1080)
{
Vector2 vector137 = base.DirectionTo(Main.npc[num1079].Center);
if (vector137.HasNaNs())
{
vector137 = Vector2.UnitY;
}
float num1081 = vector137.ToRotation();
int num1082 = (vector137.X > 0f) ? 1 : -1;
if (flag68)
{
this.direction = num1082;
this.ai[0] = -60f;
this.ai[1] = num1081 + (float)num1082 * 3.14159274f / 16f;
this.netUpdate = true;
if (this.owner == Main.myPlayer)
{
Projectile.NewProjectile(base.Center.X, base.Center.Y, vector137.X, vector137.Y, 642, this.damage, this.knockBack, this.owner, 0f, (float)this.whoAmI);
}
}
if (flag69)
{
this.direction = num1082;
this.ai[0] = -20f;
this.netUpdate = true;
if (this.owner == Main.myPlayer)
{
Vector2 vector138 = Main.npc[num1079].position + Main.npc[num1079].Size * Utils.RandomVector2(Main.rand, 0f, 1f) - base.Center;
for (int num1083 = 0; num1083 < 3; num1083++)
{
Vector2 vector139 = base.Center + vector138;
if (num1083 > 0)
{
vector139 = base.Center + vector138.RotatedByRandom(0.78539818525314331) * (Main.rand.NextFloat() * 0.5f + 0.75f);
}
float x4 = Main.rgbToHsl(new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB)).X;
Projectile.NewProjectile(vector139.X, vector139.Y, 0f, 0f, 644, this.damage, this.knockBack, this.owner, x4, (float)this.whoAmI);
}
return;
}
}
}
}
}
else if (this.aiStyle == 124)
{
Player player10 = Main.player[this.owner];
if (player10.dead)
{
this.Kill();
return;
}
if (Main.myPlayer == this.owner && player10.suspiciouslookingTentacle)
{
this.timeLeft = 2;
}
this.direction = (this.spriteDirection = player10.direction);
Vector3 v3_ = new Vector3(0.5f, 0.9f, 1f) * 1.5f;
DelegateMethods.v3_1 = v3_;
Utils.PlotTileLine(base.Center, base.Center + this.velocity * 6f, 20f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
Utils.PlotTileLine(base.Left, base.Right, 20f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
Utils.PlotTileLine(player10.Center, player10.Center + player10.velocity * 6f, 40f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
Utils.PlotTileLine(player10.Left, player10.Right, 40f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
Vector2 value72 = new Vector2((float)(player10.direction * 30), -20f);
Vector2 vector140 = player10.MountedCenter + value72;
float num1084 = Vector2.Distance(base.Center, vector140);
if (num1084 > 1000f)
{
base.Center = player10.Center + value72;
}
Vector2 vector141 = vector140 - base.Center;
float num1085 = 4f;
if (num1084 < num1085)
{
this.velocity *= 0.25f;
}
if (vector141 != Vector2.Zero)
{
if (vector141.Length() < num1085)
{
this.velocity = vector141;
}
else
{
this.velocity = vector141 * 0.1f;
}
}
if (this.velocity.Length() > 6f)
{
float num1086 = this.velocity.ToRotation() + 1.57079637f;
if (Math.Abs(this.rotation - num1086) >= 3.14159274f)
{
if (num1086 < this.rotation)
{
this.rotation -= 6.28318548f;
}
else
{
this.rotation += 6.28318548f;
}
}
float num1087 = 12f;
this.rotation = (this.rotation * (num1087 - 1f) + num1086) / num1087;
if (++this.frameCounter >= 4)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
}
else
{
if (this.rotation > 3.14159274f)
{
this.rotation -= 6.28318548f;
}
if (this.rotation > -0.005f && this.rotation < 0.005f)
{
this.rotation = 0f;
}
else
{
this.rotation *= 0.96f;
}
if (++this.frameCounter >= 6)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
}
if (this.ai[0] > 0f && (this.ai[0] += 1f) >= 60f)
{
this.ai[0] = 0f;
this.ai[1] = 0f;
}
if (Main.rand.Next(15) == 0)
{
float num1088 = -1f;
int num1089 = 17;
if ((base.Center - player10.Center).Length() < (float)Main.screenWidth)
{
int num1090 = (int)base.Center.X / 16;
int num1091 = (int)base.Center.Y / 16;
num1090 = (int)MathHelper.Clamp((float)num1090, (float)(num1089 + 1), (float)(Main.maxTilesX - num1089 - 1));
num1091 = (int)MathHelper.Clamp((float)num1091, (float)(num1089 + 1), (float)(Main.maxTilesY - num1089 - 1));
for (int num1092 = num1090 - num1089; num1092 <= num1090 + num1089; num1092++)
{
for (int num1093 = num1091 - num1089; num1093 <= num1091 + num1089; num1093++)
{
int num1094 = Main.rand.Next(8);
if (num1094 < 4)
{
Vector2 vector142 = new Vector2((float)(num1090 - num1092), (float)(num1091 - num1093));
if (vector142.Length() < (float)num1089 && Main.tile[num1092, num1093] != null && Main.tile[num1092, num1093].active())
{
bool flag70 = false;
if (Main.tile[num1092, num1093].type == 185 && Main.tile[num1092, num1093].frameY == 18)
{
if (Main.tile[num1092, num1093].frameX >= 576 && Main.tile[num1092, num1093].frameX <= 882)
{
flag70 = true;
}
}
else if (Main.tile[num1092, num1093].type == 186 && Main.tile[num1092, num1093].frameX >= 864 && Main.tile[num1092, num1093].frameX <= 1170)
{
flag70 = true;
}
if (flag70 || Main.tileSpelunker[(int)Main.tile[num1092, num1093].type] || (Main.tileAlch[(int)Main.tile[num1092, num1093].type] && Main.tile[num1092, num1093].type != 82))
{
float num1095 = base.Distance(new Vector2((float)(num1092 * 16 + 8), (float)(num1093 * 16 + 8)));
if (num1095 < num1088 || num1088 == -1f)
{
num1088 = num1095;
this.ai[0] = 1f;
this.ai[1] = base.AngleTo(new Vector2((float)(num1092 * 16 + 8), (float)(num1093 * 16 + 8)));
}
if (num1094 < 2)
{
int num1096 = Dust.NewDust(new Vector2((float)(num1092 * 16), (float)(num1093 * 16)), 16, 16, 204, 0f, 0f, 150, default(Color), 0.3f);
Main.dust[num1096].fadeIn = 0.75f;
Main.dust[num1096].velocity *= 0.1f;
}
}
}
}
}
}
}
}
float f3 = this.localAI[0] % 6.28318548f - 3.14159274f;
float num1097 = (float)Math.IEEERemainder((double)this.localAI[1], 1.0);
if (num1097 < 0f)
{
num1097 += 1f;
}
float num1098 = (float)Math.Floor((double)this.localAI[1]);
float max = 0.999f;
int num1099 = 0;
float amount2 = 0.1f;
bool flag71 = player10.velocity.Length() > 3f;
int num1100 = -1;
int num1101 = -1;
float num1102 = 300f;
float num1103 = 500f;
for (int num1104 = 0; num1104 < 200; num1104++)
{
NPC nPC16 = Main.npc[num1104];
if (nPC16.active && nPC16.chaseable && !nPC16.dontTakeDamage && !nPC16.immortal)
{
float num1105 = base.Distance(nPC16.Center);
if (nPC16.friendly || nPC16.lifeMax <= 5)
{
if (num1105 < num1102 && !flag71)
{
num1102 = num1105;
num1101 = num1104;
}
}
else if (num1105 < num1103)
{
num1103 = num1105;
num1100 = num1104;
}
}
}
float num1106;
if (flag71)
{
num1106 = base.AngleTo(base.Center + player10.velocity);
num1099 = 1;
num1097 = MathHelper.Clamp(num1097 + 0.05f, 0f, max);
num1098 += (float)Math.Sign(-10f - num1098);
}
else if (num1100 != -1)
{
num1106 = base.AngleTo(Main.npc[num1100].Center);
num1099 = 2;
num1097 = MathHelper.Clamp(num1097 + 0.05f, 0f, max);
num1098 += (float)Math.Sign(-12f - num1098);
}
else if (num1101 != -1)
{
num1106 = base.AngleTo(Main.npc[num1101].Center);
num1099 = 3;
num1097 = MathHelper.Clamp(num1097 + 0.05f, 0f, max);
num1098 += (float)Math.Sign(6f - num1098);
}
else if (this.ai[0] > 0f)
{
num1106 = this.ai[1];
num1097 = MathHelper.Clamp(num1097 + (float)Math.Sign(0.75f - num1097) * 0.05f, 0f, max);
num1099 = 4;
num1098 += (float)Math.Sign(10f - num1098);
if (Main.rand.Next(10) == 0)
{
int num1107 = Dust.NewDust(base.Center + f3.ToRotationVector2() * 6f * num1097 - Vector2.One * 4f, 8, 8, 204, 0f, 0f, 150, default(Color), 0.3f);
Main.dust[num1107].fadeIn = 0.75f;
Main.dust[num1107].velocity *= 0.1f;
}
}
else
{
num1106 = ((player10.direction == 1) ? 0f : 3.14160275f);
num1097 = MathHelper.Clamp(num1097 + (float)Math.Sign(0.75f - num1097) * 0.05f, 0f, max);
num1098 += (float)Math.Sign(0f - num1098);
amount2 = 0.12f;
}
Vector2 value73 = num1106.ToRotationVector2();
num1106 = Vector2.Lerp(f3.ToRotationVector2(), value73, amount2).ToRotation();
this.localAI[0] = num1106 + (float)num1099 * 6.28318548f + 3.14159274f;
this.localAI[1] = num1098 + num1097;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
private void AI_001()
{
if (this.type == 469 && this.wet && !this.honeyWet)
{
this.Kill();
}
if (this.type == 601)
{
Color portalColor = PortalHelper.GetPortalColor(this.owner, (int)this.ai[0]);
Vector3 vector = portalColor.ToVector3();
vector *= 0.5f;
Lighting.AddLight(base.Center + this.velocity * 3f, vector);
if (this.alpha > 0 && this.alpha <= 15)
{
Color color = portalColor;
color.A = 255;
for (int i = 0; i < 4; i++)
{
Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (3f * Main.rand.NextFloat());
Dust dust = Main.dust[Dust.NewDust(base.Center, 0, 0, 264, 0f, 0f, 0, default(Color), 1f)];
dust.position = base.Center;
dust.velocity = this.velocity * 2f + Utils.RandomVector2(Main.rand, -1f, 1f);
dust.color = color;
dust.scale = 1.2f;
dust.noLight = true;
dust.noGravity = true;
dust.customData = Main.player[this.owner];
}
}
this.alpha -= 15;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (++this.frameCounter >= 4)
{
this.frameCounter = 0;
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
}
if (this.alpha == 0)
{
Color color2 = portalColor;
color2.A = 255;
Dust dust2 = Main.dust[Dust.NewDust(base.Center, 0, 0, 263, 0f, 0f, 0, default(Color), 1f)];
dust2.position = base.Center;
dust2.velocity = this.velocity / 4f;
dust2.color = color2;
dust2.noGravity = true;
dust2.scale = 0.6f;
}
}
if (this.type == 472)
{
int num = Dust.NewDust(this.position, this.width, this.height, 30, 0f, 0f, 0, default(Color), 1f);
Main.dust[num].noGravity = true;
Main.dust[num].velocity *= 0.25f;
Main.dust[num].velocity += this.velocity * 0.75f;
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
for (int j = 0; j < 20; j++)
{
num = Dust.NewDust(this.position, this.width, this.height, 30, 0f, 0f, 0, default(Color), 1f);
Main.dust[num].noGravity = true;
Main.dust[num].velocity *= 0.25f;
Main.dust[num].velocity += this.velocity;
Dust expr_3FC_cp_0 = Main.dust[num];
expr_3FC_cp_0.velocity.X = expr_3FC_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_430_cp_0 = Main.dust[num];
expr_430_cp_0.velocity.Y = expr_430_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
}
}
}
if (this.type == 323)
{
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 436)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= 4)
{
this.frame = 0;
}
}
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.3f, 1.1f, 0.5f);
}
if (this.type == 467)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 34);
}
else if (this.ai[1] == 1f && Main.netMode != 1)
{
int num2 = -1;
float num3 = 2000f;
for (int k = 0; k < 255; k++)
{
if (Main.player[k].active && !Main.player[k].dead)
{
Vector2 center = Main.player[k].Center;
float num4 = Vector2.Distance(center, base.Center);
if ((num4 < num3 || num2 == -1) && Collision.CanHit(base.Center, 1, 1, center, 1, 1))
{
num3 = num4;
num2 = k;
}
}
}
if (num3 < 20f)
{
this.Kill();
return;
}
if (num2 != -1)
{
this.ai[1] = 21f;
this.ai[0] = (float)num2;
this.netUpdate = true;
}
}
else if (this.ai[1] > 20f && this.ai[1] < 200f)
{
this.ai[1] += 1f;
int num5 = (int)this.ai[0];
if (!Main.player[num5].active || Main.player[num5].dead)
{
this.ai[1] = 1f;
this.ai[0] = 0f;
this.netUpdate = true;
}
else
{
float num6 = this.velocity.ToRotation();
Vector2 vector2 = Main.player[num5].Center - base.Center;
if (vector2.Length() < 20f)
{
this.Kill();
return;
}
float targetAngle = vector2.ToRotation();
if (vector2 == Vector2.Zero)
{
targetAngle = num6;
}
float num7 = num6.AngleLerp(targetAngle, 0.008f);
this.velocity = new Vector2(this.velocity.Length(), 0f).RotatedBy((double)num7, default(Vector2));
}
}
if (this.ai[1] >= 1f && this.ai[1] < 20f)
{
this.ai[1] += 1f;
if (this.ai[1] == 20f)
{
this.ai[1] = 1f;
}
}
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= 4)
{
this.frame = 0;
}
}
Lighting.AddLight(base.Center, 1.1f, 0.9f, 0.4f);
this.localAI[0] += 1f;
if (this.localAI[0] == 12f)
{
this.localAI[0] = 0f;
for (int l = 0; l < 12; l++)
{
Vector2 vector3 = Vector2.UnitX * (float)(-(float)this.width) / 2f;
vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f);
vector3 = vector3.RotatedBy((double)(this.rotation - 1.57079637f), default(Vector2));
int num8 = Dust.NewDust(base.Center, 0, 0, 6, 0f, 0f, 160, default(Color), 1f);
Main.dust[num8].scale = 1.1f;
Main.dust[num8].noGravity = true;
Main.dust[num8].position = base.Center + vector3;
Main.dust[num8].velocity = this.velocity * 0.1f;
Main.dust[num8].velocity = Vector2.Normalize(base.Center - this.velocity * 3f - Main.dust[num8].position) * 1.25f;
}
}
if (Main.rand.Next(4) == 0)
{
for (int m = 0; m < 1; m++)
{
Vector2 value = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num9 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num9].velocity *= 0.1f;
Main.dust[num9].position = base.Center + value * (float)this.width / 2f;
Main.dust[num9].fadeIn = 0.9f;
}
}
if (Main.rand.Next(32) == 0)
{
for (int n = 0; n < 1; n++)
{
Vector2 value2 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num10 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 155, default(Color), 0.8f);
Main.dust[num10].velocity *= 0.3f;
Main.dust[num10].position = base.Center + value2 * (float)this.width / 2f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num10].fadeIn = 1.4f;
}
}
}
if (Main.rand.Next(2) == 0)
{
for (int num11 = 0; num11 < 2; num11++)
{
Vector2 value3 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num12 = Dust.NewDust(this.position, this.width, this.height, 6, 0f, 0f, 0, default(Color), 1.2f);
Main.dust[num12].velocity *= 0.3f;
Main.dust[num12].noGravity = true;
Main.dust[num12].position = base.Center + value3 * (float)this.width / 2f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num12].fadeIn = 1.4f;
}
}
}
}
if (this.type == 468)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 34);
}
else if (this.ai[1] == 1f && Main.netMode != 1)
{
int num13 = -1;
float num14 = 2000f;
for (int num15 = 0; num15 < 255; num15++)
{
if (Main.player[num15].active && !Main.player[num15].dead)
{
Vector2 center2 = Main.player[num15].Center;
float num16 = Vector2.Distance(center2, base.Center);
if ((num16 < num14 || num13 == -1) && Collision.CanHit(base.Center, 1, 1, center2, 1, 1))
{
num14 = num16;
num13 = num15;
}
}
}
if (num14 < 20f)
{
this.Kill();
return;
}
if (num13 != -1)
{
this.ai[1] = 21f;
this.ai[0] = (float)num13;
this.netUpdate = true;
}
}
else if (this.ai[1] > 20f && this.ai[1] < 200f)
{
this.ai[1] += 1f;
int num17 = (int)this.ai[0];
if (!Main.player[num17].active || Main.player[num17].dead)
{
this.ai[1] = 1f;
this.ai[0] = 0f;
this.netUpdate = true;
}
else
{
float num18 = this.velocity.ToRotation();
Vector2 vector4 = Main.player[num17].Center - base.Center;
if (vector4.Length() < 20f)
{
this.Kill();
return;
}
float targetAngle2 = vector4.ToRotation();
if (vector4 == Vector2.Zero)
{
targetAngle2 = num18;
}
float num19 = num18.AngleLerp(targetAngle2, 0.01f);
this.velocity = new Vector2(this.velocity.Length(), 0f).RotatedBy((double)num19, default(Vector2));
}
}
if (this.ai[1] >= 1f && this.ai[1] < 20f)
{
this.ai[1] += 1f;
if (this.ai[1] == 20f)
{
this.ai[1] = 1f;
}
}
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= 4)
{
this.frame = 0;
}
}
Lighting.AddLight(base.Center, 0.2f, 0.1f, 0.6f);
this.localAI[0] += 1f;
if (this.localAI[0] == 12f)
{
this.localAI[0] = 0f;
for (int num20 = 0; num20 < 12; num20++)
{
Vector2 vector5 = Vector2.UnitX * (float)(-(float)this.width) / 2f;
vector5 += -Vector2.UnitY.RotatedBy((double)((float)num20 * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f);
vector5 = vector5.RotatedBy((double)(this.rotation - 1.57079637f), default(Vector2));
int num21 = Dust.NewDust(base.Center, 0, 0, 27, 0f, 0f, 160, default(Color), 1f);
Main.dust[num21].scale = 1.1f;
Main.dust[num21].noGravity = true;
Main.dust[num21].position = base.Center + vector5;
Main.dust[num21].velocity = this.velocity * 0.1f;
Main.dust[num21].velocity = Vector2.Normalize(base.Center - this.velocity * 3f - Main.dust[num21].position) * 1.25f;
}
}
if (Main.rand.Next(4) == 0)
{
for (int num22 = 0; num22 < 1; num22++)
{
Vector2 value4 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num23 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num23].velocity *= 0.1f;
Main.dust[num23].position = base.Center + value4 * (float)this.width / 2f;
Main.dust[num23].fadeIn = 0.9f;
}
}
if (Main.rand.Next(32) == 0)
{
for (int num24 = 0; num24 < 1; num24++)
{
Vector2 value5 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num25 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 155, default(Color), 0.8f);
Main.dust[num25].velocity *= 0.3f;
Main.dust[num25].position = base.Center + value5 * (float)this.width / 2f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num25].fadeIn = 1.4f;
}
}
}
if (Main.rand.Next(2) == 0)
{
for (int num26 = 0; num26 < 2; num26++)
{
Vector2 value6 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num27 = Dust.NewDust(this.position, this.width, this.height, 27, 0f, 0f, 0, default(Color), 1.2f);
Main.dust[num27].velocity *= 0.3f;
Main.dust[num27].noGravity = true;
Main.dust[num27].position = base.Center + value6 * (float)this.width / 2f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num27].fadeIn = 1.4f;
}
}
}
}
if (this.type == 634 || this.type == 635)
{
float num28 = 5f;
float num29 = 250f;
float scaleFactor = 6f;
Vector2 value7 = new Vector2(8f, 10f);
float num30 = 1.2f;
Vector3 rgb = new Vector3(0.7f, 0.1f, 0.5f);
int num31 = 4 * this.MaxUpdates;
int num32 = Utils.SelectRandom<int>(Main.rand, new int[]
{
242,
73,
72,
71,
255
});
int num33 = 255;
if (this.type == 635)
{
value7 = new Vector2(10f, 20f);
num30 = 1f;
num29 = 500f;
num33 = 88;
num31 = 3 * this.MaxUpdates;
rgb = new Vector3(0.4f, 0.6f, 0.9f);
num32 = Utils.SelectRandom<int>(Main.rand, new int[]
{
242,
59,
88
});
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
this.localAI[0] = (float)(-(float)Main.rand.Next(48));
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 34);
}
else if (this.ai[1] == 1f && this.owner == Main.myPlayer)
{
int num34 = -1;
float num35 = num29;
for (int num36 = 0; num36 < 200; num36++)
{
if (Main.npc[num36].active && Main.npc[num36].CanBeChasedBy(this, false))
{
Vector2 center3 = Main.npc[num36].Center;
float num37 = Vector2.Distance(center3, base.Center);
if (num37 < num35 && num34 == -1 && Collision.CanHitLine(base.Center, 1, 1, center3, 1, 1))
{
num35 = num37;
num34 = num36;
}
}
}
if (num35 < 20f)
{
this.Kill();
return;
}
if (num34 != -1)
{
this.ai[1] = num28 + 1f;
this.ai[0] = (float)num34;
this.netUpdate = true;
}
}
else if (this.ai[1] > num28)
{
this.ai[1] += 1f;
int num38 = (int)this.ai[0];
if (!Main.npc[num38].active || !Main.npc[num38].CanBeChasedBy(this, false))
{
this.ai[1] = 1f;
this.ai[0] = 0f;
this.netUpdate = true;
}
else
{
this.velocity.ToRotation();
Vector2 vector6 = Main.npc[num38].Center - base.Center;
if (vector6.Length() < 20f)
{
this.Kill();
return;
}
if (vector6 != Vector2.Zero)
{
vector6.Normalize();
vector6 *= scaleFactor;
}
float num39 = 30f;
this.velocity = (this.velocity * (num39 - 1f) + vector6) / num39;
}
}
if (this.ai[1] >= 1f && this.ai[1] < num28)
{
this.ai[1] += 1f;
if (this.ai[1] == num28)
{
this.ai[1] = 1f;
}
}
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
this.frameCounter++;
if (this.frameCounter >= num31)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= 4)
{
this.frame = 0;
}
}
Lighting.AddLight(base.Center, rgb);
this.rotation = this.velocity.ToRotation();
this.localAI[0] += 1f;
if (this.localAI[0] == 48f)
{
this.localAI[0] = 0f;
}
else if (this.alpha == 0)
{
for (int num40 = 0; num40 < 2; num40++)
{
Vector2 value8 = Vector2.UnitX * -30f;
value8 = -Vector2.UnitY.RotatedBy((double)(this.localAI[0] * 0.1308997f + (float)num40 * 3.14159274f), default(Vector2)) * value7 - this.rotation.ToRotationVector2() * 10f;
int num41 = Dust.NewDust(base.Center, 0, 0, num33, 0f, 0f, 160, default(Color), 1f);
Main.dust[num41].scale = num30;
Main.dust[num41].noGravity = true;
Main.dust[num41].position = base.Center + value8 + this.velocity * 2f;
Main.dust[num41].velocity = Vector2.Normalize(base.Center + this.velocity * 2f * 8f - Main.dust[num41].position) * 2f + this.velocity * 2f;
}
}
if (Main.rand.Next(12) == 0)
{
for (int num42 = 0; num42 < 1; num42++)
{
Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num43 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num43].velocity *= 0.1f;
Main.dust[num43].position = base.Center + value9 * (float)this.width / 2f + this.velocity * 2f;
Main.dust[num43].fadeIn = 0.9f;
}
}
if (Main.rand.Next(64) == 0)
{
for (int num44 = 0; num44 < 1; num44++)
{
Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num45 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 155, default(Color), 0.8f);
Main.dust[num45].velocity *= 0.3f;
Main.dust[num45].position = base.Center + value10 * (float)this.width / 2f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num45].fadeIn = 1.4f;
}
}
}
if (Main.rand.Next(4) == 0)
{
for (int num46 = 0; num46 < 2; num46++)
{
Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num47 = Dust.NewDust(this.position, this.width, this.height, num32, 0f, 0f, 0, default(Color), 1.2f);
Main.dust[num47].velocity *= 0.3f;
Main.dust[num47].noGravity = true;
Main.dust[num47].position = base.Center + value11 * (float)this.width / 2f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num47].fadeIn = 1.4f;
}
}
}
if (Main.rand.Next(12) == 0 && this.type == 634)
{
Vector2 value12 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num48 = Dust.NewDust(this.position, this.width, this.height, num33, 0f, 0f, 100, default(Color), 1f);
Main.dust[num48].velocity *= 0.3f;
Main.dust[num48].position = base.Center + value12 * (float)this.width / 2f;
Main.dust[num48].fadeIn = 0.9f;
Main.dust[num48].noGravity = true;
}
if (Main.rand.Next(3) == 0 && this.type == 635)
{
Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)this.velocity.ToRotation(), default(Vector2));
int num49 = Dust.NewDust(this.position, this.width, this.height, num33, 0f, 0f, 100, default(Color), 1f);
Main.dust[num49].velocity *= 0.3f;
Main.dust[num49].position = base.Center + value13 * (float)this.width / 2f;
Main.dust[num49].fadeIn = 1.2f;
Main.dust[num49].scale = 1.5f;
Main.dust[num49].noGravity = true;
}
}
if (this.type == 459)
{
this.alpha -= 30;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= 3)
{
this.frame = 0;
}
}
this.position = base.Center;
this.scale = this.ai[1];
this.width = (this.height = (int)(22f * this.scale));
base.Center = this.position;
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.4f, 0.85f, 0.9f);
int num50;
if ((double)this.scale < 0.85)
{
num50 = ((Main.rand.Next(3) == 0) ? 1 : 0);
}
else
{
num50 = 1;
this.penetrate = -1;
this.maxPenetrate = -1;
}
for (int num51 = 0; num51 < num50; num51++)
{
int num52 = Dust.NewDust(this.position, this.width, this.height, 226, this.velocity.X, 0f, 0, default(Color), 1f);
Main.dust[num52].position -= Vector2.One * 3f;
Main.dust[num52].scale = 0.5f;
Main.dust[num52].noGravity = true;
Main.dust[num52].velocity = this.velocity / 3f;
Main.dust[num52].alpha = 255 - (int)(255f * this.scale);
}
}
if (this.type == 442)
{
this.frame = 0;
if (this.alpha != 0)
{
this.localAI[0] += 1f;
if (this.localAI[0] >= 4f)
{
this.alpha -= 90;
if (this.alpha < 0)
{
this.alpha = 0;
this.localAI[0] = 2f;
}
}
}
if (Vector2.Distance(base.Center, new Vector2(this.ai[0], this.ai[1]) * 16f + Vector2.One * 8f) <= 16f)
{
this.Kill();
return;
}
if (this.alpha == 0)
{
this.localAI[1] += 1f;
if (this.localAI[1] >= 120f)
{
this.Kill();
return;
}
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.3f, 0.45f, 0.8f);
this.localAI[0] += 1f;
if (this.localAI[0] == 3f)
{
this.localAI[0] = 0f;
for (int num53 = 0; num53 < 8; num53++)
{
Vector2 vector7 = Vector2.UnitX * -8f;
vector7 += -Vector2.UnitY.RotatedBy((double)((float)num53 * 3.14159274f / 4f), default(Vector2)) * new Vector2(2f, 4f);
vector7 = vector7.RotatedBy((double)(this.rotation - 1.57079637f), default(Vector2));
int num54 = Dust.NewDust(base.Center, 0, 0, 135, 0f, 0f, 0, default(Color), 1f);
Main.dust[num54].scale = 1.5f;
Main.dust[num54].noGravity = true;
Main.dust[num54].position = base.Center + vector7;
Main.dust[num54].velocity = this.velocity * 0.66f;
}
}
}
}
if (this.type == 440 || this.type == 449 || this.type == 606)
{
if (this.alpha > 0)
{
this.alpha -= 25;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.type == 440)
{
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.25f, 0.4f, 0.7f);
}
if (this.type == 449)
{
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.7f, 0.65f, 0.3f);
}
if (this.type == 606)
{
Lighting.AddLight(base.Center, 0.7f, 0.3f, 0.3f);
}
float num55 = 100f;
float num56 = 3f;
if (this.type == 606)
{
num55 = 150f;
num56 = 5f;
}
if (this.ai[1] == 0f)
{
this.localAI[0] += num56;
if (this.localAI[0] == num56 * 1f && this.type == 606)
{
for (int num57 = 0; num57 < 4; num57++)
{
int num58 = Dust.NewDust(base.Center - this.velocity / 2f, 0, 0, 182, 0f, 0f, 100, default(Color), 1.4f);
Main.dust[num58].velocity *= 0.2f;
Main.dust[num58].velocity += this.velocity / 10f;
Main.dust[num58].noGravity = true;
}
}
if (this.localAI[0] > num55)
{
this.localAI[0] = num55;
}
}
else
{
this.localAI[0] -= num56;
if (this.localAI[0] <= 0f)
{
this.Kill();
return;
}
}
}
if (this.type == 438)
{
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.4f, 0.1f, 0.2f);
}
if (this.type == 593)
{
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.4f, 0.1f, 0.3f);
if (++this.frameCounter >= 12)
{
if (++this.frame >= Main.projFrames[this.type])
{
this.frame = 0;
}
this.frameCounter = 0;
}
if (Main.rand.Next(2) == 0)
{
Vector2 vector8 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
Dust dust3 = Main.dust[Dust.NewDust(base.Center - vector8 * 8f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)];
dust3.noGravity = true;
dust3.position = base.Center - vector8 * 8f * this.scale;
dust3.velocity = vector8.RotatedBy(-1.5707963705062866, default(Vector2)) * 2f;
dust3.velocity = Vector2.Zero;
dust3.scale = 0.5f + Main.rand.NextFloat();
dust3.fadeIn = 0.5f;
}
}
if (this.type == 592)
{
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.15f, 0.15f, 0.4f);
}
if (this.type == 462)
{
int num59 = Dust.NewDust(base.Center, 0, 0, 229, 0f, 0f, 100, default(Color), 1f);
Main.dust[num59].noLight = true;
Main.dust[num59].noGravity = true;
Main.dust[num59].velocity = this.velocity;
Main.dust[num59].position -= Vector2.One * 4f;
Main.dust[num59].scale = 0.8f;
if (++this.frameCounter >= 9)
{
this.frameCounter = 0;
if (++this.frame >= 5)
{
this.frame = 0;
}
}
}
if (this.type == 437)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
for (int num60 = 0; num60 < 4; num60++)
{
int num61 = Dust.NewDust(this.position, this.width, this.height, 226, this.velocity.X, 0f, 0, default(Color), 1f);
Main.dust[num61].position = Vector2.Lerp(Main.dust[num61].position, base.Center, 0.25f);
Main.dust[num61].scale = 0.5f;
Main.dust[num61].noGravity = true;
Main.dust[num61].velocity /= 2f;
Main.dust[num61].velocity += this.velocity * 0.66f;
}
}
if (this.ai[0] < 16f)
{
for (int num62 = 0; num62 < 2; num62++)
{
int num63 = Dust.NewDust(this.position, this.width, this.height, 226, this.velocity.X, 0f, 0, default(Color), 1f);
Main.dust[num63].position = this.position + new Vector2((float)(((this.direction == 1) ? 1 : 0) * this.width), (float)(2 + (this.height - 4) * num62));
Main.dust[num63].scale = 0.3f;
Main.dust[num63].noGravity = true;
Main.dust[num63].velocity = Vector2.Zero;
}
}
}
if (this.type == 435)
{
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
this.frameCounter++;
if (this.frameCounter >= 3)
{
this.frame++;
this.frameCounter = 0;
if (this.frame >= 4)
{
this.frame = 0;
}
}
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.3f, 0.8f, 1.1f);
}
if (this.type == 408)
{
this.alpha -= 40;
if (this.alpha < 0)
{
this.alpha = 0;
}
this.spriteDirection = this.direction;
}
if (this.type == 282)
{
int num64 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f);
Main.dust[num64].scale = (float)Main.rand.Next(1, 10) * 0.1f;
Main.dust[num64].noGravity = true;
Main.dust[num64].fadeIn = 1.5f;
Main.dust[num64].velocity *= 0.25f;
Main.dust[num64].velocity += this.velocity * 0.25f;
}
if (this.type == 275 || this.type == 276)
{
this.frameCounter++;
if (this.frameCounter > 1)
{
this.frameCounter = 0;
this.frame++;
if (this.frame > 1)
{
this.frame = 0;
}
}
}
if (this.type == 225)
{
int num65 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, 0f, 0f, 0, default(Color), 1f);
Main.dust[num65].noGravity = true;
Main.dust[num65].scale = 1.3f;
Main.dust[num65].velocity *= 0.5f;
}
if (this.type == 174)
{
if (this.alpha == 0)
{
int num66 = Dust.NewDust(this.oldPosition - this.velocity * 3f, this.width, this.height, 76, 0f, 0f, 50, default(Color), 1f);
Main.dust[num66].noGravity = true;
Main.dust[num66].noLight = true;
Main.dust[num66].velocity *= 0.5f;
}
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
}
else if (this.type == 605)
{
if (this.alpha == 0 && Main.rand.Next(3) == 0)
{
int num67 = Dust.NewDust(this.position - this.velocity * 3f, this.width, this.height, 4, 0f, 0f, 50, new Color(78, 136, 255, 150), 1.2f);
Main.dust[num67].velocity *= 0.3f;
Main.dust[num67].velocity += this.velocity * 0.3f;
Main.dust[num67].noGravity = true;
}
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
}
else if (this.type == 176)
{
if (this.alpha == 0)
{
int num68 = Dust.NewDust(this.oldPosition, this.width, this.height, 22, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num68].noGravity = true;
Main.dust[num68].noLight = true;
Main.dust[num68].velocity *= 0.15f;
Main.dust[num68].fadeIn = 0.8f;
}
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
}
if (this.type == 350)
{
this.alpha -= 100;
if (this.alpha < 0)
{
this.alpha = 0;
}
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.9f, 0.6f, 0.2f);
if (this.alpha == 0)
{
int num69 = 2;
if (Main.rand.Next(2) == 0)
{
int num70 = Dust.NewDust(new Vector2(base.Center.X - (float)num69, base.Center.Y - (float)num69 - 2f) - this.velocity * 0.5f, num69 * 2, num69 * 2, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num70].scale *= 1.8f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num70].velocity *= 0.2f;
Main.dust[num70].noGravity = true;
}
if (Main.rand.Next(4) == 0)
{
int num71 = Dust.NewDust(new Vector2(base.Center.X - (float)num69, base.Center.Y - (float)num69 - 2f) - this.velocity * 0.5f, num69 * 2, num69 * 2, 31, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num71].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num71].velocity *= 0.05f;
}
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 42);
}
}
if (this.type == 325)
{
this.alpha -= 100;
if (this.alpha < 0)
{
this.alpha = 0;
}
Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.9f, 0.6f, 0.2f);
if (this.alpha == 0)
{
int num72 = 2;
if (Main.rand.Next(2) == 0)
{
int num73 = Dust.NewDust(new Vector2(base.Center.X - (float)num72, base.Center.Y - (float)num72 - 2f) - this.velocity * 0.5f, num72 * 2, num72 * 2, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num73].scale *= 1.8f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num73].velocity *= 0.2f;
Main.dust[num73].noGravity = true;
}
if (Main.rand.Next(4) == 0)
{
int num74 = Dust.NewDust(new Vector2(base.Center.X - (float)num72, base.Center.Y - (float)num72 - 2f) - this.velocity * 0.5f, num72 * 2, num72 * 2, 31, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num74].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num74].velocity *= 0.05f;
}
}
if (this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 42);
}
}
if (this.type == 469)
{
this.localAI[1] += 1f;
if (this.localAI[1] > 2f)
{
this.alpha -= 50;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
}
else if (this.type == 83 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33);
}
else if (this.type == 408 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 19);
}
else if (this.type == 259 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33);
}
else if (this.type == 110 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
}
else if (this.type == 302 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
}
else if (this.type == 438 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
else if (this.type == 593 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
}
else if (this.type == 592 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
else if (this.type == 462 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, Main.rand.Next(124, 126));
Vector2 value14 = Vector2.Normalize(this.velocity);
int num75 = Main.rand.Next(5, 10);
for (int num76 = 0; num76 < num75; num76++)
{
int num77 = Dust.NewDust(base.Center, 0, 0, 229, 0f, 0f, 100, default(Color), 1f);
Dust expr_3AE3_cp_0 = Main.dust[num77];
expr_3AE3_cp_0.velocity.Y = expr_3AE3_cp_0.velocity.Y - 1f;
Main.dust[num77].velocity += value14 * 2f;
Main.dust[num77].position -= Vector2.One * 4f;
Main.dust[num77].noGravity = true;
}
}
else if (this.type == 84 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
else if (this.type == 389 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
else if (this.type == 257 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
else if (this.type == 100 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33);
}
else if (this.type == 98 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
else if (this.type == 184 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
else if (this.type == 195 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
else if (this.type == 275 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
else if (this.type == 276 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
else if ((this.type == 81 || this.type == 82) && this.ai[1] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 5);
this.ai[1] = 1f;
}
else if (this.type == 180 && this.ai[1] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
this.ai[1] = 1f;
}
else if (this.type == 248 && this.ai[1] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
this.ai[1] = 1f;
}
else if (this.type == 576 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
else if (this.type == 577 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 36);
}
else if (this.type == 639)
{
if (this.localAI[0] == 0f && this.localAI[1] == 0f)
{
this.localAI[0] = base.Center.X;
this.localAI[1] = base.Center.Y;
this.ai[0] = this.velocity.X;
this.ai[1] = this.velocity.Y;
}
this.alpha -= 25;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
else if (this.type == 640)
{
this.alpha -= 25;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.velocity == Vector2.Zero)
{
this.ai[0] = 0f;
bool flag = true;
for (int num78 = 1; num78 < this.oldPos.Length; num78++)
{
if (this.oldPos[num78] != this.oldPos[0])
{
flag = false;
}
}
if (flag)
{
this.Kill();
return;
}
if (Main.rand.Next(this.extraUpdates) == 0 && (this.velocity != Vector2.Zero || Main.rand.Next((this.localAI[1] == 2f) ? 2 : 6) == 0))
{
for (int num79 = 0; num79 < 2; num79++)
{
float num80 = this.rotation + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num81 = (float)Main.rand.NextDouble() * 0.8f + 1f;
Vector2 vector9 = new Vector2((float)Math.Cos((double)num80) * num81, (float)Math.Sin((double)num80) * num81);
int num82 = Dust.NewDust(base.Center, 0, 0, 229, vector9.X, vector9.Y, 0, default(Color), 1f);
Main.dust[num82].noGravity = true;
Main.dust[num82].scale = 1.2f;
}
if (Main.rand.Next(10) == 0)
{
Vector2 value15 = this.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)this.width;
int num83 = Dust.NewDust(base.Center + value15 - Vector2.One * 4f, 8, 8, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num83].velocity *= 0.5f;
Main.dust[num83].velocity.Y = -Math.Abs(Main.dust[num83].velocity.Y);
}
}
}
else if (this.numUpdates == 1)
{
float num84 = this.rotation + 1.57079637f + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f;
float num85 = (float)Main.rand.NextDouble() * 0.25f + 0.25f;
Vector2 vector10 = new Vector2((float)Math.Cos((double)num84) * num85, (float)Math.Sin((double)num84) * num85);
int num86 = Dust.NewDust(this.position, 0, 0, 229, vector10.X, vector10.Y, 0, default(Color), 1f);
Main.dust[num86].noGravity = true;
Main.dust[num86].scale = 1.2f;
}
}
if (this.type == 41)
{
int num87 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.6f);
Main.dust[num87].noGravity = true;
num87 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num87].noGravity = true;
}
else if (this.type == 55)
{
int num88 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, 0f, 0f, 0, default(Color), 0.9f);
Main.dust[num88].noGravity = true;
}
else if (this.type == 374)
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
this.localAI[0] = 1f;
}
if (Main.rand.Next(2) == 0)
{
int num89 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, 0f, 0f, 0, default(Color), 0.9f);
Main.dust[num89].noGravity = true;
Main.dust[num89].velocity *= 0.5f;
}
}
else if (this.type == 376)
{
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20);
}
this.localAI[0] += 1f;
if (this.localAI[0] > 3f)
{
int num90 = 1;
if (this.localAI[0] > 5f)
{
num90 = 2;
}
for (int num91 = 0; num91 < num90; num91++)
{
int num92 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num92].noGravity = true;
Dust expr_46D5_cp_0 = Main.dust[num92];
expr_46D5_cp_0.velocity.X = expr_46D5_cp_0.velocity.X * 0.3f;
Dust expr_46F3_cp_0 = Main.dust[num92];
expr_46F3_cp_0.velocity.Y = expr_46F3_cp_0.velocity.Y * 0.3f;
Main.dust[num92].noLight = true;
}
if (this.wet && !this.lavaWet)
{
this.Kill();
return;
}
}
}
else if (this.type == 91 && Main.rand.Next(2) == 0)
{
int num93;
if (Main.rand.Next(2) == 0)
{
num93 = 15;
}
else
{
num93 = 58;
}
int num94 = Dust.NewDust(this.position, this.width, this.height, num93, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 150, default(Color), 0.9f);
Main.dust[num94].velocity *= 0.25f;
}
if (this.type == 163 || this.type == 310)
{
if (this.alpha > 0)
{
this.alpha -= 25;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
int num95 = this.type;
if (num95 <= 100)
{
if (num95 <= 36)
{
if (num95 != 14 && num95 != 20 && num95 != 36)
{
goto IL_49CE;
}
}
else
{
switch (num95)
{
case 83:
case 84:
break;
default:
if (num95 != 89 && num95 != 100)
{
goto IL_49CE;
}
break;
}
}
}
else if (num95 <= 161)
{
if (num95 != 104 && num95 != 110)
{
switch (num95)
{
case 158:
case 159:
case 160:
case 161:
break;
default:
goto IL_49CE;
}
}
}
else if (num95 <= 287)
{
if (num95 != 180)
{
switch (num95)
{
case 279:
case 283:
case 284:
case 285:
case 286:
case 287:
break;
case 280:
case 281:
case 282:
goto IL_49CE;
default:
goto IL_49CE;
}
}
}
else if (num95 != 389)
{
switch (num95)
{
case 576:
case 577:
this.localAI[1] += 1f;
if (this.localAI[1] <= 2f)
{
goto IL_49CE;
}
if (this.alpha > 0)
{
this.alpha -= 15;
}
if (this.alpha < 0)
{
this.alpha = 0;
goto IL_49CE;
}
goto IL_49CE;
default:
goto IL_49CE;
}
}
if (this.alpha > 0)
{
this.alpha -= 15;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
IL_49CE:
if (this.type == 484)
{
int num96 = Dust.NewDust(this.position, this.width, this.height, 78, 0f, 0f, 0, default(Color), 1f);
Main.dust[num96].noGravity = true;
Main.dust[num96].velocity *= 0.1f;
Main.dust[num96].scale = 0.75f;
Main.dust[num96].position = (Main.dust[num96].position + base.Center) / 2f;
Main.dust[num96].position += this.velocity * (float)Main.rand.Next(0, 101) * 0.01f;
}
if (this.type == 242 || this.type == 302 || this.type == 438 || this.type == 462 || this.type == 592)
{
float num97 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y));
if (this.alpha > 0)
{
this.alpha -= (int)((byte)((double)num97 * 0.9));
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 638)
{
float num98 = this.velocity.Length();
if (this.alpha > 0)
{
this.alpha -= (int)((byte)((double)num98 * 0.3));
}
if (this.alpha < 0)
{
this.alpha = 0;
}
Rectangle hitbox = base.Hitbox;
hitbox.Offset((int)this.velocity.X, (int)this.velocity.Y);
bool flag2 = false;
for (int num99 = 0; num99 < 200; num99++)
{
if (Main.npc[num99].active && !Main.npc[num99].dontTakeDamage && Main.npc[num99].immune[this.owner] == 0 && this.npcImmune[num99] == 0 && Main.npc[num99].Hitbox.Intersects(hitbox))
{
flag2 = true;
break;
}
}
if (flag2)
{
int num100 = Main.rand.Next(15, 31);
for (int num101 = 0; num101 < num100; num101++)
{
int num102 = Dust.NewDust(base.Center, 0, 0, 229, 0f, 0f, 100, default(Color), 0.8f);
Main.dust[num102].velocity *= 1.6f;
Dust expr_4CD8_cp_0 = Main.dust[num102];
expr_4CD8_cp_0.velocity.Y = expr_4CD8_cp_0.velocity.Y - 1f;
Main.dust[num102].velocity += this.velocity;
Main.dust[num102].noGravity = true;
}
}
}
if (this.type == 257 || this.type == 593)
{
if (this.alpha > 0)
{
this.alpha -= 10;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 88)
{
if (this.alpha > 0)
{
this.alpha -= 10;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 532)
{
this.ai[0] += 1f;
}
bool flag3 = true;
num95 = this.type;
if (num95 <= 299)
{
if (num95 <= 110)
{
if (num95 <= 38)
{
if (num95 <= 14)
{
if (num95 != 5 && num95 != 14)
{
goto IL_51CE;
}
}
else if (num95 != 20)
{
switch (num95)
{
case 36:
case 38:
break;
case 37:
goto IL_51CE;
default:
goto IL_51CE;
}
}
}
else if (num95 <= 89)
{
if (num95 != 55)
{
switch (num95)
{
case 83:
case 84:
case 88:
case 89:
break;
case 85:
case 86:
case 87:
goto IL_51CE;
default:
goto IL_51CE;
}
}
}
else
{
switch (num95)
{
case 98:
case 100:
break;
case 99:
goto IL_51CE;
default:
if (num95 != 104 && num95 != 110)
{
goto IL_51CE;
}
break;
}
}
}
else if (num95 <= 248)
{
if (num95 <= 180)
{
switch (num95)
{
case 158:
case 159:
case 160:
case 161:
break;
default:
if (num95 != 180)
{
goto IL_51CE;
}
break;
}
}
else if (num95 != 184 && num95 != 242 && num95 != 248)
{
goto IL_51CE;
}
}
else if (num95 <= 265)
{
switch (num95)
{
case 257:
case 259:
break;
case 258:
goto IL_51CE;
default:
if (num95 != 265)
{
goto IL_51CE;
}
break;
}
}
else if (num95 != 270)
{
switch (num95)
{
case 279:
case 283:
case 284:
case 285:
case 286:
case 287:
break;
case 280:
case 281:
case 282:
goto IL_51CE;
default:
if (num95 != 299)
{
goto IL_51CE;
}
break;
}
}
}
else if (num95 <= 462)
{
if (num95 <= 376)
{
if (num95 <= 325)
{
if (num95 != 302)
{
switch (num95)
{
case 323:
case 325:
break;
case 324:
goto IL_51CE;
default:
goto IL_51CE;
}
}
}
else
{
switch (num95)
{
case 348:
case 349:
case 350:
break;
default:
if (num95 != 355)
{
switch (num95)
{
case 374:
case 376:
break;
case 375:
goto IL_51CE;
default:
goto IL_51CE;
}
}
break;
}
}
}
else if (num95 <= 442)
{
if (num95 != 389)
{
switch (num95)
{
case 435:
case 436:
case 438:
case 440:
case 442:
break;
case 437:
case 439:
case 441:
goto IL_51CE;
default:
goto IL_51CE;
}
}
}
else if (num95 != 449 && num95 != 459 && num95 != 462)
{
goto IL_51CE;
}
}
else if (num95 <= 585)
{
if (num95 <= 485)
{
switch (num95)
{
case 467:
case 468:
case 469:
case 472:
break;
case 470:
case 471:
goto IL_51CE;
default:
switch (num95)
{
case 483:
case 484:
case 485:
break;
default:
goto IL_51CE;
}
break;
}
}
else if (num95 != 498)
{
switch (num95)
{
case 576:
case 577:
break;
default:
if (num95 != 585)
{
goto IL_51CE;
}
break;
}
}
}
else if (num95 <= 601)
{
switch (num95)
{
case 592:
case 593:
break;
default:
if (num95 != 601)
{
goto IL_51CE;
}
break;
}
}
else if (num95 != 606 && num95 != 616)
{
switch (num95)
{
case 634:
case 635:
case 638:
case 639:
break;
case 636:
case 637:
goto IL_51CE;
default:
goto IL_51CE;
}
}
flag3 = false;
IL_51CE:
if (flag3)
{
this.ai[0] += 1f;
}
if (this.type == 270)
{
int num103 = (int)Player.FindClosest(base.Center, 1, 1);
this.ai[1] += 1f;
if (this.ai[1] < 110f && this.ai[1] > 30f)
{
float scaleFactor2 = this.velocity.Length();
Vector2 vector11 = Main.player[num103].Center - base.Center;
vector11.Normalize();
vector11 *= scaleFactor2;
this.velocity = (this.velocity * 24f + vector11) / 25f;
this.velocity.Normalize();
this.velocity *= scaleFactor2;
}
if (this.ai[0] < 0f)
{
if (this.velocity.Length() < 18f)
{
this.velocity *= 1.02f;
}
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
for (int num104 = 0; num104 < 10; num104++)
{
int num105 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 5, this.velocity.X, this.velocity.Y, 0, default(Color), 2f);
Main.dust[num105].noGravity = true;
Main.dust[num105].velocity = base.Center - Main.dust[num105].position;
Main.dust[num105].velocity.Normalize();
Main.dust[num105].velocity *= -5f;
Main.dust[num105].velocity += this.velocity / 2f;
}
}
this.friendly = false;
this.hostile = true;
}
}
if (this.type == 585)
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
for (int num106 = 0; num106 < 3; num106++)
{
int num107 = Dust.NewDust(this.position, this.width, this.height, 27, this.velocity.X, this.velocity.Y, 0, default(Color), 2f);
Main.dust[num107].noGravity = true;
Main.dust[num107].velocity = base.Center - Main.dust[num107].position;
Main.dust[num107].velocity.Normalize();
Main.dust[num107].velocity *= -5f;
Main.dust[num107].velocity += this.velocity / 2f;
Main.dust[num107].noLight = true;
}
}
if (this.alpha > 0)
{
this.alpha -= 50;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
this.frameCounter++;
if (this.frameCounter >= 12)
{
this.frameCounter = 0;
}
this.frame = this.frameCounter / 2;
if (this.frame > 3)
{
this.frame = 6 - this.frame;
}
Vector3 vector12 = NPCID.Sets.MagicAuraColor[54].ToVector3();
Lighting.AddLight(base.Center, vector12.X, vector12.Y, vector12.Z);
if (Main.rand.Next(3) == 0)
{
int num108 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 27, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f);
Main.dust[num108].position -= this.velocity * 2f;
Main.dust[num108].noLight = true;
Main.dust[num108].noGravity = true;
Dust expr_5705_cp_0 = Main.dust[num108];
expr_5705_cp_0.velocity.X = expr_5705_cp_0.velocity.X * 0.3f;
Dust expr_5723_cp_0 = Main.dust[num108];
expr_5723_cp_0.velocity.Y = expr_5723_cp_0.velocity.Y * 0.3f;
}
}
if (this.type == 594)
{
int num109 = (int)(43f - this.ai[1]) / 13;
if (num109 < 1)
{
num109 = 1;
}
int num110 = (this.ai[1] < 20f) ? 6 : 31;
for (int num111 = 0; num111 < num109; num111++)
{
int num112 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, num110, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 0, default(Color), 2f);
Main.dust[num112].position -= this.velocity * 2f;
Main.dust[num112].noLight = true;
Main.dust[num112].noGravity = true;
Dust expr_5845_cp_0 = Main.dust[num112];
expr_5845_cp_0.velocity.X = expr_5845_cp_0.velocity.X * 0.3f;
Dust expr_5863_cp_0 = Main.dust[num112];
expr_5863_cp_0.velocity.Y = expr_5863_cp_0.velocity.Y * 0.3f;
if (num110 == 6)
{
Main.dust[num112].fadeIn = Main.rand.NextFloat() * 2f;
}
}
this.ai[1] += 1f;
if (this.ai[1] > (float)(43 * this.MaxUpdates))
{
this.Kill();
return;
}
}
if (this.type == 622)
{
int num113 = 229;
if (Main.rand.Next(3) != 0)
{
int num114 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, num113, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 0, default(Color), 1.2f);
Main.dust[num114].position -= this.velocity * 2f;
Main.dust[num114].noLight = true;
Main.dust[num114].noGravity = true;
Dust expr_59CB_cp_0 = Main.dust[num114];
expr_59CB_cp_0.velocity.X = expr_59CB_cp_0.velocity.X * 0.3f;
Dust expr_59E9_cp_0 = Main.dust[num114];
expr_59E9_cp_0.velocity.Y = expr_59E9_cp_0.velocity.Y * 0.3f;
}
this.ai[1] += 1f;
if (this.ai[1] > (float)(23 * this.MaxUpdates))
{
this.Kill();
return;
}
}
if (this.type == 587)
{
Color newColor = Main.hslToRgb(this.ai[1], 1f, 0.5f);
newColor.A = 200;
this.localAI[0] += 1f;
if (this.localAI[0] >= 2f)
{
if (this.localAI[0] == 2f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 5);
for (int num115 = 0; num115 < 4; num115++)
{
int num116 = Dust.NewDust(this.position, this.width, this.height, 76, this.velocity.X, this.velocity.Y, 0, newColor, 1.1f);
Main.dust[num116].noGravity = true;
Main.dust[num116].velocity = base.Center - Main.dust[num116].position;
Main.dust[num116].velocity.Normalize();
Main.dust[num116].velocity *= -3f;
Main.dust[num116].velocity += this.velocity / 2f;
}
}
else
{
this.frame++;
if (this.frame > 2)
{
this.frame = 0;
}
for (int num117 = 0; num117 < 1; num117++)
{
int num118 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 76, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 0, newColor, 0.9f);
Main.dust[num118].position = base.Center;
Main.dust[num118].noGravity = true;
Main.dust[num118].velocity = this.velocity * 0.5f;
}
}
}
}
if (this.type == 349)
{
this.frame = (int)this.ai[0];
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.localAI[0] == 0f || this.localAI[0] == 2f)
{
this.scale += 0.01f;
this.alpha -= 50;
if (this.alpha <= 0)
{
this.localAI[0] = 1f;
this.alpha = 0;
}
}
else if (this.localAI[0] == 1f)
{
this.scale -= 0.01f;
this.alpha += 50;
if (this.alpha >= 255)
{
this.localAI[0] = 2f;
this.alpha = 255;
}
}
}
if (this.type == 348)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
}
if (this.ai[0] == 0f || this.ai[0] == 2f)
{
this.scale += 0.01f;
this.alpha -= 50;
if (this.alpha <= 0)
{
this.ai[0] = 1f;
this.alpha = 0;
}
}
else if (this.ai[0] == 1f)
{
this.scale -= 0.01f;
this.alpha += 50;
if (this.alpha >= 255)
{
this.ai[0] = 2f;
this.alpha = 255;
}
}
}
if (this.type == 572)
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
for (int num119 = 0; num119 < 2; num119++)
{
int num120 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, this.velocity.X, this.velocity.Y, 100, default(Color), 1f);
Main.dust[num120].velocity *= 0.5f;
Main.dust[num120].velocity += this.velocity;
Main.dust[num120].velocity *= 0.5f;
Main.dust[num120].noGravity = true;
Main.dust[num120].scale = 1.2f;
Main.dust[num120].position = (base.Center + this.position) / 2f;
}
}
if (this.type == 577)
{
Lighting.AddLight(base.Center, 0.1f, 0.3f, 0.4f);
}
else if (this.type == 576)
{
Lighting.AddLight(base.Center, 0.4f, 0.2f, 0.4f);
for (int num121 = 0; num121 < 5; num121++)
{
Dust dust4 = Main.dust[Dust.NewDust(this.position, this.width, this.height, 242, this.velocity.X, this.velocity.Y, 100, default(Color), 1f)];
dust4.velocity = Vector2.Zero;
dust4.position -= this.velocity / 5f * (float)num121;
dust4.noGravity = true;
dust4.scale = 0.8f;
dust4.noLight = true;
}
}
else if (this.type == 581)
{
if (this.localAI[0] == 0f)
{
this.localAI[0] = 1f;
Main.PlaySound(2, (int)base.Center.X, (int)base.Center.Y, 17);
}
for (int num122 = 0; num122 < 2; num122++)
{
int num123 = Utils.SelectRandom<int>(Main.rand, new int[]
{
229,
161,
161
});
Dust dust5 = Main.dust[Dust.NewDust(this.position, this.width, this.height, num123, this.velocity.X, this.velocity.Y, 100, default(Color), 1f)];
dust5.velocity = dust5.velocity / 4f + this.velocity / 2f;
dust5.noGravity = true;
dust5.scale = 1.2f;
dust5.position = base.Center;
dust5.noLight = true;
}
}
if (this.type == 299)
{
if (this.localAI[0] == 6f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
for (int num124 = 0; num124 < 40; num124++)
{
int num125 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, 0f, 0f, 100, default(Color), 1f);
Main.dust[num125].velocity *= 3f;
Main.dust[num125].velocity += this.velocity * 0.75f;
Main.dust[num125].scale *= 1.2f;
Main.dust[num125].noGravity = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment