This commit is contained in:
Andrew Marheine committed 2020-02-27 02:46:54 -06:00
commit 7969f0fd18
89 files changed
+471 -1364

No files matched your search

+4 -1
View File
@@ -482,6 +482,7 @@ namespace CalamityMod.CalPlayer
public bool reaverSpore = false;
public bool reaverDoubleTap = false;
public bool flamethrowerBoost = false;
public bool hoverboardBoost = false; //hoverboard + shroomite visage
public bool shadeRegen = false;
public bool shadowSpeed = false;
public bool dsSetBonus = false;
@@ -1091,6 +1092,7 @@ namespace CalamityMod.CalPlayer
shadeRegen = false;
flamethrowerBoost = false;
hoverboardBoost = false; //hoverboard + shroomite visage
shadowSpeed = false;
dsSetBonus = false;
@@ -1711,6 +1713,7 @@ namespace CalamityMod.CalPlayer
#region Armorbonuses
flamethrowerBoost = false;
hoverboardBoost = false; //hoverboard + shroomite visage
shadowSpeed = false;
godSlayer = false;
godSlayerDamage = false;
@@ -3417,7 +3420,7 @@ namespace CalamityMod.CalPlayer
}
if (flamethrowerBoost && item.ranged && (item.useAmmo == 23 || item.type == ModContent.ItemType<DragoonDrizzlefish>()))
{
add += 0.25f;
add += hoverboardBoost ? 0.35f : 0.25f;
}
if (cinnamonRoll && CalamityMod.fireWeaponList.Contains(item.type))
{
+10 -2
View File
@@ -418,7 +418,15 @@ namespace CalamityMod.CalPlayer
double playerUndergroundDepth = point.Y - Main.worldSurface;
double depthRatio = playerUndergroundDepth / totalUndergroundDepth;
int lightStrength = modPlayer.GetTotalLightStrength();
float darknessStrength = (float)depthRatio;
// In the last 50 blocks before hell, the darkness smoothly fades away.
float FadeAwayStart = (float)(1D - 50D / totalUndergroundDepth);
float darknessStrength = (float)(depthRatio / FadeAwayStart);
if (depthRatio > FadeAwayStart)
{
// Varies from 1.0 to 0.0 as depthRatio varies from FadeAwayStart to 1.0.
darknessStrength = (1f - (float)depthRatio) / (1f - FadeAwayStart);
}
// Reduce the power of cave darkness based on your light level. 5+ is enough to totally eliminate it.
switch (lightStrength)
@@ -2459,7 +2467,7 @@ namespace CalamityMod.CalPlayer
}
if (player.ZoneJungle && CalamityMod.natureWeaponList.Contains(player.inventory[player.selectedItem].type))
player.AddBuff(165, 5, true); // Dryad's Blessing
player.AddBuff(BuffID.DryadsWard, 5, true); // Dryad's Blessing
if (modPlayer.ZoneAbyss)
{
@@ -0,0 +1,22 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Vanity
{
[AutoloadEquip(EquipType.Body)]
public class AncientGodSlayerChestplate : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ancient God Slayer Chestplate");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.Calamity().customRarity = (CalamityRarity)14;
item.vanity = true;
item.value = Item.buyPrice(0, 60, 0, 0);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

@@ -0,0 +1,32 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Vanity
{
[AutoloadEquip(EquipType.Head)]
public class AncientGodSlayerHelm : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ancient God Slayer Helm");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.Calamity().customRarity = (CalamityRarity)14;
item.value = Item.buyPrice(0, 75, 0, 0);
item.vanity = true;
}
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == ModContent.ItemType<AncientGodSlayerChestplate>() && legs.type == ModContent.ItemType<AncientGodSlayerLeggings>();
}
public override void ArmorSetShadows(Player player)
{
player.armorEffectDrawShadow = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@@ -0,0 +1,22 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Vanity
{
[AutoloadEquip(EquipType.Legs)]
public class AncientGodSlayerLeggings : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ancient God Slayer Leggings");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.Calamity().customRarity = (CalamityRarity)14;
item.value = Item.buyPrice(0, 45, 0, 0);
item.vanity = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

+3 -3
View File
@@ -34,14 +34,14 @@ namespace CalamityMod.Items.Armor
player.setBonus = "Increased life regen and rogue damage while submerged in liquid\n" +
"When using any weapon you have a 10% chance to throw a returning seashell projectile\n" +
"This seashell does true damage and does not benefit from any damage class\n" +
"Slightly reduces breath loss in the abyss\n" +
"Rogue stealth builds while not attacking and not moving, up to a max of 100\n" +
"Provides increased underwater mobility and slightly reduces breath loss in the abyss\n" +
"Rogue stealth builds while not attacking and not moving, up to a max of 90\n" +
"Once you have built max stealth, you will be able to perform a Stealth Strike\n" +
"Rogue stealth only reduces when you attack, it does not reduce while moving\n" +
"The higher your rogue stealth the higher your rogue damage, crit, and movement speed";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.victideSet = true;
modPlayer.rogueStealthMax += 1f;
modPlayer.rogueStealthMax += 0.9f;
modPlayer.wearingRogueArmor = true;
player.ignoreWater = true;
if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
+53 -10
View File
@@ -1424,7 +1424,9 @@ Provides heat and cold protection in Death Mode";
"Horizontal speed: 6.75\n" +
"Acceleration multiplier: 1\n" +
"Average vertical speed\n" +
"Flight time: 160";
"Flight time: 160\n" +
"+10 defense, 10% increased damage reduction,\n" +
"and the Dryad's permanent blessing while wearing the Tiki Armor";
}
}
}
@@ -1488,7 +1490,7 @@ Provides heat and cold protection in Death Mode";
"Acceleration multiplier: 1\n" +
"Average vertical speed\n" +
"Flight time: 180\n" +
"+1 max minion and 10% increased minion damage while wearing the Spooky Armor";
"+1 max minion and 5% increased minion damage while wearing the Spooky Armor";
}
}
}
@@ -1499,10 +1501,13 @@ Provides heat and cold protection in Death Mode";
if (line2.mod == "Terraria" && line2.Name == "Tooltip0")
{
line2.text = "Allows flight and slow fall\n" +
"Hold DOWN and JUMP to hover\n" +
"Horizontal speed: 6.25\n" +
"Acceleration multiplier: 1\n" +
"Average vertical speed\n" +
"Flight time: 170";
"Flight time: 170\n" +
"10% increased damage to bows, guns, rocket launchers, and flamethrowers while wearing the Shroomite Armor\n" +
"Boosted weapon type depends on the Shroomite Helmet worn";
}
}
}
@@ -1576,6 +1581,7 @@ Provides heat and cold protection in Death Mode";
if (line2.mod == "Terraria" && line2.Name == "Tooltip0")
{
line2.text = "Allows flight and slow fall\n" +
"Hold DOWN and JUMP to hover\n" +
"Horizontal speed: 6.5\n" +
"Acceleration multiplier: 1.5\n" +
"Good vertical speed\n" +
@@ -1592,6 +1598,7 @@ Provides heat and cold protection in Death Mode";
if (line2.mod == "Terraria" && line2.Name == "Tooltip0")
{
line2.text = "Allows flight and slow fall\n" +
"Hold DOWN and JUMP to hover\n" +
"Horizontal speed: 6.5\n" +
"Acceleration multiplier: 1.5\n" +
"Good vertical speed\n" +
@@ -1609,6 +1616,7 @@ Provides heat and cold protection in Death Mode";
{
line2.text = "Equipable\n" +
"Allows flight and slow fall\n" +
"Hold DOWN and JUMP to hover\n" +
"Horizontal speed: 6\n" +
"Acceleration multiplier: 2.5\n" +
"Good vertical speed\n" +
@@ -2279,12 +2287,12 @@ Provides heat and cold protection in Death Mode";
#region Head
if (item.type == ItemID.SpectreHood)
player.magicDamage += 0.2f;
else if (item.type == (ItemID.GladiatorHelmet | ItemID.ObsidianHelm))
else if (item.type == ItemID.GladiatorHelmet || item.type == ItemID.ObsidianHelm)
player.Calamity().throwingDamage += 0.03f;
#endregion
#region Body
if (item.type == (ItemID.GladiatorBreastplate | ItemID.ObsidianShirt))
if (item.type == ItemID.GladiatorBreastplate || item.type == ItemID.ObsidianShirt)
player.Calamity().throwingCrit += 3;
else if (item.type == ItemID.PalladiumBreastplate)
player.Calamity().throwingCrit += 2;
@@ -2303,7 +2311,7 @@ Provides heat and cold protection in Death Mode";
#endregion
#region Legs
if (item.type == (ItemID.GladiatorLeggings | ItemID.ObsidianPants))
if (item.type == ItemID.GladiatorLeggings || item.type == ItemID.ObsidianPants)
player.Calamity().throwingVelocity += 0.03f;
else if (item.type == ItemID.PalladiumLeggings)
player.Calamity().throwingCrit += 1;
@@ -2465,6 +2473,39 @@ Provides heat and cold protection in Death Mode";
}
}
}
else if (item.type == ItemID.Hoverboard) // Boosted ranged stats while wearing shroomite armor
{
player.noFallDmg = true;
if (player.body == ArmorIDs.Body.ShroomiteBreastplate && player.legs == ArmorIDs.Legs.ShroomiteLeggings)
{
if (player.head == ArmorIDs.Head.ShroomiteHeadgear) //arrows
{
player.arrowDamage += 0.05f;
}
else if (player.head == ArmorIDs.Head.ShroomiteMask) //bullets
{
player.bulletDamage += 0.05f;
}
else if (player.head == ArmorIDs.Head.ShroomiteHelmet) //rockets
{
player.rocketDamage += 0.05f;
}
else if (player.Calamity().flamethrowerBoost) //flamethrowers
{
player.Calamity().hoverboardBoost = true;
}
}
}
else if (item.type == ItemID.LeafWings) // Bonus to defensive stats while wearing tiki armor
{
player.noFallDmg = true;
if (player.head == ArmorIDs.Head.TikiMask && player.body == ArmorIDs.Body.TikiShirt && player.legs == ArmorIDs.Legs.TikiPants)
{
player.statDefense += 10;
player.endurance += 0.1f;
player.AddBuff(BuffID.DryadsWard, 5, true); // Dryad's Blessing
}
}
else if (item.type == ItemID.FestiveWings) // Drop powerful homing christmas tree bulbs while in flight
{
player.noFallDmg = true;
@@ -2476,7 +2517,7 @@ Provides heat and cold protection in Death Mode";
if (player.head == ArmorIDs.Head.SpookyHelmet && player.body == ArmorIDs.Body.SpookyBreastplate && player.legs == ArmorIDs.Legs.SpookyLeggings)
{
player.maxMinions++;
player.minionDamage += 0.1f;
player.minionDamage += 0.05f;
}
}
else if (item.type == ItemID.TatteredFairyWings)
@@ -2531,9 +2572,11 @@ Provides heat and cold protection in Death Mode";
player.minionDamage += 0.05f;
}
}
else if (item.type == (ItemID.FishronWings | ItemID.BetsyWings | ItemID.Yoraiz0rWings | ItemID.JimsWings | ItemID.SkiphsWings |
ItemID.LokisWings | ItemID.ArkhalisWings | ItemID.LeinforsWings | ItemID.BejeweledValkyrieWing | ItemID.RedsWings | ItemID.DTownsWings |
ItemID.WillsWings | ItemID.CrownosWings | ItemID.CenxsWings | ItemID.Hoverboard | ItemID.LeafWings))
else if (item.type == ItemID.FishronWings || item.type == ItemID.BetsyWings || item.type == ItemID.Yoraiz0rWings ||
item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings || item.type == ItemID.LokisWings ||
item.type == ItemID.ArkhalisWings || item.type == ItemID.LeinforsWings || item.type == ItemID.BejeweledValkyrieWing ||
item.type == ItemID.RedsWings || item.type == ItemID.DTownsWings || item.type == ItemID.WillsWings ||
item.type == ItemID.CrownosWings || item.type == ItemID.CenxsWings)
{
player.noFallDmg = true;
}
+3 -3
View File
@@ -17,14 +17,14 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 21;
item.damage = 28;
item.noMelee = true;
item.magic = true;
item.channel = true;
item.width = 86;
item.height = 32;
item.useTime = 20;
item.useAnimation = 20;
item.useTime = 19;
item.useAnimation = 19;
item.UseSound = SoundID.Item13;
item.useStyle = 5;
item.mana = 10;
+1 -1
View File
@@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Magic
value9 -= vector7;
}
Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, (int)((double)damage * 0.8), knockBack, player.whoAmI, 0.0f, 0.0f);
int laser = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX * 2f, speedY * 2f, 440, (int)((double)damage * 0.4), knockBack, player.whoAmI, 0.0f, 0.0f);
int laser = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX * 2f, speedY * 2f, ProjectileID.LaserMachinegunLaser, (int)((double)damage * 0.4), knockBack, player.whoAmI, 0.0f, 0.0f);
Main.projectile[laser].timeLeft = 120;
Main.projectile[laser].tileCollide = false;
}
+5 -5
View File
@@ -17,13 +17,13 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 65;
item.damage = 55;
item.magic = true;
item.mana = 4;
item.width = 74;
item.height = 28;
item.useTime = 3;
item.useAnimation = 3;
item.useTime = 4;
item.useAnimation = 4;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 1.5f;
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.autoReuse = true;
item.shootSpeed = 6f;
item.shoot = ModContent.ProjectileType<BigBeamofDeath>();
item.Calamity().customRarity = CalamityRarity.Turquoise;
item.Calamity().customRarity = CalamityRarity.Turquoise; //12
}
public override Vector2? HoldoutOffset()
@@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Magic
float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f;
for (int index = 0; index < num6; ++index)
{
int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX * 1.05f, SpeedY * 1.05f, 440, (int)((double)damage * 0.75), knockBack, player.whoAmI, 0f, 0f);
int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX * 1.05f, SpeedY * 1.05f, ProjectileID.LaserMachinegunLaser, (int)((double)damage * 0.65), knockBack * 0.6f, player.whoAmI, 0f, 0f);
Main.projectile[projectile].timeLeft = 120;
}
return false;
+2 -2
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 19;
item.damage = 16;
item.magic = true;
item.mana = 12;
item.width = 56;
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
for (int index = 0; index < 3; ++index)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(double)damage, knockBack, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
}
return false;
}
+3 -3
View File
@@ -16,13 +16,13 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
item.damage = 17;
item.damage = 22;
item.magic = true;
item.mana = 7;
item.width = 28;
item.height = 30;
item.useTime = 13;
item.useAnimation = 13;
item.useTime = 12;
item.useAnimation = 12;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 5;
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetDefaults()
{
item.width = 74;
item.damage = 470;
item.damage = 520;
item.melee = true;
item.useAnimation = 20;
item.useTime = 20;
+3 -3
View File
@@ -17,13 +17,13 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 12;
item.damage = 11;
item.ranged = true;
item.width = 62;
item.height = 26;
item.crit += 6;
item.useTime = 25;
item.useAnimation = 25;
item.useTime = 26;
item.useAnimation = 26;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 5.5f;
+2 -2
View File
@@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Ranged
item.ranged = true;
item.width = 30;
item.height = 44;
item.useTime = 20;
item.useAnimation = 20;
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 2f;
+2 -2
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 1280;
item.damage = 1000;
item.knockBack = 15f;
item.shootSpeed = 30f;
item.useStyle = 5;
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.ranged = true;
item.channel = true;
item.useTurn = false;
item.useAmmo = 75;
item.useAmmo = AmmoID.FallenStar;
item.autoReuse = true;
item.Calamity().customRarity = CalamityRarity.RareVariant;
}
+5 -5
View File
@@ -16,12 +16,12 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 9;
item.damage = 8;
item.ranged = true;
item.width = 50;
item.height = 28;
item.useTime = 9;
item.useAnimation = 9;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 1.25f;
@@ -54,8 +54,8 @@ namespace CalamityMod.Items.Weapons.Ranged
}
else
{
item.useTime = 9;
item.useAnimation = 9;
item.useTime = 10;
item.useAnimation = 10;
item.shootSpeed = 11f;
}
return base.CanUseItem(player);
+2 -2
View File
@@ -20,11 +20,11 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 250;
item.damage = 240;
item.ranged = true;
item.width = 74;
item.height = 34;
item.crit += 16;
item.crit += 15;
item.useTime = 2;
item.useAnimation = 2;
item.useStyle = 5;
+2 -2
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 14;
item.damage = 11;
item.ranged = true;
item.width = 22;
item.height = 46;
@@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
Projectile.NewProjectile(position.X, position.Y, SpeedX * 0.5f, SpeedY * 0.5f, ModContent.ProjectileType<SandWater>(), (int)((double)damage * 0.5), 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(position.X, position.Y, SpeedX * 0.5f, SpeedY * 0.5f, ModContent.ProjectileType<SandWater>(), (int)((double)damage * 0.4), 0f, player.whoAmI, 0f, 0f);
return true;
}
+2 -2
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 308;
item.damage = 291;
item.knockBack = 15f;
item.shootSpeed = 16f;
item.useStyle = 5;
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.ranged = true;
item.channel = true;
item.useTurn = false;
item.useAmmo = 75;
item.useAmmo = AmmoID.FallenStar;
item.autoReuse = true;
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
+4 -4
View File
@@ -18,13 +18,13 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void SetDefaults()
{
item.damage = 3000;
item.crit += 10;
item.damage = 2750;
item.crit += 9;
item.ranged = true;
item.width = 96;
item.height = 40;
item.useTime = 50;
item.useAnimation = 50;
item.useTime = 51;
item.useAnimation = 51;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 7.5f;
+2 -2
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
item.width = 38;
item.height = 34;
item.damage = 165;
item.damage = 145;
item.crit += 20;
item.noMelee = true;
item.noUseGraphic = true;
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Rogue
}
else
{
Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI, 0f, 0f);
}
return false;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 508 B

+3 -3
View File
@@ -20,12 +20,12 @@ Stealth strikes are faster and explode into 5 bubbles");
{
item.width = 26;
item.height = 44;
item.damage = 16;
item.damage = 12;
item.noMelee = true;
item.noUseGraphic = true;
item.useAnimation = 22;
item.useAnimation = 25;
item.useStyle = 1;
item.useTime = 22;
item.useTime = 25;
item.knockBack = 8f;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
+6
View File
@@ -102,6 +102,12 @@ namespace CalamityMod.NPCs.CeaselessVoid
// Vanity
DropHelper.DropItemChance(npc, ModContent.ItemType<CeaselessVoidTrophy>(), 10);
DropHelper.DropItemChance(npc, ModContent.ItemType<CeaselessVoidMask>(), 7);
if (Main.rand.NextBool(20))
{
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerHelm>());
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerChestplate>());
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerLeggings>());
}
// Other
bool lastSentinelKilled = !CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3;
+6
View File
@@ -757,6 +757,12 @@ namespace CalamityMod.NPCs.Signus
// Vanity
DropHelper.DropItemChance(npc, ModContent.ItemType<SignusTrophy>(), 10);
DropHelper.DropItemChance(npc, ModContent.ItemType<SignusMask>(), 7);
if (Main.rand.NextBool(20))
{
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerHelm>());
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerChestplate>());
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerLeggings>());
}
// Other
bool lastSentinelKilled = CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && !CalamityWorld.downedSentinel3;
+6
View File
@@ -624,6 +624,12 @@ namespace CalamityMod.NPCs.StormWeaver
// Vanity
DropHelper.DropItemChance(npc, ModContent.ItemType<WeaverTrophy>(), 10);
DropHelper.DropItemChance(npc, ModContent.ItemType<StormWeaverMask>(), 7);
if (Main.rand.NextBool(20))
{
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerHelm>());
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerChestplate>());
DropHelper.DropItem(npc, ModContent.ItemType<AncientGodSlayerLeggings>());
}
// Other
bool lastSentinelKilled = CalamityWorld.downedSentinel1 && !CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3;
+2 -2
View File
@@ -2002,7 +2002,7 @@ namespace CalamityMod.Projectiles
float maxDistance = distanceRequired;
bool homeIn = false;
for (int i = 0; i < 200; i++)
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
@@ -2038,7 +2038,7 @@ namespace CalamityMod.Projectiles
int[] targetArray = new int[maxTargets];
int targetArrayIndex = 0;
for (int i = 0; i < 200; i++)
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
+4 -4
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic
float num2 = (float)(projectile.position.Y - projectile.velocity.Y / 10.0 * 9.0);
float num3 = (float)Math.Sqrt((double)(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y));
float num4 = projectile.localAI[0];
if ((double)num4 == 0.0)
if (num4 == 0f)
{
projectile.localAI[0] = num3;
num4 = num3;
@@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Magic
bool flag2 = false;
int num8 = 0;
float num9;
if ((double)projectile.ai[1] == 0.0)
if (projectile.ai[1] == 0f)
{
for (int index = 0; index < 200; ++index)
for (int index = 0; index < Main.maxNPCs; ++index)
{
if (Main.npc[index].CanBeChasedBy((object)this, false) && ((double)projectile.ai[1] == 0.0 || (double)projectile.ai[1] == (double)(index + 1)))
{
@@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Magic
projectile.ai[1] = (float)(num8 + 1);
flag2 = false;
}
if ((double)projectile.ai[1] > 0.0)
if (projectile.ai[1] > 0f)
{
int index = (int)((double)projectile.ai[1] - 1.0);
if (Main.npc[index].active && Main.npc[index].CanBeChasedBy((object)this, true) && !Main.npc[index].dontTakeDamage)
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType<BigBeamofDeath2>(), (int)(double)projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType<BigBeamofDeath2>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
}
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic
if (projectile.ai[0] > 30f)
{
projectile.ai[0] = 30f;
for (int num376 = 0; num376 < 200; num376++)
for (int num376 = 0; num376 < Main.maxNPCs; num376++)
{
if (Main.npc[num376].CanBeChasedBy(projectile, false) && !Main.npc[num376].wet)
{
+1 -33
View File
@@ -55,39 +55,7 @@ namespace CalamityMod.Projectiles.Magic
{
projectile.timeLeft = 120;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 150f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 8f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 150f, 8f, 20f);
}
public override void Kill(int timeLeft)
+16 -18
View File
@@ -86,37 +86,35 @@ namespace CalamityMod.Projectiles.Magic
//homing
if (projectile.localAI[0] >= 100)
{
Vector2 center = projectile.Center;
float homingRange = 800f;
bool homeIn = false;
for (int i = 0; i < Main.npc.Length; i++)
float N = 30f;
float homingVelocity = 20f;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2);
float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < homingRange)
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (homingRange + extraDistance))
{
homingRange = num478;
centerX = num476;
centerY = num477;
center = Main.npc[i].Center;
homeIn = true;
break;
}
}
}
if (homeIn)
{
projectile.extraUpdates = 1;
float homingStrength = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = centerX - vector35.X;
float num485 = centerY - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = homingStrength / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 30f + num484) / 31f;
projectile.velocity.Y = (projectile.velocity.Y * 30f + num485) / 31f;
Vector2 homeInVector = projectile.DirectionTo(center);
if (homeInVector.HasNaNs())
homeInVector = Vector2.UnitY;
projectile.velocity = (projectile.velocity * N + homeInVector * homingVelocity) / (N + 1f);
}
else
projectile.extraUpdates = 0;
+20 -32
View File
@@ -33,10 +33,7 @@ namespace CalamityMod.Projectiles.Magic
public override void AI()
{
float[] var_2_2DDF8_cp_0 = projectile.ai;
int var_2_2DDF8_cp_1 = 0;
float num73 = var_2_2DDF8_cp_0[var_2_2DDF8_cp_1];
var_2_2DDF8_cp_0[var_2_2DDF8_cp_1] = num73 + 1f;
projectile.ai[0] += 1f;
int num1013 = 0;
if (projectile.velocity.Length() <= 8f) //4
{
@@ -109,7 +106,6 @@ namespace CalamityMod.Projectiles.Magic
dust30.fadeIn = 0.5f;
dust30.customData = projectile;
vector142 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
dust30 = Main.dust[Dust.NewDust(projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)];
dust30.noGravity = true;
dust30.position = projectile.Center - vector142 * (float)Main.rand.Next(10, 21);
dust30.velocity = vector142.RotatedBy(1.5707963705062866, default) * 6f;
@@ -142,7 +138,7 @@ namespace CalamityMod.Projectiles.Magic
int num1016 = 0;
if (projectile.ai[1] == 0f)
{
for (int num1017 = 0; num1017 < 200; num1017 = num3 + 1)
for (int num1017 = 0; num1017 < Main.maxNPCs; num1017 = num3 + 1)
{
if (Main.npc[num1017].CanBeChasedBy(projectile, false))
{
@@ -229,56 +225,50 @@ namespace CalamityMod.Projectiles.Magic
projectile.penetrate = -1;
projectile.Damage();
Main.PlaySound(SoundID.Item14, projectile.position);
int num3;
for (int num95 = 0; num95 < 4; num95 = num3 + 1)
for (int num95 = 0; num95 < 4; num95++)
{
int num96 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f);
Main.dust[num96].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
num3 = num95;
}
for (int num97 = 0; num97 < 30; num97 = num3 + 1)
for (int num97 = 0; num97 < 30; num97++)
{
int num98 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 200, default, 3.7f);
Main.dust[num98].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
Main.dust[num98].noGravity = true;
Dust dust = Main.dust[num98];
dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
dust.noGravity = true;
dust.velocity *= 3f;
num98 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f);
Main.dust[num98].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
dust = Main.dust[num98];
dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
dust.velocity *= 2f;
Main.dust[num98].noGravity = true;
Main.dust[num98].fadeIn = 1f;
Main.dust[num98].color = Color.Crimson * 0.5f;
num3 = num97;
dust.noGravity = true;
dust.fadeIn = 1f;
dust.color = Color.Crimson * 0.5f;
}
for (int num99 = 0; num99 < 10; num99 = num3 + 1)
for (int num99 = 0; num99 < 10; num99++)
{
int num100 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.7f);
Main.dust[num100].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f;
Main.dust[num100].noGravity = true;
Dust dust = Main.dust[num100];
dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f;
dust.noGravity = true;
dust.velocity *= 3f;
num3 = num99;
}
for (int num101 = 0; num101 < 10; num101 = num3 + 1)
for (int num101 = 0; num101 < 10; num101++)
{
int num102 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 1.5f);
Main.dust[num102].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f;
Main.dust[num102].noGravity = true;
Dust dust = Main.dust[num102];
dust.position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f;
dust.noGravity = true;
dust.velocity *= 3f;
num3 = num101;
}
if (Main.myPlayer == projectile.owner)
{
for (int num105 = 0; num105 < 1000; num105 = num3 + 1)
for (int num105 = 0; num105 < Main.maxProjectiles; num105++)
{
if (Main.projectile[num105].active && Main.projectile[num105].type == ModContent.ProjectileType<GhastlySubBlast>() && Main.projectile[num105].ai[1] == (float)projectile.whoAmI)
{
Main.projectile[num105].Kill();
}
num3 = num105;
}
int num106 = Main.rand.Next(5, 9);
int num107 = Main.rand.Next(5, 9);
@@ -288,7 +278,7 @@ namespace CalamityMod.Projectiles.Magic
180
});
int num109 = (num108 == 60) ? 180 : 60;
for (int num110 = 0; num110 < num106; num110 = num3 + 1)
for (int num110 = 0; num110 < num106; num110++)
{
Vector2 vector4 = projectile.Center + Utils.RandomVector2(Main.rand, -30f, 30f);
Vector2 vector5 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
@@ -303,9 +293,8 @@ namespace CalamityMod.Projectiles.Magic
}
vector5 *= (float)Main.rand.Next(70, 101) * 0.1f;
Projectile.NewProjectile(vector4.X, vector4.Y, vector5.X, vector5.Y, ModContent.ProjectileType<GhastlyExplosionShard>(), (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, (float)num108, 0f);
num3 = num110;
}
for (int num111 = 0; num111 < num107; num111 = num3 + 1)
for (int num111 = 0; num111 < num107; num111++)
{
Vector2 vector6 = projectile.Center + Utils.RandomVector2(Main.rand, -30f, 30f);
Vector2 vector7 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
@@ -320,7 +309,6 @@ namespace CalamityMod.Projectiles.Magic
}
vector7 *= (float)Main.rand.Next(40, 81) * 0.1f;
Projectile.NewProjectile(vector6.X, vector6.Y, vector7.X, vector7.Y, ModContent.ProjectileType<GhastlyExplosion>(), (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, (float)num109, 0f);
num3 = num111;
}
}
}
+1 -33
View File
@@ -45,39 +45,7 @@ namespace CalamityMod.Projectiles.Magic
return;
}
}
float centerX = projectile.Center.X;
float centerY = projectile.Center.Y;
float num474 = 500f;
bool homeIn = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
centerX = num476;
centerY = num477;
homeIn = true;
}
}
}
if (homeIn)
{
float num483 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = centerX - vector35.X;
float num485 = centerY - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 10f + num484) / 11f;
projectile.velocity.Y = (projectile.velocity.Y * 10f + num485) / 11f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 500f, 18f, 10f);
}
public override Color? GetAlpha(Color lightColor)
+6 -4
View File
@@ -44,8 +44,9 @@ namespace CalamityMod.Projectiles.Magic
bool target = false;
NPC npc = null;
bool pastNPC = false;
if (projectile.timeLeft < 18) {
for (int k = 0; k < 200; k++)
if (projectile.timeLeft < 18)
{
for (int k = 0; k < Main.maxNPCs; k++)
{
if (Main.npc[k].active && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].lifeMax > 5 && !shockedbefore.Contains(Main.npc[k]))
{
@@ -62,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic
}
}
}
//if not found, lokk thru npcs that have been shocked before
//if not found, look through npcs that have been shocked before
if (!target) {
foreach (NPC pastnpc in shockedbefore) {
Vector2 newMove = pastnpc.Center -(projectile.velocity + projectile.Center);
@@ -140,7 +141,8 @@ namespace CalamityMod.Projectiles.Magic
projectile.timeLeft -= 12;
return false;
}
private void AdjustMagnitude(ref Vector2 vector)
private void AdjustMagnitude(ref Vector2 vector)
{
float magnitude = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
if (magnitude > 6f)
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 60f, 5, ModContent.ProjectileType<Seashell>(), 0.33);
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 60f, 5, ModContent.ProjectileType<Seashell>(), 0.5);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
+1 -1
View File
@@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Rogue
Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
vector15.Normalize();
vector15 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType<BallisticPoisonCloud>() + Main.rand.Next(3), (int)((double)projectile.damage * 0.5), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType<BallisticPoisonCloud>() + Main.rand.Next(3), (int)((double)projectile.damage * 0.3), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
num3 = num321;
}
}
+1 -33
View File
@@ -69,39 +69,7 @@ namespace CalamityMod.Projectiles.Rogue
//Stealth strike
if (stealthstrike)
{
float pcx = projectile.Center.X;
float pcy = projectile.Center.Y;
float var1 = 800f;
bool flag = false;
for (int npcvar = 0; npcvar < 200; npcvar++)
{
if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1))
{
float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2);
float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2);
float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3);
if (var4 < var1)
{
var1 = var4;
pcx = var2;
pcy = var3;
flag = true;
}
}
}
if (flag)
{
float homingstrenght = 7f;
Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float var6 = pcx - vector1.X;
float var7 = pcy - vector1.Y;
float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7);
var8 = homingstrenght / var8;
var6 *= var8;
var7 *= var8;
projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 7f, 20f);
}
//Gravity code
else
+1 -33
View File
@@ -30,39 +30,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.Kill();
}
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.5f / 255f);
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 300f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 28f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 300f, 28f, 20f);
}
}
}
+1 -33
View File
@@ -50,39 +50,7 @@ namespace CalamityMod.Projectiles.Rogue
if (projectile.timeLeft > 350)
projectile.velocity *= 1.06f;
projectile.damage = (int) ((double)originalDamage * 1.25);
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 1500f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 21f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 21f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 1500f, 20f, 20f);
}
}
+1 -33
View File
@@ -27,39 +27,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void AI()
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 350f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 350f, 12f, 20f);
}
public override bool OnTileCollide(Vector2 oldVelocity)
+1 -35
View File
@@ -28,41 +28,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.ai[0] += 1f;
else
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 20f, 20f);
}
projectile.rotation += Math.Abs(projectile.velocity.X) * 0.01f * (float)projectile.direction;
+1 -35
View File
@@ -28,41 +28,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.ai[0] += 1f;
else
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 20f, 20f);
}
projectile.rotation += Math.Abs(projectile.velocity.X) * 0.01f * (float)projectile.direction;
+1 -33
View File
@@ -47,39 +47,7 @@ namespace CalamityMod.Projectiles.Rogue
{
if (projectile.ai[1] == 0f)
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 8f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 8f, 20f);
}
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue
{
int num35 = -1;
float num36 = num30;
for (int num37 = 0; num37 < 200; num37++)
for (int num37 = 0; num37 < Main.maxNPCs; num37++)
{
if (Main.npc[num37].active && Main.npc[num37].CanBeChasedBy(projectile, false))
{
+3 -35
View File
@@ -28,39 +28,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void AI()
{
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 400f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 24f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 24f, 20f);
}
public override void Kill(int timeLeft)
@@ -68,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue
Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14);
for (int num621 = 0; num621 < 20; num621++)
{
if (Main.rand.Next(10) == 0)
if (Main.rand.NextBool(10))
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
@@ -81,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue
}
for (int num623 = 0; num623 < 35; num623++)
{
if (Main.rand.Next(10) == 0)
if (Main.rand.NextBool(10))
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 138, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
+1 -33
View File
@@ -55,39 +55,7 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.rotation += 0.5f;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 250f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 15f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 250f, 15f, 20f);
if (Main.rand.NextBool(6))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f);
+1 -1
View File
@@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Rogue
if (projectile.timeLeft % 7 == 1 && projectile.Calamity().stealthStrike)
{
float axeSpeed = 15f;
int axeDamage = 25;
int axeDamage = projectile.damage / 2;
Projectile.NewProjectile(projectile.position, new Vector2(1f, 0f) * axeSpeed, ModContent.ProjectileType<EnchantedAxe2>(), axeDamage, 2, projectile.owner, 0, 0);
Projectile.NewProjectile(projectile.position, new Vector2(0f, 1f) * axeSpeed, ModContent.ProjectileType<EnchantedAxe2>(), axeDamage, 2, projectile.owner, 0, 0);
Projectile.NewProjectile(projectile.position, new Vector2(-1f, 0f) * axeSpeed, ModContent.ProjectileType<EnchantedAxe2>(), axeDamage, 2, projectile.owner, 0, 0);
+1 -33
View File
@@ -54,39 +54,7 @@ namespace CalamityMod.Projectiles.Rogue
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 1200f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 26f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 1200f, 26f, 20f);
}
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
+1 -33
View File
@@ -46,39 +46,7 @@ namespace CalamityMod.Projectiles.Rogue
Main.projectile[proj].penetrate = 3;
stealthTrailTimer = 10;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 500f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 16f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 500f, 16f, 20f);
}
public override void Kill(int timeLeft)
+1 -33
View File
@@ -108,39 +108,7 @@ namespace CalamityMod.Projectiles.Rogue
else
{
projectile.rotation += 0.2f * (float)projectile.direction;
float pcx = projectile.Center.X;
float pcy = projectile.Center.Y;
float var1 = 800f;
bool flag = false;
for (int npcvar = 0; npcvar < Main.npc.Length; npcvar++)
{
if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1))
{
float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2);
float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2);
float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3);
if (var4 < var1)
{
var1 = var4;
pcx = var2;
pcy = var3;
flag = true;
}
}
}
if (flag)
{
float homingstrenght = (projectile.Calamity().stealthStrike ? 14f : 7f);
Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float var6 = pcx - vector1.X;
float var7 = pcy - vector1.Y;
float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7);
var8 = homingstrenght / var8;
var6 *= var8;
var7 *= var8;
projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, (projectile.Calamity().stealthStrike ? 14f : 7f), 20f);
}
Player player = Main.player[projectile.owner];
+1 -33
View File
@@ -46,39 +46,7 @@ namespace CalamityMod.Projectiles.Rogue
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = projectile.Calamity().stealthStrike ? 800f : 400f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 14f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, projectile.Calamity().stealthStrike ? 800f : 400f, 14f, 20f);
projectile.velocity = initStealth && !flag17 ? initialVelocity : projectile.velocity;
}
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f;
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
if (projectile.spriteDirection == -1)
{
projectile.rotation -= 1.57f;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 B

After

Width:  |  Height:  |  Size: 508 B

+1 -33
View File
@@ -44,39 +44,7 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.rotation += 0.5f;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 800f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 35f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 35f, 20f);
if (Main.rand.NextBool(6))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
+1 -33
View File
@@ -41,39 +41,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.frame = 0;
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 400f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 24f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 24f, 20f);
}
public override void Kill(int timeLeft)
+1 -33
View File
@@ -46,39 +46,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.frame = 0;
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = (lunarEnhance ? 1000f : 500f);
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = (lunarEnhance ? 35f : 15f);
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, (lunarEnhance ? 1000f : 500f), (lunarEnhance ? 35f : 15f), 20f);
if (Main.rand.Next(6) == 0 && lunarEnhance)
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
+2 -34
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.height = 20;
projectile.friendly = true;
projectile.alpha = 0;
projectile.penetrate = -1;
projectile.penetrate = 10;
projectile.tileCollide = true;
projectile.ignoreWater = true;
projectile.timeLeft = 250;
@@ -41,39 +41,7 @@ namespace CalamityMod.Projectiles.Rogue
return;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 8f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 8f, 20f);
}
public override void Kill(int timeLeft)
+1 -31
View File
@@ -61,37 +61,7 @@ namespace CalamityMod.Projectiles.Rogue
private void HomingAI()
{
// Find the closest NPC within range.
int targetIdx = -1;
float maxHomingRange = 400f;
bool hasHomingTarget = false;
for (int i = 0; i < Main.npc.Length; ++i)
{
NPC npc = Main.npc[i];
if (npc == null || !npc.active)
continue;
// Won't home in through walls and won't chase invulnerable targets.
if (npc.CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1))
{
float dist = (projectile.Center - npc.Center).Length();
if (dist < maxHomingRange)
{
targetIdx = i;
maxHomingRange = dist;
hasHomingTarget = true;
}
}
}
// Home in on said closest NPC.
if (hasHomingTarget)
{
NPC target = Main.npc[targetIdx];
Vector2 homingVector = (target.Center - projectile.Center).SafeNormalize(Vector2.Zero) * (Penumbra.ShootSpeed * 1.5f);
float homingRatio = 35f;
projectile.velocity = (projectile.velocity * homingRatio + homingVector) / (homingRatio + 1f);
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, (Penumbra.ShootSpeed * 1.5f), 35f);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
+1 -33
View File
@@ -35,39 +35,7 @@ namespace CalamityMod.Projectiles.Rogue
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default(Color), 0.85f);
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 18f, 20f);
}
public override void Kill(int timeLeft)
+1 -33
View File
@@ -85,39 +85,7 @@ namespace CalamityMod.Projectiles.Rogue
}
if (projectile.ai[0] == 0f)
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 10f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 600f, 10f, 20f);
}
}
else
+1 -3
View File
@@ -55,8 +55,7 @@ namespace CalamityMod.Projectiles.Rogue
if (projectile.ai[0] > 30f)
{
projectile.ai[0] = 30f;
int num3;
for (int num376 = 0; num376 < 200; num376 = num3 + 1)
for (int num376 = 0; num376 < Main.maxNPCs; num376++)
{
if (Main.npc[num376].CanBeChasedBy(projectile, false) && (!Main.npc[num376].wet || projectile.type == 307))
{
@@ -71,7 +70,6 @@ namespace CalamityMod.Projectiles.Rogue
flag10 = true;
}
}
num3 = num376;
}
}
if (!flag10)
+1 -34
View File
@@ -29,40 +29,7 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.rotation -= 1.57f;
}
float centerX = projectile.Center.X;
float centerY = projectile.Center.Y;
float num474 = 300f;
bool homeIn = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
centerX = num476;
centerY = num477;
homeIn = true;
}
}
}
if (homeIn)
{
float num483 = 25f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = centerX - vector35.X;
float num485 = centerY - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
return;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 300f, 25f, 20f);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
+1 -31
View File
@@ -94,37 +94,7 @@ namespace CalamityMod.Projectiles.Rogue
float pcy = projectile.Center.Y;
if (timer >= 10)
{
float var1 = 800f;
bool flag = false;
for (int npcvar = 0; npcvar < 200; npcvar++)
{
if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1))
{
float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2);
float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2);
float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3);
if (var4 < var1)
{
var1 = var4;
pcx = var2;
pcy = var3;
flag = true;
}
}
}
if (flag)
{
float homingstrenght = 7f;
Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float var6 = pcx - vector1.X;
float var7 = pcy - vector1.Y;
float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7);
var8 = homingstrenght / var8;
var6 *= var8;
var7 *= var8;
projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 7f, 20f);
}
}
+2 -34
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue
float num473 = projectile.Center.Y;
float num474 = projectile.Calamity().stealthStrike ? 1800f : 600f;
float homingSpeed = 0.25f;
for (int num475 = 0; num475 < 200; num475++)
for (int num475 = 0; num475 < Main.maxNPCs; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses)
{
@@ -73,39 +73,7 @@ namespace CalamityMod.Projectiles.Rogue
}
else
{
float centerX = projectile.Center.X;
float centerY = projectile.Center.Y;
float num474 = projectile.Calamity().stealthStrike ? 1800f : 600f;
bool homeIn = false;
for (int i = 0; i < 200; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
{
float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2);
float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
centerX = num476;
centerY = num477;
homeIn = true;
}
}
}
if (homeIn)
{
float num483 = 24f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = centerX - vector35.X;
float num485 = centerY - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, projectile.Calamity().stealthStrike ? 1800f : 600f, 24f, 20f);
}
}
+2 -34
View File
@@ -48,39 +48,7 @@ namespace CalamityMod.Projectiles.Rogue
}
else
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 400f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f);
}
}
else
@@ -107,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue
}
Vector2 vector46 = projectile.position;
bool flag25 = false;
for (int num645 = 0; num645 < 200; num645++)
for (int num645 = 0; num645 < Main.maxNPCs; num645++)
{
NPC nPC2 = Main.npc[num645];
if (nPC2.CanBeChasedBy(projectile, false))
+25 -33
View File
@@ -54,41 +54,33 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.extraUpdates = 1;
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 500f;
bool flag17 = false;
Vector2 center = projectile.Center;
float maxDistance = 500f;
bool homeIn = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
if (flag17)
{
float num483 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
{
center = Main.npc[i].Center;
homeIn = true;
break;
}
}
}
if (homeIn)
{
Vector2 homeInVector = projectile.DirectionTo(center);
if (homeInVector.HasNaNs())
homeInVector = Vector2.UnitY;
projectile.velocity = (projectile.velocity * 20f + homeInVector * 12f) / (21f);
}
else
projectile.Kill();
}
+31 -33
View File
@@ -32,39 +32,37 @@ namespace CalamityMod.Projectiles.Rogue
}
else
{
float centerX = projectile.Center.X;
float centerY = projectile.Center.Y;
float num474 = 1000f;
bool homeIn = false;
for (int i = 0; i < 200; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2);
float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
centerX = num476;
centerY = num477;
homeIn = true;
}
}
}
if (homeIn)
{
float num483 = 30f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = centerX - vector35.X;
float num485 = centerY - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 10f + num484) / 11f;
projectile.velocity.Y = (projectile.velocity.Y * 10f + num485) / 11f;
}
Vector2 center = projectile.Center;
float maxDistance = 1000f;
bool homeIn = false;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
bool canHit = true;
if (extraDistance < maxDistance && !ignoreTiles)
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit)
{
center = Main.npc[i].Center;
homeIn = true;
break;
}
}
}
if (homeIn)
{
Vector2 homeInVector = projectile.DirectionTo(center);
if (homeInVector.HasNaNs())
homeInVector = Vector2.UnitY;
projectile.velocity = (projectile.velocity * 10f + homeInVector * 30f) / (11f);
}
else
{
projectile.velocity.X = 0f;
+1 -33
View File
@@ -77,39 +77,7 @@ namespace CalamityMod.Projectiles.Rogue
}
Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0f);
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 400f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f);
float num633 = 700f;
Vector2 vector46 = projectile.position;
bool flag25 = false;
+1 -1
View File
@@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Rogue
bool flag49 = false;
Vector2 center12 = new Vector2(0f, 0f);
float num948 = 600f;
for (int num949 = 0; num949 < 200; num949++)
for (int num949 = 0; num949 < Main.maxNPCs; num949++)
{
if (Main.npc[num949].CanBeChasedBy(projectile, false))
{
+32 -33
View File
@@ -39,40 +39,39 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.rotation -= 1.57f;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 300f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
Vector2 center = projectile.Center;
float maxDistance = 300f;
bool homeIn = false;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
bool canHit = true;
if (extraDistance < maxDistance && !ignoreTiles)
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
{
center = Main.npc[i].Center;
homeIn = true;
break;
}
}
}
if (homeIn)
{
projectile.extraUpdates = 2;
float num483 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
Vector2 homeInVector = projectile.DirectionTo(center);
if (homeInVector.HasNaNs())
homeInVector = Vector2.UnitY;
projectile.velocity = (projectile.velocity * 20f + homeInVector * 12f) / (21f);
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
+1 -33
View File
@@ -42,39 +42,7 @@ namespace CalamityMod.Projectiles.Rogue
projectile.rotation += projectile.velocity.X * 0.02f;
projectile.velocity.Y = projectile.velocity.Y + 0.085f;
projectile.velocity.X = projectile.velocity.X * 0.99f;
float pcx = projectile.Center.X;
float pcy = projectile.Center.Y;
float var1 = 800f;
bool flag = false;
for (int npcvar = 0; npcvar < 200; npcvar++)
{
if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1))
{
float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2);
float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2);
float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3);
if (var4 < var1)
{
var1 = var4;
pcx = var2;
pcy = var3;
flag = true;
}
}
}
if (flag)
{
float homingstrenght = 16f;
Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float var6 = pcx - vector1.X;
float var7 = pcy - vector1.Y;
float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7);
var8 = homingstrenght / var8;
var6 *= var8;
var7 *= var8;
projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 16f, 20f);
}
public override void Kill(int timeLeft)
+40 -33
View File
@@ -32,6 +32,11 @@ namespace CalamityMod.Projectiles.Rogue
public override void AI()
{
//synthesized timeLeft
projectile.localAI[1]++;
if (projectile.localAI[1] > 600f)
projectile.Kill();
if (projectile.ai[0] == 1f)
{
projectile.ai[0] = 0f;
@@ -52,39 +57,41 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.rotation -= 1.57f;
}
float centerX = projectile.Center.X;
float centerY = projectile.Center.Y;
float num474 = 600f;
bool homeIn = false;
for (int i = 0; i < 200; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
{
float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2);
float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
centerX = num476;
centerY = num477;
homeIn = true;
}
}
}
if (homeIn)
{
float num483 = 30f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = centerX - vector35.X;
float num485 = centerY - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 10f + num484) / 11f;
projectile.velocity.Y = (projectile.velocity.Y * 10f + num485) / 11f;
}
projectile.localAI[0]++;
Vector2 center = projectile.Center;
float maxDistance = 600f;
bool homeIn = false;
if (projectile.localAI[0] >= 20f && !homeIn) //shorten knife lifespan if it hasn't found a target
if (projectile.timeLeft >= 60)
projectile.timeLeft = 60;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
{
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance))
{
center = Main.npc[i].Center;
homeIn = true;
break;
}
}
}
if (homeIn)
{
projectile.timeLeft = 600; //when homing in, the projectile cannot run out of timeLeft, but synthesized timeLeft still runs
Vector2 homeInVector = projectile.DirectionTo(center);
if (homeInVector.HasNaNs())
homeInVector = Vector2.UnitY;
projectile.velocity = (projectile.velocity * 10f + homeInVector * 30f) / (10f + 1f);
}
else
{
projectile.velocity.X *= 0.92f;
+25 -33
View File
@@ -51,41 +51,33 @@ namespace CalamityMod.Projectiles.Rogue
{
projectile.extraUpdates = 1;
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 500f;
bool flag17 = false;
Vector2 center = projectile.Center;
float maxDistance = 500f;
bool homeIn = false;
for (int num475 = 0; num475 < Main.npc.Length; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
if (flag17)
{
float num483 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
{
center = Main.npc[i].Center;
homeIn = true;
break;
}
}
}
if (homeIn)
{
Vector2 homeInVector = projectile.DirectionTo(center);
if (homeInVector.HasNaNs())
homeInVector = Vector2.UnitY;
projectile.velocity = (projectile.velocity * 20f + homeInVector * 12f) / (21f);
}
else
projectile.Kill();
}
+1 -33
View File
@@ -61,39 +61,7 @@ namespace CalamityMod.Projectiles.Rogue
}
if (projectile.ai[1] == 1f)
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 150f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 8f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 150f, 8f, 20f);
}
}
+1 -33
View File
@@ -48,39 +48,7 @@ namespace CalamityMod.Projectiles.Rogue
}
else
{
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 400f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f);
}
}
else
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Typeless
projectile.ignoreWater = true;
projectile.timeLeft = 3600;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
projectile.localNPCHitCooldown = 40;
}
public override void AI()
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Typeless
projectile.ignoreWater = true;
projectile.timeLeft = 3600;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
projectile.localNPCHitCooldown = 40;
}
public override void AI()
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Typeless
projectile.ignoreWater = true;
projectile.timeLeft = 3600;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
projectile.localNPCHitCooldown = 40;
}
public override void AI()
+17 -71
View File
@@ -136,24 +136,12 @@ namespace CalamityMod.UI
OneToMany[ModContent.NPCType<AstrumDeusHeadSpectral>()] = StarWorm;
OneToMany[ModContent.NPCType<AstrumDeusHead>()] = StarWorm;
int[] Cal = new int[] { ModContent.NPCType<CalamitasRun3>(), ModContent.NPCType<CalamitasRun>(), ModContent.NPCType<CalamitasRun2>() };
OneToMany[ModContent.NPCType<CalamitasRun3>()] = Cal;
OneToMany[ModContent.NPCType<CalamitasRun>()] = Cal;
OneToMany[ModContent.NPCType<CalamitasRun2>()] = Cal;
int[] Void = new int[] { ModContent.NPCType<CeaselessVoid>(), ModContent.NPCType<DarkEnergy>(), ModContent.NPCType<DarkEnergy2>(), ModContent.NPCType<DarkEnergy3>() };
OneToMany[ModContent.NPCType<CeaselessVoid>()] = Void;
OneToMany[ModContent.NPCType<DarkEnergy>()] = Void;
OneToMany[ModContent.NPCType<DarkEnergy2>()] = Void;
OneToMany[ModContent.NPCType<DarkEnergy3>()] = Void;
int[] Perfs = new int[] { ModContent.NPCType<PerforatorHive>(), ModContent.NPCType<PerforatorHeadSmall>(), ModContent.NPCType<PerforatorHeadMedium>(),
ModContent.NPCType<PerforatorHeadLarge>() };
OneToMany[ModContent.NPCType<PerforatorHive>()] = Perfs;
OneToMany[ModContent.NPCType<PerforatorHeadSmall>()] = Perfs;
OneToMany[ModContent.NPCType<PerforatorHeadMedium>()] = Perfs;
OneToMany[ModContent.NPCType<PerforatorHeadLarge>()] = Perfs;
int[] Rav = new int[] { ModContent.NPCType<RavagerBody>(), ModContent.NPCType<RavagerClawRight>(), ModContent.NPCType<RavagerClawLeft>(),
ModContent.NPCType<RavagerLegRight>(), ModContent.NPCType<RavagerLegLeft>(), ModContent.NPCType<RavagerHead>() };
OneToMany[ModContent.NPCType<RavagerBody>()] = Rav;
@@ -243,6 +231,9 @@ namespace CalamityMod.UI
//Prehardmode
ModContent.NPCType<GiantClam>(),
ModContent.NPCType<PerforatorHeadSmall>(),
ModContent.NPCType<PerforatorHeadMedium>(),
ModContent.NPCType<PerforatorHeadLarge>(),
//Hardmode
ModContent.NPCType<ThiccWaifu>(),
@@ -250,6 +241,8 @@ namespace CalamityMod.UI
ModContent.NPCType<GreatSandShark>(),
ModContent.NPCType<PlaguebringerShade>(),
ModContent.NPCType<ArmoredDiggerHead>(),
ModContent.NPCType<CalamitasRun>(), //Clone's brothers
ModContent.NPCType<CalamitasRun2>(),
//Abyss
ModContent.NPCType<EidolonWyrmHeadHuge>(),
@@ -452,9 +445,7 @@ namespace CalamityMod.UI
enum SpecialType2 : byte
{
None,
Calam,
Ceaseless,
Perforator,
Ravage,
SlimeCore
}
@@ -493,18 +484,10 @@ namespace CalamityMod.UI
{
_special2 = SpecialType2.Ravage;
}
else if (type == ModContent.NPCType<PerforatorHive>())
{
_special2 = SpecialType2.Perforator;
}
else if (type == ModContent.NPCType<CeaselessVoid>())
{
_special2 = SpecialType2.Ceaseless;
}
else if (type == ModContent.NPCType<CalamitasRun3>())
{
_special2 = SpecialType2.Calam;
}
else if (type == ModContent.NPCType<AstrumDeusHeadSpectral>())
{
_special = SpecialType.Astrum;
@@ -699,37 +682,26 @@ namespace CalamityMod.UI
{
default:
break;
case SpecialType2.Calam:
int count = NPC.CountNPCS(ModContent.NPCType<CalamitasRun>()) +
NPC.CountNPCS(ModContent.NPCType<CalamitasRun2>());
_specialData2[0] = count;
break;
case SpecialType2.Ceaseless:
int count2 = NPC.CountNPCS(ModContent.NPCType<DarkEnergy>()) +
int count = NPC.CountNPCS(ModContent.NPCType<DarkEnergy>()) +
NPC.CountNPCS(ModContent.NPCType<DarkEnergy2>()) +
NPC.CountNPCS(ModContent.NPCType<DarkEnergy3>());
_specialData2[1] = count2;
break;
case SpecialType2.Perforator:
int count3 = NPC.CountNPCS(ModContent.NPCType<PerforatorHeadSmall>()) +
NPC.CountNPCS(ModContent.NPCType<PerforatorHeadMedium>()) +
NPC.CountNPCS(ModContent.NPCType<PerforatorHeadLarge>());
_specialData2[2] = count3;
_specialData2[0] = count;
break;
case SpecialType2.Ravage:
int count4 = NPC.CountNPCS(ModContent.NPCType<RavagerClawRight>()) +
int count2 = NPC.CountNPCS(ModContent.NPCType<RavagerClawRight>()) +
NPC.CountNPCS(ModContent.NPCType<RavagerClawLeft>()) +
NPC.CountNPCS(ModContent.NPCType<RavagerLegRight>()) +
NPC.CountNPCS(ModContent.NPCType<RavagerLegLeft>()) +
NPC.CountNPCS(ModContent.NPCType<RavagerHead>());
_specialData2[3] = count4;
_specialData2[1] = count2;
break;
case SpecialType2.SlimeCore:
int count5 = NPC.CountNPCS(ModContent.NPCType<SlimeGod>()) +
int count3 = NPC.CountNPCS(ModContent.NPCType<SlimeGod>()) +
NPC.CountNPCS(ModContent.NPCType<SlimeGodSplit>()) +
NPC.CountNPCS(ModContent.NPCType<SlimeGodRun>()) +
NPC.CountNPCS(ModContent.NPCType<SlimeGodRunSplit>());
_specialData2[4] = count5;
_specialData2[2] = count3;
break;
}
}
@@ -841,32 +813,20 @@ namespace CalamityMod.UI
{
default:
break;
case SpecialType2.Calam:
string count = "(Brothers left: " + _specialData2[0] + ")";
Vector2 countSize = Main.fontItemStack.MeasureString(count) * textScale;
float countX = Math.Max(x, x + mainBarWidth - countSize.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count, new Vector2(countX, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale);
return;
case SpecialType2.Ceaseless:
string count2 = "(Dark Energy left: " + _specialData2[1] + ")";
string count2 = "(Dark Energy left: " + _specialData2[0] + ")";
Vector2 countSize2 = Main.fontItemStack.MeasureString(count2) * textScale;
float countX2 = Math.Max(x, x + mainBarWidth - countSize2.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count2, new Vector2(countX2, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale);
return;
case SpecialType2.Perforator:
string count3 = "(Worms left: " + _specialData2[2] + ")";
Vector2 countSize3 = Main.fontItemStack.MeasureString(count3) * textScale;
float countX3 = Math.Max(x, x + mainBarWidth - countSize3.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count3, new Vector2(countX3, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale);
return;
case SpecialType2.Ravage:
string count4 = "(Body Parts left: " + _specialData2[3] + ")";
string count4 = "(Body Parts left: " + _specialData2[1] + ")";
Vector2 countSize4 = Main.fontItemStack.MeasureString(count4) * textScale;
float countX4 = Math.Max(x, x + mainBarWidth - countSize4.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count4, new Vector2(countX4, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale);
return;
case SpecialType2.SlimeCore:
string count5 = "(Large Slimes left: " + _specialData2[4] + ")";
string count5 = "(Large Slimes left: " + _specialData2[2] + ")";
Vector2 countSize5 = Main.fontItemStack.MeasureString(count5) * textScale;
float countX5 = Math.Max(x, x + mainBarWidth - countSize5.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count5, new Vector2(countX5, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale);
@@ -973,36 +933,22 @@ namespace CalamityMod.UI
{
default:
break;
case SpecialType2.Calam:
string count = "(Brothers left: " + _specialData2[0] + ")";
Vector2 countSize = Main.fontItemStack.MeasureString(count) * textScale;
float countX = Math.Max(x, x + mainBarWidth - countSize.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count, new Vector2(countX, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale);
_openAnimCounter--;
return;
case SpecialType2.Ceaseless:
string count2 = "(Dark Energy left: " + _specialData2[1] + ")";
string count2 = "(Dark Energy left: " + _specialData2[0] + ")";
Vector2 countSize2 = Main.fontItemStack.MeasureString(count2) * textScale;
float countX2 = Math.Max(x, x + mainBarWidth - countSize2.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count2, new Vector2(countX2, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale);
_openAnimCounter--;
return;
case SpecialType2.Perforator:
string count3 = "(Worms left: " + _specialData2[2] + ")";
Vector2 countSize3 = Main.fontItemStack.MeasureString(count3) * textScale;
float countX3 = Math.Max(x, x + mainBarWidth - countSize3.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count3, new Vector2(countX3, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale);
_openAnimCounter--;
return;
case SpecialType2.Ravage:
string count4 = "(Body Parts left: " + _specialData2[3] + ")";
string count4 = "(Body Parts left: " + _specialData2[1] + ")";
Vector2 countSize4 = Main.fontItemStack.MeasureString(count4) * textScale;
float countX4 = Math.Max(x, x + mainBarWidth - countSize4.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count4, new Vector2(countX4, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale);
_openAnimCounter--;
return;
case SpecialType2.SlimeCore:
string count5 = "(Large Slimes left: " + _specialData2[4] + ")";
string count5 = "(Large Slimes left: " + _specialData2[2] + ")";
Vector2 countSize5 = Main.fontItemStack.MeasureString(count5) * textScale;
float countX5 = Math.Max(x, x + mainBarWidth - countSize5.X);
DrawBorderStringEightWay(sb, Main.fontItemStack, count5, new Vector2(countX5, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale);