terraria-source-code/Terraria/Projectile.cs
TheVamp 0462173018 Version 1.2.0.3.1
Decompiled with IlSpy
Fixes Source Code
2013-10-12 11:25:17 +02:00

19182 lines
1.4 MiB

using Microsoft.Xna.Framework;
using System;
namespace Terraria
{
public class Projectile
{
public int numHits;
public bool netImportant;
public bool noDropItem;
public bool wet;
public bool honeyWet;
public byte wetCount;
public bool lavaWet;
public int whoAmI;
public static int maxAI = 2;
public Vector2 position;
public Vector2 lastPosition;
public Vector2 velocity;
public Vector2 lastVelocity;
public int width;
public int height;
public float scale = 1f;
public float rotation;
public int type;
public int alpha;
public int owner = 255;
public bool active;
public string name = "";
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 direction;
public int spriteDirection = 1;
public bool hostile;
public float knockBack;
public bool friendly;
public int penetrate = 1;
public int identity;
public float light;
public bool netUpdate;
public bool netUpdate2;
public int netSpam;
public Vector2[] oldPos = new Vector2[10];
public bool minion;
public int minionPos;
public int restrikeDelay;
public bool tileCollide;
public int maxUpdates;
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 magic;
public int frameCounter;
public int frame;
public void SetDefaults(int Type)
{
this.numHits = 0;
this.netImportant = false;
for (int i = 0; i < this.oldPos.Length; i++)
{
this.oldPos[i].X = 0f;
this.oldPos[i].Y = 0f;
}
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;
}
this.noDropItem = false;
this.minion = false;
this.soundDelay = 0;
this.spriteDirection = 1;
this.melee = false;
this.ranged = 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.maxUpdates = 0;
this.identity = 0;
this.restrikeDelay = 0;
this.light = 0f;
this.penetrate = 1;
this.tileCollide = true;
this.position = default(Vector2);
this.velocity = default(Vector2);
this.aiStyle = 0;
this.alpha = 0;
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 = "";
if (this.type == 1)
{
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.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.ranged = true;
}
else
{
if (this.type == 4)
{
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.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.maxUpdates = 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.magic = 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.maxUpdates = 1;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
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;
}
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.maxUpdates = 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.ranged = 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.maxUpdates = 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.ranged = 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.ranged = 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 Chakrum";
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.maxUpdates = 1;
this.scale = 1.4f;
this.timeLeft = 600;
this.ranged = true;
}
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.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.maxUpdates = 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.ranged = 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.ranged = 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.maxUpdates = 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.maxUpdates = 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 == 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;
}
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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 1;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
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.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.ranged = true;
this.penetrate = -1;
}
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;
}
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.maxUpdates = 2;
this.scale = 1.8f;
this.timeLeft = 1200;
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.maxUpdates = 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.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.maxUpdates = 1;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
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;
}
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;
}
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.maxUpdates = 1;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
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;
}
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.name = "Bone Arrow";
this.maxUpdates = 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;
}
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.name = "Frost Arrow";
this.maxUpdates = 1;
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
}
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 = 2;
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 = 2;
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 = 3;
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 = 3;
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 = 4;
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;
}
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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 1;
this.timeLeft = 600;
this.ranged = true;
}
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.maxUpdates = 1;
this.timeLeft = 600;
this.ranged = true;
}
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.maxUpdates = 1;
this.timeLeft = 600;
this.ranged = true;
}
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.maxUpdates = 1;
this.timeLeft = 600;
this.ranged = true;
}
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;
}
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.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.name = "Frostburn Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 1f;
this.ranged = 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;
}
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;
}
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.maxUpdates = 1;
this.scale = 1.2f;
this.timeLeft = 600;
this.ranged = true;
}
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.magic = true;
this.maxUpdates = 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.maxUpdates = 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.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.ranged = true;
this.penetrate = -1;
}
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.ranged = true;
this.timeLeft = 900;
}
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.ranged = true;
this.timeLeft = 300;
}
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;
}
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.maxUpdates = 2;
this.magic = 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.maxUpdates = 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;
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.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.maxUpdates = 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;
}
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.maxUpdates = 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.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.maxUpdates = 1;
this.timeLeft = 300;
this.scale = 1.1f;
this.magic = true;
}
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.maxUpdates = 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.maxUpdates = 1;
this.timeLeft = 300;
this.scale = 1.1f;
this.magic = true;
}
else
{
if (this.type == 246)
{
this.name = "Stynger";
this.maxUpdates = 1;
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.alpha = 255;
}
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.ranged = 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 = 420;
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.maxUpdates = 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.melee = true;
this.scale = 1f;
}
else
{
if (this.type == 257)
{
this.name = "Frost Beem";
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.maxUpdates = 1;
this.scale = 1.2f;
this.timeLeft = 600;
this.magic = true;
}
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.maxUpdates = 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.maxUpdates = 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;
}
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.maxUpdates = 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;
}
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.maxUpdates = 1;
this.timeLeft = 120;
this.scale = 1.1f;
}
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 = 6;
}
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;
}
else
{
if (this.type == 267)
{
this.alpha = 255;
this.name = "Poison Dart";
this.width = 14;
this.height = 14;
this.aiStyle = 1;
this.friendly = 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 = 6;
}
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.name = "Ichor Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.light = 1f;
this.ranged = true;
this.maxUpdates = 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.maxUpdates = 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 = -1;
this.maxUpdates = 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.name = "Venom Arrow";
this.width = 10;
this.height = 10;
this.aiStyle = 1;
this.friendly = true;
this.ranged = true;
this.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 1;
this.penetrate = -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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 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.maxUpdates = 3;
}
else
{
if (this.type == 308)
{
this.name = "Frost Hydra";
this.width = 80;
this.height = 74;
this.aiStyle = 53;
this.timeLeft = 3600;
this.light = 0.25f;
this.ignoreWater = 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.maxUpdates = 3;
}
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
{
this.active = false;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
this.width = (int)((float)this.width * this.scale);
this.height = (int)((float)this.height * this.scale);
}
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;
}
Main.projectile[num].SetDefaults(Type);
Main.projectile[num].position.X = X - (float)Main.projectile[num].width * 0.5f;
Main.projectile[num].position.Y = Y - (float)Main.projectile[num].height * 0.5f;
Main.projectile[num].owner = Owner;
Main.projectile[num].velocity.X = SpeedX;
Main.projectile[num].velocity.Y = SpeedY;
Main.projectile[num].damage = Damage;
Main.projectile[num].knockBack = KnockBack;
Main.projectile[num].identity = num;
Main.projectile[num].gfxOffY = 0f;
Main.projectile[num].stepSpeed = 1f;
Main.projectile[num].wet = Collision.WetCollision(Main.projectile[num].position, Main.projectile[num].width, Main.projectile[num].height);
if (Main.projectile[num].ignoreWater)
{
Main.projectile[num].wet = false;
}
Main.projectile[num].honeyWet = Collision.honey;
if (Owner == Main.myPlayer)
{
if (Type == 206)
{
Main.projectile[num].ai[0] = (float)Main.rand.Next(-100, 101) * 0.0005f;
Main.projectile[num].ai[1] = (float)Main.rand.Next(-100, 101) * 0.0005f;
}
else
{
Main.projectile[num].ai[0] = ai0;
Main.projectile[num].ai[1] = ai1;
}
}
if (Main.netMode != 0 && Owner == Main.myPlayer)
{
NetMessage.SendData(27, -1, -1, "", num, 0f, 0f, 0f, 0);
}
if (Owner == Main.myPlayer)
{
if (Type == 28)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 29)
{
Main.projectile[num].timeLeft = 300;
}
if (Type == 30)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 37)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 75)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 133)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 136)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 139)
{
Main.projectile[num].timeLeft = 180;
}
if (Type == 142)
{
Main.projectile[num].timeLeft = 180;
}
}
if (Type == 249)
{
Main.projectile[num].frame = Main.rand.Next(5);
}
return num;
}
public void StatusNPC(int i)
{
if (this.melee && Main.player[this.owner].meleeEnchant > 0)
{
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(69, 120, false);
}
}
if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn)
{
Main.npc[i].AddBuff(44, 60 * Main.rand.Next(5, 15), false);
}
if (this.melee && Main.player[this.owner].magmaStone)
{
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 == 295 || this.type == 296)
{
Main.npc[i].AddBuff(24, 60 * Main.rand.Next(8, 16), false);
}
if (this.type == 2 && Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, 180, 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 == 172)
{
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(44, 240, 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, 600, 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, 240, 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(3) != 0)
{
Main.npc[i].AddBuff(31, 120, 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, 900, false);
}
else
{
if (this.type == 282 || this.type == 283)
{
Main.npc[i].AddBuff(70, 600, false);
}
else
{
if (this.type == 98)
{
Main.npc[i].AddBuff(20, 600, false);
}
else
{
if (this.type == 184)
{
Main.npc[i].AddBuff(20, 900, false);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (this.type != 163 && this.type != 310)
{
if (this.type == 265)
{
Main.npc[i].AddBuff(20, 3600, false);
}
return;
}
if (Main.rand.Next(3) == 0)
{
Main.npc[i].AddBuff(24, 600, false);
return;
}
Main.npc[i].AddBuff(24, 300, false);
}
public void StatusPvP(int i)
{
if (this.melee && Main.player[this.owner].meleeEnchant > 0)
{
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.melee || this.ranged) && Main.player[this.owner].frostBurn)
{
Main.player[i].AddBuff(44, 60 * Main.rand.Next(1, 8), false);
}
if (this.melee && Main.player[this.owner].magmaStone)
{
if (Main.rand.Next(7) == 0)
{
Main.player[i].AddBuff(24, 360, true);
}
else
{
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(24, 120, true);
}
else
{
Main.player[i].AddBuff(24, 60, 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 == 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 == 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 == 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 (this.type == 265)
{
Main.player[i].AddBuff(20, 1800, true);
}
return;
}
if (Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(24, 600, true);
return;
}
Main.player[i].AddBuff(24, 300, true);
}
public void ghostHeal(int dmg, Vector2 Position)
{
float num = 0.1f;
num -= (float)this.numHits * 0.02f;
if (num <= 0f)
{
return;
}
float num2 = (float)dmg * num;
if ((int)num2 <= 0)
{
return;
}
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 < 800f && (float)(Main.player[i].statLifeMax - Main.player[i].statLife) > num3)
{
num3 = (float)(Main.player[i].statLifeMax - 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;
}
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 == 55 && Main.rand.Next(3) == 0)
{
Main.player[i].AddBuff(20, 600, 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(3) == 0)
{
Main.player[i].AddBuff(39, 480, 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);
}
}
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)
{
return;
}
if (Main.projPet[this.type] && this.type != 266)
{
return;
}
Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
if (this.type == 85 || this.type == 101)
{
int num = 30;
rectangle.X -= num;
rectangle.Y -= num;
rectangle.Width += num * 2;
rectangle.Height += num * 2;
}
if (this.type == 188)
{
int num2 = 20;
rectangle.X -= num2;
rectangle.Y -= num2;
rectangle.Width += num2 * 2;
rectangle.Height += num2 * 2;
}
if (this.aiStyle == 29)
{
int num3 = 4;
rectangle.X -= num3;
rectangle.Y -= num3;
rectangle.Width += num3 * 2;
rectangle.Height += num3 * 2;
}
if (this.friendly && this.owner == Main.myPlayer)
{
if (((this.aiStyle == 16 || this.type == 41) && (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 (rectangle.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 (Main.netMode != 0)
{
NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), myPlayer, (float)this.direction, (float)num4, 1f, 0);
}
}
}
}
if (this.type != 69 && this.type != 70 && this.type != 10 && this.type != 11 && this.aiStyle != 45)
{
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;
}
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)
{
WorldGen.KillTile(i, j, false, false, false);
if (Main.netMode != 0)
{
NetMessage.SendData(17, -1, -1, "", 0, (float)i, (float)j, 0f, 0);
}
}
}
}
}
}
if (this.owner == Main.myPlayer)
{
if (this.damage > 0)
{
for (int k = 0; k < 200; k++)
{
if (Main.npc[k].active && !Main.npc[k].dontTakeDamage && (((!Main.npc[k].friendly || (Main.npc[k].type == 22 && this.owner < 255 && Main.player[this.owner].killGuide)) && this.friendly) || (Main.npc[k].friendly && this.hostile)) && (this.owner < 0 || Main.npc[k].immune[this.owner] == 0))
{
bool flag = false;
if (this.type == 11 && (Main.npc[k].type == 47 || Main.npc[k].type == 57))
{
flag = true;
}
else
{
if (this.type == 31 && Main.npc[k].type == 69)
{
flag = true;
}
}
if (!flag && (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)))
{
Rectangle value2 = new Rectangle((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height);
if (rectangle.Intersects(value2))
{
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.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 == 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.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 flag2 = false;
if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit)
{
flag2 = true;
}
if (this.ranged && Main.rand.Next(1, 101) <= Main.player[this.owner].rangedCrit)
{
flag2 = true;
}
if (this.magic && Main.rand.Next(1, 101) <= Main.player[this.owner].magicCrit)
{
flag2 = true;
}
int num9 = Main.DamageVar((float)this.damage);
if (this.type == 294)
{
this.damage = (int)((double)this.damage * 0.8);
}
if (this.type == 261)
{
float num10 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y));
if (num10 < 1f)
{
num10 = 1f;
}
num9 = (int)((float)num9 * num10 / 8f);
}
this.StatusNPC(k);
if (this.type != 221 && this.type != 227)
{
Main.player[this.owner].onHit(Main.npc[k].center().X, Main.npc[k].center().Y);
}
int num11 = (int)Main.npc[k].StrikeNPC(num9, this.knockBack, this.direction, flag2, false);
if (num11 > 0 && Main.npc[k].lifeMax > 5 && Main.player[this.owner].ghostHeal)
{
this.ghostHeal(num11, new Vector2(Main.npc[k].center().X, Main.npc[k].center().Y));
}
if (this.type == 304 && num11 > 0 && Main.npc[k].lifeMax > 5)
{
this.vampireHeal(num11, new Vector2(Main.npc[k].center().X, Main.npc[k].center().Y));
}
if (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.npc[k].value > 0f && Main.player[this.owner].coins && Main.rand.Next(5) == 0)
{
int num12 = 71;
if (Main.rand.Next(10) == 0)
{
num12 = 72;
}
if (Main.rand.Next(100) == 0)
{
num12 = 73;
}
int num13 = Item.NewItem((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height, num12, 1, false, 0, false);
Main.item[num13].stack = Main.rand.Next(1, 11);
Main.item[num13].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
Main.item[num13].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)this.direction;
if (Main.netMode == 1)
{
NetMessage.SendData(21, -1, -1, "", num13, 0f, 0f, 0f, 0);
}
}
if (Main.netMode != 0)
{
if (flag2)
{
NetMessage.SendData(28, -1, -1, "", k, (float)num9, this.knockBack, (float)this.direction, 1);
}
else
{
NetMessage.SendData(28, -1, -1, "", k, (float)num9, this.knockBack, (float)this.direction, 0);
}
}
if (this.type == 286)
{
Main.npc[k].immune[this.owner] = 5;
}
else
{
if (this.penetrate != 1)
{
Main.npc[k].immune[this.owner] = 10;
}
}
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;
}
}
this.numHits++;
}
}
}
}
}
if (this.damage > 0 && Main.player[Main.myPlayer].hostile)
{
for (int l = 0; l < 255; l++)
{
if (l != this.owner && Main.player[l].active && !Main.player[l].dead && !Main.player[l].immune && Main.player[l].hostile && this.playerImmune[l] <= 0 && (Main.player[Main.myPlayer].team == 0 || Main.player[Main.myPlayer].team != Main.player[l].team) && (!this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.player[l].position, Main.player[l].width, Main.player[l].height)))
{
Rectangle value3 = new Rectangle((int)Main.player[l].position.X, (int)Main.player[l].position.Y, Main.player[l].width, Main.player[l].height);
if (rectangle.Intersects(value3))
{
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[l].position.X + (float)(Main.player[l].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 flag3 = false;
if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit)
{
flag3 = true;
}
int num14 = Main.DamageVar((float)this.damage);
if (!Main.player[l].immune)
{
this.StatusPvP(l);
}
if (this.type != 221 && this.type != 227)
{
Main.player[this.owner].onHit(Main.player[l].center().X, Main.player[l].center().Y);
}
int num15 = (int)Main.player[l].Hurt(num14, this.direction, true, false, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), flag3);
if (num15 > 0 && Main.player[this.owner].ghostHeal)
{
this.ghostHeal(num15, new Vector2(Main.player[l].center().X, Main.player[l].center().Y));
}
if (this.type == 304 && num15 > 0)
{
this.vampireHeal(num15, new Vector2(Main.player[l].center().X, Main.player[l].center().Y));
}
if (this.melee && Main.player[this.owner].meleeEnchant == 7)
{
Projectile.NewProjectile(Main.player[l].center().X, Main.player[l].center().Y, Main.player[l].velocity.X, Main.player[l].velocity.Y, 289, 0, 0f, this.owner, 0f, 0f);
}
if (Main.netMode != 0)
{
if (flag3)
{
NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), l, (float)this.direction, (float)num14, 1f, 1);
}
else
{
NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), l, (float)this.direction, (float)num14, 1f, 0);
}
}
this.playerImmune[l] = 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;
}
}
}
}
}
}
}
if (this.type == 11 && Main.netMode != 1)
{
for (int m = 0; m < 200; m++)
{
if (Main.npc[m].active)
{
if (Main.npc[m].type == 46)
{
Rectangle value4 = new Rectangle((int)Main.npc[m].position.X, (int)Main.npc[m].position.Y, Main.npc[m].width, Main.npc[m].height);
if (rectangle.Intersects(value4))
{
Main.npc[m].Transform(47);
}
}
else
{
if (Main.npc[m].type == 55)
{
Rectangle value5 = new Rectangle((int)Main.npc[m].position.X, (int)Main.npc[m].position.Y, Main.npc[m].width, Main.npc[m].height);
if (rectangle.Intersects(value5))
{
Main.npc[m].Transform(57);
}
}
}
}
}
}
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)
{
Rectangle value6 = new Rectangle((int)Main.player[myPlayer2].position.X, (int)Main.player[myPlayer2].position.Y, Main.player[myPlayer2].width, Main.player[myPlayer2].height);
if (rectangle.Intersects(value6))
{
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 num16 = Main.DamageVar((float)this.damage);
if (!Main.player[myPlayer2].immune)
{
this.StatusPlayer(myPlayer2);
}
Main.player[myPlayer2].Hurt(num16 * 2, hitDirection, false, false, Lang.deathMsg(-1, -1, this.whoAmI, -1), false);
}
}
}
}
public void ProjLight()
{
if (this.light > 0f)
{
float num = this.light;
float num2 = this.light;
float num3 = this.light;
if (this.type == 259)
{
num3 *= 0.1f;
}
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 == 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 == 53)
{
num *= 0.7f;
num2 *= 0.8f;
}
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)
{
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 Vector2 center()
{
return new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2));
}
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)
{
if (Main.player[this.owner].frostBurn && (this.melee || this.ranged) && this.friendly && !this.hostile && Main.rand.Next(2 * (1 + this.maxUpdates)) == 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_F2_cp_0 = Main.dust[num];
expr_F2_cp_0.velocity.Y = expr_F2_cp_0.velocity.Y - 0.5f;
}
if (this.melee && Main.player[this.owner].meleeEnchant > 0)
{
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_309_cp_0 = Main.dust[num4];
expr_309_cp_0.velocity.Y = expr_309_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_3D5_cp_0 = Main.dust[num5];
expr_3D5_cp_0.velocity.Y = expr_3D5_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_488_cp_0 = Main.dust[num6];
expr_488_cp_0.velocity.X = expr_488_cp_0.velocity.X / 2f;
Dust expr_4A6_cp_0 = Main.dust[num6];
expr_4A6_cp_0.velocity.Y = expr_4A6_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_529_cp_0 = Main.dust[num7];
expr_529_cp_0.velocity.X = expr_529_cp_0.velocity.X + (float)this.direction;
Dust expr_549_cp_0 = Main.dust[num7];
expr_549_cp_0.velocity.Y = expr_549_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_5DA_cp_0 = Main.dust[num8];
expr_5DA_cp_0.velocity.X = expr_5DA_cp_0.velocity.X + (float)this.direction;
Dust expr_5FA_cp_0 = Main.dust[num8];
expr_5FA_cp_0.velocity.Y = expr_5FA_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_6AA_cp_0 = Main.dust[num10];
expr_6AA_cp_0.velocity.X = expr_6AA_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_6DE_cp_0 = Main.dust[num10];
expr_6DE_cp_0.velocity.Y = expr_6DE_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_712_cp_0 = Main.dust[num10];
expr_712_cp_0.velocity.X = expr_712_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Dust expr_740_cp_0 = Main.dust[num10];
expr_740_cp_0.velocity.Y = expr_740_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_7DE_cp_0 = Main.gore[num12];
expr_7DE_cp_0.velocity.X = expr_7DE_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Gore expr_812_cp_0 = Main.gore[num12];
expr_812_cp_0.velocity.Y = expr_812_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_875_cp_0 = Main.gore[num12];
expr_875_cp_0.velocity.X = expr_875_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Gore expr_8A3_cp_0 = Main.gore[num12];
expr_8A3_cp_0.velocity.Y = expr_8A3_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 && 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_A3D_cp_0 = Main.dust[num14];
expr_A3D_cp_0.velocity.X = expr_A3D_cp_0.velocity.X * 2f;
Dust expr_A5B_cp_0 = Main.dust[num14];
expr_A5B_cp_0.velocity.Y = expr_A5B_cp_0.velocity.Y * 2f;
}
if (this.minion)
{
this.minionPos = Main.player[this.owner].numMinions;
if (this.minionPos >= Main.player[this.owner].maxMinions)
{
this.Kill();
}
Main.player[this.owner].numMinions++;
}
this.lastVelocity = this.velocity;
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;
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;
}
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]--;
}
}
this.AI();
if (this.owner < 255 && !Main.player[this.owner].active)
{
this.Kill();
}
if (this.type == 242 || this.type == 302)
{
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 k = 0; k < 10; k++)
{
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_E4D_cp_0 = Main.dust[num16];
expr_E4D_cp_0.velocity.Y = expr_E4D_cp_0.velocity.Y - 1f;
Dust expr_E6B_cp_0 = Main.dust[num16];
expr_E6B_cp_0.velocity.X = expr_E6B_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 l = 0; l < 10; l++)
{
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_F56_cp_0 = Main.dust[num17];
expr_F56_cp_0.velocity.Y = expr_F56_cp_0.velocity.Y - 4f;
Dust expr_F74_cp_0 = Main.dust[num17];
expr_F74_cp_0.velocity.X = expr_F74_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 m = 0; m < 10; m++)
{
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_105C_cp_0 = Main.dust[num18];
expr_105C_cp_0.velocity.Y = expr_105C_cp_0.velocity.Y - 1.5f;
Dust expr_107A_cp_0 = Main.dust[num18];
expr_107A_cp_0.velocity.X = expr_107A_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 n = 0; n < 10; n++)
{
int num19 = 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_11D0_cp_0 = Main.dust[num19];
expr_11D0_cp_0.velocity.Y = expr_11D0_cp_0.velocity.Y - 1f;
Dust expr_11EE_cp_0 = Main.dust[num19];
expr_11EE_cp_0.velocity.X = expr_11EE_cp_0.velocity.X * 2.5f;
Main.dust[num19].scale = 1.3f;
Main.dust[num19].alpha = 100;
Main.dust[num19].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
else
{
for (int num20 = 0; num20 < 10; num20++)
{
int num21 = 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_12D3_cp_0 = Main.dust[num21];
expr_12D3_cp_0.velocity.Y = expr_12D3_cp_0.velocity.Y - 4f;
Dust expr_12F1_cp_0 = Main.dust[num21];
expr_12F1_cp_0.velocity.X = expr_12F1_cp_0.velocity.X * 2.5f;
Main.dust[num21].scale = 1.3f;
Main.dust[num21].alpha = 100;
Main.dust[num21].noGravity = true;
}
Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1);
}
}
else
{
for (int num22 = 0; num22 < 10; num22++)
{
int num23 = 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_13D9_cp_0 = Main.dust[num23];
expr_13D9_cp_0.velocity.Y = expr_13D9_cp_0.velocity.Y - 1.5f;
Dust expr_13F7_cp_0 = Main.dust[num23];
expr_13F7_cp_0.velocity.X = expr_13F7_cp_0.velocity.X * 2.5f;
Main.dust[num23].scale = 1.3f;
Main.dust[num23].alpha = 100;
Main.dust[num23].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.lastPosition = this.position;
bool flag3 = false;
if (this.tileCollide)
{
Vector2 vector = this.velocity;
bool flag4 = true;
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 (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.aiStyle == 10)
{
if (this.type == 42 || this.type == 65 || this.type == 68 || (this.type == 31 && this.ai[0] == 2f))
{
this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4);
}
else
{
this.velocity = Collision.AnyCollision(this.position, this.velocity, this.width, this.height);
}
}
else
{
if (this.aiStyle == 29)
{
int num24 = this.width - 8;
int num25 = this.height - 8;
Vector2 vector2 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num24 / 2), this.position.Y + (float)(this.height / 2) - (float)(num25 / 2));
this.velocity = Collision.TileCollision(vector2, this.velocity, num24, num25, flag4, flag4);
}
else
{
if (this.aiStyle == 49)
{
int num26 = this.width - 8;
int num27 = this.height - 8;
Vector2 vector3 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num26 / 2), this.position.Y + (float)(this.height / 2) - (float)(num27 / 2));
this.velocity = Collision.TileCollision(vector3, this.velocity, num26, num27, flag4, flag4);
}
else
{
if (this.type == 250 || this.type == 267 || this.type == 297)
{
int num28 = 2;
int num29 = 2;
Vector2 vector4 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num28 / 2), this.position.Y + (float)(this.height / 2) - (float)(num29 / 2));
this.velocity = Collision.TileCollision(vector4, this.velocity, num28, num29, flag4, flag4);
}
else
{
if (this.type == 308)
{
int num30 = 26;
int num31 = this.height;
Vector2 vector5 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num30 / 2), this.position.Y + (float)(this.height / 2) - (float)(num31 / 2));
this.velocity = Collision.TileCollision(vector5, this.velocity, num30, num31, flag4, flag4);
}
else
{
if (this.type == 261 || this.type == 277)
{
int num32 = 26;
int num33 = 26;
Vector2 vector6 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num32 / 2), this.position.Y + (float)(this.height / 2) - (float)(num33 / 2));
this.velocity = Collision.TileCollision(vector6, this.velocity, num32, num33, flag4, flag4);
}
else
{
if (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)
{
int num34 = 10;
int num35 = 10;
Vector2 vector7 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num34 / 2), this.position.Y + (float)(this.height / 2) - (float)(num35 / 2));
this.velocity = Collision.TileCollision(vector7, this.velocity, num34, num35, flag4, flag4);
}
else
{
if (this.type == 248 || this.type == 247)
{
int num36 = this.width - 12;
int num37 = this.height - 12;
Vector2 vector8 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num36 / 2), this.position.Y + (float)(this.height / 2) - (float)(num37 / 2));
this.velocity = Collision.TileCollision(vector8, this.velocity, num36, num37, flag4, flag4);
}
else
{
if (this.aiStyle == 18 || this.type == 254)
{
int num38 = this.width - 36;
int num39 = this.height - 36;
Vector2 vector9 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num38 / 2), this.position.Y + (float)(this.height / 2) - (float)(num39 / 2));
this.velocity = Collision.TileCollision(vector9, this.velocity, num38, num39, flag4, flag4);
}
else
{
if (this.type == 182 || this.type == 190 || this.type == 33 || this.type == 229 || this.type == 237 || this.type == 243)
{
int num40 = this.width - 20;
int num41 = this.height - 20;
Vector2 vector10 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num40 / 2), this.position.Y + (float)(this.height / 2) - (float)(num41 / 2));
this.velocity = Collision.TileCollision(vector10, this.velocity, num40, num41, flag4, flag4);
}
else
{
if (this.aiStyle == 27)
{
int num42 = 6;
this.velocity = Collision.TileCollision(new Vector2(this.position.X + (float)num42, this.position.Y + (float)num42), this.velocity, this.width - num42 * 2, this.height - num42 * 2, flag4, flag4);
}
else
{
if (this.wet)
{
if (this.honeyWet)
{
Vector2 vector11 = this.velocity;
this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4);
value = this.velocity * 0.25f;
if (this.velocity.X != vector11.X)
{
value.X = this.velocity.X;
}
if (this.velocity.Y != vector11.Y)
{
value.Y = this.velocity.Y;
}
}
else
{
Vector2 vector12 = this.velocity;
this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4);
value = this.velocity * 0.5f;
if (this.velocity.X != vector12.X)
{
value.X = this.velocity.X;
}
if (this.velocity.Y != vector12.Y)
{
value.Y = this.velocity.Y;
}
}
}
else
{
this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4);
if (!Main.projPet[this.type])
{
Vector4 vector13 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, 0f);
if (this.position.X != vector13.X)
{
flag3 = true;
}
if (this.position.Y != vector13.Y)
{
flag3 = true;
}
if (this.velocity.X != vector13.Z)
{
flag3 = true;
}
if (this.velocity.Y != vector13.W)
{
flag3 = true;
}
this.position.X = vector13.X;
this.position.Y = vector13.Y;
this.velocity.X = vector13.Z;
this.velocity.Y = vector13.W;
}
}
}
}
}
}
}
}
}
}
}
}
}
if (vector != this.velocity)
{
flag3 = true;
}
if (flag3 && !Main.projPet[this.type])
{
if (this.type == 254)
{
this.tileCollide = false;
this.velocity = this.lastVelocity;
if (this.timeLeft > 30)
{
this.timeLeft = 30;
}
}
else
{
if (this.type == 225 && this.penetrate > 0)
{
this.velocity.X = -vector.X;
this.velocity.Y = -vector.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);
}
}
}
this.ai[1] = 0f;
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.6f;
}
if (this.velocity.Y != vector.Y && vector.Y > 2f)
{
this.velocity.Y = vector.Y * -0.6f;
}
}
else
{
if (this.aiStyle == 33)
{
if (this.localAI[0] == 0f)
{
if (this.wet)
{
this.position += vector / 2f;
}
else
{
this.position += vector;
}
this.velocity *= 0f;
this.localAI[0] = 1f;
}
}
else
{
if (this.type != 308)
{
if (this.type == 94)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
if (this.type == 281)
{
float num43 = Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y);
if (num43 < 2f || this.ai[1] == 2f)
{
this.ai[1] = 2f;
}
else
{
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X * 0.5f;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y * 0.5f;
}
}
}
else
{
if (this.type == 290 || this.type == 294)
{
if (this.velocity.X != vector.X)
{
this.position.X = this.position.X + this.velocity.X;
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.position.Y = this.position.Y + this.velocity.Y;
this.velocity.Y = -vector.Y;
}
}
else
{
if ((this.type == 181 || this.type == 189) && this.penetrate > 0)
{
this.penetrate--;
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
if (this.type == 307 && this.ai[1] < 5f)
{
this.ai[1] += 1f;
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
if (this.type == 99)
{
if (this.velocity.Y != vector.Y && vector.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 = -vector.Y * 0.2f;
}
if (this.velocity.X != vector.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 != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
this.Kill();
}
}
else
{
if (this.aiStyle == 21)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
if (this.aiStyle == 17)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.75f;
}
if (this.velocity.Y != vector.Y && (double)vector.Y > 1.5)
{
this.velocity.Y = vector.Y * -0.7f;
}
}
else
{
if (this.aiStyle == 15)
{
bool flag5 = false;
if (vector.X != this.velocity.X)
{
if (Math.Abs(vector.X) > 4f)
{
flag5 = true;
}
this.position.X = this.position.X + this.velocity.X;
this.velocity.X = -vector.X * 0.2f;
}
if (vector.Y != this.velocity.Y)
{
if (Math.Abs(vector.Y) > 4f)
{
flag5 = true;
}
this.position.Y = this.position.Y + this.velocity.Y;
this.velocity.Y = -vector.Y * 0.2f;
}
this.ai[0] = 1f;
if (flag5)
{
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);
}
}
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 != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
this.ai[0] = 1f;
if (this.aiStyle == 3)
{
this.velocity.X = -vector.X;
this.velocity.Y = -vector.Y;
}
}
this.netUpdate = true;
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
}
else
{
if (this.aiStyle == 3 || this.aiStyle == 13)
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
if (this.type == 33 || this.type == 106)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X;
}
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
else
{
this.ai[0] = 1f;
if (this.aiStyle == 3)
{
this.velocity.X = -vector.X;
this.velocity.Y = -vector.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 != vector.Y)
{
this.velocity.Y = -vector.Y * 0.8f;
}
}
else
{
if (this.velocity.Y != vector.Y)
{
this.velocity.Y = -vector.Y;
}
}
if (this.velocity.X != vector.X)
{
this.velocity.X = -vector.X;
}
}
}
else
{
if (this.aiStyle == 14)
{
if (this.type == 261 && ((this.velocity.X != vector.X && (vector.X < -3f || vector.X > 3f)) || (this.velocity.Y != vector.Y && (vector.Y < -3f || vector.Y > 3f))))
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
Main.PlaySound(0, (int)this.center().X, (int)this.center().Y, 1);
}
if (this.type == 50)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.2f;
}
if (this.velocity.Y != vector.Y && (double)vector.Y > 1.5)
{
this.velocity.Y = vector.Y * -0.2f;
}
}
else
{
if (this.type == 185)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.9f;
}
if (this.velocity.Y != vector.Y && vector.Y > 1f)
{
this.velocity.Y = vector.Y * -0.9f;
}
}
else
{
if (this.type == 277)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.9f;
}
if (this.velocity.Y != vector.Y && vector.Y > 3f)
{
this.velocity.Y = vector.Y * -0.9f;
}
}
else
{
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.5f;
}
if (this.velocity.Y != vector.Y && vector.Y > 1f)
{
this.velocity.Y = vector.Y * -0.5f;
}
}
}
}
}
else
{
if (this.aiStyle == 16)
{
if (this.velocity.X != vector.X)
{
this.velocity.X = vector.X * -0.4f;
if (this.type == 29)
{
this.velocity.X = this.velocity.X * 0.8f;
}
}
if (this.velocity.Y != vector.Y && (double)vector.Y > 0.7 && this.type != 102)
{
this.velocity.Y = vector.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.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)
{
if (this.wet)
{
this.position += value;
}
else
{
this.position += this.velocity;
}
if (Main.projPet[this.type] && this.tileCollide)
{
Vector4 vector14 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, 0f);
if (this.position.X != vector14.X)
{
}
if (this.position.Y != vector14.Y)
{
}
if (this.velocity.X != vector14.Z)
{
}
if (this.velocity.Y != vector14.W)
{
}
this.position.X = vector14.X;
this.position.Y = vector14.Y;
this.velocity.X = vector14.Z;
this.velocity.Y = vector14.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 != 15 || this.ai[0] != 1f) && this.aiStyle != 15 && this.aiStyle != 26)
{
if (this.velocity.X < 0f)
{
this.direction = -1;
}
else
{
this.direction = 1;
}
}
if (this.active)
{
this.ProjLight();
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 num44 = 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[num44].noGravity = true;
Main.dust[num44].scale *= 2f;
}
}
else
{
if (this.type == 278)
{
int num45 = 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[num45].noGravity = true;
Main.dust[num45].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 num46 = Main.rand.Next(3);
if (num46 == 0)
{
num46 = 15;
}
else
{
if (num46 == 1)
{
num46 = 57;
}
else
{
num46 = 58;
}
}
Dust.NewDust(this.position, this.width, this.height, num46, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f);
}
}
}
}
}
}
this.Damage();
if (Main.netMode != 1 && this.type == 99)
{
Collision.SwitchTiles(this.position, this.width, this.height, this.lastPosition, 3);
}
if (this.type == 94 || this.type == 301)
{
for (int num47 = this.oldPos.Length - 1; num47 > 0; num47--)
{
this.oldPos[num47] = this.oldPos[num47 - 1];
}
this.oldPos[0] = this.position;
}
this.timeLeft--;
if (this.timeLeft <= 0)
{
this.Kill();
}
if (this.penetrate == 0)
{
this.Kill();
}
if (this.active && this.owner == Main.myPlayer)
{
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);
this.netUpdate2 = false;
}
else
{
this.netUpdate2 = true;
}
}
if (this.netSpam > 0)
{
this.netSpam--;
}
}
if (this.active && this.maxUpdates > 0)
{
this.numUpdates--;
if (this.numUpdates >= 0)
{
this.Update(i);
}
else
{
this.numUpdates = this.maxUpdates;
}
}
this.netUpdate = false;
return;
}
return;
}
}
public void AI()
{
if (this.aiStyle == 1)
{
if (this.type == 282)
{
int num = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f);
Main.dust[num].scale = (float)Main.rand.Next(1, 10) * 0.1f;
Main.dust[num].noGravity = true;
Main.dust[num].fadeIn = 1.5f;
Main.dust[num].velocity *= 0.25f;
Main.dust[num].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 num2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, 0f, 0f, 0, default(Color), 1f);
Main.dust[num2].noGravity = true;
Main.dust[num2].scale = 1.3f;
Main.dust[num2].velocity *= 0.5f;
}
if (this.type == 174)
{
if (this.alpha == 0)
{
int num3 = Dust.NewDust(this.lastPosition - this.velocity * 3f, this.width, this.height, 76, 0f, 0f, 50, default(Color), 1f);
Main.dust[num3].noGravity = true;
Main.dust[num3].noLight = true;
Main.dust[num3].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 == 176)
{
if (this.alpha == 0)
{
int num4 = Dust.NewDust(this.lastPosition, this.width, this.height, 22, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num4].noGravity = true;
Main.dust[num4].noLight = true;
Main.dust[num4].velocity *= 0.15f;
Main.dust[num4].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 == 83 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33);
}
if (this.type == 259 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33);
}
if (this.type == 110 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
}
if (this.type == 302 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
}
if (this.type == 84 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
if (this.type == 257 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12);
}
if (this.type == 100 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33);
}
if (this.type == 98 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
if (this.type == 184 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
if (this.type == 195 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
if (this.type == 275 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
if (this.type == 276 && this.ai[1] == 0f)
{
this.ai[1] = 1f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
}
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;
}
if (this.type == 180 && this.ai[1] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11);
this.ai[1] = 1f;
}
if (this.type == 248 && this.ai[1] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17);
this.ai[1] = 1f;
}
if (this.type == 41)
{
int num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.6f);
Main.dust[num5].noGravity = true;
num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num5].noGravity = true;
}
else
{
if (this.type == 55)
{
int num6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, 0f, 0f, 0, default(Color), 0.9f);
Main.dust[num6].noGravity = true;
}
else
{
if (this.type == 91 && Main.rand.Next(2) == 0)
{
int num7;
if (Main.rand.Next(2) == 0)
{
num7 = 15;
}
else
{
num7 = 58;
}
int num8 = Dust.NewDust(this.position, this.width, this.height, num7, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 150, default(Color), 0.9f);
Main.dust[num8].velocity *= 0.25f;
}
}
}
if (this.type == 163 || this.type == 310)
{
if (this.alpha > 0)
{
this.alpha -= 25;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 20 || this.type == 14 || this.type == 36 || this.type == 83 || this.type == 84 || this.type == 89 || this.type == 100 || this.type == 104 || this.type == 110 || this.type == 180 || this.type == 279 || (this.type >= 158 && this.type <= 161) || (this.type >= 283 && this.type <= 287))
{
if (this.alpha > 0)
{
this.alpha -= 15;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 242 || this.type == 302)
{
float num9 = (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)num9 * 0.9));
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 257)
{
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 != 5 && this.type != 14 && this.type != 270 && this.type != 180 && this.type != 259 && this.type != 242 && this.type != 302 && this.type != 20 && this.type != 36 && this.type != 38 && this.type != 55 && this.type != 83 && this.type != 84 && this.type != 88 && this.type != 89 && this.type != 98 && this.type != 100 && this.type != 265 && this.type != 104 && this.type != 110 && this.type != 184 && this.type != 257 && this.type != 248 && (this.type < 283 || this.type > 287) && this.type != 279 && this.type != 299 && (this.type < 158 || this.type > 161))
{
this.ai[0] += 1f;
}
if (this.type == 299)
{
if (this.localAI[0] == 6f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8);
for (int i = 0; i < 40; i++)
{
int num10 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, 0f, 0f, 100, default(Color), 1f);
Main.dust[num10].velocity *= 3f;
Main.dust[num10].velocity += this.velocity * 0.75f;
Main.dust[num10].scale *= 1.2f;
Main.dust[num10].noGravity = true;
}
}
this.localAI[0] += 1f;
if (this.localAI[0] > 6f)
{
for (int j = 0; j < 3; j++)
{
int num11 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f);
Main.dust[num11].velocity *= 0.6f;
Main.dust[num11].scale *= 1.4f;
Main.dust[num11].noGravity = true;
}
}
}
else
{
if (this.type == 270)
{
if (this.alpha > 0)
{
this.alpha -= 50;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
this.frame++;
if (this.frame > 2)
{
this.frame = 0;
}
for (int k = 0; k < 2; k++)
{
int num12 = 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);
Main.dust[num12].position -= this.velocity * 2f;
Main.dust[num12].noGravity = true;
Dust expr_10B6_cp_0 = Main.dust[num12];
expr_10B6_cp_0.velocity.X = expr_10B6_cp_0.velocity.X * 0.3f;
Dust expr_10D4_cp_0 = Main.dust[num12];
expr_10D4_cp_0.velocity.Y = expr_10D4_cp_0.velocity.Y * 0.3f;
}
}
}
if (this.type == 259)
{
if (this.alpha > 0)
{
this.alpha -= 10;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.type == 265)
{
if (this.alpha > 0)
{
this.alpha -= 50;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.alpha == 0)
{
int num13 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num13].noGravity = true;
Main.dust[num13].velocity *= 0.3f;
Main.dust[num13].velocity -= this.velocity * 0.4f;
}
}
if (this.type == 207)
{
if (this.alpha < 170)
{
for (int l = 0; l < 10; l++)
{
float x = this.position.X - this.velocity.X / 10f * (float)l;
float y = this.position.Y - this.velocity.Y / 10f * (float)l;
int num14 = Dust.NewDust(new Vector2(x, y), 1, 1, 75, 0f, 0f, 0, default(Color), 1f);
Main.dust[num14].alpha = this.alpha;
Main.dust[num14].position.X = x;
Main.dust[num14].position.Y = y;
Main.dust[num14].velocity *= 0f;
Main.dust[num14].noGravity = true;
}
}
float num15 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y));
float num16 = this.localAI[0];
if (num16 == 0f)
{
this.localAI[0] = num15;
num16 = num15;
}
if (this.alpha > 0)
{
this.alpha -= 25;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
float num17 = this.position.X;
float num18 = this.position.Y;
float num19 = 300f;
bool flag = false;
int num20 = 0;
if (this.ai[1] == 0f)
{
for (int m = 0; m < 200; m++)
{
if (Main.npc[m].active && !Main.npc[m].dontTakeDamage && !Main.npc[m].friendly && Main.npc[m].lifeMax > 5 && (this.ai[1] == 0f || this.ai[1] == (float)(m + 1)))
{
float num21 = Main.npc[m].position.X + (float)(Main.npc[m].width / 2);
float num22 = Main.npc[m].position.Y + (float)(Main.npc[m].height / 2);
float num23 = Math.Abs(this.position.X + (float)(this.width / 2) - num21) + Math.Abs(this.position.Y + (float)(this.height / 2) - num22);
if (num23 < num19 && Collision.CanHit(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), 1, 1, Main.npc[m].position, Main.npc[m].width, Main.npc[m].height))
{
num19 = num23;
num17 = num21;
num18 = num22;
flag = true;
num20 = m;
}
}
}
if (flag)
{
this.ai[1] = (float)(num20 + 1);
}
flag = false;
}
if (this.ai[1] != 0f)
{
int num24 = (int)(this.ai[1] - 1f);
if (Main.npc[num24].active)
{
float num25 = Main.npc[num24].position.X + (float)(Main.npc[num24].width / 2);
float num26 = Main.npc[num24].position.Y + (float)(Main.npc[num24].height / 2);
float num27 = Math.Abs(this.position.X + (float)(this.width / 2) - num25) + Math.Abs(this.position.Y + (float)(this.height / 2) - num26);
if (num27 < 1000f)
{
flag = true;
num17 = Main.npc[num24].position.X + (float)(Main.npc[num24].width / 2);
num18 = Main.npc[num24].position.Y + (float)(Main.npc[num24].height / 2);
}
}
}
if (flag)
{
float num28 = num16;
Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num29 = num17 - vector.X;
float num30 = num18 - vector.Y;
float num31 = (float)Math.Sqrt((double)(num29 * num29 + num30 * num30));
num31 = num28 / num31;
num29 *= num31;
num30 *= num31;
this.velocity.X = (this.velocity.X * 5f + num29) / 6f;
this.velocity.Y = (this.velocity.Y * 5f + num30) / 6f;
}
}
else
{
if (this.type == 81 || this.type == 91)
{
if (this.ai[0] >= 20f)
{
this.ai[0] = 20f;
this.velocity.Y = this.velocity.Y + 0.07f;
}
}
else
{
if (this.type == 174)
{
if (this.ai[0] >= 5f)
{
this.ai[0] = 5f;
this.velocity.Y = this.velocity.Y + 0.15f;
}
}
else
{
if (this.type == 246)
{
this.alpha -= 20;
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[0] >= 60f)
{
this.ai[0] = 60f;
this.velocity.Y = this.velocity.Y + 0.15f;
}
}
else
{
if (this.type != 239 && this.type != 264)
{
if (this.type == 176)
{
if (this.ai[0] >= 15f)
{
this.ai[0] = 15f;
this.velocity.Y = this.velocity.Y + 0.05f;
}
}
else
{
if (this.type == 275 || this.type == 276)
{
if (this.alpha > 0)
{
this.alpha -= 30;
}
if (this.alpha < 0)
{
this.alpha = 0;
}
if (this.ai[0] >= 35f)
{
this.ai[0] = 35f;
this.velocity.Y = this.velocity.Y + 0.025f;
}
}
else
{
if (this.type == 172)
{
if (this.ai[0] >= 17f)
{
this.ai[0] = 17f;
this.velocity.Y = this.velocity.Y + 0.085f;
}
}
else
{
if (this.type == 117)
{
if (this.ai[0] >= 35f)
{
this.ai[0] = 35f;
this.velocity.Y = this.velocity.Y + 0.06f;
}
}
else
{
if (this.type == 120)
{
int num32 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f);
Main.dust[num32].noGravity = true;
Main.dust[num32].velocity *= 0.3f;
if (this.ai[0] >= 30f)
{
this.ai[0] = 30f;
this.velocity.Y = this.velocity.Y + 0.05f;
}
}
else
{
if (this.type == 195)
{
if (this.ai[0] >= 20f)
{
this.ai[0] = 20f;
this.velocity.Y = this.velocity.Y + 0.075f;
}
}
else
{
if (this.type == 267)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 3f)
{
this.alpha = 0;
}
if (this.ai[0] >= 20f)
{
this.ai[0] = 20f;
this.velocity.Y = this.velocity.Y + 0.075f;
}
}
else
{
if (this.ai[0] >= 15f)
{
this.ai[0] = 15f;
this.velocity.Y = this.velocity.Y + 0.1f;
}
}
}
}
}
}
}
}
}
}
}
}
}
if (this.type == 248)
{
if (this.velocity.X < 0f)
{
this.rotation -= (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.05f;
}
else
{
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.05f;
}
}
if (this.type == 270)
{
this.spriteDirection = this.direction;
if (this.direction < 0)
{
this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X));
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
return;
}
}
else
{
if (this.aiStyle == 2)
{
if (this.type == 93 && Main.rand.Next(5) == 0)
{
int num33 = 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_1D89_cp_0 = Main.dust[num33];
expr_1D89_cp_0.velocity.X = expr_1D89_cp_0.velocity.X * 0.3f;
Dust expr_1DA7_cp_0 = Main.dust[num33];
expr_1DA7_cp_0.velocity.Y = expr_1DA7_cp_0.velocity.Y * 0.3f;
}
if (this.type == 304 && this.localAI[0] == 0f)
{
this.localAI[0] += 1f;
this.alpha = 0;
}
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 n = 0; n < 10; n++)
{
int num34 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num34].velocity *= 0.5f;
Main.dust[num34].velocity += this.velocity * 0.1f;
}
for (int num35 = 0; num35 < 5; num35++)
{
int num36 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num36].noGravity = true;
Main.dust[num36].velocity *= 3f;
Main.dust[num36].velocity += this.velocity * 0.2f;
num36 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num36].velocity *= 2f;
Main.dust[num36].velocity += this.velocity * 0.3f;
}
for (int num37 = 0; num37 < 1; num37++)
{
int num38 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num38].position += this.velocity * 1.25f;
Main.gore[num38].scale = 1.5f;
Main.gore[num38].velocity += this.velocity * 0.5f;
Main.gore[num38].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 num39 = 0; num39 < 10; num39++)
{
int num40 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num40].velocity *= 0.5f;
Main.dust[num40].velocity += this.velocity * 0.1f;
}
for (int num41 = 0; num41 < 5; num41++)
{
int num42 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num42].noGravity = true;
Main.dust[num42].velocity *= 3f;
Main.dust[num42].velocity += this.velocity * 0.2f;
num42 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num42].velocity *= 2f;
Main.dust[num42].velocity += this.velocity * 0.3f;
}
for (int num43 = 0; num43 < 1; num43++)
{
int num44 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num44].position += this.velocity * 1.25f;
Main.gore[num44].scale = 1.5f;
Main.gore[num44].velocity += this.velocity * 0.5f;
Main.gore[num44].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 num45 = 0; num45 < 7; num45++)
{
int num46 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num46].velocity *= 0.5f;
Main.dust[num46].velocity += this.velocity * 0.1f;
}
for (int num47 = 0; num47 < 3; num47++)
{
int num48 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num48].noGravity = true;
Main.dust[num48].velocity *= 3f;
Main.dust[num48].velocity += this.velocity * 0.2f;
num48 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num48].velocity *= 2f;
Main.dust[num48].velocity += this.velocity * 0.3f;
}
for (int num49 = 0; num49 < 1; num49++)
{
int num50 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num50].position += this.velocity * 1.25f;
Main.gore[num50].scale = 1.25f;
Main.gore[num50].velocity += this.velocity * 0.5f;
Main.gore[num50].velocity *= 0.02f;
}
}
}
}
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 == 69 || this.type == 70)
{
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 num51 = 0; num51 < 4; num51++)
{
float num52 = this.velocity.X / 4f * (float)num51;
float num53 = this.velocity.Y / 4f * (float)num51;
int num54 = Dust.NewDust(this.position, this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f);
Main.dust[num54].position.X = this.center().X - num52;
Main.dust[num54].position.Y = this.center().Y - num53;
Main.dust[num54].velocity *= 0f;
Main.dust[num54].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
{
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.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.soundDelay = 8;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 7);
}
if (this.type == 19)
{
for (int num55 = 0; num55 < 2; num55++)
{
int num56 = 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[num56].noGravity = true;
Dust expr_2F65_cp_0 = Main.dust[num56];
expr_2F65_cp_0.velocity.X = expr_2F65_cp_0.velocity.X * 0.3f;
Dust expr_2F83_cp_0 = Main.dust[num56];
expr_2F83_cp_0.velocity.Y = expr_2F83_cp_0.velocity.Y * 0.3f;
}
}
else
{
if (this.type == 33)
{
if (Main.rand.Next(1) == 0)
{
int num57 = 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[num57].noGravity = true;
}
}
else
{
if (this.type == 6)
{
if (Main.rand.Next(5) == 0)
{
int num58 = Main.rand.Next(3);
if (num58 == 0)
{
num58 = 15;
}
else
{
if (num58 == 1)
{
num58 = 57;
}
else
{
num58 = 58;
}
}
Dust.NewDust(this.position, this.width, this.height, num58, 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 num59 = 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[num59].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)
{
if (this.ai[1] >= 45f)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
this.netUpdate = true;
}
}
else
{
if (this.type == 182)
{
if (Main.rand.Next(2) == 0)
{
int num60 = Dust.NewDust(this.position, this.width, this.height, 57, 0f, 0f, 255, default(Color), 0.75f);
Main.dust[num60].velocity *= 0.1f;
Main.dust[num60].noGravity = true;
}
if (this.velocity.X > 0f)
{
this.spriteDirection = 1;
}
else
{
if (this.velocity.X < 0f)
{
this.spriteDirection = -1;
}
}
float num61 = this.position.X;
float num62 = this.position.Y;
bool flag2 = false;
if (this.ai[1] > 10f)
{
for (int num63 = 0; num63 < 200; num63++)
{
if (Main.npc[num63].active && !Main.npc[num63].dontTakeDamage && !Main.npc[num63].friendly && Main.npc[num63].lifeMax > 5)
{
float num64 = Main.npc[num63].position.X + (float)(Main.npc[num63].width / 2);
float num65 = Main.npc[num63].position.Y + (float)(Main.npc[num63].height / 2);
float num66 = Math.Abs(this.position.X + (float)(this.width / 2) - num64) + Math.Abs(this.position.Y + (float)(this.height / 2) - num65);
if (num66 < 800f && Collision.CanHit(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), 1, 1, Main.npc[num63].position, Main.npc[num63].width, Main.npc[num63].height))
{
num61 = num64;
num62 = num65;
flag2 = true;
}
}
}
}
if (!flag2)
{
num61 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f;
num62 = 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 num67 = 12f;
float num68 = 0.25f;
Vector2 vector2 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num69 = num61 - vector2.X;
float num70 = num62 - vector2.Y;
float num71 = (float)Math.Sqrt((double)(num69 * num69 + num70 * num70));
num71 = num67 / num71;
num69 *= num71;
num70 *= num71;
if (this.velocity.X < num69)
{
this.velocity.X = this.velocity.X + num68;
if (this.velocity.X < 0f && num69 > 0f)
{
this.velocity.X = this.velocity.X + num68 * 2f;
}
}
else
{
if (this.velocity.X > num69)
{
this.velocity.X = this.velocity.X - num68;
if (this.velocity.X > 0f && num69 < 0f)
{
this.velocity.X = this.velocity.X - num68 * 2f;
}
}
}
if (this.velocity.Y < num70)
{
this.velocity.Y = this.velocity.Y + num68;
if (this.velocity.Y < 0f && num70 > 0f)
{
this.velocity.Y = this.velocity.Y + num68 * 2f;
}
}
else
{
if (this.velocity.Y > num70)
{
this.velocity.Y = this.velocity.Y - num68;
if (this.velocity.Y > 0f && num70 < 0f)
{
this.velocity.Y = this.velocity.Y - num68 * 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 num72 = 9f;
float num73 = 0.4f;
if (this.type == 19)
{
num72 = 13f;
num73 = 0.6f;
}
else
{
if (this.type == 33)
{
num72 = 15f;
num73 = 0.8f;
}
else
{
if (this.type == 182)
{
num72 = 16f;
num73 = 1.2f;
}
else
{
if (this.type == 106)
{
num72 = 16f;
num73 = 1.2f;
}
else
{
if (this.type == 272)
{
num72 = 15f;
num73 = 1f;
}
else
{
if (this.type == 301)
{
num72 = 15f;
num73 = 3f;
}
}
}
}
}
}
Vector2 vector3 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num74 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector3.X;
float num75 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector3.Y;
float num76 = (float)Math.Sqrt((double)(num74 * num74 + num75 * num75));
if (num76 > 3000f)
{
this.Kill();
}
num76 = num72 / num76;
num74 *= num76;
num75 *= num76;
if (this.velocity.X < num74)
{
this.velocity.X = this.velocity.X + num73;
if (this.velocity.X < 0f && num74 > 0f)
{
this.velocity.X = this.velocity.X + num73;
}
}
else
{
if (this.velocity.X > num74)
{
this.velocity.X = this.velocity.X - num73;
if (this.velocity.X > 0f && num74 < 0f)
{
this.velocity.X = this.velocity.X - num73;
}
}
}
if (this.velocity.Y < num75)
{
this.velocity.Y = this.velocity.Y + num73;
if (this.velocity.Y < 0f && num75 > 0f)
{
this.velocity.Y = this.velocity.Y + num73;
}
}
else
{
if (this.velocity.Y > num75)
{
this.velocity.Y = this.velocity.Y - num73;
if (this.velocity.Y > 0f && num75 < 0f)
{
this.velocity.Y = this.velocity.Y - num73;
}
}
}
if (Main.myPlayer == this.owner)
{
Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
Rectangle value = 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(value))
{
this.Kill();
}
}
}
if (this.type == 106)
{
this.rotation += 0.3f * (float)this.direction;
return;
}
this.rotation += 0.4f * (float)this.direction;
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;
}
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 num77 = this.type;
if (this.ai[1] >= 6f)
{
num77++;
}
int num78 = 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, num77, this.damage, this.knockBack, this.owner, 0f, 0f);
Main.projectile[num78].damage = this.damage;
Main.projectile[num78].ai[1] = this.ai[1] + 1f;
NetMessage.SendData(27, -1, -1, "", num78, 0f, 0f, 0f, 0);
return;
}
if ((this.type == 150 || this.type == 151) && Main.myPlayer == this.owner)
{
int num79 = this.type;
if (this.type == 150)
{
num79 = 151;
}
else
{
if (this.type == 151)
{
num79 = 150;
}
}
if (this.ai[1] >= 10f && this.type == 151)
{
num79 = 152;
}
int num80 = 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, num79, this.damage, this.knockBack, this.owner, 0f, 0f);
Main.projectile[num80].damage = this.damage;
Main.projectile[num80].ai[1] = this.ai[1] + 1f;
NetMessage.SendData(27, -1, -1, "", num80, 0f, 0f, 0f, 0);
return;
}
}
}
else
{
if (this.alpha < 170 && this.alpha + 5 >= 170)
{
if (this.type >= 150 && this.type <= 152)
{
for (int num81 = 0; num81 < 8; num81++)
{
int num82 = 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[num82].noGravity = true;
Main.dust[num82].velocity *= 0.5f;
}
}
else
{
for (int num83 = 0; num83 < 3; num83++)
{
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
{
this.alpha += 5;
}
if (this.alpha >= 255)
{
this.Kill();
return;
}
}
}
else
{
if (this.aiStyle == 5)
{
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.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;
}
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f * (float)this.direction;
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;
for (int num84 = 0; num84 < 30; num84++)
{
Dust.NewDust(this.position, this.width, this.height, 10 + this.type, this.velocity.X, this.velocity.Y, 50, default(Color), 1f);
}
}
if (this.type == 10 || this.type == 11)
{
int num85 = (int)(this.position.X / 16f) - 1;
int num86 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num87 = (int)(this.position.Y / 16f) - 1;
int num88 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num85 < 0)
{
num85 = 0;
}
if (num86 > Main.maxTilesX)
{
num86 = Main.maxTilesX;
}
if (num87 < 0)
{
num87 = 0;
}
if (num88 > Main.maxTilesY)
{
num88 = Main.maxTilesY;
}
for (int num89 = num85; num89 < num86; num89++)
{
for (int num90 = num87; num90 < num88; num90++)
{
Vector2 vector4;
vector4.X = (float)(num89 * 16);
vector4.Y = (float)(num90 * 16);
if (this.position.X + (float)this.width > vector4.X && this.position.X < vector4.X + 16f && this.position.Y + (float)this.height > vector4.Y && this.position.Y < vector4.Y + 16f && Main.myPlayer == this.owner && Main.tile[num89, num90].active())
{
if (this.type == 10)
{
if (Main.tile[num89, num90].type == 23 || Main.tile[num89, num90].type == 199)
{
Main.tile[num89, num90].type = 2;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
if (Main.tile[num89, num90].type == 25 || Main.tile[num89, num90].type == 203)
{
Main.tile[num89, num90].type = 1;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
if (Main.tile[num89, num90].type == 112 || Main.tile[num89, num90].type == 234)
{
Main.tile[num89, num90].type = 53;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
if (Main.tile[num89, num90].type == 163 || Main.tile[num89, num90].type == 200)
{
Main.tile[num89, num90].type = 161;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
}
else
{
if (this.type == 11)
{
if (Main.tile[num89, num90].type == 109)
{
Main.tile[num89, num90].type = 2;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
if (Main.tile[num89, num90].type == 116)
{
Main.tile[num89, num90].type = 53;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
if (Main.tile[num89, num90].type == 117)
{
Main.tile[num89, num90].type = 1;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
if (Main.tile[num89, num90].type == 164)
{
Main.tile[num89, num90].type = 161;
WorldGen.SquareTileFrame(num89, num90, true);
if (Main.netMode == 1)
{
NetMessage.SendTileSquare(-1, num89, num90, 1);
}
}
}
}
}
}
}
return;
}
}
else
{
if (this.aiStyle == 7)
{
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
Vector2 vector5 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num91 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector5.X;
float num92 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector5.Y;
float num93 = (float)Math.Sqrt((double)(num91 * num91 + num92 * num92));
this.rotation = (float)Math.Atan2((double)num92, (double)num91) - 1.57f;
if (this.type == 256)
{
this.rotation = (float)Math.Atan2((double)num92, (double)num91) + 3.92500019f;
}
if (this.ai[0] == 0f)
{
if ((num93 > 300f && this.type == 13) || (num93 > 400f && this.type == 32) || (num93 > 440f && this.type == 73) || (num93 > 440f && this.type == 74) || (num93 > 250f && this.type == 165) || (num93 > 350f && this.type == 256))
{
this.ai[0] = 1f;
}
else
{
if (this.type >= 230 && this.type <= 235)
{
int num94 = 300 + (this.type - 230) * 30;
if (num93 > (float)num94)
{
this.ai[0] = 1f;
}
}
}
int num95 = (int)(this.position.X / 16f) - 1;
int num96 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num97 = (int)(this.position.Y / 16f) - 1;
int num98 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num95 < 0)
{
num95 = 0;
}
if (num96 > Main.maxTilesX)
{
num96 = Main.maxTilesX;
}
if (num97 < 0)
{
num97 = 0;
}
if (num98 > Main.maxTilesY)
{
num98 = Main.maxTilesY;
}
for (int num99 = num95; num99 < num96; num99++)
{
int num100 = num97;
while (num100 < num98)
{
if (Main.tile[num99, num100] == null)
{
Main.tile[num99, num100] = new Tile();
}
Vector2 vector6;
vector6.X = (float)(num99 * 16);
vector6.Y = (float)(num100 * 16);
if (this.position.X + (float)this.width > vector6.X && this.position.X < vector6.X + 16f && this.position.Y + (float)this.height > vector6.Y && this.position.Y < vector6.Y + 16f && Main.tile[num99, num100].nactive() && Main.tileSolid[(int)Main.tile[num99, num100].type])
{
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 num101 = 0;
int num102 = -1;
int num103 = 100000;
if (this.type == 73 || this.type == 74)
{
for (int num104 = 0; num104 < 1000; num104++)
{
if (num104 != this.whoAmI && Main.projectile[num104].active && Main.projectile[num104].owner == this.owner && Main.projectile[num104].aiStyle == 7 && Main.projectile[num104].ai[0] == 2f)
{
Main.projectile[num104].Kill();
}
}
}
else
{
int num105 = 3;
if (this.type == 165)
{
num105 = 8;
}
if (this.type == 256)
{
num105 = 2;
}
for (int num106 = 0; num106 < 1000; num106++)
{
if (Main.projectile[num106].active && Main.projectile[num106].owner == this.owner && Main.projectile[num106].aiStyle == 7)
{
if (Main.projectile[num106].timeLeft < num103)
{
num102 = num106;
num103 = Main.projectile[num106].timeLeft;
}
num101++;
}
}
if (num101 > num105)
{
Main.projectile[num102].Kill();
}
}
}
WorldGen.KillTile(num99, num100, true, true, false);
Main.PlaySound(0, num99 * 16, num100 * 16, 1);
this.velocity.X = 0f;
this.velocity.Y = 0f;
this.ai[0] = 2f;
this.position.X = (float)(num99 * 16 + 8 - this.width / 2);
this.position.Y = (float)(num100 * 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);
break;
}
break;
}
else
{
num100++;
}
}
if (this.ai[0] == 2f)
{
return;
}
}
return;
}
if (this.ai[0] == 1f)
{
float num107 = 11f;
if (this.type == 32)
{
num107 = 15f;
}
if (this.type == 73 || this.type == 74)
{
num107 = 17f;
}
if (this.type >= 230 && this.type <= 235)
{
num107 = 11f + (float)(this.type - 230) * 0.75f;
}
if (num93 < 24f)
{
this.Kill();
}
num93 = num107 / num93;
num91 *= num93;
num92 *= num93;
this.velocity.X = num91;
this.velocity.Y = num92;
return;
}
if (this.ai[0] == 2f)
{
int num108 = (int)(this.position.X / 16f) - 1;
int num109 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num110 = (int)(this.position.Y / 16f) - 1;
int num111 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num108 < 0)
{
num108 = 0;
}
if (num109 > Main.maxTilesX)
{
num109 = Main.maxTilesX;
}
if (num110 < 0)
{
num110 = 0;
}
if (num111 > Main.maxTilesY)
{
num111 = Main.maxTilesY;
}
bool flag3 = true;
for (int num112 = num108; num112 < num109; num112++)
{
for (int num113 = num110; num113 < num111; num113++)
{
if (Main.tile[num112, num113] == null)
{
Main.tile[num112, num113] = new Tile();
}
Vector2 vector7;
vector7.X = (float)(num112 * 16);
vector7.Y = (float)(num113 * 16);
if (this.position.X + (float)(this.width / 2) > vector7.X && this.position.X + (float)(this.width / 2) < vector7.X + 16f && this.position.Y + (float)(this.height / 2) > vector7.Y && this.position.Y + (float)(this.height / 2) < vector7.Y + 16f && Main.tile[num112, num113].nactive() && Main.tileSolid[(int)Main.tile[num112, num113].type])
{
flag3 = false;
}
}
}
if (flag3)
{
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 num114 = 0; num114 < 5; num114++)
{
float num115 = this.velocity.X / 3f * (float)num114;
float num116 = this.velocity.Y / 3f * (float)num114;
int num117 = 4;
int num118 = Dust.NewDust(new Vector2(this.position.X + (float)num117, this.position.Y + (float)num117), this.width - num117 * 2, this.height - num117 * 2, 172, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num118].noGravity = true;
Main.dust[num118].velocity *= 0.1f;
Main.dust[num118].velocity += this.velocity * 0.1f;
Dust expr_52E1_cp_0 = Main.dust[num118];
expr_52E1_cp_0.position.X = expr_52E1_cp_0.position.X - num115;
Dust expr_52FC_cp_0 = Main.dust[num118];
expr_52FC_cp_0.position.Y = expr_52FC_cp_0.position.Y - num116;
}
if (Main.rand.Next(5) == 0)
{
int num119 = 4;
int num120 = Dust.NewDust(new Vector2(this.position.X + (float)num119, this.position.Y + (float)num119), this.width - num119 * 2, this.height - num119 * 2, 172, 0f, 0f, 100, default(Color), 0.6f);
Main.dust[num120].velocity *= 0.25f;
Main.dust[num120].velocity += this.velocity * 0.5f;
}
}
else
{
if (this.type == 95 || this.type == 96)
{
int num121 = 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[num121].noGravity = true;
}
else
{
if (this.type == 253)
{
for (int num122 = 0; num122 < 2; num122++)
{
int num123 = 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[num123].noGravity = true;
Dust expr_551A_cp_0 = Main.dust[num123];
expr_551A_cp_0.velocity.X = expr_551A_cp_0.velocity.X * 0.3f;
Dust expr_5538_cp_0 = Main.dust[num123];
expr_5538_cp_0.velocity.Y = expr_5538_cp_0.velocity.Y * 0.3f;
}
}
else
{
for (int num124 = 0; num124 < 2; num124++)
{
int num125 = 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[num125].noGravity = true;
Dust expr_55E5_cp_0 = Main.dust[num125];
expr_55E5_cp_0.velocity.X = expr_55E5_cp_0.velocity.X * 0.3f;
Dust expr_5603_cp_0 = Main.dust[num125];
expr_5603_cp_0.velocity.Y = expr_5603_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;
}
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 == 34)
{
int num126 = 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[num126].noGravity = true;
Main.dust[num126].velocity *= 1.4f;
num126 = 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 num127 = 0; num127 < 1; num127++)
{
int num128 = 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[num128].velocity *= 0.1f;
Main.dust[num128].velocity += this.velocity * 0.2f;
Main.dust[num128].position.X = this.position.X + (float)(this.width / 2) + 4f + (float)Main.rand.Next(-2, 3);
Main.dust[num128].position.Y = this.position.Y + (float)(this.height / 2) + (float)Main.rand.Next(-2, 3);
Main.dust[num128].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 num129 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 2f);
Main.dust[num129].velocity *= 0.3f;
Main.dust[num129].position.X = this.position.X + (float)(this.width / 2) + 4f + (float)Main.rand.Next(-4, 5);
Main.dust[num129].position.Y = this.position.Y + (float)(this.height / 2) + (float)Main.rand.Next(-4, 5);
Main.dust[num129].noGravity = true;
}
}
if (Main.myPlayer == this.owner && this.ai[0] == 0f)
{
if (Main.player[this.owner].channel)
{
float num130 = 12f;
if (this.type == 16)
{
num130 = 15f;
}
Vector2 vector8 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num131 = (float)Main.mouseX + Main.screenPosition.X - vector8.X;
float num132 = (float)Main.mouseY + Main.screenPosition.Y - vector8.Y;
if (Main.player[this.owner].gravDir == -1f)
{
num132 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector8.Y;
}
float num133 = (float)Math.Sqrt((double)(num131 * num131 + num132 * num132));
num133 = (float)Math.Sqrt((double)(num131 * num131 + num132 * num132));
if (num133 > num130)
{
num133 = num130 / num133;
num131 *= num133;
num132 *= num133;
int num134 = (int)(num131 * 1000f);
int num135 = (int)(this.velocity.X * 1000f);
int num136 = (int)(num132 * 1000f);
int num137 = (int)(this.velocity.Y * 1000f);
if (num134 != num135 || num136 != num137)
{
this.netUpdate = true;
}
this.velocity.X = num131;
this.velocity.Y = num132;
}
else
{
int num138 = (int)(num131 * 1000f);
int num139 = (int)(this.velocity.X * 1000f);
int num140 = (int)(num132 * 1000f);
int num141 = (int)(this.velocity.Y * 1000f);
if (num138 != num139 || num140 != num141)
{
this.netUpdate = true;
}
this.velocity.X = num131;
this.velocity.Y = num132;
}
}
else
{
if (this.ai[0] == 0f)
{
this.ai[0] = 1f;
this.netUpdate = true;
float num142 = 12f;
Vector2 vector9 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num143 = (float)Main.mouseX + Main.screenPosition.X - vector9.X;
float num144 = (float)Main.mouseY + Main.screenPosition.Y - vector9.Y;
float num145 = (float)Math.Sqrt((double)(num143 * num143 + num144 * num144));
if (num145 == 0f)
{
vector9 = 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));
num143 = this.position.X + (float)this.width * 0.5f - vector9.X;
num144 = this.position.Y + (float)this.height * 0.5f - vector9.Y;
num145 = (float)Math.Sqrt((double)(num143 * num143 + num144 * num144));
}
num145 = num142 / num145;
num143 *= num145;
num144 *= num145;
this.velocity.X = num143;
this.velocity.Y = num144;
if (this.velocity.X == 0f && this.velocity.Y == 0f)
{
this.Kill();
}
}
}
}
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 num146 = 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_5FE2_cp_0 = Main.dust[num146];
expr_5FE2_cp_0.velocity.X = expr_5FE2_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 39)
{
if (Main.rand.Next(2) == 0)
{
int num147 = 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_607C_cp_0 = Main.dust[num147];
expr_607C_cp_0.velocity.X = expr_607C_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 40)
{
if (Main.rand.Next(2) == 0)
{
int num148 = 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[num148].velocity *= 0.4f;
}
}
else
{
if (this.type == 42 || this.type == 31)
{
if (Main.rand.Next(2) == 0)
{
int num149 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, 0f, 0, default(Color), 1f);
Dust expr_61AD_cp_0 = Main.dust[num149];
expr_61AD_cp_0.velocity.X = expr_61AD_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 56 || this.type == 65)
{
if (Main.rand.Next(2) == 0)
{
int num150 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 0, default(Color), 1f);
Dust expr_6245_cp_0 = Main.dust[num150];
expr_6245_cp_0.velocity.X = expr_6245_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 67 || this.type == 68)
{
if (Main.rand.Next(2) == 0)
{
int num151 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51, 0f, 0f, 0, default(Color), 1f);
Dust expr_62DD_cp_0 = Main.dust[num151];
expr_62DD_cp_0.velocity.X = expr_62DD_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 71)
{
if (Main.rand.Next(2) == 0)
{
int num152 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53, 0f, 0f, 0, default(Color), 1f);
Dust expr_636B_cp_0 = Main.dust[num152];
expr_636B_cp_0.velocity.X = expr_636B_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 179)
{
if (Main.rand.Next(2) == 0)
{
int num153 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 149, 0f, 0f, 0, default(Color), 1f);
Dust expr_63FF_cp_0 = Main.dust[num153];
expr_63FF_cp_0.velocity.X = expr_63FF_cp_0.velocity.X * 0.4f;
}
}
else
{
if (this.type == 241)
{
if (Main.rand.Next(2) == 0)
{
int num154 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, 0f, 0, default(Color), 1f);
Dust expr_648D_cp_0 = Main.dust[num154];
expr_648D_cp_0.velocity.X = expr_648D_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);
}
}
}
}
}
}
}
}
}
}
if (Main.myPlayer == this.owner && this.ai[0] == 0f)
{
if (Main.player[this.owner].channel)
{
float num155 = 12f;
Vector2 vector10 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num156 = (float)Main.mouseX + Main.screenPosition.X - vector10.X;
float num157 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y;
float num158 = (float)Math.Sqrt((double)(num156 * num156 + num157 * num157));
num158 = (float)Math.Sqrt((double)(num156 * num156 + num157 * num157));
if (num158 > num155)
{
num158 = num155 / num158;
num156 *= num158;
num157 *= num158;
if (num156 != this.velocity.X || num157 != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity.X = num156;
this.velocity.Y = num157;
}
else
{
if (num156 != this.velocity.X || num157 != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity.X = num156;
this.velocity.Y = num157;
}
}
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.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 num159 = 56;
if (this.type == 86)
{
num159 = 73;
}
else
{
if (this.type == 87)
{
num159 = 74;
}
}
int num160 = Dust.NewDust(this.position, this.width, this.height, num159, 0f, 0f, 200, default(Color), 0.8f);
Main.dust[num160].velocity *= 0.3f;
}
}
else
{
this.rotation += 0.02f;
}
if (Main.myPlayer == this.owner)
{
if (this.type == 72 || this.type == 86 || this.type == 87)
{
if (Main.player[Main.myPlayer].fairy)
{
this.timeLeft = 2;
}
}
else
{
if (Main.player[Main.myPlayer].lightOrb)
{
this.timeLeft = 2;
}
}
}
if (Main.player[this.owner].dead)
{
this.Kill();
return;
}
float num161 = 3f;
if (this.type == 72 || this.type == 86 || this.type == 87)
{
num161 = 3.75f;
}
Vector2 vector11 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num162 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector11.X;
float num163 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector11.Y;
int num164 = 70;
if (this.type == 18)
{
if (Main.player[this.owner].controlUp)
{
num163 = Main.player[this.owner].position.Y - 40f - vector11.Y;
num162 -= 6f;
num164 = 4;
}
else
{
if (Main.player[this.owner].controlDown)
{
num163 = Main.player[this.owner].position.Y + (float)Main.player[this.owner].height + 40f - vector11.Y;
num162 -= 6f;
num164 = 4;
}
}
}
float num165 = (float)Math.Sqrt((double)(num162 * num162 + num163 * num163));
num165 = (float)Math.Sqrt((double)(num162 * num162 + num163 * num163));
if (this.type == 72 || this.type == 86 || this.type == 87)
{
num164 = 40;
}
if (num165 > 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 (num165 > (float)num164)
{
num165 = num161 / num165;
num162 *= num165;
num163 *= num165;
this.velocity.X = num162;
this.velocity.Y = num163;
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 num166 = 0; num166 < 3; num166++)
{
float num167 = this.velocity.X / 3f * (float)num166;
float num168 = this.velocity.Y / 3f * (float)num166;
int num169 = 14;
int num170 = Dust.NewDust(new Vector2(this.position.X + (float)num169, this.position.Y + (float)num169), this.width - num169 * 2, this.height - num169 * 2, 170, 0f, 0f, 100, default(Color), 1f);
Main.dust[num170].noGravity = true;
Main.dust[num170].velocity *= 0.1f;
Main.dust[num170].velocity += this.velocity * 0.5f;
Dust expr_6E74_cp_0 = Main.dust[num170];
expr_6E74_cp_0.position.X = expr_6E74_cp_0.position.X - num167;
Dust expr_6E8F_cp_0 = Main.dust[num170];
expr_6E8F_cp_0.position.Y = expr_6E8F_cp_0.position.Y - num168;
}
if (Main.rand.Next(8) == 0)
{
int num171 = 16;
int num172 = Dust.NewDust(new Vector2(this.position.X + (float)num171, this.position.Y + (float)num171), this.width - num171 * 2, this.height - num171 * 2, 170, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num172].velocity *= 0.25f;
Main.dust[num172].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 num173 = 0; num173 < 1; num173++)
{
for (int num174 = 0; num174 < 3; num174++)
{
float num175 = this.velocity.X / 3f * (float)num174;
float num176 = this.velocity.Y / 3f * (float)num174;
int num177 = 6;
int num178 = Dust.NewDust(new Vector2(this.position.X + (float)num177, this.position.Y + (float)num177), this.width - num177 * 2, this.height - num177 * 2, 172, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num178].noGravity = true;
Main.dust[num178].velocity *= 0.3f;
Main.dust[num178].velocity += this.velocity * 0.5f;
Dust expr_70DA_cp_0 = Main.dust[num178];
expr_70DA_cp_0.position.X = expr_70DA_cp_0.position.X - num175;
Dust expr_70F5_cp_0 = Main.dust[num178];
expr_70F5_cp_0.position.Y = expr_70F5_cp_0.position.Y - num176;
}
if (Main.rand.Next(8) == 0)
{
int num179 = 6;
int num180 = Dust.NewDust(new Vector2(this.position.X + (float)num179, this.position.Y + (float)num179), this.width - num179 * 2, this.height - num179 * 2, 172, 0f, 0f, 100, default(Color), 0.75f);
Main.dust[num180].velocity *= 0.5f;
Main.dust[num180].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;
}
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);
}
}
Vector2 vector12 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num181 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector12.X;
float num182 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector12.Y;
float num183 = (float)Math.Sqrt((double)(num181 * num181 + num182 * num182));
if (this.ai[0] == 0f)
{
if (num183 > 700f)
{
this.ai[0] = 1f;
}
else
{
if (this.type == 262 && num183 > 500f)
{
this.ai[0] = 1f;
}
else
{
if (this.type == 271 && num183 > 200f)
{
this.ai[0] = 1f;
}
else
{
if (this.type == 273 && num183 > 150f)
{
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.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)num182, (double)num181) - 1.57f;
float num184 = 20f;
if (this.type == 262)
{
num184 = 30f;
}
if (num183 < 50f)
{
this.Kill();
}
num183 = num184 / num183;
num181 *= num183;
num182 *= num183;
this.velocity.X = num181;
this.velocity.Y = num182;
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 == 196)
{
int num185 = Main.rand.Next(1, 3);
for (int num186 = 0; num186 < num185; num186++)
{
int num187 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num187].alpha += Main.rand.Next(100);
Main.dust[num187].velocity *= 0.3f;
Dust expr_7745_cp_0 = Main.dust[num187];
expr_7745_cp_0.velocity.X = expr_7745_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.025f;
Dust expr_7773_cp_0 = Main.dust[num187];
expr_7773_cp_0.velocity.Y = expr_7773_cp_0.velocity.Y - (0.4f + (float)Main.rand.Next(-3, 14) * 0.15f);
Main.dust[num187].fadeIn = 1.25f + (float)Main.rand.Next(20) * 0.15f;
}
}
if (this.type == 53)
{
try
{
Vector2 value2 = Collision.TileCollision(this.position, this.velocity, this.width, this.height, false, false);
//this.velocity != value2;
int num188 = (int)(this.position.X / 16f) - 1;
int num189 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num190 = (int)(this.position.Y / 16f) - 1;
int num191 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num188 < 0)
{
num188 = 0;
}
if (num189 > Main.maxTilesX)
{
num189 = Main.maxTilesX;
}
if (num190 < 0)
{
num190 = 0;
}
if (num191 > Main.maxTilesY)
{
num191 = Main.maxTilesY;
}
for (int num192 = num188; num192 < num189; num192++)
{
for (int num193 = num190; num193 < num191; num193++)
{
if (Main.tile[num192, num193] != null && Main.tile[num192, num193].nactive() && (Main.tileSolid[(int)Main.tile[num192, num193].type] || (Main.tileSolidTop[(int)Main.tile[num192, num193].type] && Main.tile[num192, num193].frameY == 0)))
{
Vector2 vector13;
vector13.X = (float)(num192 * 16);
vector13.Y = (float)(num193 * 16);
if (this.position.X + (float)this.width > vector13.X && this.position.X < vector13.X + 16f && this.position.Y + (float)this.height > vector13.Y && this.position.Y < vector13.Y + 16f)
{
this.velocity.X = 0f;
this.velocity.Y = -0.2f;
}
}
}
}
}
catch
{
}
}
if (this.type == 277 && this.alpha > 0)
{
this.alpha -= 30;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
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
{
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.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 num194 = 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[num194].noGravity = true;
Dust expr_7D2E_cp_0 = Main.dust[num194];
expr_7D2E_cp_0.velocity.X = expr_7D2E_cp_0.velocity.X / 2f;
Dust expr_7D4C_cp_0 = Main.dust[num194];
expr_7D4C_cp_0.velocity.Y = expr_7D4C_cp_0.velocity.Y / 2f;
}
else
{
if (this.type == 35)
{
int num195 = 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[num195].noGravity = true;
Dust expr_7DDB_cp_0 = Main.dust[num195];
expr_7DDB_cp_0.velocity.X = expr_7DDB_cp_0.velocity.X * 2f;
Dust expr_7DF9_cp_0 = Main.dust[num195];
expr_7DF9_cp_0.velocity.Y = expr_7DF9_cp_0.velocity.Y * 2f;
}
else
{
if (this.type == 154)
{
int num196 = 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[num196].noGravity = true;
Main.dust[num196].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 vector14 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num197 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector14.X;
float num198 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector14.Y;
float num199 = (float)Math.Sqrt((double)(num197 * num197 + num198 * num198));
if (this.ai[0] == 0f)
{
float num200 = 160f;
if (this.type == 63)
{
num200 *= 1.5f;
}
if (this.type == 247)
{
num200 *= 1.5f;
}
this.tileCollide = true;
if (num199 > num200)
{
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 num201 = 14f / Main.player[this.owner].meleeSpeed;
float num202 = 0.9f / Main.player[this.owner].meleeSpeed;
float num203 = 300f;
if (this.type == 63)
{
num203 *= 1.5f;
num201 *= 1.5f;
num202 *= 1.5f;
}
if (this.type == 247)
{
num203 *= 1.5f;
num201 = 15.9f;
num202 *= 2f;
}
Math.Abs(num197);
Math.Abs(num198);
if (this.ai[1] == 1f)
{
this.tileCollide = false;
}
if (!Main.player[this.owner].channel || num199 > num203 || !this.tileCollide)
{
this.ai[1] = 1f;
if (this.tileCollide)
{
this.netUpdate = true;
}
this.tileCollide = false;
if (num199 < 20f)
{
this.Kill();
}
}
if (!this.tileCollide)
{
num202 *= 2f;
}
int num204 = 60;
if (this.type == 247)
{
num204 = 100;
}
if (num199 > (float)num204 || !this.tileCollide)
{
num199 = num201 / num199;
num197 *= num199;
num198 *= num199;
new Vector2(this.velocity.X, this.velocity.Y);
float num205 = num197 - this.velocity.X;
float num206 = num198 - this.velocity.Y;
float num207 = (float)Math.Sqrt((double)(num205 * num205 + num206 * num206));
num207 = num202 / num207;
num205 *= num207;
num206 *= num207;
this.velocity.X = this.velocity.X * 0.98f;
this.velocity.Y = this.velocity.Y * 0.98f;
this.velocity.X = this.velocity.X + num205;
this.velocity.Y = this.velocity.Y + num206;
}
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)num198, (double)num197) - 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 num208 = this.position.X;
float num209 = this.position.Y;
float num210 = 600f;
bool flag4 = false;
if (this.owner == Main.myPlayer)
{
this.localAI[1] += 1f;
if (this.localAI[1] > 20f)
{
this.localAI[1] = 20f;
for (int num211 = 0; num211 < 200; num211++)
{
if (Main.npc[num211].active && !Main.npc[num211].dontTakeDamage && !Main.npc[num211].friendly && Main.npc[num211].lifeMax > 5)
{
float num212 = Main.npc[num211].position.X + (float)(Main.npc[num211].width / 2);
float num213 = Main.npc[num211].position.Y + (float)(Main.npc[num211].height / 2);
float num214 = Math.Abs(this.position.X + (float)(this.width / 2) - num212) + Math.Abs(this.position.Y + (float)(this.height / 2) - num213);
if (num214 < num210 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num211].position, Main.npc[num211].width, Main.npc[num211].height))
{
num210 = num214;
num208 = num212;
num209 = num213;
flag4 = true;
}
}
}
}
}
if (flag4)
{
this.localAI[1] = 0f;
float num215 = 14f;
vector14 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
num197 = num208 - vector14.X;
num198 = num209 - vector14.Y;
num199 = (float)Math.Sqrt((double)(num197 * num197 + num198 * num198));
num199 = num215 / num199;
num197 *= num199;
num198 *= num199;
Projectile.NewProjectile(vector14.X, vector14.Y, num197, num198, 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)
{
try
{
int num216 = (int)(this.position.X / 16f) - 1;
int num217 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num218 = (int)(this.position.Y / 16f) - 1;
int num219 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num216 < 0)
{
num216 = 0;
}
if (num217 > Main.maxTilesX)
{
num217 = Main.maxTilesX;
}
if (num218 < 0)
{
num218 = 0;
}
if (num219 > Main.maxTilesY)
{
num219 = Main.maxTilesY;
}
for (int num220 = num216; num220 < num217; num220++)
{
for (int num221 = num218; num221 < num219; num221++)
{
if (Main.tile[num220, num221] != null && Main.tile[num220, num221].nactive() && (Main.tileSolid[(int)Main.tile[num220, num221].type] || (Main.tileSolidTop[(int)Main.tile[num220, num221].type] && Main.tile[num220, num221].frameY == 0)))
{
Vector2 vector15;
vector15.X = (float)(num220 * 16);
vector15.Y = (float)(num221 * 16);
if (this.position.X + (float)this.width - 4f > vector15.X && this.position.X + 4f < vector15.X + 16f && this.position.Y + (float)this.height - 4f > vector15.Y && this.position.Y + 4f < vector15.Y + 16f)
{
this.velocity.X = 0f;
this.velocity.Y = -0.2f;
}
}
}
}
}
catch
{
}
}
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.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.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.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.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.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 != 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.damage = 0;
}
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 num222 = 0; num222 < 2; num222++)
{
float num223 = 0f;
float num224 = 0f;
if (num222 == 1)
{
num223 = this.velocity.X * 0.5f;
num224 = this.velocity.Y * 0.5f;
}
int num225 = Dust.NewDust(new Vector2(this.position.X + 3f + num223, this.position.Y + 3f + num224) - this.velocity * 0.5f, this.width - 8, this.height - 8, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num225].scale *= 2f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num225].velocity *= 0.2f;
Main.dust[num225].noGravity = true;
num225 = Dust.NewDust(new Vector2(this.position.X + 3f + num223, this.position.Y + 3f + num224) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f);
Main.dust[num225].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num225].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 num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num226].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num226].velocity *= 0.2f;
Main.dust[num226].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 num227 = 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[num227].scale *= 1.6f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num227].velocity *= 0.05f;
Main.dust[num227].noGravity = true;
}
}
else
{
if (this.type != 30 && Main.rand.Next(2) == 0)
{
int num228 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f);
Main.dust[num228].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num228].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num228].noGravity = true;
if (Main.rand.Next(3) == 0)
{
num228 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num228].scale = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num228].noGravity = true;
}
}
}
}
}
}
this.ai[0] += 1f;
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.ai[0] > 10f) || (this.type != 30 && 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.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 != 134 && this.type != 137 && this.type != 140 && this.type != 143 && this.type != 303)
{
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 num229 = (int)((this.position.X + (float)(this.width / 2)) / 16f);
int num230 = (int)((this.position.Y + (float)this.height - 4f) / 16f);
if (Main.tile[num229, num230] != null && !Main.tile[num229, num230].active())
{
int num231 = 0;
if (this.type >= 201 && this.type <= 205)
{
num231 = this.type - 200;
}
WorldGen.PlaceTile(num229, num230, 85, false, false, this.owner, num231);
if (Main.tile[num229, num230].active())
{
if (Main.netMode != 0)
{
NetMessage.SendData(17, -1, -1, "", 1, (float)num229, (float)num230, 85f, num231);
}
int num232 = Sign.ReadSign(num229, num230);
if (num232 >= 0)
{
Sign.TextSign(num232, 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 num233 = 0; num233 < 2; num233++)
{
int num234 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, 0f, 0f, 100, default(Color), 1f);
Main.dust[num234].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)
{
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 = 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);
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 == 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(this.center().X + this.velocity.X * this.ai[0], this.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 == 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 / 2, 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 num235 = 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[num235].noGravity = true;
Dust expr_A7A4_cp_0 = Main.dust[num235];
expr_A7A4_cp_0.velocity.X = expr_A7A4_cp_0.velocity.X / 2f;
Dust expr_A7C4_cp_0 = Main.dust[num235];
expr_A7C4_cp_0.velocity.Y = expr_A7C4_cp_0.velocity.Y / 2f;
num235 = Dust.NewDust(this.position - this.velocity * 2f, this.width, this.height, 27, 0f, 0f, 150, default(Color), 1.4f);
Dust expr_A838_cp_0 = Main.dust[num235];
expr_A838_cp_0.velocity.X = expr_A838_cp_0.velocity.X / 5f;
Dust expr_A858_cp_0 = Main.dust[num235];
expr_A858_cp_0.velocity.Y = expr_A858_cp_0.velocity.Y / 5f;
return;
}
if (this.type == 105)
{
if (Main.rand.Next(3) == 0)
{
int num236 = 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[num236].velocity += this.velocity * 0.3f;
Main.dust[num236].velocity *= 0.2f;
}
if (Main.rand.Next(4) == 0)
{
int num237 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 43, 0f, 0f, 254, default(Color), 0.3f);
Main.dust[num237].velocity += this.velocity * 0.5f;
Main.dust[num237].velocity *= 0.5f;
return;
}
}
else
{
if (this.type == 153)
{
int num238 = 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[num238].noGravity = true;
Main.dust[num238].fadeIn = 1.25f;
Main.dust[num238].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.soundDelay <= 0)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 22);
this.soundDelay = 30;
}
if (Main.myPlayer == this.owner)
{
if (Main.player[this.owner].channel)
{
float num239 = Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].shootSpeed * this.scale;
Vector2 vector16 = new Vector2(Main.player[this.owner].position.X + (float)Main.player[this.owner].width * 0.5f, Main.player[this.owner].position.Y + (float)Main.player[this.owner].height * 0.5f);
float num240 = (float)Main.mouseX + Main.screenPosition.X - vector16.X;
float num241 = (float)Main.mouseY + Main.screenPosition.Y - vector16.Y;
float num242 = (float)Math.Sqrt((double)(num240 * num240 + num241 * num241));
num242 = (float)Math.Sqrt((double)(num240 * num240 + num241 * num241));
num242 = num239 / num242;
num240 *= num242;
num241 *= num242;
if (num240 != this.velocity.X || num241 != this.velocity.Y)
{
this.netUpdate = true;
}
this.velocity.X = num240;
this.velocity.Y = num241;
}
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 = 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);
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 num243 = 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_AF7A_cp_0 = Main.dust[num243];
expr_AF7A_cp_0.position.X = expr_AF7A_cp_0.position.X - 4f;
Main.dust[num243].noGravity = true;
Main.dust[num243].velocity *= 0.2f;
Main.dust[num243].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 num244 = Dust.NewDust(this.position, this.width, this.height, 27, 0f, 0f, 80, default(Color), 1f);
Main.dust[num244].noGravity = true;
Main.dust[num244].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 num245 = (int)(this.position.X / 16f) - 1;
int num246 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num247 = (int)(this.position.Y / 16f) - 1;
int num248 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num245 < 0)
{
num245 = 0;
}
if (num246 > Main.maxTilesX)
{
num246 = Main.maxTilesX;
}
if (num247 < 0)
{
num247 = 0;
}
if (num248 > Main.maxTilesY)
{
num248 = Main.maxTilesY;
}
int num249 = (int)this.position.X + 4;
int num250 = (int)this.position.Y + 4;
for (int num251 = num245; num251 < num246; num251++)
{
for (int num252 = num247; num252 < num248; num252++)
{
if (Main.tile[num251, num252] != null && Main.tile[num251, num252].active() && Main.tile[num251, num252].type != 127 && Main.tileSolid[(int)Main.tile[num251, num252].type] && !Main.tileSolidTop[(int)Main.tile[num251, num252].type])
{
Vector2 vector17;
vector17.X = (float)(num251 * 16);
vector17.Y = (float)(num252 * 16);
if ((float)(num249 + 8) > vector17.X && (float)num249 < vector17.X + 16f && (float)(num250 + 8) > vector17.Y && (float)num250 < vector17.Y + 16f)
{
this.Kill();
}
}
}
}
int num253 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f);
Main.dust[num253].noGravity = true;
Main.dust[num253].velocity *= 0.3f;
return;
}
if (this.ai[0] < 0f)
{
if (this.ai[0] == -1f)
{
for (int num254 = 0; num254 < 10; num254++)
{
int num255 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1.1f);
Main.dust[num255].noGravity = true;
Main.dust[num255].velocity *= 1.3f;
}
}
else
{
if (Main.rand.Next(30) == 0)
{
int num256 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 100, default(Color), 1f);
Main.dust[num256].velocity *= 0.2f;
}
}
int num257 = (int)this.position.X / 16;
int num258 = (int)this.position.Y / 16;
if (Main.tile[num257, num258] == null || !Main.tile[num257, num258].active())
{
this.Kill();
}
this.ai[0] -= 1f;
if (this.ai[0] <= -300f && (Main.myPlayer == this.owner || Main.netMode == 2) && Main.tile[num257, num258].active() && Main.tile[num257, num258].type == 127)
{
WorldGen.KillTile(num257, num258, false, false, false);
if (Main.netMode == 1)
{
NetMessage.SendData(17, -1, -1, "", 0, (float)num257, (float)num258, 0f, 0);
}
this.Kill();
return;
}
}
else
{
int num259 = (int)(this.position.X / 16f) - 1;
int num260 = (int)((this.position.X + (float)this.width) / 16f) + 2;
int num261 = (int)(this.position.Y / 16f) - 1;
int num262 = (int)((this.position.Y + (float)this.height) / 16f) + 2;
if (num259 < 0)
{
num259 = 0;
}
if (num260 > Main.maxTilesX)
{
num260 = Main.maxTilesX;
}
if (num261 < 0)
{
num261 = 0;
}
if (num262 > Main.maxTilesY)
{
num262 = Main.maxTilesY;
}
int num263 = (int)this.position.X + 4;
int num264 = (int)this.position.Y + 4;
for (int num265 = num259; num265 < num260; num265++)
{
for (int num266 = num261; num266 < num262; num266++)
{
if (Main.tile[num265, num266] != null && Main.tile[num265, num266].nactive() && Main.tile[num265, num266].type != 127 && Main.tileSolid[(int)Main.tile[num265, num266].type] && !Main.tileSolidTop[(int)Main.tile[num265, num266].type])
{
Vector2 vector18;
vector18.X = (float)(num265 * 16);
vector18.Y = (float)(num266 * 16);
if ((float)(num263 + 8) > vector18.X && (float)num263 < vector18.X + 16f && (float)(num264 + 8) > vector18.Y && (float)num264 < vector18.Y + 16f)
{
this.Kill();
}
}
}
}
if (this.lavaWet)
{
this.Kill();
}
if (this.active)
{
int num267 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f);
Main.dust[num267].noGravity = true;
Main.dust[num267].velocity *= 0.3f;
int num268 = (int)this.ai[0];
int num269 = (int)this.ai[1];
if (this.velocity.X > 0f)
{
this.rotation += 0.3f;
}
else
{
this.rotation -= 0.3f;
}
if (Main.myPlayer == this.owner)
{
int num270 = (int)((this.position.X + (float)(this.width / 2)) / 16f);
int num271 = (int)((this.position.Y + (float)(this.height / 2)) / 16f);
bool flag5 = false;
if (num270 == num268 && num271 == num269)
{
flag5 = true;
}
if (((this.velocity.X <= 0f && num270 <= num268) || (this.velocity.X >= 0f && num270 >= num268)) && ((this.velocity.Y <= 0f && num271 <= num269) || (this.velocity.Y >= 0f && num271 >= num269)))
{
flag5 = true;
}
if (flag5)
{
if (WorldGen.PlaceTile(num268, num269, 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);
}
this.damage = 0;
this.ai[0] = -1f;
this.velocity *= 0f;
this.alpha = 255;
this.position.X = (float)(num268 * 16);
this.position.Y = (float)(num269 * 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 num272 = 1f;
if (this.ai[0] == 8f)
{
num272 = 0.25f;
}
else
{
if (this.ai[0] == 9f)
{
num272 = 0.5f;
}
else
{
if (this.ai[0] == 10f)
{
num272 = 0.75f;
}
}
}
this.ai[0] += 1f;
int num273 = 6;
if (this.type == 101)
{
num273 = 75;
}
if (num273 == 6 || Main.rand.Next(2) == 0)
{
for (int num274 = 0; num274 < 1; num274++)
{
int num275 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num273, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f);
if (Main.rand.Next(3) != 0 || (num273 == 75 && Main.rand.Next(3) == 0))
{
Main.dust[num275].noGravity = true;
Main.dust[num275].scale *= 3f;
Dust expr_BCE4_cp_0 = Main.dust[num275];
expr_BCE4_cp_0.velocity.X = expr_BCE4_cp_0.velocity.X * 2f;
Dust expr_BD04_cp_0 = Main.dust[num275];
expr_BD04_cp_0.velocity.Y = expr_BD04_cp_0.velocity.Y * 2f;
}
if (this.type == 188)
{
Main.dust[num275].scale *= 1.25f;
}
else
{
Main.dust[num275].scale *= 1.5f;
}
Dust expr_BD69_cp_0 = Main.dust[num275];
expr_BD69_cp_0.velocity.X = expr_BD69_cp_0.velocity.X * 1.2f;
Dust expr_BD89_cp_0 = Main.dust[num275];
expr_BD89_cp_0.velocity.Y = expr_BD89_cp_0.velocity.Y * 1.2f;
Main.dust[num275].scale *= num272;
if (num273 == 75)
{
Main.dust[num275].velocity += this.velocity;
if (!Main.dust[num275].noGravity)
{
Main.dust[num275].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 num276 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 70, 0f, 0f, 0, default(Color), 1f);
Main.dust[num276].noGravity = true;
Main.dust[num276].velocity *= 0.5f;
Main.dust[num276].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 num277 = 0.5f;
int i2 = (int)((this.position.X - 8f) / 16f);
int num278 = (int)(this.position.Y / 16f);
bool flag6 = false;
bool flag7 = false;
if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1))
{
flag6 = true;
}
i2 = (int)((this.position.X + (float)this.width + 8f) / 16f);
if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1))
{
flag7 = true;
}
if (flag6)
{
this.velocity.X = num277;
}
else
{
if (flag7)
{
this.velocity.X = -num277;
}
else
{
i2 = (int)((this.position.X - 8f - 16f) / 16f);
num278 = (int)(this.position.Y / 16f);
flag6 = false;
flag7 = false;
if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1))
{
flag6 = true;
}
i2 = (int)((this.position.X + (float)this.width + 8f + 16f) / 16f);
if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1))
{
flag7 = true;
}
if (flag6)
{
this.velocity.X = num277;
}
else
{
if (flag7)
{
this.velocity.X = -num277;
}
else
{
i2 = (int)((this.position.X + 4f) / 16f);
num278 = (int)((this.position.Y + (float)this.height + 8f) / 16f);
if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1))
{
flag6 = true;
}
if (!flag6)
{
this.velocity.X = num277;
}
else
{
this.velocity.X = -num277;
}
}
}
}
}
}
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)
{
if (!Main.player[this.owner].active)
{
this.active = false;
return;
}
bool flag8 = false;
bool flag9 = false;
bool flag10 = false;
bool flag11 = false;
int num279 = 85;
if (this.type == 112)
{
num279 = 100;
}
if (this.type == 127)
{
num279 = 50;
}
if (this.type >= 191 && this.type <= 194)
{
if (this.lavaWet)
{
this.ai[0] = 1f;
this.ai[1] = 0f;
}
num279 = 60 + 30 * this.minionPos;
}
else
{
if (this.type == 266)
{
num279 = 60 + 30 * this.minionPos;
}
}
if (Main.myPlayer == this.owner)
{
if (this.type == 111)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].bunny = false;
}
if (Main.player[Main.myPlayer].bunny)
{
this.timeLeft = 2;
}
}
if (this.type == 112)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].penguin = false;
}
if (Main.player[Main.myPlayer].penguin)
{
this.timeLeft = 2;
}
}
if (this.type == 127)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].turtle = false;
}
if (Main.player[Main.myPlayer].turtle)
{
this.timeLeft = 2;
}
}
if (this.type == 175)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].eater = false;
}
if (Main.player[Main.myPlayer].eater)
{
this.timeLeft = 2;
}
}
if (this.type == 197)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].skeletron = false;
}
if (Main.player[Main.myPlayer].skeletron)
{
this.timeLeft = 2;
}
}
if (this.type == 198)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].hornet = false;
}
if (Main.player[Main.myPlayer].hornet)
{
this.timeLeft = 2;
}
}
if (this.type == 199)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].tiki = false;
}
if (Main.player[Main.myPlayer].tiki)
{
this.timeLeft = 2;
}
}
if (this.type == 200)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].lizard = false;
}
if (Main.player[Main.myPlayer].lizard)
{
this.timeLeft = 2;
}
}
if (this.type == 208)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].parrot = false;
}
if (Main.player[Main.myPlayer].parrot)
{
this.timeLeft = 2;
}
}
if (this.type == 209)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].truffle = false;
}
if (Main.player[Main.myPlayer].truffle)
{
this.timeLeft = 2;
}
}
if (this.type == 210)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].sapling = false;
}
if (Main.player[Main.myPlayer].sapling)
{
this.timeLeft = 2;
}
}
if (this.type == 211)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].wisp = false;
}
if (Main.player[Main.myPlayer].wisp)
{
this.timeLeft = 2;
}
}
if (this.type == 236)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].dino = false;
}
if (Main.player[Main.myPlayer].dino)
{
this.timeLeft = 2;
}
}
if (this.type == 266)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].slime = false;
}
if (Main.player[Main.myPlayer].slime)
{
this.timeLeft = 2;
}
}
if (this.type == 268)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].eyeSpring = false;
}
if (Main.player[Main.myPlayer].eyeSpring)
{
this.timeLeft = 2;
}
}
if (this.type == 269)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].snowman = false;
}
if (Main.player[Main.myPlayer].snowman)
{
this.timeLeft = 2;
}
}
if (this.type >= 191 && this.type <= 194)
{
if (Main.player[Main.myPlayer].dead)
{
Main.player[Main.myPlayer].pygmy = false;
}
if (Main.player[Main.myPlayer].pygmy)
{
this.timeLeft = Main.rand.Next(2, 10);
}
}
}
if ((this.type >= 191 && this.type <= 194) || this.type == 266)
{
num279 = 10;
int num280 = 40 * (this.minionPos + 1) * Main.player[this.owner].direction;
if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2) - (float)num279 + (float)num280)
{
flag8 = true;
}
else
{
if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) > this.position.X + (float)(this.width / 2) + (float)num279 + (float)num280)
{
flag9 = true;
}
}
}
else
{
if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2) - (float)num279)
{
flag8 = true;
}
else
{
if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) > this.position.X + (float)(this.width / 2) + (float)num279)
{
flag9 = true;
}
}
}
if (this.type == 175)
{
float num281 = 0.1f;
this.tileCollide = false;
int num282 = 300;
Vector2 vector19 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num283 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector19.X;
float num284 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector19.Y;
if (this.type == 127)
{
num284 = Main.player[this.owner].position.Y - vector19.Y;
}
float num285 = (float)Math.Sqrt((double)(num283 * num283 + num284 * num284));
float num286 = 7f;
if (num285 < (float)num282 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
if (this.velocity.Y < -6f)
{
this.velocity.Y = -6f;
}
}
if (num285 < 150f)
{
if (Math.Abs(this.velocity.X) > 2f || Math.Abs(this.velocity.Y) > 2f)
{
this.velocity *= 0.99f;
}
num281 = 0.01f;
if (num283 < -2f)
{
num283 = -2f;
}
if (num283 > 2f)
{
num283 = 2f;
}
if (num284 < -2f)
{
num284 = -2f;
}
if (num284 > 2f)
{
num284 = 2f;
}
}
else
{
if (num285 > 300f)
{
num281 = 0.2f;
}
num285 = num286 / num285;
num283 *= num285;
num284 *= num285;
}
if (Math.Abs(num283) > Math.Abs(num284) || num281 == 0.05f)
{
if (this.velocity.X < num283)
{
this.velocity.X = this.velocity.X + num281;
if (num281 > 0.05f && this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X + num281;
}
}
if (this.velocity.X > num283)
{
this.velocity.X = this.velocity.X - num281;
if (num281 > 0.05f && this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X - num281;
}
}
}
if (Math.Abs(num283) <= Math.Abs(num284) || num281 == 0.05f)
{
if (this.velocity.Y < num284)
{
this.velocity.Y = this.velocity.Y + num281;
if (num281 > 0.05f && this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + num281;
}
}
if (this.velocity.Y > num284)
{
this.velocity.Y = this.velocity.Y - num281;
if (num281 > 0.05f && this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - num281;
}
}
}
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 > 1)
{
this.frame = 0;
return;
}
}
else
{
if (this.type == 197)
{
float num287 = 0.1f;
this.tileCollide = false;
int num288 = 300;
Vector2 vector20 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num289 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector20.X;
float num290 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector20.Y;
if (this.type == 127)
{
num290 = Main.player[this.owner].position.Y - vector20.Y;
}
float num291 = (float)Math.Sqrt((double)(num289 * num289 + num290 * num290));
float num292 = 3f;
if (num291 > 500f)
{
this.localAI[0] = 10000f;
}
if (this.localAI[0] >= 10000f)
{
num292 = 14f;
}
if (num291 < (float)num288 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
if (this.velocity.Y < -6f)
{
this.velocity.Y = -6f;
}
}
if (num291 < 150f)
{
if (Math.Abs(this.velocity.X) > 2f || Math.Abs(this.velocity.Y) > 2f)
{
this.velocity *= 0.99f;
}
num287 = 0.01f;
if (num289 < -2f)
{
num289 = -2f;
}
if (num289 > 2f)
{
num289 = 2f;
}
if (num290 < -2f)
{
num290 = -2f;
}
if (num290 > 2f)
{
num290 = 2f;
}
}
else
{
if (num291 > 300f)
{
num287 = 0.2f;
}
num291 = num292 / num291;
num289 *= num291;
num290 *= num291;
}
if (this.velocity.X < num289)
{
this.velocity.X = this.velocity.X + num287;
if (num287 > 0.05f && this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X + num287;
}
}
if (this.velocity.X > num289)
{
this.velocity.X = this.velocity.X - num287;
if (num287 > 0.05f && this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X - num287;
}
}
if (this.velocity.Y < num290)
{
this.velocity.Y = this.velocity.Y + num287;
if (num287 > 0.05f && this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + num287;
}
}
if (this.velocity.Y > num290)
{
this.velocity.Y = this.velocity.Y - num287;
if (num287 > 0.05f && this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - num287;
}
}
this.localAI[0] += (float)Main.rand.Next(10);
if (this.localAI[0] > 10000f)
{
if (this.localAI[1] == 0f)
{
if (this.velocity.X < 0f)
{
this.localAI[1] = -1f;
}
else
{
this.localAI[1] = 1f;
}
}
this.rotation += 0.25f * this.localAI[1];
if (this.localAI[0] > 12000f)
{
this.localAI[0] = 0f;
}
}
else
{
this.localAI[1] = 0f;
float num293 = this.velocity.X * 0.1f;
if (this.rotation > num293)
{
this.rotation -= (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f;
if (this.rotation < num293)
{
this.rotation = num293;
}
}
if (this.rotation < num293)
{
this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f;
if (this.rotation > num293)
{
this.rotation = num293;
}
}
}
if ((double)this.rotation > 6.28)
{
this.rotation -= 6.28f;
}
if ((double)this.rotation < -6.28)
{
this.rotation += 6.28f;
return;
}
}
else
{
if (this.type == 198)
{
float num294 = 0.4f;
this.tileCollide = false;
int num295 = 100;
Vector2 vector21 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num296 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector21.X;
float num297 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector21.Y;
num297 += (float)Main.rand.Next(-10, 21);
num296 += (float)Main.rand.Next(-10, 21);
num296 += (float)(60 * -(float)Main.player[this.owner].direction);
num297 -= 60f;
if (this.type == 127)
{
num297 = Main.player[this.owner].position.Y - vector21.Y;
}
float num298 = (float)Math.Sqrt((double)(num296 * num296 + num297 * num297));
float num299 = 14f;
if (num298 < (float)num295 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
if (this.velocity.Y < -6f)
{
this.velocity.Y = -6f;
}
}
if (num298 < 50f)
{
if (Math.Abs(this.velocity.X) > 2f || Math.Abs(this.velocity.Y) > 2f)
{
this.velocity *= 0.99f;
}
num294 = 0.01f;
}
else
{
if (num298 < 100f)
{
num294 = 0.1f;
}
if (num298 > 300f)
{
num294 = 0.6f;
}
num298 = num299 / num298;
num296 *= num298;
num297 *= num298;
}
if (this.velocity.X < num296)
{
this.velocity.X = this.velocity.X + num294;
if (num294 > 0.05f && this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X + num294;
}
}
if (this.velocity.X > num296)
{
this.velocity.X = this.velocity.X - num294;
if (num294 > 0.05f && this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X - num294;
}
}
if (this.velocity.Y < num297)
{
this.velocity.Y = this.velocity.Y + num294;
if (num294 > 0.05f && this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + num294 * 2f;
}
}
if (this.velocity.Y > num297)
{
this.velocity.Y = this.velocity.Y - num294;
if (num294 > 0.05f && this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - num294 * 2f;
}
}
if ((double)this.velocity.X > 0.25)
{
this.direction = -1;
}
else
{
if ((double)this.velocity.X < -0.25)
{
this.direction = 1;
}
}
this.spriteDirection = this.direction;
this.rotation = this.velocity.X * 0.05f;
this.frameCounter++;
if (this.frameCounter > 2)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 3)
{
this.frame = 0;
return;
}
}
else
{
if (this.type == 211)
{
this.ignoreWater = false;
float num300 = 0.2f;
float num301 = 5f;
this.tileCollide = false;
Vector2 vector22 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num302 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector22.X;
float num303 = Main.player[this.owner].position.Y + Main.player[this.owner].gfxOffY + (float)(Main.player[this.owner].height / 2) - vector22.Y;
if (Main.player[this.owner].controlLeft)
{
num302 -= 120f;
}
else
{
if (Main.player[this.owner].controlRight)
{
num302 += 120f;
}
}
if (Main.player[this.owner].controlDown)
{
num303 += 120f;
}
else
{
if (Main.player[this.owner].controlUp)
{
num303 -= 120f;
}
num303 -= 60f;
}
float num304 = (float)Math.Sqrt((double)(num302 * num302 + num303 * num303));
if (num304 > 1000f)
{
this.position.X = this.position.X + num302;
this.position.Y = this.position.Y + num303;
}
if (this.localAI[0] == 1f)
{
if (num304 < 10f && Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y) < num301 && Main.player[this.owner].velocity.Y == 0f)
{
this.localAI[0] = 0f;
}
num301 = 12f;
if (num304 < num301)
{
this.velocity.X = num302;
this.velocity.Y = num303;
}
else
{
num304 = num301 / num304;
this.velocity.X = num302 * num304;
this.velocity.Y = num303 * num304;
}
if ((double)this.velocity.X > 0.5)
{
this.direction = -1;
}
else
{
if ((double)this.velocity.X < -0.5)
{
this.direction = 1;
}
}
this.spriteDirection = this.direction;
this.rotation -= (0.2f + Math.Abs(this.velocity.X) * 0.025f) * (float)this.direction;
this.frameCounter++;
if (this.frameCounter > 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame < 5)
{
this.frame = 5;
}
if (this.frame > 9)
{
this.frame = 5;
}
for (int num305 = 0; num305 < 2; num305++)
{
int num306 = Dust.NewDust(new Vector2(this.position.X + 3f, this.position.Y + 4f), 14, 14, 156, 0f, 0f, 0, default(Color), 1f);
Main.dust[num306].velocity *= 0.2f;
Main.dust[num306].noGravity = true;
Main.dust[num306].scale = 1.25f;
}
return;
}
if (num304 > 200f)
{
this.localAI[0] = 1f;
}
if ((double)this.velocity.X > 0.5)
{
this.direction = -1;
}
else
{
if ((double)this.velocity.X < -0.5)
{
this.direction = 1;
}
}
this.spriteDirection = this.direction;
if (num304 < 10f)
{
this.velocity.X = num302;
this.velocity.Y = num303;
this.rotation = this.velocity.X * 0.05f;
if (num304 < num301)
{
this.position += this.velocity;
this.velocity *= 0f;
num300 = 0f;
}
this.direction = -Main.player[this.owner].direction;
}
num304 = num301 / num304;
num302 *= num304;
num303 *= num304;
if (this.velocity.X < num302)
{
this.velocity.X = this.velocity.X + num300;
if (this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X * 0.99f;
}
}
if (this.velocity.X > num302)
{
this.velocity.X = this.velocity.X - num300;
if (this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X * 0.99f;
}
}
if (this.velocity.Y < num303)
{
this.velocity.Y = this.velocity.Y + num300;
if (this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y * 0.99f;
}
}
if (this.velocity.Y > num303)
{
this.velocity.Y = this.velocity.Y - num300;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y * 0.99f;
}
}
if (this.velocity.X != 0f || this.velocity.Y != 0f)
{
this.rotation = this.velocity.X * 0.05f;
}
this.frameCounter++;
if (this.frameCounter > 3)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 4)
{
this.frame = 0;
return;
}
}
else
{
if (this.type == 199)
{
float num307 = 0.1f;
this.tileCollide = false;
int num308 = 200;
Vector2 vector23 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num309 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector23.X;
float num310 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector23.Y;
num310 -= 60f;
num309 -= 2f;
if (this.type == 127)
{
num310 = Main.player[this.owner].position.Y - vector23.Y;
}
float num311 = (float)Math.Sqrt((double)(num309 * num309 + num310 * num310));
float num312 = 4f;
float num313 = num311;
if (num311 < (float)num308 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
if (this.velocity.Y < -6f)
{
this.velocity.Y = -6f;
}
}
if (num311 < 4f)
{
this.velocity.X = num309;
this.velocity.Y = num310;
num307 = 0f;
}
else
{
if (num311 > 350f)
{
num307 = 0.2f;
num312 = 10f;
}
num311 = num312 / num311;
num309 *= num311;
num310 *= num311;
}
if (this.velocity.X < num309)
{
this.velocity.X = this.velocity.X + num307;
if (this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X + num307;
}
}
if (this.velocity.X > num309)
{
this.velocity.X = this.velocity.X - num307;
if (this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X - num307;
}
}
if (this.velocity.Y < num310)
{
this.velocity.Y = this.velocity.Y + num307;
if (this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + num307;
}
}
if (this.velocity.Y > num310)
{
this.velocity.Y = this.velocity.Y - num307;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - num307;
}
}
this.direction = -Main.player[this.owner].direction;
this.spriteDirection = 1;
this.rotation = this.velocity.Y * 0.05f * (float)(-(float)this.direction);
if (num313 >= 50f)
{
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frameCounter = 0;
if (this.velocity.X < 0f)
{
if (this.frame < 2)
{
this.frame++;
}
if (this.frame > 2)
{
this.frame--;
return;
}
}
else
{
if (this.frame < 6)
{
this.frame++;
}
if (this.frame > 6)
{
this.frame--;
return;
}
}
}
}
else
{
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame += this.direction;
this.frameCounter = 0;
}
if (this.frame > 7)
{
this.frame = 0;
}
if (this.frame < 0)
{
this.frame = 7;
return;
}
}
}
else
{
if (this.ai[1] == 0f)
{
int num314 = 500;
if (this.type == 127)
{
num314 = 200;
}
if (this.type == 208)
{
num314 = 300;
}
if ((this.type >= 191 && this.type <= 194) || this.type == 266)
{
num314 += 40 * this.minionPos;
if (this.localAI[0] > 0f)
{
num314 += 500;
}
if (this.type == 266 && this.localAI[0] > 0f)
{
num314 += 100;
}
}
if (Main.player[this.owner].rocketDelay2 > 0)
{
this.ai[0] = 1f;
}
Vector2 vector24 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num315 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector24.X;
if (this.type >= 191)
{
int arg_E8AA_0 = this.type;
}
float num316 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector24.Y;
float num317 = (float)Math.Sqrt((double)(num315 * num315 + num316 * num316));
if (num317 > 2000f)
{
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);
}
else
{
if (num317 > (float)num314 || (Math.Abs(num316) > 300f && (((this.type < 191 || this.type > 194) && this.type != 266) || this.localAI[0] <= 0f)))
{
this.ai[0] = 1f;
if (num316 > 0f && this.velocity.Y < 0f)
{
this.velocity.Y = 0f;
}
if (num316 < 0f && this.velocity.Y > 0f)
{
this.velocity.Y = 0f;
}
}
}
}
if (this.type == 209 && this.ai[0] != 0f)
{
if (Main.player[this.owner].velocity.Y == 0f && this.alpha >= 100)
{
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 - (float)this.height;
this.ai[0] = 0f;
return;
}
this.velocity.X = 0f;
this.velocity.Y = 0f;
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
return;
}
}
else
{
if (this.ai[0] != 0f)
{
float num318 = 0.2f;
int num319 = 200;
if (this.type == 127)
{
num319 = 100;
}
if (this.type >= 191 && this.type <= 194)
{
num318 = 0.5f;
num319 = 100;
}
this.tileCollide = false;
Vector2 vector25 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num320 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector25.X;
if ((this.type >= 191 && this.type <= 194) || this.type == 266)
{
num320 -= (float)(40 * Main.player[this.owner].direction);
float num321 = 600f;
bool flag12 = false;
for (int num322 = 0; num322 < 200; num322++)
{
if (Main.npc[num322].active && !Main.npc[num322].dontTakeDamage && !Main.npc[num322].friendly && Main.npc[num322].lifeMax > 5)
{
float num323 = Main.npc[num322].position.X + (float)(Main.npc[num322].width / 2);
float num324 = Main.npc[num322].position.Y + (float)(Main.npc[num322].height / 2);
float num325 = Math.Abs(Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - num323) + Math.Abs(Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - num324);
if (num325 < num321)
{
flag12 = true;
break;
}
}
}
if (!flag12)
{
num320 -= (float)(40 * this.minionPos * Main.player[this.owner].direction);
}
}
float num326 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector25.Y;
if (this.type == 127)
{
num326 = Main.player[this.owner].position.Y - vector25.Y;
}
float num327 = (float)Math.Sqrt((double)(num320 * num320 + num326 * num326));
float num328 = 10f;
if (this.type == 111)
{
num328 = 11f;
}
if (this.type == 127)
{
num328 = 9f;
}
if (this.type >= 191 && this.type <= 194)
{
num318 = 0.4f;
num328 = 12f;
if (num328 < Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y))
{
num328 = Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y);
}
}
if (this.type == 208 && Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y) > 4f)
{
num319 = -1;
}
if (num327 < (float)num319 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height))
{
this.ai[0] = 0f;
if (this.velocity.Y < -6f)
{
this.velocity.Y = -6f;
}
}
if (num327 < 60f)
{
num320 = this.velocity.X;
num326 = this.velocity.Y;
}
else
{
num327 = num328 / num327;
num320 *= num327;
num326 *= num327;
}
if (this.velocity.X < num320)
{
this.velocity.X = this.velocity.X + num318;
if (this.velocity.X < 0f)
{
this.velocity.X = this.velocity.X + num318 * 1.5f;
}
}
if (this.velocity.X > num320)
{
this.velocity.X = this.velocity.X - num318;
if (this.velocity.X > 0f)
{
this.velocity.X = this.velocity.X - num318 * 1.5f;
}
}
if (this.velocity.Y < num326)
{
this.velocity.Y = this.velocity.Y + num318;
if (this.velocity.Y < 0f)
{
this.velocity.Y = this.velocity.Y + num318 * 1.5f;
}
}
if (this.velocity.Y > num326)
{
this.velocity.Y = this.velocity.Y - num318;
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y - num318 * 1.5f;
}
}
if (this.type == 111)
{
this.frame = 7;
}
if (this.type == 112)
{
this.frame = 2;
}
if (this.type >= 191 && this.type <= 194 && this.frame < 12)
{
this.frame = Main.rand.Next(12, 18);
this.frameCounter = 0;
}
if ((double)this.velocity.X > 0.5)
{
this.spriteDirection = -1;
}
else
{
if ((double)this.velocity.X < -0.5)
{
this.spriteDirection = 1;
}
}
if (this.type == 112)
{
if (this.spriteDirection == -1)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f;
}
}
else
{
if (this.type == 127)
{
this.frameCounter += 3;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame <= 5 || this.frame > 15)
{
this.frame = 6;
}
this.rotation = this.velocity.X * 0.1f;
}
else
{
if (this.type == 269)
{
if (this.frame == 6)
{
this.frameCounter = 0;
}
else
{
if (this.frame < 4 || this.frame > 6)
{
this.frameCounter = 0;
this.frame = 4;
}
else
{
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
}
}
this.rotation = this.velocity.X * 0.05f;
}
else
{
if (this.type == 266)
{
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame < 2 || this.frame > 5)
{
this.frame = 2;
}
this.rotation = this.velocity.X * 0.1f;
}
else
{
if (this.type == 268)
{
this.frameCounter++;
if (this.frameCounter > 4)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame < 6 || this.frame > 7)
{
this.frame = 6;
}
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.58f;
}
else
{
if (this.type == 200)
{
this.frameCounter += 3;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame <= 5 || this.frame > 9)
{
this.frame = 6;
}
this.rotation = this.velocity.X * 0.1f;
}
else
{
if (this.type == 208)
{
this.rotation = this.velocity.X * 0.075f;
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 4)
{
this.frame = 1;
}
if (this.frame < 1)
{
this.frame = 1;
}
}
else
{
if (this.type == 236)
{
this.rotation = this.velocity.Y * 0.05f * (float)this.direction;
if (this.velocity.Y < 0f)
{
this.frameCounter += 2;
}
else
{
this.frameCounter++;
}
if (this.frameCounter >= 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 12)
{
this.frame = 9;
}
if (this.frame < 9)
{
this.frame = 9;
}
}
else
{
if (this.type == 210)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.58f;
this.frameCounter += 3;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 11)
{
this.frame = 7;
}
if (this.frame < 7)
{
this.frame = 7;
}
}
else
{
if (this.spriteDirection == -1)
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X);
}
else
{
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f;
}
}
}
}
}
}
}
}
}
}
if (this.type >= 191 && this.type <= 194)
{
return;
}
if (this.type != 127 && this.type != 200 && this.type != 208 && this.type != 210 && this.type != 236 && this.type != 266 && this.type != 268 && this.type != 269)
{
int num329 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) - 4f, this.position.Y + (float)(this.height / 2) - 4f) - this.velocity, 8, 8, 16, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.7f);
Main.dust[num329].velocity.X = Main.dust[num329].velocity.X * 0.2f;
Main.dust[num329].velocity.Y = Main.dust[num329].velocity.Y * 0.2f;
Main.dust[num329].noGravity = true;
return;
}
}
else
{
if (this.type >= 191 && this.type <= 194)
{
float num330 = (float)(40 * this.minionPos);
int num331 = 30;
int num332 = 60;
this.localAI[0] -= 1f;
if (this.localAI[0] < 0f)
{
this.localAI[0] = 0f;
}
if (this.ai[1] > 0f)
{
this.ai[1] -= 1f;
}
else
{
float num333 = this.position.X;
float num334 = this.position.Y;
float num335 = 100000f;
float num336 = num335;
int num337 = -1;
for (int num338 = 0; num338 < 200; num338++)
{
if (Main.npc[num338].active && !Main.npc[num338].dontTakeDamage && !Main.npc[num338].friendly && Main.npc[num338].lifeMax > 5)
{
float num339 = Main.npc[num338].position.X + (float)(Main.npc[num338].width / 2);
float num340 = Main.npc[num338].position.Y + (float)(Main.npc[num338].height / 2);
float num341 = Math.Abs(this.position.X + (float)(this.width / 2) - num339) + Math.Abs(this.position.Y + (float)(this.height / 2) - num340);
if (num341 < num335)
{
if (num337 == -1 && num341 <= num336)
{
num336 = num341;
num333 = num339;
num334 = num340;
}
if (Collision.CanHit(this.position, this.width, this.height, Main.npc[num338].position, Main.npc[num338].width, Main.npc[num338].height))
{
num335 = num341;
num333 = num339;
num334 = num340;
num337 = num338;
}
}
}
}
if (num337 == -1 && num336 < num335)
{
num335 = num336;
}
float num342 = 400f;
if ((double)this.position.Y > Main.worldSurface * 16.0)
{
num342 = 200f;
}
if (num335 < num342 + num330 && num337 == -1)
{
float num343 = num333 - (this.position.X + (float)(this.width / 2));
if (num343 < -5f)
{
flag8 = true;
flag9 = false;
}
else
{
if (num343 > 5f)
{
flag9 = true;
flag8 = false;
}
}
}
else
{
if (num337 >= 0 && num335 < 800f + num330)
{
this.localAI[0] = (float)num332;
float num344 = num333 - (this.position.X + (float)(this.width / 2));
if (num344 > 300f || num344 < -300f)
{
if (num344 < -50f)
{
flag8 = true;
flag9 = false;
}
else
{
if (num344 > 50f)
{
flag9 = true;
flag8 = false;
}
}
}
else
{
if (this.owner == Main.myPlayer)
{
this.ai[1] = (float)num331;
float num345 = 12f;
Vector2 vector26 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)(this.height / 2) - 8f);
float num346 = num333 - vector26.X + (float)Main.rand.Next(-20, 21);
float num347 = Math.Abs(num346) * 0.1f;
num347 = num347 * (float)Main.rand.Next(0, 100) * 0.001f;
float num348 = num334 - vector26.Y + (float)Main.rand.Next(-20, 21) - num347;
float num349 = (float)Math.Sqrt((double)(num346 * num346 + num348 * num348));
num349 = num345 / num349;
num346 *= num349;
num348 *= num349;
int num350 = this.damage;
int num351 = 195;
int num352 = Projectile.NewProjectile(vector26.X, vector26.Y, num346, num348, num351, num350, this.knockBack, Main.myPlayer, 0f, 0f);
Main.projectile[num352].timeLeft = 300;
if (num346 < 0f)
{
this.direction = -1;
}
if (num346 > 0f)
{
this.direction = 1;
}
this.netUpdate = true;
}
}
}
}
}
}
if (this.type == 266)
{
float num353 = (float)(40 * this.minionPos);
int num354 = 60;
this.localAI[0] -= 1f;
if (this.localAI[0] < 0f)
{
this.localAI[0] = 0f;
}
if (this.ai[1] > 0f)
{
this.ai[1] -= 1f;
}
else
{
float num355 = this.position.X;
float num356 = this.position.Y;
float num357 = 100000f;
float num358 = num357;
int num359 = -1;
for (int num360 = 0; num360 < 200; num360++)
{
if (Main.npc[num360].active && !Main.npc[num360].dontTakeDamage && !Main.npc[num360].friendly && Main.npc[num360].lifeMax > 5)
{
float num361 = Main.npc[num360].position.X + (float)(Main.npc[num360].width / 2);
float num362 = Main.npc[num360].position.Y + (float)(Main.npc[num360].height / 2);
float num363 = Math.Abs(this.position.X + (float)(this.width / 2) - num361) + Math.Abs(this.position.Y + (float)(this.height / 2) - num362);
if (num363 < num357)
{
if (num359 == -1 && num363 <= num358)
{
num358 = num363;
num355 = num361;
num356 = num362;
}
if (Collision.CanHit(this.position, this.width, this.height, Main.npc[num360].position, Main.npc[num360].width, Main.npc[num360].height))
{
num357 = num363;
num355 = num361;
num356 = num362;
num359 = num360;
}
}
}
}
if (num359 == -1 && num358 < num357)
{
num357 = num358;
}
float num364 = 300f;
if ((double)this.position.Y > Main.worldSurface * 16.0)
{
num364 = 150f;
}
if (num357 < num364 + num353 && num359 == -1)
{
float num365 = num355 - (this.position.X + (float)(this.width / 2));
if (num365 < -5f)
{
flag8 = true;
flag9 = false;
}
else
{
if (num365 > 5f)
{
flag9 = true;
flag8 = false;
}
}
}
if (num359 >= 0 && num357 < 800f + num353)
{
this.friendly = true;
this.localAI[0] = (float)num354;
float num366 = num355 - (this.position.X + (float)(this.width / 2));
if (num366 < -10f)
{
flag8 = true;
flag9 = false;
}
else
{
if (num366 > 10f)
{
flag9 = true;
flag8 = false;
}
}
if (num356 < this.center().Y - 100f && num366 > -50f && num366 < 50f && this.velocity.Y == 0f)
{
float num367 = Math.Abs(num356 - this.center().Y);
if (num367 < 120f)
{
this.velocity.Y = -10f;
}
else
{
if (num367 < 210f)
{
this.velocity.Y = -13f;
}
else
{
if (num367 < 270f)
{
this.velocity.Y = -15f;
}
else
{
if (num367 < 310f)
{
this.velocity.Y = -17f;
}
else
{
if (num367 < 380f)
{
this.velocity.Y = -18f;
}
}
}
}
}
}
}
else
{
this.friendly = false;
}
}
}
if (this.ai[1] != 0f)
{
flag8 = false;
flag9 = false;
}
else
{
if (this.type >= 191 && this.type <= 195 && this.localAI[0] == 0f)
{
this.direction = Main.player[this.owner].direction;
}
}
if (this.type == 127)
{
if ((double)this.rotation > -0.1 && (double)this.rotation < 0.1)
{
this.rotation = 0f;
}
else
{
if (this.rotation < 0f)
{
this.rotation += 0.1f;
}
else
{
this.rotation -= 0.1f;
}
}
}
else
{
this.rotation = 0f;
}
this.tileCollide = true;
float num368 = 0.08f;
float num369 = 6.5f;
if (this.type == 127)
{
num369 = 2f;
num368 = 0.04f;
}
if (this.type == 112)
{
num369 = 6f;
num368 = 0.06f;
}
if (this.type == 268)
{
num369 = 8f;
num368 = 0.4f;
}
if ((this.type >= 191 && this.type <= 194) || this.type == 266)
{
num369 = 6f;
num368 = 0.2f;
if (num369 < Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y))
{
num369 = Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y);
num368 = 0.3f;
}
}
if (flag8)
{
if ((double)this.velocity.X > -3.5)
{
this.velocity.X = this.velocity.X - num368;
}
else
{
this.velocity.X = this.velocity.X - num368 * 0.25f;
}
}
else
{
if (flag9)
{
if ((double)this.velocity.X < 3.5)
{
this.velocity.X = this.velocity.X + num368;
}
else
{
this.velocity.X = this.velocity.X + num368 * 0.25f;
}
}
else
{
this.velocity.X = this.velocity.X * 0.9f;
if (this.velocity.X >= -num368 && this.velocity.X <= num368)
{
this.velocity.X = 0f;
}
}
}
if (this.type == 208)
{
this.velocity.X = this.velocity.X * 0.95f;
if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1)
{
this.velocity.X = 0f;
}
flag8 = false;
flag9 = false;
}
if (flag8 || flag9)
{
int num370 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int j2 = (int)(this.position.Y + (float)(this.height / 2)) / 16;
if (this.type == 236)
{
num370 += this.direction;
}
if (flag8)
{
num370--;
}
if (flag9)
{
num370++;
}
num370 += (int)this.velocity.X;
if (WorldGen.SolidTile(num370, j2))
{
flag11 = true;
}
}
if (Main.player[this.owner].position.Y + (float)Main.player[this.owner].height - 8f > this.position.Y + (float)this.height)
{
flag10 = true;
}
if (this.type == 268 && this.frameCounter < 10)
{
flag11 = false;
}
if (this.velocity.Y >= 0f)
{
int num371 = 0;
if (this.velocity.X < 0f)
{
num371 = -1;
}
if (this.velocity.X > 0f)
{
num371 = 1;
}
Vector2 vector27 = this.position;
vector27.X += this.velocity.X;
int num372 = (int)((vector27.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num371)) / 16f);
int num373 = (int)((vector27.Y + (float)this.height - 1f) / 16f);
bool flag13 = false;
if (Main.tile[num372, num373] == null)
{
Main.tile[num372, num373] = new Tile();
}
if (num373 - 1 > 0 && Main.tile[num372, num373 - 1] == null)
{
Main.tile[num372, num373 - 1] = new Tile();
}
if (num373 - 2 > 0 && Main.tile[num372, num373 - 2] == null)
{
Main.tile[num372, num373 - 2] = new Tile();
}
if (num373 - 3 > 0 && Main.tile[num372, num373 - 3] == null)
{
Main.tile[num372, num373 - 3] = new Tile();
}
if (num373 - 4 > 0 && Main.tile[num372, num373 - 4] == null)
{
Main.tile[num372, num373 - 4] = new Tile();
}
if (num373 - 3 > 0 && Main.tile[num372 - num371, num373 - 3] == null)
{
Main.tile[num372 - num371, num373 - 3] = new Tile();
}
if ((float)(num372 * 16) < vector27.X + (float)this.width && (float)(num372 * 16 + 16) > vector27.X && ((Main.tile[num372, num373].nactive() && (Main.tile[num372, num373].slope() == 0 || (Main.tile[num372, num373].slope() == 1 && this.position.X + (float)(this.width / 2) < (float)(num372 * 16)) || (Main.tile[num372, num373].slope() == 2 && this.position.X + (float)(this.width / 2) > (float)(num372 * 16 + 16))) && (Main.tile[num372, num373 - 1].slope() == 0 || this.position.Y + (float)this.height > (float)(num373 * 16)) && ((Main.tileSolid[(int)Main.tile[num372, num373].type] && !Main.tileSolidTop[(int)Main.tile[num372, num373].type]) || (flag13 && Main.tileSolidTop[(int)Main.tile[num372, num373].type] && Main.tile[num372, num373].frameY == 0 && (!Main.tileSolid[(int)Main.tile[num372, num373 - 1].type] || !Main.tile[num372, num373 - 1].nactive())))) || (Main.tile[num372, num373 - 1].halfBrick() && Main.tile[num372, num373 - 1].nactive())) && (!Main.tile[num372, num373 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 1].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 1].type] || Main.tile[num372, num373 - 1].slope() != 0 || (Main.tile[num372, num373 - 1].halfBrick() && (!Main.tile[num372, num373 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 4].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 4].type]))) && (!Main.tile[num372, num373 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 2].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 2].type]) && (!Main.tile[num372, num373 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 3].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 3].type]) && (!Main.tile[num372 - num371, num373 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num372 - num371, num373 - 3].type] || Main.tileSolidTop[(int)Main.tile[num372 - num371, num373 - 3].type]))
{
float num374 = (float)(num373 * 16);
if (Main.tile[num372, num373].halfBrick())
{
num374 += 8f;
}
if (Main.tile[num372, num373 - 1].halfBrick())
{
num374 -= 8f;
}
if (num374 < vector27.Y + (float)this.height)
{
float num375 = vector27.Y + (float)this.height - num374;
if ((double)num375 <= 16.1)
{
this.gfxOffY += this.position.Y + (float)this.height - num374;
this.position.Y = num374 - (float)this.height;
if (num375 < 9f)
{
this.stepSpeed = 1f;
}
else
{
this.stepSpeed = 2f;
}
}
}
}
}
if (this.velocity.Y == 0f || this.type == 200)
{
if (!flag10 && (this.velocity.X < 0f || this.velocity.X > 0f))
{
int num376 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int j3 = (int)(this.position.Y + (float)(this.height / 2)) / 16 + 1;
if (flag8)
{
num376--;
}
if (flag9)
{
num376++;
}
WorldGen.SolidTile(num376, j3);
}
if (flag11)
{
int num377 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int num378 = (int)(this.position.Y + (float)this.height) / 16 + 1;
if (WorldGen.SolidTile(num377, num378) || Main.tile[num377, num378].halfBrick() || Main.tile[num377, num378].slope() > 0 || this.type == 200)
{
if (this.type == 200)
{
this.velocity.Y = -3.1f;
}
else
{
try
{
num377 = (int)(this.position.X + (float)(this.width / 2)) / 16;
num378 = (int)(this.position.Y + (float)(this.height / 2)) / 16;
if (flag8)
{
num377--;
}
if (flag9)
{
num377++;
}
num377 += (int)this.velocity.X;
if (!WorldGen.SolidTile(num377, num378 - 1) && !WorldGen.SolidTile(num377, num378 - 2))
{
this.velocity.Y = -5.1f;
}
else
{
if (!WorldGen.SolidTile(num377, num378 - 2))
{
this.velocity.Y = -7.1f;
}
else
{
if (WorldGen.SolidTile(num377, num378 - 5))
{
this.velocity.Y = -11.1f;
}
else
{
if (WorldGen.SolidTile(num377, num378 - 4))
{
this.velocity.Y = -10.1f;
}
else
{
this.velocity.Y = -9.1f;
}
}
}
}
}
catch
{
this.velocity.Y = -9.1f;
}
}
if (this.type == 127)
{
this.ai[0] = 1f;
}
}
}
else
{
if (this.type == 266 && (flag8 || flag9))
{
this.velocity.Y = this.velocity.Y - 6f;
}
}
}
if (this.velocity.X > num369)
{
this.velocity.X = num369;
}
if (this.velocity.X < -num369)
{
this.velocity.X = -num369;
}
if (this.velocity.X < 0f)
{
this.direction = -1;
}
if (this.velocity.X > 0f)
{
this.direction = 1;
}
if (this.velocity.X > num368 && flag9)
{
this.direction = 1;
}
if (this.velocity.X < -num368 && flag8)
{
this.direction = -1;
}
if (this.direction == -1)
{
this.spriteDirection = 1;
}
if (this.direction == 1)
{
this.spriteDirection = -1;
}
if (this.type >= 191 && this.type <= 194)
{
if (this.ai[1] > 0f)
{
if (this.localAI[1] == 0f)
{
this.localAI[1] = 1f;
this.frame = 1;
}
if (this.frame != 0)
{
this.frameCounter++;
if (this.frameCounter > 4)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame == 4)
{
this.frame = 0;
}
}
}
else
{
if (this.velocity.Y == 0f)
{
this.localAI[1] = 0f;
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame < 5)
{
this.frame = 5;
}
if (this.frame >= 11)
{
this.frame = 5;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
if (this.velocity.Y < 0f)
{
this.frameCounter = 0;
this.frame = 4;
}
else
{
if (this.velocity.Y > 0f)
{
this.frameCounter = 0;
this.frame = 4;
}
}
}
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 268)
{
if (this.velocity.Y == 0f)
{
if (this.frame > 5)
{
this.frameCounter = 0;
}
if (this.velocity.X == 0f)
{
int num379 = 3;
this.frameCounter++;
if (this.frameCounter < num379)
{
this.frame = 0;
}
else
{
if (this.frameCounter < num379 * 2)
{
this.frame = 1;
}
else
{
if (this.frameCounter < num379 * 3)
{
this.frame = 2;
}
else
{
if (this.frameCounter < num379 * 4)
{
this.frame = 3;
}
else
{
this.frameCounter = num379 * 4;
}
}
}
}
}
else
{
this.velocity.X = this.velocity.X * 0.8f;
this.frameCounter++;
int num380 = 3;
if (this.frameCounter < num380)
{
this.frame = 0;
}
else
{
if (this.frameCounter < num380 * 2)
{
this.frame = 1;
}
else
{
if (this.frameCounter < num380 * 3)
{
this.frame = 2;
}
else
{
if (this.frameCounter < num380 * 4)
{
this.frame = 3;
}
else
{
if (flag8 || flag9)
{
this.velocity.X = this.velocity.X * 2f;
this.frame = 4;
this.velocity.Y = -6.1f;
this.frameCounter = 0;
for (int num381 = 0; num381 < 4; num381++)
{
int num382 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), this.width, 4, 5, 0f, 0f, 0, default(Color), 1f);
Main.dust[num382].velocity += this.velocity;
Main.dust[num382].velocity *= 0.4f;
}
}
else
{
this.frameCounter = num380 * 4;
}
}
}
}
}
}
}
else
{
if (this.velocity.Y < 0f)
{
this.frameCounter = 0;
this.frame = 5;
}
else
{
this.frame = 4;
this.frameCounter = 3;
}
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 269)
{
if (this.velocity.Y >= 0f && (double)this.velocity.Y <= 0.8)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8)
{
int num383 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), this.width, 6, 76, 0f, 0f, 0, default(Color), 1f);
Main.dust[num383].noGravity = true;
Main.dust[num383].velocity *= 0.3f;
Main.dust[num383].noLight = true;
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 3)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
this.frameCounter = 0;
this.frame = 2;
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 236)
{
if (this.velocity.Y >= 0f && (double)this.velocity.Y <= 0.8)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8)
{
if (this.frame < 2)
{
this.frame = 2;
}
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 8)
{
this.frame = 2;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
this.frameCounter = 0;
this.frame = 1;
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 266)
{
if (this.velocity.Y >= 0f && (double)this.velocity.Y <= 0.8)
{
if (this.velocity.X == 0f)
{
this.frameCounter++;
}
else
{
this.frameCounter += 3;
}
}
else
{
this.frameCounter += 5;
}
if (this.frameCounter >= 20)
{
this.frameCounter -= 20;
this.frame++;
}
if (this.frame > 1)
{
this.frame = 0;
}
if (this.wet && Main.player[this.owner].position.Y + (float)Main.player[this.owner].height < this.position.Y + (float)this.height && this.localAI[0] == 0f)
{
if (this.velocity.Y > -4f)
{
this.velocity.Y = this.velocity.Y - 0.2f;
}
if (this.velocity.Y > 0f)
{
this.velocity.Y = this.velocity.Y * 0.95f;
}
}
else
{
this.velocity.Y = this.velocity.Y + 0.4f;
}
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 111)
{
if (this.velocity.Y == 0f)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 7)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
if (this.velocity.Y < 0f)
{
this.frameCounter = 0;
this.frame = 4;
}
else
{
if (this.velocity.Y > 0f)
{
this.frameCounter = 0;
this.frame = 6;
}
}
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 112)
{
if (this.velocity.Y == 0f)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame >= 3)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
if (this.velocity.Y < 0f)
{
this.frameCounter = 0;
this.frame = 2;
}
else
{
if (this.velocity.Y > 0f)
{
this.frameCounter = 0;
this.frame = 2;
}
}
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 127)
{
if (this.velocity.Y == 0f)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 5)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 200)
{
if (this.velocity.Y == 0f)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 5)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
this.rotation = this.velocity.X * 0.1f;
this.frameCounter++;
if (this.velocity.Y < 0f)
{
this.frameCounter += 2;
}
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 9)
{
this.frame = 6;
}
if (this.frame < 6)
{
this.frame = 6;
}
}
this.velocity.Y = this.velocity.Y + 0.1f;
if (this.velocity.Y > 4f)
{
this.velocity.Y = 4f;
return;
}
}
else
{
if (this.type == 208)
{
if (this.velocity.Y == 0f && this.velocity.X == 0f)
{
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
{
if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) > this.position.X + (float)(this.width / 2))
{
this.direction = 1;
}
}
this.rotation = 0f;
this.frame = 0;
}
else
{
this.rotation = this.velocity.X * 0.075f;
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 4)
{
this.frame = 1;
}
if (this.frame < 1)
{
this.frame = 1;
}
}
this.velocity.Y = this.velocity.Y + 0.1f;
if (this.velocity.Y > 4f)
{
this.velocity.Y = 4f;
return;
}
}
else
{
if (this.type == 209)
{
if (this.alpha > 0)
{
this.alpha -= 5;
if (this.alpha < 0)
{
this.alpha = 0;
}
}
if (this.velocity.Y == 0f)
{
if (this.velocity.X == 0f)
{
this.frame = 0;
this.frameCounter = 0;
}
else
{
if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 11)
{
this.frame = 2;
}
if (this.frame < 2)
{
this.frame = 2;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
}
else
{
this.frame = 1;
this.frameCounter = 0;
this.rotation = 0f;
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
else
{
if (this.type == 210)
{
if (this.velocity.Y == 0f)
{
if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1)
{
this.frameCounter += (int)Math.Abs(this.velocity.X);
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 6)
{
this.frame = 0;
}
}
else
{
this.frame = 0;
this.frameCounter = 0;
}
}
else
{
this.rotation = this.velocity.X * 0.05f;
this.frameCounter++;
if (this.frameCounter > 6)
{
this.frame++;
this.frameCounter = 0;
}
if (this.frame > 11)
{
this.frame = 7;
}
if (this.frame < 7)
{
this.frame = 7;
}
}
this.velocity.Y = this.velocity.Y + 0.4f;
if (this.velocity.Y > 10f)
{
this.velocity.Y = 10f;
return;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
else
{
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 num384 = 5; num384 < 25; num384++)
{
float num385 = this.velocity.X * (30f / (float)num384);
float num386 = this.velocity.Y * (30f / (float)num384);
num385 *= 80f;
num386 *= 80f;
int num387 = Dust.NewDust(new Vector2(this.position.X - num385, this.position.Y - num386), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 0.9f);
Main.dust[num387].velocity *= 0.25f;
Main.dust[num387].velocity -= this.velocity * 5f;
}
}
if (this.localAI[1] > 7f && this.type == 173)
{
int num388 = Main.rand.Next(3);
if (num388 == 0)
{
num388 = 15;
}
else
{
if (num388 == 1)
{
num388 = 57;
}
else
{
num388 = 58;
}
}
int num389 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, num388, 0f, 0f, 100, default(Color), 1.25f);
Main.dust[num389].velocity *= 0.1f;
}
if (this.localAI[1] > 7f && this.type == 132)
{
int num390 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.25f);
Main.dust[num390].velocity *= -0.25f;
num390 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.25f);
Main.dust[num390].velocity *= -0.25f;
Main.dust[num390].position -= this.velocity * 0.5f;
}
if (this.localAI[1] < 15f)
{
this.localAI[1] += 1f;
}
else
{
if (this.type == 114 || this.type == 115)
{
int num391 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 4f), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 0.6f);
Main.dust[num391].velocity *= -0.25f;
}
else
{
if (this.type == 116)
{
int num392 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 5f + 2f, this.position.Y + 2f - this.velocity.Y * 5f), 8, 8, 64, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.5f);
Main.dust[num392].velocity *= -0.25f;
Main.dust[num392].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;
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 num393 = 0; num393 < 3; num393++)
{
int num394 = 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[num394].noGravity = true;
Main.dust[num394].velocity *= 0.3f;
}
}
if (this.type == 118)
{
for (int num395 = 0; num395 < 2; num395++)
{
int num396 = 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[num396].noGravity = true;
Main.dust[num396].velocity *= 0.3f;
}
}
if (this.type == 119 || this.type == 128)
{
for (int num397 = 0; num397 < 3; num397++)
{
int num398 = 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[num398].noGravity = true;
Main.dust[num398].velocity *= 0.3f;
}
}
if (this.type == 309)
{
for (int num399 = 0; num399 < 3; num399++)
{
int num400 = 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[num400].noGravity = true;
Main.dust[num400].velocity *= 0.3f;
}
}
if (this.type == 129)
{
for (int num401 = 0; num401 < 6; num401++)
{
int num402 = 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[num402].noGravity = true;
Main.dust[num402].velocity *= 0.1f + (float)Main.rand.Next(4) * 0.1f;
Main.dust[num402].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)
{
int num403 = this.type - 121 + 86;
for (int num404 = 0; num404 < 2; num404++)
{
int num405 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num403, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f);
Main.dust[num405].noGravity = true;
Main.dust[num405].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 num406 = 110;
int num407 = 0;
if (this.type == 146)
{
num406 = 111;
num407 = 2;
}
if (this.type == 147)
{
num406 = 112;
num407 = 1;
}
if (this.type == 148)
{
num406 = 113;
num407 = 3;
}
if (this.type == 149)
{
num406 = 114;
num407 = 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, num407, 2);
}
if (this.timeLeft > 133)
{
this.timeLeft = 133;
}
if (this.ai[0] > 7f)
{
float num408 = 1f;
if (this.ai[0] == 8f)
{
num408 = 0.2f;
}
else
{
if (this.ai[0] == 9f)
{
num408 = 0.4f;
}
else
{
if (this.ai[0] == 10f)
{
num408 = 0.6f;
}
else
{
if (this.ai[0] == 11f)
{
num408 = 0.8f;
}
}
}
}
this.ai[0] += 1f;
for (int num409 = 0; num409 < 1; num409++)
{
int num410 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num406, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f);
Main.dust[num410].noGravity = true;
Main.dust[num410].scale *= 1.75f;
Dust expr_1352D_cp_0 = Main.dust[num410];
expr_1352D_cp_0.velocity.X = expr_1352D_cp_0.velocity.X * 2f;
Dust expr_1354D_cp_0 = Main.dust[num410];
expr_1354D_cp_0.velocity.Y = expr_1354D_cp_0.velocity.Y * 2f;
Main.dust[num410].scale *= num408;
}
}
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 num411 = 0; num411 < 255; num411++)
{
Rectangle rectangle2 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height);
if (Main.player[num411].active)
{
Rectangle value3 = new Rectangle((int)Main.player[num411].position.X, (int)Main.player[num411].position.Y, Main.player[num411].width, Main.player[num411].height);
if (rectangle2.Intersects(value3))
{
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[num411].direction * 1.75f) / 2f;
this.velocity.X = this.velocity.X + Main.player[num411].velocity.X * 3f;
this.velocity.Y = this.velocity.Y + Main.player[num411].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 num412 = 4f;
float num413 = this.ai[0];
float num414 = this.ai[1];
if (num413 == 0f && num414 == 0f)
{
num413 = 1f;
}
float num415 = (float)Math.Sqrt((double)(num413 * num413 + num414 * num414));
num415 = num412 / num415;
num413 *= num415;
num414 *= num415;
if (this.alpha < 70)
{
int num416 = 127;
if (this.type == 310)
{
num416 = 187;
}
int num417 = Dust.NewDust(new Vector2(this.position.X, this.position.Y - 2f), 6, 6, num416, this.velocity.X, this.velocity.Y, 100, default(Color), 1.6f);
Main.dust[num417].noGravity = true;
Dust expr_13B42_cp_0 = Main.dust[num417];
expr_13B42_cp_0.position.X = expr_13B42_cp_0.position.X - num413 * 1f;
Dust expr_13B67_cp_0 = Main.dust[num417];
expr_13B67_cp_0.position.Y = expr_13B67_cp_0.position.Y - num414 * 1f;
Dust expr_13B8C_cp_0 = Main.dust[num417];
expr_13B8C_cp_0.velocity.X = expr_13B8C_cp_0.velocity.X - num413;
Dust expr_13BAB_cp_0 = Main.dust[num417];
expr_13BAB_cp_0.velocity.Y = expr_13BAB_cp_0.velocity.Y - num414;
}
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)
{
int num418 = 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[num418].noGravity = true;
Main.dust[num418].velocity *= 0.2f;
return;
}
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 vector28 = Collision.TileCollision(this.position, this.velocity, this.width, this.height, true, true);
if (vector28 != this.velocity)
{
this.position += vector28;
int num419 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int num420 = (int)(this.position.Y + (float)(this.height / 2)) / 16;
int num421 = 10;
if (Main.tile[num419, num420] != null)
{
while (Main.tile[num419, num420] != null && Main.tile[num419, num420].active())
{
if (!Main.tileRope[(int)Main.tile[num419, num420].type])
{
break;
}
num420++;
}
while (num421 > 0)
{
num421--;
if (Main.tile[num419, num420] == null)
{
break;
}
if (Main.tile[num419, num420].active() && (Main.tileCut[(int)Main.tile[num419, num420].type] || Main.tile[num419, num420].type == 165))
{
WorldGen.KillTile(num419, num420, false, false, false);
NetMessage.SendData(17, -1, -1, "", 0, (float)num419, (float)num420, 0f, 0);
}
if (!Main.tile[num419, num420].active())
{
WorldGen.PlaceTile(num419, num420, 213, false, false, -1, 0);
NetMessage.SendData(17, -1, -1, "", 1, (float)num419, (float)num420, 213f, 0);
this.ai[1] += 1f;
}
else
{
num421 = 0;
}
num420++;
}
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.maxUpdates = 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 num422 = 0; num422 < 3; num422++)
{
float num423 = this.velocity.X / 3f * (float)num422;
float num424 = this.velocity.Y / 3f * (float)num422;
int num425 = Dust.NewDust(this.position, this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f);
Main.dust[num425].position.X = this.center().X - num423;
Main.dust[num425].position.Y = this.center().Y - num424;
Main.dust[num425].velocity *= 0f;
Main.dust[num425].scale = 0.5f;
}
}
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 num426 = this.position.X;
float num427 = this.position.Y;
float num428 = 100000f;
bool flag14 = false;
this.ai[0] += 1f;
if (this.ai[0] > 30f)
{
this.ai[0] = 30f;
for (int num429 = 0; num429 < 200; num429++)
{
if (Main.npc[num429].active && !Main.npc[num429].dontTakeDamage && !Main.npc[num429].friendly && Main.npc[num429].lifeMax > 5 && (!Main.npc[num429].wet || this.type == 307))
{
float num430 = Main.npc[num429].position.X + (float)(Main.npc[num429].width / 2);
float num431 = Main.npc[num429].position.Y + (float)(Main.npc[num429].height / 2);
float num432 = Math.Abs(this.position.X + (float)(this.width / 2) - num430) + Math.Abs(this.position.Y + (float)(this.height / 2) - num431);
if (num432 < 800f && num432 < num428 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num429].position, Main.npc[num429].width, Main.npc[num429].height))
{
num428 = num432;
num426 = num430;
num427 = num431;
flag14 = true;
}
}
}
}
if (!flag14)
{
num426 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f;
num427 = this.position.Y + (float)(this.height / 2) + this.velocity.Y * 100f;
}
else
{
if (this.type == 307)
{
this.friendly = true;
}
}
float num433 = 6f;
float num434 = 0.1f;
if (this.type == 189)
{
num433 = 7f;
num434 = 0.15f;
}
if (this.type == 307)
{
num433 = 9f;
num434 = 0.2f;
}
Vector2 vector29 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num435 = num426 - vector29.X;
float num436 = num427 - vector29.Y;
float num437 = (float)Math.Sqrt((double)(num435 * num435 + num436 * num436));
num437 = num433 / num437;
num435 *= num437;
num436 *= num437;
if (this.velocity.X < num435)
{
this.velocity.X = this.velocity.X + num434;
if (this.velocity.X < 0f && num435 > 0f)
{
this.velocity.X = this.velocity.X + num434 * 2f;
}
}
else
{
if (this.velocity.X > num435)
{
this.velocity.X = this.velocity.X - num434;
if (this.velocity.X > 0f && num435 < 0f)
{
this.velocity.X = this.velocity.X - num434 * 2f;
}
}
}
if (this.velocity.Y < num436)
{
this.velocity.Y = this.velocity.Y + num434;
if (this.velocity.Y < 0f && num436 > 0f)
{
this.velocity.Y = this.velocity.Y + num434 * 2f;
return;
}
}
else
{
if (this.velocity.Y > num436)
{
this.velocity.Y = this.velocity.Y - num434;
if (this.velocity.Y > 0f && num436 < 0f)
{
this.velocity.Y = this.velocity.Y - num434 * 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 num438 = this.position.Y - this.ai[1];
if (num438 > 300f)
{
this.velocity.Y = this.velocity.Y * -1f;
this.ai[0] += 1f;
return;
}
}
else
{
if (Collision.SolidCollision(this.position, this.width, this.height))
{
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 vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num439 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector30.X;
float num440 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector30.Y;
float num441 = (float)Math.Sqrt((double)(num439 * num439 + num440 * num440));
if (!Main.player[this.owner].channel && this.alpha == 0)
{
this.ai[0] = 1f;
this.ai[1] = -1f;
}
if (this.ai[1] > 0f && num441 > 1500f)
{
this.ai[1] = 0f;
this.ai[0] = 1f;
}
if (this.ai[1] > 0f)
{
this.tileCollide = false;
int num442 = (int)this.ai[1] - 1;
if (Main.npc[num442].active && Main.npc[num442].life > 0)
{
float num443 = 16f;
vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
num439 = Main.npc[num442].position.X + (float)(Main.npc[num442].width / 2) - vector30.X;
num440 = Main.npc[num442].position.Y + (float)(Main.npc[num442].height / 2) - vector30.Y;
num441 = (float)Math.Sqrt((double)(num439 * num439 + num440 * num440));
if (num441 < num443)
{
this.velocity.X = num439;
this.velocity.Y = num440;
if (num441 > num443 / 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
{
num441 = num443 / num441;
num439 *= num441;
num440 *= num441;
this.velocity.X = num439;
this.velocity.Y = num440;
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 num444 = this.position.X;
float num445 = this.position.Y;
float num446 = 3000f;
int num447 = -1;
for (int num448 = 0; num448 < 200; num448++)
{
if (Main.npc[num448].active && !Main.npc[num448].friendly && Main.npc[num448].lifeMax > 5)
{
float num449 = Main.npc[num448].position.X + (float)(Main.npc[num448].width / 2);
float num450 = Main.npc[num448].position.Y + (float)(Main.npc[num448].height / 2);
float num451 = Math.Abs(this.position.X + (float)(this.width / 2) - num449) + Math.Abs(this.position.Y + (float)(this.height / 2) - num450);
if (num451 < num446 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num448].position, Main.npc[num448].width, Main.npc[num448].height))
{
num446 = num451;
num444 = num449;
num445 = num450;
num447 = num448;
}
}
}
if (num447 >= 0)
{
float num452 = 16f;
vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
num439 = num444 - vector30.X;
num440 = num445 - vector30.Y;
num441 = (float)Math.Sqrt((double)(num439 * num439 + num440 * num440));
num441 = num452 / num441;
num439 *= num441;
num440 *= num441;
this.velocity.X = num439;
this.velocity.Y = num440;
this.ai[0] = 0f;
this.ai[1] = (float)(num447 + 1);
}
}
}
else
{
if (this.ai[0] == 0f)
{
if (num441 > 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 num453 = 20f;
if (num441 < 70f)
{
this.Kill();
}
num441 = num453 / num441;
num439 *= num441;
num440 *= num441;
this.velocity.X = num439;
this.velocity.Y = num440;
}
}
}
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 num454 = (float)Main.mouseTextColor / 200f - 0.35f;
num454 *= 0.2f;
this.scale = num454 + 0.95f;
if (this.owner == Main.myPlayer)
{
if (this.ai[0] != 0f)
{
this.ai[0] -= 1f;
return;
}
float num455 = this.position.X;
float num456 = this.position.Y;
float num457 = 700f;
bool flag15 = false;
for (int num458 = 0; num458 < 200; num458++)
{
if (Main.npc[num458].active && !Main.npc[num458].friendly && Main.npc[num458].lifeMax > 5)
{
float num459 = Main.npc[num458].position.X + (float)(Main.npc[num458].width / 2);
float num460 = Main.npc[num458].position.Y + (float)(Main.npc[num458].height / 2);
float num461 = Math.Abs(this.position.X + (float)(this.width / 2) - num459) + Math.Abs(this.position.Y + (float)(this.height / 2) - num460);
if (num461 < num457 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num458].position, Main.npc[num458].width, Main.npc[num458].height))
{
num457 = num461;
num455 = num459;
num456 = num460;
flag15 = true;
}
}
}
if (flag15)
{
float num462 = 12f;
Vector2 vector31 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num463 = num455 - vector31.X;
float num464 = num456 - vector31.Y;
float num465 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464));
num465 = num462 / num465;
num463 *= num465;
num464 *= num465;
Projectile.NewProjectile(this.center().X - 4f, this.center().Y, num463, num464, 227, 40, 5f, this.owner, 0f, 0f);
this.ai[0] = 60f;
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 num466 = 0; num466 < 5; num466++)
{
int num467 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f);
Main.dust[num467].noGravity = true;
Main.dust[num467].velocity *= 3f;
Main.dust[num467].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 num468 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f);
Main.dust[num468].noGravity = true;
Main.dust[num468].velocity *= 0.1f;
Main.dust[num468].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 num469 = this.ai[0];
float num470 = this.ai[1];
if (num469 != 0f && num470 != 0f)
{
bool flag16 = false;
bool flag17 = false;
if ((this.velocity.X < 0f && this.center().X < num469) || (this.velocity.X > 0f && this.center().X > num469))
{
flag16 = true;
}
if ((this.velocity.Y < 0f && this.center().Y < num470) || (this.velocity.Y > 0f && this.center().Y > num470))
{
flag17 = true;
}
if (flag16 && flag17)
{
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] >= 1800f)
{
this.alpha += 5;
if (this.alpha > 255)
{
this.alpha = 255;
this.Kill();
}
}
else
{
if (this.type == 238 && this.ai[1] >= 3600f)
{
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 num471 = (int)(this.position.X + 14f + (float)Main.rand.Next(this.width - 28));
int num472 = (int)(this.position.Y + (float)this.height + 4f);
Projectile.NewProjectile((float)num471, (float)num472, 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 num473 = (int)(this.position.X + 14f + (float)Main.rand.Next(this.width - 28));
int num474 = (int)(this.position.Y + (float)this.height + 4f);
Projectile.NewProjectile((float)num473, (float)num474, 0f, 5f, 239, this.damage, 0f, this.owner, 0f, 0f);
}
}
}
}
}
this.localAI[0] += 1f;
if (this.localAI[0] >= 10f)
{
this.localAI[0] = 0f;
int num475 = 0;
int num476 = 0;
float num477 = 0f;
int num478 = this.type;
for (int num479 = 0; num479 < 1000; num479++)
{
if (Main.projectile[num479].active && Main.projectile[num479].owner == this.owner && Main.projectile[num479].type == num478 && Main.projectile[num479].ai[1] < 3600f)
{
num475++;
if (Main.projectile[num479].ai[1] > num477)
{
num476 = num479;
num477 = Main.projectile[num479].ai[1];
}
}
}
if (this.type == 244)
{
if (num475 > 1)
{
Main.projectile[num476].netUpdate = true;
Main.projectile[num476].ai[1] = 36000f;
return;
}
}
else
{
if (num475 > 2)
{
Main.projectile[num476].netUpdate = true;
Main.projectile[num476].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)
{
if (this.type == 250)
{
if (this.owner == Main.myPlayer)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 4f)
{
this.localAI[0] = 3f;
Projectile.NewProjectile(this.center().X, this.center().Y, this.velocity.X * 0.001f, this.velocity.Y * 0.001f, 251, this.damage, this.knockBack, this.owner, 0f, 0f);
}
if (this.timeLeft > 150)
{
this.timeLeft = 150;
}
}
float num480 = 1f;
if (this.velocity.Y < 0f)
{
num480 -= this.velocity.Y / 3f;
}
this.ai[0] += num480;
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 num481 = this.velocity.X;
float num482 = this.velocity.Y;
float num483 = (float)Math.Sqrt((double)(num481 * num481 + num482 * num482));
num483 = 15.95f * this.scale / num483;
num481 *= num483;
num482 *= num483;
this.velocity.X = num481;
this.velocity.Y = num482;
this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f;
return;
}
int num484 = 300;
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 = num484;
}
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 > num484 - 10)
{
int num485 = num484 - this.timeLeft;
this.alpha = 255 - (int)(255f * (float)num485 / 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 num486 = 0; num486 < 1000; num486++)
{
if (num486 != this.whoAmI && Main.projectile[num486].active && Main.projectile[num486].owner == this.owner && Main.projectile[num486].type == this.type && this.timeLeft > Main.projectile[num486].timeLeft && Main.projectile[num486].timeLeft > 30)
{
Main.projectile[num486].timeLeft = 30;
}
}
int[] array = new int[20];
int num487 = 0;
float num488 = 300f;
bool flag18 = false;
for (int num489 = 0; num489 < 200; num489++)
{
if (Main.npc[num489].active && !Main.npc[num489].dontTakeDamage && !Main.npc[num489].friendly && Main.npc[num489].lifeMax > 5)
{
float num490 = Main.npc[num489].position.X + (float)(Main.npc[num489].width / 2);
float num491 = Main.npc[num489].position.Y + (float)(Main.npc[num489].height / 2);
float num492 = Math.Abs(this.position.X + (float)(this.width / 2) - num490) + Math.Abs(this.position.Y + (float)(this.height / 2) - num491);
if (num492 < num488 && Collision.CanHit(this.center(), 1, 1, Main.npc[num489].center(), 1, 1))
{
if (num487 < 20)
{
array[num487] = num489;
num487++;
}
flag18 = true;
}
}
}
if (this.timeLeft < 30)
{
flag18 = false;
}
if (flag18)
{
int num493 = Main.rand.Next(num487);
num493 = array[num493];
float num494 = Main.npc[num493].position.X + (float)(Main.npc[num493].width / 2);
float num495 = Main.npc[num493].position.Y + (float)(Main.npc[num493].height / 2);
this.localAI[0] += 1f;
if (this.localAI[0] > 8f)
{
this.localAI[0] = 0f;
float num496 = 6f;
Vector2 value4 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
value4 += this.velocity * 4f;
float num497 = num494 - value4.X;
float num498 = num495 - value4.Y;
float num499 = (float)Math.Sqrt((double)(num497 * num497 + num498 * num498));
num499 = num496 / num499;
num497 *= num499;
num498 *= num499;
Projectile.NewProjectile(value4.X, value4.Y, num497, num498, 255, this.damage, this.knockBack, this.owner, 0f, 0f);
return;
}
}
}
else
{
if (this.aiStyle == 48)
{
if (this.type == 255)
{
for (int num500 = 0; num500 < 4; num500++)
{
Vector2 value5 = this.position;
value5 -= this.velocity * ((float)num500 * 0.25f);
this.alpha = 255;
int num501 = Dust.NewDust(value5, 1, 1, 160, 0f, 0f, 0, default(Color), 1f);
Main.dust[num501].position = value5;
Dust expr_16D3E_cp_0 = Main.dust[num501];
expr_16D3E_cp_0.position.X = expr_16D3E_cp_0.position.X + (float)(this.width / 2);
Dust expr_16D62_cp_0 = Main.dust[num501];
expr_16D62_cp_0.position.Y = expr_16D62_cp_0.position.Y + (float)(this.height / 2);
Main.dust[num501].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num501].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 num502 = 0; num502 < 3; num502++)
{
Vector2 value6 = this.position;
value6 -= this.velocity * ((float)num502 * 0.3334f);
this.alpha = 255;
int num503 = Dust.NewDust(value6, 1, 1, 173, 0f, 0f, 0, default(Color), 1f);
Main.dust[num503].position = value6;
Main.dust[num503].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num503].velocity *= 0.2f;
}
return;
}
}
else
{
if (this.type == 294)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 9f)
{
for (int num504 = 0; num504 < 4; num504++)
{
Vector2 value7 = this.position;
value7 -= this.velocity * ((float)num504 * 0.25f);
this.alpha = 255;
int num505 = Dust.NewDust(value7, 1, 1, 173, 0f, 0f, 0, default(Color), 1f);
Main.dust[num505].position = value7;
Main.dust[num505].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num505].velocity *= 0.2f;
}
return;
}
}
else
{
this.localAI[0] += 1f;
if (this.localAI[0] > 3f)
{
for (int num506 = 0; num506 < 4; num506++)
{
Vector2 value8 = this.position;
value8 -= this.velocity * ((float)num506 * 0.25f);
this.alpha = 255;
int num507 = Dust.NewDust(value8, 1, 1, 162, 0f, 0f, 0, default(Color), 1f);
Main.dust[num507].position = value8;
Dust expr_170FE_cp_0 = Main.dust[num507];
expr_170FE_cp_0.position.X = expr_170FE_cp_0.position.X + (float)(this.width / 2);
Dust expr_17122_cp_0 = Main.dust[num507];
expr_17122_cp_0.position.Y = expr_17122_cp_0.position.Y + (float)(this.height / 2);
Main.dust[num507].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num507].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 num508 = 0; num508 < 10; num508++)
{
int num509 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num509].velocity *= 0.5f;
Main.dust[num509].velocity += this.velocity * 0.1f;
}
for (int num510 = 0; num510 < 5; num510++)
{
int num511 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num511].noGravity = true;
Main.dust[num511].velocity *= 3f;
Main.dust[num511].velocity += this.velocity * 0.2f;
num511 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f);
Main.dust[num511].velocity *= 2f;
Main.dust[num511].velocity += this.velocity * 0.3f;
}
for (int num512 = 0; num512 < 1; num512++)
{
int num513 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num513].position += this.velocity * 1.25f;
Main.gore[num513].scale = 1.5f;
Main.gore[num513].velocity += this.velocity * 0.5f;
Main.gore[num513].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 flag19 = false;
bool flag20 = false;
if (this.velocity.X < 0f && this.position.X < this.ai[0])
{
flag19 = true;
}
if (this.velocity.X > 0f && this.position.X > this.ai[0])
{
flag19 = true;
}
if (this.velocity.Y < 0f && this.position.Y < this.ai[1])
{
flag20 = true;
}
if (this.velocity.Y > 0f && this.position.Y > this.ai[1])
{
flag20 = true;
}
if (flag19 && flag20)
{
this.Kill();
}
for (int num514 = 0; num514 < 10; num514++)
{
int num515 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num515].noGravity = true;
Main.dust[num515].velocity *= 0.5f;
Main.dust[num515].velocity += this.velocity * 0.1f;
}
return;
}
if (this.type == 295)
{
for (int num516 = 0; num516 < 8; num516++)
{
int num517 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num517].noGravity = true;
Main.dust[num517].velocity *= 0.5f;
Main.dust[num517].velocity += this.velocity * 0.1f;
}
return;
}
if (this.localAI[0] == 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
this.localAI[0] += 1f;
}
this.ai[0] += 1f;
if (this.type == 296)
{
this.ai[0] += 3f;
}
float num518 = 25f;
if (this.ai[0] > 180f)
{
num518 -= (this.ai[0] - 180f) / 2f;
}
if (num518 <= 0f)
{
num518 = 0f;
this.Kill();
}
if (this.type == 296)
{
num518 *= 0.7f;
}
int num519 = 0;
while ((float)num519 < num518)
{
float num520 = (float)Main.rand.Next(-10, 11);
float num521 = (float)Main.rand.Next(-10, 11);
float num522 = (float)Main.rand.Next(3, 9);
float num523 = (float)Math.Sqrt((double)(num520 * num520 + num521 * num521));
num523 = num522 / num523;
num520 *= num523;
num521 *= num523;
int num524 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num524].noGravity = true;
Main.dust[num524].position.X = this.center().X;
Main.dust[num524].position.Y = this.center().Y;
Dust expr_17B71_cp_0 = Main.dust[num524];
expr_17B71_cp_0.position.X = expr_17B71_cp_0.position.X + (float)Main.rand.Next(-10, 11);
Dust expr_17B9B_cp_0 = Main.dust[num524];
expr_17B9B_cp_0.position.Y = expr_17B9B_cp_0.position.Y + (float)Main.rand.Next(-10, 11);
Main.dust[num524].velocity.X = num520;
Main.dust[num524].velocity.Y = num521;
num519++;
}
return;
}
else
{
if (this.aiStyle == 51)
{
if (this.type == 297)
{
this.localAI[0] += 1f;
if (this.localAI[0] > 4f)
{
for (int num525 = 0; num525 < 5; num525++)
{
int num526 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 2f);
Main.dust[num526].noGravity = true;
Main.dust[num526].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 num527 = 0; num527 < 9; num527++)
{
int num528 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f);
Main.dust[num528].noGravity = true;
Main.dust[num528].velocity *= 0f;
}
}
float num529 = this.center().X;
float num530 = this.center().Y;
float num531 = 400f;
bool flag21 = false;
if (this.type == 297)
{
for (int num532 = 0; num532 < 200; num532++)
{
if (Main.npc[num532].active && !Main.npc[num532].dontTakeDamage && !Main.npc[num532].friendly && Main.npc[num532].lifeMax > 5 && Collision.CanHit(this.center(), 1, 1, Main.npc[num532].center(), 1, 1))
{
float num533 = Main.npc[num532].position.X + (float)(Main.npc[num532].width / 2);
float num534 = Main.npc[num532].position.Y + (float)(Main.npc[num532].height / 2);
float num535 = Math.Abs(this.position.X + (float)(this.width / 2) - num533) + Math.Abs(this.position.Y + (float)(this.height / 2) - num534);
if (num535 < num531)
{
num531 = num535;
num529 = num533;
num530 = num534;
flag21 = true;
}
}
}
}
else
{
num531 = 200f;
for (int num536 = 0; num536 < 255; num536++)
{
if (Main.player[num536].active && !Main.player[num536].dead)
{
float num537 = Main.player[num536].position.X + (float)(Main.player[num536].width / 2);
float num538 = Main.player[num536].position.Y + (float)(Main.player[num536].height / 2);
float num539 = Math.Abs(this.position.X + (float)(this.width / 2) - num537) + Math.Abs(this.position.Y + (float)(this.height / 2) - num538);
if (num539 < num531)
{
num531 = num539;
num529 = num537;
num530 = num538;
flag21 = true;
}
}
}
}
if (flag21)
{
float num540 = 3f;
if (this.type == 297)
{
num540 = 6f;
}
Vector2 vector32 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num541 = num529 - vector32.X;
float num542 = num530 - vector32.Y;
float num543 = (float)Math.Sqrt((double)(num541 * num541 + num542 * num542));
num543 = num540 / num543;
num541 *= num543;
num542 *= num543;
if (this.type == 297)
{
this.velocity.X = (this.velocity.X * 20f + num541) / 21f;
this.velocity.Y = (this.velocity.Y * 20f + num542) / 21f;
return;
}
this.velocity.X = (this.velocity.X * 100f + num541) / 101f;
this.velocity.Y = (this.velocity.Y * 100f + num542) / 101f;
return;
}
}
else
{
if (this.aiStyle == 52)
{
int num544 = (int)this.ai[0];
float num545 = 4f;
Vector2 vector33 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num546 = Main.player[num544].center().X - vector33.X;
float num547 = Main.player[num544].center().Y - vector33.Y;
float num548 = (float)Math.Sqrt((double)(num546 * num546 + num547 * num547));
if (num548 < 50f && this.position.X < Main.player[num544].position.X + (float)Main.player[num544].width && this.position.X + (float)this.width > Main.player[num544].position.X && this.position.Y < Main.player[num544].position.Y + (float)Main.player[num544].height && this.position.Y + (float)this.height > Main.player[num544].position.Y)
{
if (this.owner == Main.myPlayer)
{
int num549 = (int)this.ai[1];
Main.player[num544].HealEffect(num549, false);
Main.player[num544].statLife += num549;
if (Main.player[num544].statLife > Main.player[num544].statLifeMax)
{
Main.player[num544].statLife = Main.player[num544].statLifeMax;
}
NetMessage.SendData(66, -1, -1, "", num544, (float)num549, 0f, 0f, 0);
}
this.Kill();
}
num548 = num545 / num548;
num546 *= num548;
num547 *= num548;
this.velocity.X = (this.velocity.X * 15f + num546) / 16f;
this.velocity.Y = (this.velocity.Y * 15f + num547) / 16f;
if (this.type == 305)
{
for (int num550 = 0; num550 < 3; num550++)
{
float num551 = this.velocity.X * 0.334f * (float)num550;
float num552 = -(this.velocity.Y * 0.334f) * (float)num550;
int num553 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 183, 0f, 0f, 100, default(Color), 1.1f);
Main.dust[num553].noGravity = true;
Main.dust[num553].velocity *= 0f;
Dust expr_18598_cp_0 = Main.dust[num553];
expr_18598_cp_0.position.X = expr_18598_cp_0.position.X - num551;
Dust expr_185B7_cp_0 = Main.dust[num553];
expr_185B7_cp_0.position.Y = expr_185B7_cp_0.position.Y - num552;
}
return;
}
for (int num554 = 0; num554 < 5; num554++)
{
float num555 = this.velocity.X * 0.2f * (float)num554;
float num556 = -(this.velocity.Y * 0.2f) * (float)num554;
int num557 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f);
Main.dust[num557].noGravity = true;
Main.dust[num557].velocity *= 0f;
Dust expr_186AF_cp_0 = Main.dust[num557];
expr_186AF_cp_0.position.X = expr_186AF_cp_0.position.X - num555;
Dust expr_186CE_cp_0 = Main.dust[num557];
expr_186CE_cp_0.position.Y = expr_186CE_cp_0.position.Y - num556;
}
return;
}
else
{
if (this.aiStyle == 53)
{
if (this.localAI[0] == 0f)
{
this.localAI[1] = 1f;
this.localAI[0] = 1f;
this.ai[0] = 120f;
int num558 = 80;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 46);
for (int num559 = 0; num559 < num558; num559++)
{
int num560 = 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[num560].velocity *= 2f;
Main.dust[num560].noGravity = true;
Main.dust[num560].scale *= 1.15f;
}
}
this.velocity.X = 0f;
this.velocity.Y = this.velocity.Y + 0.2f;
if (this.velocity.Y > 16f)
{
this.velocity.Y = 16f;
}
bool flag22 = false;
float num561 = this.center().X;
float num562 = this.center().Y;
float num563 = 1000f;
for (int num564 = 0; num564 < 200; num564++)
{
if (Main.npc[num564].active && !Main.npc[num564].dontTakeDamage && !Main.npc[num564].friendly && Main.npc[num564].lifeMax > 5)
{
float num565 = Main.npc[num564].position.X + (float)(Main.npc[num564].width / 2);
float num566 = Main.npc[num564].position.Y + (float)(Main.npc[num564].height / 2);
float num567 = Math.Abs(this.position.X + (float)(this.width / 2) - num565) + Math.Abs(this.position.Y + (float)(this.height / 2) - num566);
if (num567 < num563 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num564].position, Main.npc[num564].width, Main.npc[num564].height))
{
num563 = num567;
num561 = num565;
num562 = num566;
flag22 = true;
}
}
}
if (flag22)
{
float num568 = num561;
float num569 = num562;
num561 -= this.center().X;
num562 -= this.center().Y;
if (num561 < 0f)
{
this.spriteDirection = -1;
}
else
{
this.spriteDirection = 1;
}
int num570;
if (num562 > 0f)
{
num570 = 0;
}
else
{
if (Math.Abs(num562) > Math.Abs(num561) * 3f)
{
num570 = 4;
}
else
{
if (Math.Abs(num562) > Math.Abs(num561) * 2f)
{
num570 = 3;
}
else
{
if (Math.Abs(num561) > Math.Abs(num562) * 3f)
{
num570 = 0;
}
else
{
if (Math.Abs(num561) > Math.Abs(num562) * 2f)
{
num570 = 1;
}
else
{
num570 = 2;
}
}
}
}
}
this.frame = num570 * 2;
if (this.ai[0] > 40f && this.localAI[1] == 0f)
{
this.frame++;
}
if (this.ai[0] <= 0f)
{
this.localAI[1] = 0f;
this.ai[0] = 60f;
if (Main.myPlayer == this.owner)
{
float num571 = 6f;
Vector2 vector34 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
if (num570 == 0)
{
vector34.Y += 12f;
vector34.X += (float)(24 * this.spriteDirection);
}
else
{
if (num570 == 1)
{
vector34.Y += 0f;
vector34.X += (float)(24 * this.spriteDirection);
}
else
{
if (num570 == 2)
{
vector34.Y -= 2f;
vector34.X += (float)(24 * this.spriteDirection);
}
else
{
if (num570 == 3)
{
vector34.Y -= 6f;
vector34.X += (float)(14 * this.spriteDirection);
}
else
{
if (num570 == 4)
{
vector34.Y -= 14f;
vector34.X += (float)(2 * this.spriteDirection);
}
}
}
}
}
if (this.spriteDirection < 0)
{
vector34.X += 10f;
}
float num572 = num568 - vector34.X;
float num573 = num569 - vector34.Y;
float num574 = (float)Math.Sqrt((double)(num572 * num572 + num573 * num573));
num574 = num571 / num574;
num572 *= num574;
num573 *= num574;
int num575 = this.damage;
int num576 = 309;
Projectile.NewProjectile(vector34.X, vector34.Y, num572, num573, num576, num575, 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;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
public void Kill()
{
if (!this.active)
{
return;
}
this.timeLeft = 0;
if (this.type == 1 || this.type == 81 || this.type == 98)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int i = 0; i < 10; i++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 184 || this.type == 195)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int j = 0; j < 5; j++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 275 || this.type == 276)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int k = 0; k < 5; k++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 291)
{
if (this.owner == Main.myPlayer)
{
Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 292, this.damage, this.knockBack, this.owner, 0f, 0f);
}
}
else
{
if (this.type == 295)
{
if (this.owner == Main.myPlayer)
{
Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 296, (int)((double)this.damage * 0.65), this.knockBack, this.owner, 0f, 0f);
}
}
else
{
if (this.type == 270)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 27);
for (int l = 0; l < 20; l++)
{
int num = Dust.NewDust(this.position, this.width, this.height, 26, 0f, 0f, 100, default(Color), 1f);
Main.dust[num].noGravity = true;
Main.dust[num].velocity *= 1.2f;
Main.dust[num].scale = 1.3f;
Main.dust[num].velocity -= this.lastVelocity * 0.3f;
num = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num].noGravity = true;
Main.dust[num].velocity *= 3f;
}
}
else
{
if (this.type == 265)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 27);
for (int m = 0; m < 15; m++)
{
int num2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num2].noGravity = true;
Main.dust[num2].velocity *= 1.2f;
Main.dust[num2].velocity -= this.lastVelocity * 0.3f;
}
}
else
{
if (this.type == 304)
{
for (int n = 0; n < 3; n++)
{
int num3 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 182, 0f, 0f, 100, default(Color), 0.8f);
Main.dust[num3].noGravity = true;
Main.dust[num3].velocity *= 1.2f;
Main.dust[num3].velocity -= this.lastVelocity * 0.3f;
}
}
else
{
if (this.type == 263)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27);
for (int num4 = 0; num4 < 15; num4++)
{
int num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, Main.rand.Next(0, 101), default(Color), 1f + (float)Main.rand.Next(40) * 0.01f);
Main.dust[num5].noGravity = true;
Main.dust[num5].velocity *= 2f;
}
}
else
{
if (this.type == 261)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num6 = 0; num6 < 5; num6++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 148, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 229)
{
for (int num7 = 0; num7 < 25; num7++)
{
int num8 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f);
Main.dust[num8].noGravity = true;
Main.dust[num8].velocity *= 1.5f;
Main.dust[num8].scale = 1.5f;
}
}
else
{
if (this.type == 239)
{
int num9 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), 2, 2, 154, 0f, 0f, 0, default(Color), 1f);
Dust expr_896_cp_0 = Main.dust[num9];
expr_896_cp_0.position.X = expr_896_cp_0.position.X - 2f;
Main.dust[num9].alpha = 38;
Main.dust[num9].velocity *= 0.1f;
Main.dust[num9].velocity += -this.lastVelocity * 0.25f;
Main.dust[num9].scale = 0.95f;
}
else
{
if (this.type == 245)
{
int num10 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), 2, 2, 114, 0f, 0f, 0, default(Color), 1f);
Main.dust[num10].noGravity = true;
Dust expr_994_cp_0 = Main.dust[num10];
expr_994_cp_0.position.X = expr_994_cp_0.position.X - 2f;
Main.dust[num10].alpha = 38;
Main.dust[num10].velocity *= 0.1f;
Main.dust[num10].velocity += -this.lastVelocity * 0.25f;
Main.dust[num10].scale = 0.95f;
}
else
{
if (this.type == 264)
{
int num11 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), 2, 2, 54, 0f, 0f, 0, default(Color), 1f);
Main.dust[num11].noGravity = true;
Dust expr_A92_cp_0 = Main.dust[num11];
expr_A92_cp_0.position.X = expr_A92_cp_0.position.X - 2f;
Main.dust[num11].alpha = 38;
Main.dust[num11].velocity *= 0.1f;
Main.dust[num11].velocity += -this.lastVelocity * 0.25f;
Main.dust[num11].scale = 0.95f;
}
else
{
if (this.type == 206 || this.type == 225)
{
Main.PlaySound(6, (int)this.position.X, (int)this.position.Y, 1);
for (int num12 = 0; num12 < 5; num12++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 227)
{
Main.PlaySound(6, (int)this.position.X, (int)this.position.Y, 1);
for (int num13 = 0; num13 < 15; num13++)
{
int num14 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f);
Main.dust[num14].noGravity = true;
Main.dust[num14].velocity += this.lastVelocity;
Main.dust[num14].scale = 1.5f;
}
}
else
{
if (this.type == 237 && this.owner == Main.myPlayer)
{
Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 238, this.damage, this.knockBack, this.owner, 0f, 0f);
}
else
{
if (this.type == 243 && this.owner == Main.myPlayer)
{
Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 244, this.damage, this.knockBack, this.owner, 0f, 0f);
}
else
{
if (this.type == 120)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num15 = 0; num15 < 10; num15++)
{
int num16 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 100, default(Color), 1f);
if (num15 < 5)
{
Main.dust[num16].noGravity = true;
}
Main.dust[num16].velocity *= 0.2f;
}
}
else
{
if (this.type == 181 || this.type == 189)
{
for (int num17 = 0; num17 < 6; num17++)
{
int num18 = Dust.NewDust(this.position, this.width, this.height, 150, this.velocity.X, this.velocity.Y, 50, default(Color), 1f);
Main.dust[num18].noGravity = true;
Main.dust[num18].scale = 1f;
}
}
else
{
if (this.type == 178)
{
for (int num19 = 0; num19 < 85; num19++)
{
int num20 = Main.rand.Next(139, 143);
int num21 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num20, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f);
Dust expr_F6F_cp_0 = Main.dust[num21];
expr_F6F_cp_0.velocity.X = expr_F6F_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f;
Dust expr_F9D_cp_0 = Main.dust[num21];
expr_F9D_cp_0.velocity.Y = expr_F9D_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f;
Dust expr_FCB_cp_0 = Main.dust[num21];
expr_FCB_cp_0.velocity.X = expr_FCB_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_FFF_cp_0 = Main.dust[num21];
expr_FFF_cp_0.velocity.Y = expr_FFF_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_1033_cp_0 = Main.dust[num21];
expr_1033_cp_0.velocity.X = expr_1033_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Dust expr_1061_cp_0 = Main.dust[num21];
expr_1061_cp_0.velocity.Y = expr_1061_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
Main.dust[num21].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
}
for (int num22 = 0; num22 < 40; num22++)
{
int num23 = Main.rand.Next(276, 283);
int num24 = Gore.NewGore(this.position, this.velocity, num23, 1f);
Gore expr_1105_cp_0 = Main.gore[num24];
expr_1105_cp_0.velocity.X = expr_1105_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f;
Gore expr_1133_cp_0 = Main.gore[num24];
expr_1133_cp_0.velocity.Y = expr_1133_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f;
Gore expr_1161_cp_0 = Main.gore[num24];
expr_1161_cp_0.velocity.X = expr_1161_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Gore expr_1195_cp_0 = Main.gore[num24];
expr_1195_cp_0.velocity.Y = expr_1195_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Main.gore[num24].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
Gore expr_11F8_cp_0 = Main.gore[num24];
expr_11F8_cp_0.velocity.X = expr_11F8_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Gore expr_1226_cp_0 = Main.gore[num24];
expr_1226_cp_0.velocity.Y = expr_1226_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
}
}
else
{
if (this.type == 289)
{
for (int num25 = 0; num25 < 30; num25++)
{
int num26 = Main.rand.Next(139, 143);
int num27 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num26, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f);
Dust expr_12F0_cp_0 = Main.dust[num27];
expr_12F0_cp_0.velocity.X = expr_12F0_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f;
Dust expr_131E_cp_0 = Main.dust[num27];
expr_131E_cp_0.velocity.Y = expr_131E_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f;
Dust expr_134C_cp_0 = Main.dust[num27];
expr_134C_cp_0.velocity.X = expr_134C_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_1380_cp_0 = Main.dust[num27];
expr_1380_cp_0.velocity.Y = expr_1380_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_13B4_cp_0 = Main.dust[num27];
expr_13B4_cp_0.velocity.X = expr_13B4_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Dust expr_13E2_cp_0 = Main.dust[num27];
expr_13E2_cp_0.velocity.Y = expr_13E2_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
Main.dust[num27].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
}
for (int num28 = 0; num28 < 15; num28++)
{
int num29 = Main.rand.Next(276, 283);
int num30 = Gore.NewGore(this.position, this.velocity, num29, 1f);
Gore expr_1486_cp_0 = Main.gore[num30];
expr_1486_cp_0.velocity.X = expr_1486_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f;
Gore expr_14B4_cp_0 = Main.gore[num30];
expr_14B4_cp_0.velocity.Y = expr_14B4_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f;
Gore expr_14E2_cp_0 = Main.gore[num30];
expr_14E2_cp_0.velocity.X = expr_14E2_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Gore expr_1516_cp_0 = Main.gore[num30];
expr_1516_cp_0.velocity.Y = expr_1516_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Main.gore[num30].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
Gore expr_1579_cp_0 = Main.gore[num30];
expr_1579_cp_0.velocity.X = expr_1579_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Gore expr_15A7_cp_0 = Main.gore[num30];
expr_15A7_cp_0.velocity.Y = expr_15A7_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
}
}
else
{
if (this.type == 171)
{
if (this.ai[1] == 0f)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
}
if (this.ai[1] < 10f)
{
Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f);
float num31 = -this.velocity.X;
float num32 = -this.velocity.Y;
float num33 = 1f;
if (this.ai[0] <= 17f)
{
num33 = this.ai[0] / 17f;
}
int num34 = (int)(30f * num33);
float num35 = 1f;
if (this.ai[0] <= 30f)
{
num35 = this.ai[0] / 30f;
}
float num36 = 0.4f * num35;
float num37 = num36;
num32 += num37;
for (int num38 = 0; num38 < num34; num38++)
{
float num39 = (float)Math.Sqrt((double)(num31 * num31 + num32 * num32));
float num40 = 5.6f;
if (Math.Abs(num31) + Math.Abs(num32) < 1f)
{
num40 *= Math.Abs(num31) + Math.Abs(num32) / 1f;
}
num39 = num40 / num39;
num31 *= num39;
num32 *= num39;
Math.Atan2((double)num32, (double)num31);
if ((float)num38 > this.ai[1])
{
for (int num41 = 0; num41 < 4; num41++)
{
int num42 = Dust.NewDust(vector, this.width, this.height, 129, 0f, 0f, 0, default(Color), 1f);
Main.dust[num42].noGravity = true;
Main.dust[num42].velocity *= 0.3f;
}
}
vector.X += num31;
vector.Y += num32;
num31 = -this.velocity.X;
num32 = -this.velocity.Y;
num37 += num36;
num32 += num37;
}
}
}
else
{
if (this.type == 117)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num43 = 0; num43 < 10; num43++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 166)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 51);
for (int num44 = 0; num44 < 10; num44++)
{
int num45 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 76, 0f, 0f, 0, default(Color), 1f);
Main.dust[num45].noGravity = true;
Main.dust[num45].velocity -= this.lastVelocity * 0.25f;
}
}
else
{
if (this.type == 158)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num46 = 0; num46 < 10; num46++)
{
int num47 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 9, 0f, 0f, 0, default(Color), 1f);
Main.dust[num47].noGravity = true;
Main.dust[num47].velocity -= this.velocity * 0.5f;
}
}
else
{
if (this.type == 159)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num48 = 0; num48 < 10; num48++)
{
int num49 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11, 0f, 0f, 0, default(Color), 1f);
Main.dust[num49].noGravity = true;
Main.dust[num49].velocity -= this.velocity * 0.5f;
}
}
else
{
if (this.type == 160)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num50 = 0; num50 < 10; num50++)
{
int num51 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 19, 0f, 0f, 0, default(Color), 1f);
Main.dust[num51].noGravity = true;
Main.dust[num51].velocity -= this.velocity * 0.5f;
}
}
else
{
if (this.type == 161)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num52 = 0; num52 < 10; num52++)
{
int num53 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11, 0f, 0f, 0, default(Color), 1f);
Main.dust[num53].noGravity = true;
Main.dust[num53].velocity -= this.velocity * 0.5f;
}
}
else
{
if (this.type >= 191 && this.type <= 194)
{
int num54 = Gore.NewGore(new Vector2(this.position.X - (float)(this.width / 2), this.position.Y - (float)(this.height / 2)), new Vector2(0f, 0f), Main.rand.Next(61, 64), this.scale);
Main.gore[num54].velocity *= 0.1f;
}
else
{
if (Main.projPet[this.type])
{
int num55 = Gore.NewGore(new Vector2(this.position.X - (float)(this.width / 2), this.position.Y - (float)(this.height / 2)), new Vector2(0f, 0f), Main.rand.Next(11, 14), this.scale);
Main.gore[num55].velocity *= 0.1f;
}
else
{
if (this.type == 93)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num56 = 0; num56 < 10; num56++)
{
int num57 = Dust.NewDust(this.position, this.width, this.height, 57, 0f, 0f, 100, default(Color), 0.5f);
Dust expr_1E73_cp_0 = Main.dust[num57];
expr_1E73_cp_0.velocity.X = expr_1E73_cp_0.velocity.X * 2f;
Dust expr_1E91_cp_0 = Main.dust[num57];
expr_1E91_cp_0.velocity.Y = expr_1E91_cp_0.velocity.Y * 2f;
}
}
else
{
if (this.type == 99)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num58 = 0; num58 < 30; num58++)
{
int num59 = Dust.NewDust(this.position, this.width, this.height, 1, 0f, 0f, 0, default(Color), 1f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num59].scale *= 1.4f;
}
this.velocity *= 1.9f;
}
}
else
{
if (this.type == 91 || this.type == 92)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num60 = 0; num60 < 10; num60++)
{
Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f);
}
for (int num61 = 0; num61 < 3; num61++)
{
Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
if (this.type == 12 && this.damage < 500)
{
for (int num62 = 0; num62 < 10; num62++)
{
Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f);
}
for (int num63 = 0; num63 < 3; num63++)
{
Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
}
if ((this.type == 91 || (this.type == 92 && this.ai[0] > 0f)) && this.owner == Main.myPlayer)
{
float x = this.position.X + (float)Main.rand.Next(-400, 400);
float y = this.position.Y - (float)Main.rand.Next(600, 900);
Vector2 vector2 = new Vector2(x, y);
float num64 = this.position.X + (float)(this.width / 2) - vector2.X;
float num65 = this.position.Y + (float)(this.height / 2) - vector2.Y;
int num66 = 22;
float num67 = (float)Math.Sqrt((double)(num64 * num64 + num65 * num65));
num67 = (float)num66 / num67;
num64 *= num67;
num65 *= num67;
int num68 = this.damage;
if (this.type == 91)
{
num68 = (int)((float)num68 * 0.5f);
}
int num69 = Projectile.NewProjectile(x, y, num64, num65, 92, num68, this.knockBack, this.owner, 0f, 0f);
if (this.type == 91)
{
Main.projectile[num69].ai[1] = this.position.Y;
Main.projectile[num69].ai[0] = 1f;
}
else
{
Main.projectile[num69].ai[1] = this.position.Y;
}
}
}
else
{
if (this.type == 89)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num70 = 0; num70 < 5; num70++)
{
int num71 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 68, 0f, 0f, 0, default(Color), 1f);
Main.dust[num71].noGravity = true;
Main.dust[num71].velocity *= 1.5f;
Main.dust[num71].scale *= 0.9f;
}
if (this.type == 89 && this.owner == Main.myPlayer)
{
for (int num72 = 0; num72 < 3; num72++)
{
float num73 = -this.velocity.X * (float)Main.rand.Next(40, 70) * 0.01f + (float)Main.rand.Next(-20, 21) * 0.4f;
float num74 = -this.velocity.Y * (float)Main.rand.Next(40, 70) * 0.01f + (float)Main.rand.Next(-20, 21) * 0.4f;
Projectile.NewProjectile(this.position.X + num73, this.position.Y + num74, num73, num74, 90, (int)((double)this.damage * 0.5), 0f, this.owner, 0f, 0f);
}
}
}
else
{
if (this.type == 177)
{
for (int num75 = 0; num75 < 20; num75++)
{
int num76 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 137, 0f, 0f, Main.rand.Next(0, 101), default(Color), 1f + (float)Main.rand.Next(-20, 40) * 0.01f);
Main.dust[num76].velocity -= this.lastVelocity * 0.2f;
if (Main.rand.Next(3) == 0)
{
Main.dust[num76].scale *= 0.8f;
Main.dust[num76].velocity *= 0.5f;
}
else
{
Main.dust[num76].noGravity = true;
}
}
}
else
{
if (this.type == 119 || this.type == 118 || this.type == 128)
{
int num77 = 10;
if (this.type == 119)
{
num77 = 20;
}
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27);
for (int num78 = 0; num78 < num77; num78++)
{
int num79 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, 0f, 0f, 0, default(Color), 1f);
if (Main.rand.Next(3) != 0)
{
Main.dust[num79].velocity *= 2f;
Main.dust[num79].noGravity = true;
Main.dust[num79].scale *= 1.75f;
}
else
{
Main.dust[num79].scale *= 0.5f;
}
}
}
else
{
if (this.type == 309)
{
int num80 = 10;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27);
for (int num81 = 0; num81 < num80; num81++)
{
int num82 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 185, 0f, 0f, 0, default(Color), 1f);
if (Main.rand.Next(2) == 0)
{
Main.dust[num82].velocity *= 2f;
Main.dust[num82].noGravity = true;
Main.dust[num82].scale *= 1.75f;
}
}
}
else
{
if (this.type == 308)
{
int num83 = 80;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27);
for (int num84 = 0; num84 < num83; num84++)
{
int num85 = 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[num85].velocity *= 2f;
Main.dust[num85].noGravity = true;
Main.dust[num85].scale *= 1.15f;
}
}
else
{
if (this.aiStyle == 29)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
int num86 = this.type - 121 + 86;
for (int num87 = 0; num87 < 15; num87++)
{
int num88 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num86, this.lastVelocity.X, this.lastVelocity.Y, 50, default(Color), 1.2f);
Main.dust[num88].noGravity = true;
Main.dust[num88].scale *= 1.25f;
Main.dust[num88].velocity *= 0.5f;
}
}
else
{
if (this.type == 80)
{
if (this.ai[0] >= 0f)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27);
for (int num89 = 0; num89 < 10; num89++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f);
}
}
int num90 = (int)this.position.X / 16;
int num91 = (int)this.position.Y / 16;
if (Main.tile[num90, num91] == null)
{
Main.tile[num90, num91] = new Tile();
}
if (Main.tile[num90, num91].type == 127 && Main.tile[num90, num91].active())
{
WorldGen.KillTile(num90, num91, false, false, false);
}
}
else
{
if (this.type == 76 || this.type == 77 || this.type == 78)
{
for (int num92 = 0; num92 < 5; num92++)
{
int num93 = Dust.NewDust(this.position, this.width, this.height, 27, 0f, 0f, 80, default(Color), 1.5f);
Main.dust[num93].noGravity = true;
}
}
else
{
if (this.type == 55)
{
for (int num94 = 0; num94 < 5; num94++)
{
int num95 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, 0f, 0f, 0, default(Color), 1.5f);
Main.dust[num95].noGravity = true;
}
}
else
{
if (this.type == 51 || this.type == 267)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num96 = 0; num96 < 5; num96++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, 0f, 0f, 0, default(Color), 0.7f);
}
}
else
{
if (this.type == 2 || this.type == 82)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num97 = 0; num97 < 20; num97++)
{
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)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num98 = 0; num98 < 20; num98++)
{
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)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num99 = 0; num99 < 20; num99++)
{
int num100 = 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[num100].scale *= 2.5f;
Main.dust[num100].noGravity = true;
Main.dust[num100].velocity *= 5f;
}
}
}
else
{
if (this.type == 278)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num101 = 0; num101 < 20; num101++)
{
int num102 = 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[num102].scale *= 1.5f;
Main.dust[num102].noGravity = true;
Main.dust[num102].velocity *= 5f;
}
}
}
else
{
if (this.type == 3 || this.type == 48 || this.type == 54)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num103 = 0; num103 < 10; num103++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 1, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 0.75f);
}
}
else
{
if (this.type == 4)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num104 = 0; num104 < 10; num104++)
{
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)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num105 = 0; num105 < 60; num105++)
{
int num106 = Main.rand.Next(3);
if (num106 == 0)
{
num106 = 15;
}
else
{
if (num106 == 1)
{
num106 = 57;
}
else
{
num106 = 58;
}
}
Dust.NewDust(this.position, this.width, this.height, num106, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.5f);
}
}
else
{
if (this.type == 9 || this.type == 12)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num107 = 0; num107 < 10; num107++)
{
Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f);
}
for (int num108 = 0; num108 < 3; num108++)
{
Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
if (this.type == 12 && this.damage < 100)
{
for (int num109 = 0; num109 < 10; num109++)
{
Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f);
}
for (int num110 = 0; num110 < 3; num110++)
{
Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
}
}
else
{
if (this.type == 281)
{
Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 1);
int num111 = Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-20, 21) * 0.2f, (float)Main.rand.Next(-20, 21) * 0.2f), 76, 1f);
Main.gore[num111].velocity -= this.velocity * 0.5f;
num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2((float)Main.rand.Next(-20, 21) * 0.2f, (float)Main.rand.Next(-20, 21) * 0.2f), 77, 1f);
Main.gore[num111].velocity -= this.velocity * 0.5f;
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num112 = 0; num112 < 20; num112++)
{
int num113 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num113].velocity *= 1.4f;
}
for (int num114 = 0; num114 < 10; num114++)
{
int num115 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num115].noGravity = true;
Main.dust[num115].velocity *= 5f;
num115 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num115].velocity *= 3f;
}
num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num111].velocity *= 0.4f;
Gore expr_3667_cp_0 = Main.gore[num111];
expr_3667_cp_0.velocity.X = expr_3667_cp_0.velocity.X + 1f;
Gore expr_3685_cp_0 = Main.gore[num111];
expr_3685_cp_0.velocity.Y = expr_3685_cp_0.velocity.Y + 1f;
num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num111].velocity *= 0.4f;
Gore expr_3703_cp_0 = Main.gore[num111];
expr_3703_cp_0.velocity.X = expr_3703_cp_0.velocity.X - 1f;
Gore expr_3721_cp_0 = Main.gore[num111];
expr_3721_cp_0.velocity.Y = expr_3721_cp_0.velocity.Y + 1f;
num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num111].velocity *= 0.4f;
Gore expr_379F_cp_0 = Main.gore[num111];
expr_379F_cp_0.velocity.X = expr_379F_cp_0.velocity.X + 1f;
Gore expr_37BD_cp_0 = Main.gore[num111];
expr_37BD_cp_0.velocity.Y = expr_37BD_cp_0.velocity.Y - 1f;
num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num111].velocity *= 0.4f;
Gore expr_383B_cp_0 = Main.gore[num111];
expr_383B_cp_0.velocity.X = expr_383B_cp_0.velocity.X - 1f;
Gore expr_3859_cp_0 = Main.gore[num111];
expr_3859_cp_0.velocity.Y = expr_3859_cp_0.velocity.Y - 1f;
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();
}
else
{
if (this.type == 162)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num116 = 0; num116 < 20; num116++)
{
int num117 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num117].velocity *= 1.4f;
}
for (int num118 = 0; num118 < 10; num118++)
{
int num119 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num119].noGravity = true;
Main.dust[num119].velocity *= 5f;
num119 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num119].velocity *= 3f;
}
int num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num120].velocity *= 0.4f;
Gore expr_3B0C_cp_0 = Main.gore[num120];
expr_3B0C_cp_0.velocity.X = expr_3B0C_cp_0.velocity.X + 1f;
Gore expr_3B2A_cp_0 = Main.gore[num120];
expr_3B2A_cp_0.velocity.Y = expr_3B2A_cp_0.velocity.Y + 1f;
num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num120].velocity *= 0.4f;
Gore expr_3BA8_cp_0 = Main.gore[num120];
expr_3BA8_cp_0.velocity.X = expr_3BA8_cp_0.velocity.X - 1f;
Gore expr_3BC6_cp_0 = Main.gore[num120];
expr_3BC6_cp_0.velocity.Y = expr_3BC6_cp_0.velocity.Y + 1f;
num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num120].velocity *= 0.4f;
Gore expr_3C44_cp_0 = Main.gore[num120];
expr_3C44_cp_0.velocity.X = expr_3C44_cp_0.velocity.X + 1f;
Gore expr_3C62_cp_0 = Main.gore[num120];
expr_3C62_cp_0.velocity.Y = expr_3C62_cp_0.velocity.Y - 1f;
num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num120].velocity *= 0.4f;
Gore expr_3CE0_cp_0 = Main.gore[num120];
expr_3CE0_cp_0.velocity.X = expr_3CE0_cp_0.velocity.X - 1f;
Gore expr_3CFE_cp_0 = Main.gore[num120];
expr_3CFE_cp_0.velocity.Y = expr_3CFE_cp_0.velocity.Y - 1f;
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();
}
else
{
if (this.type == 240)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num121 = 0; num121 < 20; num121++)
{
int num122 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num122].velocity *= 1.4f;
}
for (int num123 = 0; num123 < 10; num123++)
{
int num124 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num124].noGravity = true;
Main.dust[num124].velocity *= 5f;
num124 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num124].velocity *= 3f;
}
int num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num125].velocity *= 0.4f;
Gore expr_3FB1_cp_0 = Main.gore[num125];
expr_3FB1_cp_0.velocity.X = expr_3FB1_cp_0.velocity.X + 1f;
Gore expr_3FCF_cp_0 = Main.gore[num125];
expr_3FCF_cp_0.velocity.Y = expr_3FCF_cp_0.velocity.Y + 1f;
num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num125].velocity *= 0.4f;
Gore expr_404D_cp_0 = Main.gore[num125];
expr_404D_cp_0.velocity.X = expr_404D_cp_0.velocity.X - 1f;
Gore expr_406B_cp_0 = Main.gore[num125];
expr_406B_cp_0.velocity.Y = expr_406B_cp_0.velocity.Y + 1f;
num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num125].velocity *= 0.4f;
Gore expr_40E9_cp_0 = Main.gore[num125];
expr_40E9_cp_0.velocity.X = expr_40E9_cp_0.velocity.X + 1f;
Gore expr_4107_cp_0 = Main.gore[num125];
expr_4107_cp_0.velocity.Y = expr_4107_cp_0.velocity.Y - 1f;
num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num125].velocity *= 0.4f;
Gore expr_4185_cp_0 = Main.gore[num125];
expr_4185_cp_0.velocity.X = expr_4185_cp_0.velocity.X - 1f;
Gore expr_41A3_cp_0 = Main.gore[num125];
expr_41A3_cp_0.velocity.Y = expr_41A3_cp_0.velocity.Y - 1f;
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 96;
this.height = 96;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.Damage();
}
else
{
if (this.type == 283 || this.type == 282)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num126 = 0; num126 < 10; num126++)
{
int num127 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f);
Main.dust[num127].scale = (float)Main.rand.Next(1, 10) * 0.1f;
Main.dust[num127].noGravity = true;
Main.dust[num127].fadeIn = 1.5f;
Main.dust[num127].velocity *= 0.75f;
}
}
else
{
if (this.type == 284)
{
for (int num128 = 0; num128 < 10; num128++)
{
int num129 = Main.rand.Next(139, 143);
int num130 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num129, -this.velocity.X * 0.3f, -this.velocity.Y * 0.3f, 0, default(Color), 1.2f);
Dust expr_43D2_cp_0 = Main.dust[num130];
expr_43D2_cp_0.velocity.X = expr_43D2_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f;
Dust expr_4400_cp_0 = Main.dust[num130];
expr_4400_cp_0.velocity.Y = expr_4400_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f;
Dust expr_442E_cp_0 = Main.dust[num130];
expr_442E_cp_0.velocity.X = expr_442E_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_4462_cp_0 = Main.dust[num130];
expr_4462_cp_0.velocity.Y = expr_4462_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Dust expr_4496_cp_0 = Main.dust[num130];
expr_4496_cp_0.velocity.X = expr_4496_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Dust expr_44C4_cp_0 = Main.dust[num130];
expr_44C4_cp_0.velocity.Y = expr_44C4_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
Main.dust[num130].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
}
for (int num131 = 0; num131 < 5; num131++)
{
int num132 = Main.rand.Next(276, 283);
int num133 = Gore.NewGore(this.position, -this.velocity * 0.3f, num132, 1f);
Gore expr_4577_cp_0 = Main.gore[num133];
expr_4577_cp_0.velocity.X = expr_4577_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f;
Gore expr_45A5_cp_0 = Main.gore[num133];
expr_45A5_cp_0.velocity.Y = expr_45A5_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f;
Gore expr_45D3_cp_0 = Main.gore[num133];
expr_45D3_cp_0.velocity.X = expr_45D3_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Gore expr_4607_cp_0 = Main.gore[num133];
expr_4607_cp_0.velocity.Y = expr_4607_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f);
Main.gore[num133].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
Gore expr_466A_cp_0 = Main.gore[num133];
expr_466A_cp_0.velocity.X = expr_466A_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
Gore expr_4698_cp_0 = Main.gore[num133];
expr_4698_cp_0.velocity.Y = expr_4698_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
}
}
else
{
if (this.type == 286)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num134 = 0; num134 < 7; num134++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
}
for (int num135 = 0; num135 < 3; num135++)
{
int num136 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num136].noGravity = true;
Main.dust[num136].velocity *= 3f;
num136 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num136].velocity *= 2f;
}
int num137 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num137].velocity *= 0.3f;
Gore expr_48CD_cp_0 = Main.gore[num137];
expr_48CD_cp_0.velocity.X = expr_48CD_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f;
Gore expr_48FB_cp_0 = Main.gore[num137];
expr_48FB_cp_0.velocity.Y = expr_48FB_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f;
if (this.owner == Main.myPlayer)
{
this.localAI[1] = -1f;
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.Damage();
}
}
else
{
if (this.type == 14 || this.type == 20 || this.type == 36 || this.type == 83 || this.type == 84 || this.type == 104 || this.type == 279 || this.type == 100 || this.type == 110 || this.type == 180 || this.type == 207 || this.type == 242 || this.type == 302 || this.type == 257 || this.type == 259 || this.type == 285 || this.type == 287)
{
Collision.HitTiles(this.position, this.velocity, this.width, this.height);
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
}
else
{
if (this.type == 15 || this.type == 34)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num138 = 0; num138 < 20; num138++)
{
int num139 = 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[num139].noGravity = true;
Main.dust[num139].velocity *= 2f;
num139 = 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), 1f);
Main.dust[num139].velocity *= 2f;
}
}
else
{
if (this.type == 253)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num140 = 0; num140 < 20; num140++)
{
int num141 = 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[num141].noGravity = true;
Main.dust[num141].velocity *= 2f;
num141 = 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), 1f);
Main.dust[num141].velocity *= 2f;
}
}
else
{
if (this.type == 95 || this.type == 96)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num142 = 0; num142 < 20; num142++)
{
int num143 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 2f * this.scale);
Main.dust[num143].noGravity = true;
Main.dust[num143].velocity *= 2f;
num143 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1f * this.scale);
Main.dust[num143].velocity *= 2f;
}
}
else
{
if (this.type == 79)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num144 = 0; num144 < 20; num144++)
{
int num145 = 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), 2f);
Main.dust[num145].noGravity = true;
Main.dust[num145].velocity *= 4f;
}
}
else
{
if (this.type == 16)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num146 = 0; num146 < 20; num146++)
{
int num147 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 2f);
Main.dust[num147].noGravity = true;
Main.dust[num147].velocity *= 2f;
num147 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 1f);
}
}
else
{
if (this.type == 17)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num148 = 0; num148 < 5; num148++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, 0f, 0f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 31 || this.type == 42)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num149 = 0; num149 < 5; num149++)
{
int num150 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, 0f, 0, default(Color), 1f);
Main.dust[num150].velocity *= 0.6f;
}
}
else
{
if (this.type == 109)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num151 = 0; num151 < 5; num151++)
{
int num152 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51, 0f, 0f, 0, default(Color), 0.6f);
Main.dust[num152].velocity *= 0.6f;
}
}
else
{
if (this.type == 39)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num153 = 0; num153 < 5; num153++)
{
int num154 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 38, 0f, 0f, 0, default(Color), 1f);
Main.dust[num154].velocity *= 0.6f;
}
}
else
{
if (this.type == 71)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num155 = 0; num155 < 5; num155++)
{
int num156 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53, 0f, 0f, 0, default(Color), 1f);
Main.dust[num156].velocity *= 0.6f;
}
}
else
{
if (this.type == 40)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num157 = 0; num157 < 5; num157++)
{
int num158 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, 0f, 0, default(Color), 1f);
Main.dust[num158].velocity *= 0.6f;
}
}
else
{
if (this.type == 21)
{
Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1);
for (int num159 = 0; num159 < 10; num159++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, 0f, 0f, 0, default(Color), 0.8f);
}
}
else
{
if (this.type == 24)
{
for (int num160 = 0; num160 < 10; num160++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 1, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 0.75f);
}
}
else
{
if (this.type == 27)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num161 = 0; num161 < 30; num161++)
{
int num162 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100, default(Color), 1f);
Main.dust[num162].noGravity = true;
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100, default(Color), 0.5f);
}
}
else
{
if (this.type == 38)
{
for (int num163 = 0; num163 < 10; num163++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 42, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 1f);
}
}
else
{
if (this.type == 44 || this.type == 45)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num164 = 0; num164 < 30; num164++)
{
int num165 = 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.7f);
Main.dust[num165].noGravity = true;
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100, default(Color), 1f);
}
}
else
{
if (this.type == 41)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num166 = 0; num166 < 10; num166++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
}
for (int num167 = 0; num167 < 5; num167++)
{
int num168 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num168].noGravity = true;
Main.dust[num168].velocity *= 3f;
num168 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num168].velocity *= 2f;
}
int num169 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num169].velocity *= 0.4f;
Gore expr_5AF4_cp_0 = Main.gore[num169];
expr_5AF4_cp_0.velocity.X = expr_5AF4_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.1f;
Gore expr_5B22_cp_0 = Main.gore[num169];
expr_5B22_cp_0.velocity.Y = expr_5B22_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.1f;
num169 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num169].velocity *= 0.4f;
Gore expr_5BB0_cp_0 = Main.gore[num169];
expr_5BB0_cp_0.velocity.X = expr_5BB0_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.1f;
Gore expr_5BDE_cp_0 = Main.gore[num169];
expr_5BDE_cp_0.velocity.Y = expr_5BDE_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.1f;
if (this.owner == Main.myPlayer)
{
this.penetrate = -1;
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 64;
this.height = 64;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.Damage();
}
}
else
{
if (this.type == 306)
{
Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1);
for (int num170 = 0; num170 < 20; num170++)
{
int num171 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f);
Main.dust[num171].scale *= 1.1f;
Main.dust[num171].noGravity = true;
}
for (int num172 = 0; num172 < 30; num172++)
{
int num173 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f);
Main.dust[num173].velocity *= 2.5f;
Main.dust[num173].scale *= 0.8f;
Main.dust[num173].noGravity = true;
}
if (this.owner == Main.myPlayer)
{
int num174 = 2;
if (Main.rand.Next(10) == 0)
{
num174++;
}
if (Main.rand.Next(10) == 0)
{
num174++;
}
for (int num175 = 0; num175 < num174; num175++)
{
float num176 = (float)Main.rand.Next(-35, 36) * 0.02f;
float num177 = (float)Main.rand.Next(-35, 36) * 0.02f;
num176 *= 10f;
num177 *= 10f;
Projectile.NewProjectile(this.position.X, this.position.Y, num176, num177, 307, (int)((double)this.damage * 0.55), (float)((int)((double)this.knockBack * 0.3)), Main.myPlayer, 0f, 0f);
}
}
}
else
{
if (this.type == 183)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num178 = 0; num178 < 20; num178++)
{
int num179 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num179].velocity *= 1f;
}
int num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Gore expr_5FF3_cp_0 = Main.gore[num180];
expr_5FF3_cp_0.velocity.X = expr_5FF3_cp_0.velocity.X + 1f;
Gore expr_6011_cp_0 = Main.gore[num180];
expr_6011_cp_0.velocity.Y = expr_6011_cp_0.velocity.Y + 1f;
Main.gore[num180].velocity *= 0.3f;
num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Gore expr_608F_cp_0 = Main.gore[num180];
expr_608F_cp_0.velocity.X = expr_608F_cp_0.velocity.X - 1f;
Gore expr_60AD_cp_0 = Main.gore[num180];
expr_60AD_cp_0.velocity.Y = expr_60AD_cp_0.velocity.Y + 1f;
Main.gore[num180].velocity *= 0.3f;
num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Gore expr_612B_cp_0 = Main.gore[num180];
expr_612B_cp_0.velocity.X = expr_612B_cp_0.velocity.X + 1f;
Gore expr_6149_cp_0 = Main.gore[num180];
expr_6149_cp_0.velocity.Y = expr_6149_cp_0.velocity.Y - 1f;
Main.gore[num180].velocity *= 0.3f;
num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Gore expr_61C7_cp_0 = Main.gore[num180];
expr_61C7_cp_0.velocity.X = expr_61C7_cp_0.velocity.X - 1f;
Gore expr_61E5_cp_0 = Main.gore[num180];
expr_61E5_cp_0.velocity.Y = expr_61E5_cp_0.velocity.Y - 1f;
Main.gore[num180].velocity *= 0.3f;
if (this.owner == Main.myPlayer)
{
int num181 = Main.rand.Next(15, 25);
for (int num182 = 0; num182 < num181; num182++)
{
float speedX = (float)Main.rand.Next(-35, 36) * 0.02f;
float speedY = (float)Main.rand.Next(-35, 36) * 0.02f;
Projectile.NewProjectile(this.position.X, this.position.Y, speedX, speedY, 181, this.damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
else
{
if (this.aiStyle == 34)
{
if (this.owner != Main.myPlayer)
{
this.timeLeft = 60;
}
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
if (this.type == 167)
{
for (int num183 = 0; num183 < 400; num183++)
{
float num184 = 16f;
if (num183 < 300)
{
num184 = 12f;
}
if (num183 < 200)
{
num184 = 8f;
}
if (num183 < 100)
{
num184 = 4f;
}
int num185 = 130;
int num186 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num185, 0f, 0f, 100, default(Color), 1f);
float num187 = Main.dust[num186].velocity.X;
float num188 = Main.dust[num186].velocity.Y;
if (num187 == 0f && num188 == 0f)
{
num187 = 1f;
}
float num189 = (float)Math.Sqrt((double)(num187 * num187 + num188 * num188));
num189 = num184 / num189;
num187 *= num189;
num188 *= num189;
Main.dust[num186].velocity *= 0.5f;
Dust expr_6424_cp_0 = Main.dust[num186];
expr_6424_cp_0.velocity.X = expr_6424_cp_0.velocity.X + num187;
Dust expr_643F_cp_0 = Main.dust[num186];
expr_643F_cp_0.velocity.Y = expr_643F_cp_0.velocity.Y + num188;
Main.dust[num186].scale = 1.3f;
Main.dust[num186].noGravity = true;
}
}
if (this.type == 168)
{
for (int num190 = 0; num190 < 400; num190++)
{
float num191 = 2f * ((float)num190 / 100f);
if (num190 > 100)
{
num191 = 10f;
}
if (num190 > 250)
{
num191 = 13f;
}
int num192 = 131;
int num193 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num192, 0f, 0f, 100, default(Color), 1f);
float num194 = Main.dust[num193].velocity.X;
float num195 = Main.dust[num193].velocity.Y;
if (num194 == 0f && num195 == 0f)
{
num194 = 1f;
}
float num196 = (float)Math.Sqrt((double)(num194 * num194 + num195 * num195));
num196 = num191 / num196;
if (num190 <= 200)
{
num194 *= num196;
num195 *= num196;
}
else
{
num194 = num194 * num196 * 1.25f;
num195 = num195 * num196 * 0.75f;
}
Main.dust[num193].velocity *= 0.5f;
Dust expr_65CA_cp_0 = Main.dust[num193];
expr_65CA_cp_0.velocity.X = expr_65CA_cp_0.velocity.X + num194;
Dust expr_65E5_cp_0 = Main.dust[num193];
expr_65E5_cp_0.velocity.Y = expr_65E5_cp_0.velocity.Y + num195;
if (num190 > 100)
{
Main.dust[num193].scale = 1.3f;
Main.dust[num193].noGravity = true;
}
}
}
if (this.type == 169)
{
for (int num197 = 0; num197 < 400; num197++)
{
int num198 = 132;
float num199 = 14f;
if (num197 > 100)
{
num199 = 10f;
}
if (num197 > 100)
{
num198 = 133;
}
if (num197 > 200)
{
num199 = 6f;
}
if (num197 > 200)
{
num198 = 132;
}
if (num197 > 300)
{
num199 = 6f;
}
if (num197 > 300)
{
num198 = 133;
}
int num200 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num198, 0f, 0f, 100, default(Color), 1f);
float num201 = Main.dust[num200].velocity.X;
float num202 = Main.dust[num200].velocity.Y;
if (num201 == 0f && num202 == 0f)
{
num201 = 1f;
}
float num203 = (float)Math.Sqrt((double)(num201 * num201 + num202 * num202));
num203 = num199 / num203;
if (num197 > 300)
{
num201 = num201 * num203 * 0.5f;
num202 *= num203;
}
else
{
if (num197 > 200)
{
num201 *= num203;
num202 = num202 * num203 * 0.5f;
}
else
{
num201 *= num203;
num202 *= num203;
}
}
Main.dust[num200].velocity *= 0.5f;
Dust expr_67C2_cp_0 = Main.dust[num200];
expr_67C2_cp_0.velocity.X = expr_67C2_cp_0.velocity.X + num201;
Dust expr_67DD_cp_0 = Main.dust[num200];
expr_67DD_cp_0.velocity.Y = expr_67DD_cp_0.velocity.Y + num202;
if (num197 <= 200)
{
Main.dust[num200].scale = 1.3f;
Main.dust[num200].noGravity = true;
}
}
}
if (this.type == 170)
{
for (int num204 = 0; num204 < 400; num204++)
{
int num205 = 133;
float num206 = 16f;
if (num204 > 100)
{
num206 = 11f;
}
if (num204 > 100)
{
num205 = 134;
}
if (num204 > 200)
{
num206 = 8f;
}
if (num204 > 200)
{
num205 = 133;
}
if (num204 > 300)
{
num206 = 5f;
}
if (num204 > 300)
{
num205 = 134;
}
int num207 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num205, 0f, 0f, 100, default(Color), 1f);
float num208 = Main.dust[num207].velocity.X;
float num209 = Main.dust[num207].velocity.Y;
if (num208 == 0f && num209 == 0f)
{
num208 = 1f;
}
float num210 = (float)Math.Sqrt((double)(num208 * num208 + num209 * num209));
num210 = num206 / num210;
if (num204 > 300)
{
num208 = num208 * num210 * 0.7f;
num209 *= num210;
}
else
{
if (num204 > 200)
{
num208 *= num210;
num209 = num209 * num210 * 0.7f;
}
else
{
if (num204 > 100)
{
num208 = num208 * num210 * 0.7f;
num209 *= num210;
}
else
{
num208 *= num210;
num209 = num209 * num210 * 0.7f;
}
}
}
Main.dust[num207].velocity *= 0.5f;
Dust expr_69DF_cp_0 = Main.dust[num207];
expr_69DF_cp_0.velocity.X = expr_69DF_cp_0.velocity.X + num208;
Dust expr_69FA_cp_0 = Main.dust[num207];
expr_69FA_cp_0.velocity.Y = expr_69FA_cp_0.velocity.Y + num209;
if (Main.rand.Next(3) != 0)
{
Main.dust[num207].scale = 1.3f;
Main.dust[num207].noGravity = true;
}
}
}
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 192;
this.height = 192;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.penetrate = -1;
this.Damage();
}
else
{
if (this.type == 133 || this.type == 134 || this.type == 135 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 303)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 22;
this.height = 22;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
for (int num211 = 0; num211 < 30; num211++)
{
int num212 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num212].velocity *= 1.4f;
}
for (int num213 = 0; num213 < 20; num213++)
{
int num214 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 3.5f);
Main.dust[num214].noGravity = true;
Main.dust[num214].velocity *= 7f;
num214 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num214].velocity *= 3f;
}
for (int num215 = 0; num215 < 2; num215++)
{
float scaleFactor = 0.4f;
if (num215 == 1)
{
scaleFactor = 0.8f;
}
int num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num216].velocity *= scaleFactor;
Gore expr_6DD2_cp_0 = Main.gore[num216];
expr_6DD2_cp_0.velocity.X = expr_6DD2_cp_0.velocity.X + 1f;
Gore expr_6DF0_cp_0 = Main.gore[num216];
expr_6DF0_cp_0.velocity.Y = expr_6DF0_cp_0.velocity.Y + 1f;
num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num216].velocity *= scaleFactor;
Gore expr_6E6B_cp_0 = Main.gore[num216];
expr_6E6B_cp_0.velocity.X = expr_6E6B_cp_0.velocity.X - 1f;
Gore expr_6E89_cp_0 = Main.gore[num216];
expr_6E89_cp_0.velocity.Y = expr_6E89_cp_0.velocity.Y + 1f;
num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num216].velocity *= scaleFactor;
Gore expr_6F04_cp_0 = Main.gore[num216];
expr_6F04_cp_0.velocity.X = expr_6F04_cp_0.velocity.X + 1f;
Gore expr_6F22_cp_0 = Main.gore[num216];
expr_6F22_cp_0.velocity.Y = expr_6F22_cp_0.velocity.Y - 1f;
num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num216].velocity *= scaleFactor;
Gore expr_6F9D_cp_0 = Main.gore[num216];
expr_6F9D_cp_0.velocity.X = expr_6F9D_cp_0.velocity.X - 1f;
Gore expr_6FBB_cp_0 = Main.gore[num216];
expr_6FBB_cp_0.velocity.Y = expr_6FBB_cp_0.velocity.Y - 1f;
}
}
else
{
if (this.type == 139 || this.type == 140 || this.type == 141 || this.type == 142 || this.type == 143 || this.type == 144)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
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);
for (int num217 = 0; num217 < 40; num217++)
{
int num218 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 2f);
Main.dust[num218].velocity *= 3f;
if (Main.rand.Next(2) == 0)
{
Main.dust[num218].scale = 0.5f;
Main.dust[num218].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num219 = 0; num219 < 70; num219++)
{
int num220 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 3f);
Main.dust[num220].noGravity = true;
Main.dust[num220].velocity *= 5f;
num220 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num220].velocity *= 2f;
}
for (int num221 = 0; num221 < 3; num221++)
{
float scaleFactor2 = 0.33f;
if (num221 == 1)
{
scaleFactor2 = 0.66f;
}
if (num221 == 2)
{
scaleFactor2 = 1f;
}
int num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num222].velocity *= scaleFactor2;
Gore expr_7340_cp_0 = Main.gore[num222];
expr_7340_cp_0.velocity.X = expr_7340_cp_0.velocity.X + 1f;
Gore expr_735E_cp_0 = Main.gore[num222];
expr_735E_cp_0.velocity.Y = expr_735E_cp_0.velocity.Y + 1f;
num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num222].velocity *= scaleFactor2;
Gore expr_73F9_cp_0 = Main.gore[num222];
expr_73F9_cp_0.velocity.X = expr_73F9_cp_0.velocity.X - 1f;
Gore expr_7417_cp_0 = Main.gore[num222];
expr_7417_cp_0.velocity.Y = expr_7417_cp_0.velocity.Y + 1f;
num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num222].velocity *= scaleFactor2;
Gore expr_74B2_cp_0 = Main.gore[num222];
expr_74B2_cp_0.velocity.X = expr_74B2_cp_0.velocity.X + 1f;
Gore expr_74D0_cp_0 = Main.gore[num222];
expr_74D0_cp_0.velocity.Y = expr_74D0_cp_0.velocity.Y - 1f;
num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num222].velocity *= scaleFactor2;
Gore expr_756B_cp_0 = Main.gore[num222];
expr_756B_cp_0.velocity.X = expr_756B_cp_0.velocity.X - 1f;
Gore expr_7589_cp_0 = Main.gore[num222];
expr_7589_cp_0.velocity.Y = expr_7589_cp_0.velocity.Y - 1f;
}
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 10;
this.height = 10;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
}
else
{
if (this.type == 246)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num223 = 0; num223 < 10; num223++)
{
int num224 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num224].velocity *= 0.9f;
}
for (int num225 = 0; num225 < 5; num225++)
{
int num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num226].noGravity = true;
Main.dust[num226].velocity *= 3f;
num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num226].velocity *= 2f;
}
int num227 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num227].velocity *= 0.3f;
Gore expr_783D_cp_0 = Main.gore[num227];
expr_783D_cp_0.velocity.X = expr_783D_cp_0.velocity.X + (float)Main.rand.Next(-1, 2);
Gore expr_7863_cp_0 = Main.gore[num227];
expr_7863_cp_0.velocity.Y = expr_7863_cp_0.velocity.Y + (float)Main.rand.Next(-1, 2);
if (this.owner == Main.myPlayer)
{
int num228 = Main.rand.Next(2, 6);
for (int num229 = 0; num229 < num228; num229++)
{
float num230 = (float)Main.rand.Next(-100, 101);
num230 += 0.01f;
float num231 = (float)Main.rand.Next(-100, 101);
num230 -= 0.01f;
float num232 = (float)Math.Sqrt((double)(num230 * num230 + num231 * num231));
num232 = 8f / num232;
num230 *= num232;
num231 *= num232;
Projectile.NewProjectile(this.center().X - this.lastVelocity.X, this.center().Y - this.lastVelocity.Y, num230, num231, 249, this.damage, this.knockBack, this.owner, 0f, 0f);
}
}
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 150;
this.height = 150;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.penetrate = -1;
this.Damage();
}
else
{
if (this.type == 249)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
for (int num233 = 0; num233 < 7; num233++)
{
int num234 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num234].velocity *= 0.8f;
}
for (int num235 = 0; num235 < 2; num235++)
{
int num236 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num236].noGravity = true;
Main.dust[num236].velocity *= 2.5f;
num236 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num236].velocity *= 1.5f;
}
int num237 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num237].velocity *= 0.2f;
Gore expr_7C13_cp_0 = Main.gore[num237];
expr_7C13_cp_0.velocity.X = expr_7C13_cp_0.velocity.X + (float)Main.rand.Next(-1, 2);
Gore expr_7C39_cp_0 = Main.gore[num237];
expr_7C39_cp_0.velocity.Y = expr_7C39_cp_0.velocity.Y + (float)Main.rand.Next(-1, 2);
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 100;
this.height = 100;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
this.penetrate = -1;
this.Damage();
}
else
{
if (this.type == 28 || this.type == 30 || this.type == 37 || this.type == 75 || this.type == 102 || this.type == 164)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 22;
this.height = 22;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
for (int num238 = 0; num238 < 20; num238++)
{
int num239 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num239].velocity *= 1.4f;
}
for (int num240 = 0; num240 < 10; num240++)
{
int num241 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f);
Main.dust[num241].noGravity = true;
Main.dust[num241].velocity *= 5f;
num241 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f);
Main.dust[num241].velocity *= 3f;
}
int num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num242].velocity *= 0.4f;
Gore expr_7FCA_cp_0 = Main.gore[num242];
expr_7FCA_cp_0.velocity.X = expr_7FCA_cp_0.velocity.X + 1f;
Gore expr_7FEA_cp_0 = Main.gore[num242];
expr_7FEA_cp_0.velocity.Y = expr_7FEA_cp_0.velocity.Y + 1f;
num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num242].velocity *= 0.4f;
Gore expr_806E_cp_0 = Main.gore[num242];
expr_806E_cp_0.velocity.X = expr_806E_cp_0.velocity.X - 1f;
Gore expr_808E_cp_0 = Main.gore[num242];
expr_808E_cp_0.velocity.Y = expr_808E_cp_0.velocity.Y + 1f;
num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num242].velocity *= 0.4f;
Gore expr_8112_cp_0 = Main.gore[num242];
expr_8112_cp_0.velocity.X = expr_8112_cp_0.velocity.X + 1f;
Gore expr_8132_cp_0 = Main.gore[num242];
expr_8132_cp_0.velocity.Y = expr_8132_cp_0.velocity.Y - 1f;
num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num242].velocity *= 0.4f;
Gore expr_81B6_cp_0 = Main.gore[num242];
expr_81B6_cp_0.velocity.X = expr_81B6_cp_0.velocity.X - 1f;
Gore expr_81D6_cp_0 = Main.gore[num242];
expr_81D6_cp_0.velocity.Y = expr_81D6_cp_0.velocity.Y - 1f;
}
else
{
if (this.type == 29 || this.type == 108)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14);
if (this.type == 29)
{
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);
}
for (int num243 = 0; num243 < 50; num243++)
{
int num244 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 2f);
Main.dust[num244].velocity *= 1.4f;
}
for (int num245 = 0; num245 < 80; num245++)
{
int num246 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 3f);
Main.dust[num246].noGravity = true;
Main.dust[num246].velocity *= 5f;
num246 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f);
Main.dust[num246].velocity *= 3f;
}
for (int num247 = 0; num247 < 2; num247++)
{
int num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num248].scale = 1.5f;
Gore expr_84DD_cp_0 = Main.gore[num248];
expr_84DD_cp_0.velocity.X = expr_84DD_cp_0.velocity.X + 1.5f;
Gore expr_84FD_cp_0 = Main.gore[num248];
expr_84FD_cp_0.velocity.Y = expr_84FD_cp_0.velocity.Y + 1.5f;
num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num248].scale = 1.5f;
Gore expr_8596_cp_0 = Main.gore[num248];
expr_8596_cp_0.velocity.X = expr_8596_cp_0.velocity.X - 1.5f;
Gore expr_85B6_cp_0 = Main.gore[num248];
expr_85B6_cp_0.velocity.Y = expr_85B6_cp_0.velocity.Y + 1.5f;
num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num248].scale = 1.5f;
Gore expr_864F_cp_0 = Main.gore[num248];
expr_864F_cp_0.velocity.X = expr_864F_cp_0.velocity.X + 1.5f;
Gore expr_866F_cp_0 = Main.gore[num248];
expr_866F_cp_0.velocity.Y = expr_866F_cp_0.velocity.Y - 1.5f;
num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f);
Main.gore[num248].scale = 1.5f;
Gore expr_8708_cp_0 = Main.gore[num248];
expr_8708_cp_0.velocity.X = expr_8708_cp_0.velocity.X - 1.5f;
Gore expr_8728_cp_0 = Main.gore[num248];
expr_8728_cp_0.velocity.Y = expr_8728_cp_0.velocity.Y - 1.5f;
}
this.position.X = this.position.X + (float)(this.width / 2);
this.position.Y = this.position.Y + (float)(this.height / 2);
this.width = 10;
this.height = 10;
this.position.X = this.position.X - (float)(this.width / 2);
this.position.Y = this.position.Y - (float)(this.height / 2);
}
else
{
if (this.type == 69)
{
Main.PlaySound(13, (int)this.position.X, (int)this.position.Y, 1);
for (int num249 = 0; num249 < 5; num249++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13, 0f, 0f, 0, default(Color), 1f);
}
for (int num250 = 0; num250 < 30; num250++)
{
int num251 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 33, 0f, -2f, 0, default(Color), 1.1f);
Main.dust[num251].alpha = 100;
Dust expr_88DA_cp_0 = Main.dust[num251];
expr_88DA_cp_0.velocity.X = expr_88DA_cp_0.velocity.X * 1.5f;
Main.dust[num251].velocity *= 3f;
}
}
else
{
if (this.type == 70)
{
Main.PlaySound(13, (int)this.position.X, (int)this.position.Y, 1);
for (int num252 = 0; num252 < 5; num252++)
{
Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13, 0f, 0f, 0, default(Color), 1f);
}
for (int num253 = 0; num253 < 30; num253++)
{
int num254 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 52, 0f, -2f, 0, default(Color), 1.1f);
Main.dust[num254].alpha = 100;
Dust expr_8A30_cp_0 = Main.dust[num254];
expr_8A30_cp_0.velocity.X = expr_8A30_cp_0.velocity.X * 1.5f;
Main.dust[num254].velocity *= 3f;
}
}
else
{
if (this.type == 114 || this.type == 115)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num255 = 4; num255 < 31; num255++)
{
float num256 = this.lastVelocity.X * (30f / (float)num255);
float num257 = this.lastVelocity.Y * (30f / (float)num255);
int num258 = Dust.NewDust(new Vector2(this.position.X - num256, this.position.Y - num257), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.4f);
Main.dust[num258].noGravity = true;
Main.dust[num258].velocity *= 0.5f;
num258 = Dust.NewDust(new Vector2(this.position.X - num256, this.position.Y - num257), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 0.9f);
Main.dust[num258].velocity *= 0.5f;
}
}
else
{
if (this.type == 116)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num259 = 4; num259 < 31; num259++)
{
float num260 = this.lastVelocity.X * (30f / (float)num259);
float num261 = this.lastVelocity.Y * (30f / (float)num259);
int num262 = Dust.NewDust(new Vector2(this.position.X - num260, this.position.Y - num261), 8, 8, 64, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.8f);
Main.dust[num262].noGravity = true;
num262 = Dust.NewDust(new Vector2(this.position.X - num260, this.position.Y - num261), 8, 8, 64, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.4f);
Main.dust[num262].noGravity = true;
}
}
else
{
if (this.type == 173)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num263 = 4; num263 < 24; num263++)
{
float num264 = this.lastVelocity.X * (30f / (float)num263);
float num265 = this.lastVelocity.Y * (30f / (float)num263);
int num266 = Main.rand.Next(3);
if (num266 == 0)
{
num266 = 15;
}
else
{
if (num266 == 1)
{
num266 = 57;
}
else
{
num266 = 58;
}
}
int num267 = Dust.NewDust(new Vector2(this.position.X - num264, this.position.Y - num265), 8, 8, num266, this.lastVelocity.X * 0.2f, this.lastVelocity.Y * 0.2f, 100, default(Color), 1.8f);
Main.dust[num267].velocity *= 1.5f;
Main.dust[num267].noGravity = true;
}
}
else
{
if (this.type == 132)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num268 = 4; num268 < 31; num268++)
{
float num269 = this.lastVelocity.X * (30f / (float)num268);
float num270 = this.lastVelocity.Y * (30f / (float)num268);
int num271 = Dust.NewDust(new Vector2(this.lastPosition.X - num269, this.lastPosition.Y - num270), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.8f);
Main.dust[num271].noGravity = true;
Main.dust[num271].velocity *= 0.5f;
num271 = Dust.NewDust(new Vector2(this.lastPosition.X - num269, this.lastPosition.Y - num270), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.4f);
Main.dust[num271].velocity *= 0.05f;
}
}
else
{
if (this.type == 156)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num272 = 4; num272 < 31; num272++)
{
float num273 = this.lastVelocity.X * (30f / (float)num272);
float num274 = this.lastVelocity.Y * (30f / (float)num272);
int num275 = Dust.NewDust(new Vector2(this.lastPosition.X - num273, this.lastPosition.Y - num274), 8, 8, 73, this.lastVelocity.X, this.lastVelocity.Y, 255, default(Color), 1.8f);
Main.dust[num275].noGravity = true;
Main.dust[num275].velocity *= 0.5f;
num275 = Dust.NewDust(new Vector2(this.lastPosition.X - num273, this.lastPosition.Y - num274), 8, 8, 73, this.lastVelocity.X, this.lastVelocity.Y, 255, default(Color), 1.4f);
Main.dust[num275].velocity *= 0.05f;
Main.dust[num275].noGravity = true;
}
}
else
{
if (this.type == 157)
{
Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10);
for (int num276 = 4; num276 < 31; num276++)
{
int num277 = Dust.NewDust(this.position, this.width, this.height, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.8f);
Main.dust[num277].noGravity = true;
Main.dust[num277].velocity *= 0.5f;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (this.owner == Main.myPlayer)
{
if (this.type == 28 || this.type == 29 || this.type == 37 || this.type == 108 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 142 || this.type == 143 || this.type == 144)
{
int num278 = 3;
if (this.type == 28 || this.type == 37)
{
num278 = 4;
}
if (this.type == 29)
{
num278 = 7;
}
if (this.type == 142 || this.type == 143 || this.type == 144)
{
num278 = 5;
}
if (this.type == 108)
{
num278 = 10;
}
int num279 = (int)(this.position.X / 16f - (float)num278);
int num280 = (int)(this.position.X / 16f + (float)num278);
int num281 = (int)(this.position.Y / 16f - (float)num278);
int num282 = (int)(this.position.Y / 16f + (float)num278);
if (num279 < 0)
{
num279 = 0;
}
if (num280 > Main.maxTilesX)
{
num280 = Main.maxTilesX;
}
if (num281 < 0)
{
num281 = 0;
}
if (num282 > Main.maxTilesY)
{
num282 = Main.maxTilesY;
}
bool flag = false;
for (int num283 = num279; num283 <= num280; num283++)
{
for (int num284 = num281; num284 <= num282; num284++)
{
float num285 = Math.Abs((float)num283 - this.position.X / 16f);
float num286 = Math.Abs((float)num284 - this.position.Y / 16f);
double num287 = Math.Sqrt((double)(num285 * num285 + num286 * num286));
if (num287 < (double)num278 && Main.tile[num283, num284] != null && Main.tile[num283, num284].wall == 0)
{
flag = true;
break;
}
}
}
for (int num288 = num279; num288 <= num280; num288++)
{
for (int num289 = num281; num289 <= num282; num289++)
{
float num290 = Math.Abs((float)num288 - this.position.X / 16f);
float num291 = Math.Abs((float)num289 - this.position.Y / 16f);
double num292 = Math.Sqrt((double)(num290 * num290 + num291 * num291));
if (num292 < (double)num278)
{
bool flag2 = true;
if (Main.tile[num288, num289] != null && Main.tile[num288, num289].active())
{
flag2 = true;
if (Main.tileDungeon[(int)Main.tile[num288, num289].type] || Main.tile[num288, num289].type == 21 || Main.tile[num288, num289].type == 26 || Main.tile[num288, num289].type == 107 || Main.tile[num288, num289].type == 108 || Main.tile[num288, num289].type == 111 || Main.tile[num288, num289].type == 226 || Main.tile[num288, num289].type == 237 || Main.tile[num288, num289].type == 221 || Main.tile[num288, num289].type == 222 || Main.tile[num288, num289].type == 223 || Main.tile[num288, num289].type == 211)
{
flag2 = false;
}
if (!Main.hardMode && Main.tile[num288, num289].type == 58)
{
flag2 = false;
}
if (flag2)
{
WorldGen.KillTile(num288, num289, false, false, false);
if (!Main.tile[num288, num289].active() && Main.netMode != 0)
{
NetMessage.SendData(17, -1, -1, "", 0, (float)num288, (float)num289, 0f, 0);
}
}
}
if (flag2)
{
for (int num293 = num288 - 1; num293 <= num288 + 1; num293++)
{
for (int num294 = num289 - 1; num294 <= num289 + 1; num294++)
{
if (Main.tile[num293, num294] != null && Main.tile[num293, num294].wall > 0 && flag)
{
WorldGen.KillWall(num293, num294, false);
if (Main.tile[num293, num294].wall == 0 && Main.netMode != 0)
{
NetMessage.SendData(17, -1, -1, "", 2, (float)num293, (float)num294, 0f, 0);
}
}
}
}
}
}
}
}
}
if (Main.netMode != 0)
{
NetMessage.SendData(29, -1, -1, "", this.identity, (float)this.owner, 0f, 0f, 0);
}
if (!this.noDropItem)
{
int num295 = -1;
if (this.aiStyle == 10)
{
int num296 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int num297 = (int)(this.position.Y + (float)(this.width / 2)) / 16;
int num298 = 0;
int num299 = 2;
if (this.type == 109)
{
num298 = 147;
num299 = 0;
}
if (this.type == 31)
{
num298 = 53;
num299 = 0;
}
if (this.type == 42)
{
num298 = 53;
num299 = 0;
}
if (this.type == 56)
{
num298 = 112;
num299 = 0;
}
if (this.type == 65)
{
num298 = 112;
num299 = 0;
}
if (this.type == 67)
{
num298 = 116;
num299 = 0;
}
if (this.type == 68)
{
num298 = 116;
num299 = 0;
}
if (this.type == 71)
{
num298 = 123;
num299 = 0;
}
if (this.type == 39)
{
num298 = 59;
num299 = 176;
}
if (this.type == 40)
{
num298 = 57;
num299 = 172;
}
if (this.type == 179)
{
num298 = 224;
num299 = 0;
}
if (this.type == 241)
{
num298 = 234;
num299 = 0;
}
if (Main.tile[num296, num297].halfBrick() && this.velocity.Y > 0f && Math.Abs(this.velocity.Y) > Math.Abs(this.velocity.X))
{
num297--;
}
if (!Main.tile[num296, num297].active())
{
WorldGen.PlaceTile(num296, num297, num298, false, true, -1, 0);
if (Main.tile[num296, num297].active() && (int)Main.tile[num296, num297].type == num298)
{
NetMessage.SendData(17, -1, -1, "", 1, (float)num296, (float)num297, (float)num298, 0);
}
else
{
if (num299 > 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num299, 1, false, 0, false);
}
}
}
else
{
if (num299 > 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num299, 1, false, 0, false);
}
}
}
if (this.type == 1 && Main.rand.Next(3) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false);
}
if (this.type == 103 && Main.rand.Next(6) == 0)
{
if (Main.rand.Next(3) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 545, 1, false, 0, false);
}
else
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false);
}
}
if (this.type == 2 && Main.rand.Next(3) == 0)
{
if (Main.rand.Next(3) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 41, 1, false, 0, false);
}
else
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false);
}
}
if (this.type == 172 && Main.rand.Next(3) == 0)
{
if (Main.rand.Next(3) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 988, 1, false, 0, false);
}
else
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false);
}
}
if (this.type == 171)
{
if (this.ai[1] == 0f)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 985, 1, false, 0, false);
}
else
{
if (this.ai[1] < 10f)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 965, (int)(10f - this.ai[1]), false, 0, false);
}
}
}
if (this.type == 91 && Main.rand.Next(6) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 516, 1, false, 0, false);
}
if (this.type == 50 && Main.rand.Next(3) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 282, 1, false, 0, false);
}
if (this.type == 53 && Main.rand.Next(3) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 286, 1, false, 0, false);
}
if (this.type == 48 && Main.rand.Next(2) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 279, 1, false, 0, false);
}
if (this.type == 54 && Main.rand.Next(2) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 287, 1, false, 0, false);
}
if (this.type == 3 && Main.rand.Next(2) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 42, 1, false, 0, false);
}
if (this.type == 4 && Main.rand.Next(4) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 47, 1, false, 0, false);
}
if (this.type == 12 && this.damage > 100)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 75, 1, false, 0, false);
}
if (this.type == 155)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 859, 1, false, 0, false);
}
if (this.type == 21 && Main.rand.Next(2) == 0)
{
num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 154, 1, false, 0, false);
}
if (Main.netMode == 1 && num295 >= 0)
{
NetMessage.SendData(21, -1, -1, "", num295, 0f, 0f, 0f, 0);
}
}
if (this.type == 69 || this.type == 70)
{
int num300 = (int)(this.position.X + (float)(this.width / 2)) / 16;
int num301 = (int)(this.position.Y + (float)(this.height / 2)) / 16;
for (int num302 = num300 - 4; num302 <= num300 + 4; num302++)
{
for (int num303 = num301 - 4; num303 <= num301 + 4; num303++)
{
if (Math.Abs(num302 - num300) + Math.Abs(num303 - num301) < 6)
{
if (this.type == 69)
{
if (Main.tile[num302, num303].type == 2)
{
Main.tile[num302, num303].type = 109;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 1 || Main.tileMoss[(int)Main.tile[num302, num303].type])
{
Main.tile[num302, num303].type = 117;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 53 || Main.tile[num302, num303].type == 234)
{
Main.tile[num302, num303].type = 116;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 23 || Main.tile[num302, num303].type == 199)
{
Main.tile[num302, num303].type = 109;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 25 || Main.tile[num302, num303].type == 203)
{
Main.tile[num302, num303].type = 117;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 161 || Main.tile[num302, num303].type == 163 || Main.tile[num302, num303].type == 200)
{
Main.tile[num302, num303].type = 164;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 112)
{
Main.tile[num302, num303].type = 116;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 161 || Main.tile[num302, num303].type == 163)
{
Main.tile[num302, num303].type = 164;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
}
}
}
}
}
}
}
}
else
{
if (Main.tile[num302, num303].type == 2)
{
Main.tile[num302, num303].type = 23;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 1 || Main.tileMoss[(int)Main.tile[num302, num303].type])
{
Main.tile[num302, num303].type = 25;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 53)
{
Main.tile[num302, num303].type = 112;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 109)
{
Main.tile[num302, num303].type = 23;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 117)
{
Main.tile[num302, num303].type = 25;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 116)
{
Main.tile[num302, num303].type = 112;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
else
{
if (Main.tile[num302, num303].type == 161 || Main.tile[num302, num303].type == 164 || Main.tile[num302, num303].type == 200)
{
Main.tile[num302, num303].type = 163;
WorldGen.SquareTileFrame(num302, num303, true);
NetMessage.SendTileSquare(-1, num302, num303, 1);
}
}
}
}
}
}
}
}
}
}
}
}
}
this.active = false;
}
public Color GetAlpha(Color newColor)
{
if (this.type == 34 || this.type == 15 || this.type == 93 || this.type == 94 || this.type == 95 || this.type == 96 || this.type == 253 || this.type == 258 || (this.type == 102 && this.alpha < 255))
{
return new Color(200, 200, 200, 25);
}
if (this.type == 16)
{
return new Color(255, 255, 255, 0);
}
if (this.type == 76 || this.type == 77 || this.type == 78)
{
return new Color(255, 255, 255, 0);
}
if (this.type == 308)
{
return new Color(200, 200, 255, 125);
}
if (this.type == 263)
{
if (this.timeLeft < 255)
{
return new Color(255, 255, 255, (int)((byte)this.timeLeft));
}
return new Color(255, 255, 255, 255);
}
else
{
if (this.type == 274)
{
if (this.timeLeft < 85)
{
byte b = (byte)(this.timeLeft * 3);
byte a = (byte)(100f * ((float)b / 255f));
return new Color((int)b, (int)b, (int)b, (int)a);
}
return new Color(255, 255, 255, 100);
}
else
{
if (this.type == 5)
{
return new Color(255, 255, 255, 0);
}
if (this.type == 300 || this.type == 301)
{
return new Color(250, 250, 250, 50);
}
if (this.type == 304)
{
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, (int)((byte)((float)(255 - this.alpha) / 3f)));
}
if (this.type == 116 || this.type == 132 || this.type == 156 || this.type == 157 || this.type == 157 || this.type == 173)
{
if (this.localAI[1] >= 15f)
{
return new Color(255, 255, 255, this.alpha);
}
if (this.localAI[1] < 5f)
{
return new Color(0, 0, 0, 0);
}
int num = (int)((this.localAI[1] - 5f) / 10f * 255f);
return new Color(num, num, num, num);
}
else
{
if (this.type == 254)
{
if (this.timeLeft < 30)
{
float num2 = (float)this.timeLeft / 30f;
this.alpha = (int)(255f - 255f * num2);
}
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0);
}
if (this.type == 265)
{
if (this.alpha > 0)
{
return new Color(0, 0, 0, 0);
}
return new Color(255, 255, 255, 0);
}
else
{
if (this.type == 270)
{
if (this.alpha > 0)
{
return new Color(0, 0, 0, 0);
}
return new Color(255, 255, 255, 200);
}
else
{
if (this.type == 257)
{
if (this.alpha > 200)
{
return new Color(0, 0, 0, 0);
}
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0);
}
else
{
if (this.type == 259)
{
if (this.alpha > 200)
{
return new Color(0, 0, 0, 0);
}
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0);
}
else
{
if (this.type >= 150 && this.type <= 152)
{
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 255 - this.alpha);
}
if (this.type == 250)
{
return new Color(0, 0, 0, 0);
}
if (this.type == 251)
{
int num3 = 255 - this.alpha;
int num4 = 255 - this.alpha;
int num5 = 255 - this.alpha;
return new Color(num3, num4, num5, 0);
}
if (this.type == 131)
{
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0);
}
if (this.type == 211)
{
return new Color(255, 255, 255, 0);
}
if (this.type == 229)
{
return new Color(255, 255, 255, 50);
}
if (this.type == 221)
{
return new Color(255, 255, 255, 200);
}
if (this.type == 207)
{
return new Color(0, 0, 0, 0);
}
if (this.type != 242)
{
int num3;
int num4;
int num5;
if (this.type == 209)
{
num3 = (int)newColor.R - this.alpha;
num4 = (int)newColor.G - this.alpha;
num5 = (int)newColor.B - this.alpha / 2;
}
else
{
if (this.type == 130)
{
return new Color(255, 255, 255, 175);
}
if (this.type == 182)
{
return new Color(255, 255, 255, 200);
}
if (this.type == 226)
{
num3 = 255;
num4 = 255;
num5 = 255;
float num6 = (float)Main.mouseTextColor / 200f - 0.3f;
num3 = (int)((float)num3 * num6);
num4 = (int)((float)num4 * num6);
num5 = (int)((float)num5 * num6);
num3 += 50;
if (num3 > 255)
{
num3 = 255;
}
num4 += 50;
if (num4 > 255)
{
num4 = 255;
}
num5 += 50;
if (num5 > 255)
{
num5 = 255;
}
return new Color(num3, num4, num5, 200);
}
if (this.type == 227)
{
num4 = (num3 = (num5 = 255));
float num7 = (float)Main.mouseTextColor / 100f - 1.6f;
num3 = (int)((float)num3 * num7);
num4 = (int)((float)num4 * num7);
num5 = (int)((float)num5 * num7);
int a2 = (int)(100f * num7);
num3 += 50;
if (num3 > 255)
{
num3 = 255;
}
num4 += 50;
if (num4 > 255)
{
num4 = 255;
}
num5 += 50;
if (num5 > 255)
{
num5 = 255;
}
return new Color(num3, num4, num5, a2);
}
if (this.type == 114 || this.type == 115)
{
if (this.localAI[1] >= 15f)
{
return new Color(255, 255, 255, this.alpha);
}
if (this.localAI[1] < 5f)
{
return new Color(0, 0, 0, 0);
}
int num8 = (int)((this.localAI[1] - 5f) / 10f * 255f);
return new Color(num8, num8, num8, num8);
}
else
{
if (this.type == 83 || this.type == 88 || this.type == 89 || this.type == 90 || this.type == 100 || this.type == 104 || this.type == 279 || (this.type >= 283 && this.type <= 287))
{
if (this.alpha < 200)
{
return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0);
}
return new Color(0, 0, 0, 0);
}
else
{
if (this.type == 34 || this.type == 35 || this.type == 15 || this.type == 19 || this.type == 44 || this.type == 45)
{
return Color.White;
}
if (this.type == 79)
{
num3 = Main.DiscoR;
num4 = Main.DiscoG;
num5 = Main.DiscoB;
return default(Color);
}
if (this.type == 9 || this.type == 15 || this.type == 34 || this.type == 50 || this.type == 53 || this.type == 76 || this.type == 77 || this.type == 78 || this.type == 92 || this.type == 91)
{
num3 = (int)newColor.R - this.alpha / 3;
num4 = (int)newColor.G - this.alpha / 3;
num5 = (int)newColor.B - this.alpha / 3;
}
else
{
if (this.type == 18)
{
return new Color(255, 255, 255, 50);
}
if (this.type == 16 || this.type == 44 || this.type == 45)
{
num3 = (int)newColor.R;
num4 = (int)newColor.G;
num5 = (int)newColor.B;
}
else
{
if (this.type == 12 || this.type == 72 || this.type == 86 || this.type == 87)
{
return new Color(255, 255, 255, (int)newColor.A - this.alpha);
}
}
}
}
}
}
float num9 = (float)(255 - this.alpha) / 255f;
num3 = (int)((float)newColor.R * num9);
num4 = (int)((float)newColor.G * num9);
num5 = (int)((float)newColor.B * num9);
int num10 = (int)newColor.A - this.alpha;
if (num10 < 0)
{
num10 = 0;
}
if (num10 > 255)
{
num10 = 255;
}
return new Color(num3, num4, num5, num10);
}
if (this.alpha < 140)
{
return new Color(255, 255, 255, 100);
}
return new Color(0, 0, 0, 0);
}
}
}
}
}
}
}
}
}
}