1 - Removed dumb item.scale adjustments from nearly all weapons.

2 - Updated/upgraded Comet Quasher, Baleful Harvester, Greentide, Astral Blade and Aftershock.
3 - Fixed some missing netmode checks.
4 - Added more lasers to death mode Skeletron Prime heads.
5 - Made Rev+ Skeletron Prime skulls more difficult to avoid.
6 - Rev+ Skeletron Prime spawns Probes during skull attack.
7 - Rev+ Skeletron Prime moves faster during missile vomit attack.
8 - Rev+ Skeletron Prime Cannon rockets are faster.
9 - Rev+ Skeletron Prime Cannon rocket spreads have greater spread.
10 - Avalanche Ice Bombs no longer collide with tiles.
11 - Rev+ Skeletron Prime rockets have different homing.
This commit is contained in:
mountaindrew10 committed 2024-03-14 13:46:30 -05:00
1 parent cd5d9a5eb7
commit fc495e5c5f
41 files changed
+305 -418

No files matched your search

+22 -22
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.Items
#region CATEGORY 1: Weapon Balancing
{ ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(65), ShootSpeedRatio(1.25f)) },
{ ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(14)) },
{ ItemID.AdamantiteSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(77)) },
{ ItemID.AdamantiteSword, Do(UseTurn, DamageExact(77)) },
{ ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) },
{ ItemID.AmethystStaff, Do(ManaExact(2)) },
{ ItemID.Anchor, Do(DamageExact(107), UseExact(30)) },
@@ -47,16 +47,16 @@ namespace CalamityMod.Items
{ ItemID.BeamSword, Do(UseMeleeSpeed, UseTurn, DamageExact(180), UseAnimationExact(60), ShootSpeedExact(23f)) },
{ ItemID.BeeGun, Do(DamageExact(10), ManaExact(4)) },
{ ItemID.BeesKnees, Do(PointBlank, DamageExact(18), UseExact(38)) },
{ ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120), ScaleRatio(1.75f)) },
{ ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120)) },
{ ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) },
{ ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) },
{ ItemID.Blowgun, Do(PointBlank, DamageExact(40)) },
{ ItemID.BluePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.BluePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.BluePhasesaber, Do(DamageExact(60)) },
{ ItemID.BookofSkulls, Do(ManaExact(12), ShootSpeedExact(5.5f)) },
{ ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom
{ ItemID.Boomstick, Do(PointBlank, DamageExact(11)) },
{ ItemID.BreakerBlade, Do(AutoReuse, UseTurn, ScaleRatio(1.4f), DamageExact(97)) },
{ ItemID.BreakerBlade, Do(AutoReuse, UseTurn, DamageExact(97)) },
{ ItemID.CandyCornRifle, Do(PointBlank, DamageExact(66)) },
{ ItemID.Cascade, Do(AutoReuse, DamageExact(30)) },
{ ItemID.ChainGuillotines, Do(DamageExact(100)) },
@@ -70,7 +70,7 @@ namespace CalamityMod.Items
{ ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) },
{ ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(90)) },
{ ItemID.CobaltRepeater, Do(PointBlank, UseExact(18)) },
{ ItemID.CobaltSword, Do(UseTurn, ScaleRatio(1.4f), DamageExact(80)) },
{ ItemID.CobaltSword, Do(UseTurn, DamageExact(80)) },
{ ItemID.Code2, Do(AutoReuse, DamageExact(43)) },
{ ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise
{ ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery
@@ -99,7 +99,7 @@ namespace CalamityMod.Items
{ ItemID.EmpressBlade, Do(AutoReuse, DamageExact(60), UseExact(20)) }, // Terraprisma
{ ItemID.EnchantedBoomerang, Do(DamageExact(24)) },
{ ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) },
{ ItemID.Excalibur, Do(TrueMelee, ScaleRatio(1.2f), UseRatio(0.8f), DamageExact(125), UseAnimationExact(45)) },
{ ItemID.Excalibur, Do(TrueMelee, UseRatio(0.8f), DamageExact(125), UseAnimationExact(45)) },
{ ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow
{ ItemID.FairyQueenRangedItem, Do(PointBlank, DamageExact(42))}, //Eventide
{ ItemID.FalconBlade, Do(UseTurn, UseExact(15)) },
@@ -120,7 +120,7 @@ namespace CalamityMod.Items
{ ItemID.GolemFist, Do(DamageExact(150)) },
{ ItemID.Gradient, Do(AutoReuse, DamageExact(39)) },
{ ItemID.GreenPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.GreenPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.GreenPhasesaber, Do(DamageExact(60)) },
{ ItemID.GrenadeLauncher, Do(DamageExact(90)) },
{ ItemID.Gungnir, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(92), ShootSpeedRatio(1.25f)) },
{ ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) },
@@ -139,7 +139,7 @@ namespace CalamityMod.Items
{ ItemID.InfernoFork, Do(DamageExact(84)) },
{ ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) },
{ ItemID.IronShortsword, Do(AutoReuse, TrueMelee, DamageExact(10)) },
{ ItemID.Keybrand, Do(UseTurn, ScaleRatio(1.5f)) }, // Uses ratios due to remix seed
{ ItemID.Keybrand, Do(UseTurn) },
{ ItemID.Kraken, Do(AutoReuse, DamageExact(85)) },
{ ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // Uses ratios due to remix seed
{ ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) },
@@ -167,20 +167,20 @@ namespace CalamityMod.Items
{ ItemID.Musket, Do(PointBlank, DamageExact(22)) },
{ ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(95), ShootSpeedRatio(1.25f)) },
{ ItemID.MythrilRepeater, Do(PointBlank, UseExact(16)) },
{ ItemID.MythrilSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(100)) },
{ ItemID.MythrilSword, Do(UseTurn, DamageExact(100)) },
{ ItemID.NettleBurst, Do(ManaExact(10), DamageExact(70)) },
{ ItemID.NightsEdge, Do(TrueMelee, DamageExact(45)) },
{ ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) },
{ ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.OrangePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.OrangePhasesaber, Do(DamageExact(60)) },
{ ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(98), ShootSpeedRatio(1.25f)) },
{ ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(48)) },
{ ItemID.OrichalcumSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(82)) },
{ ItemID.OrichalcumSword, Do(UseTurn, DamageExact(82)) },
{ ItemID.PainterPaintballGun, Do(PointBlank, DamageExact(8)) },
{ ItemID.PaladinsHammer, Do(DamageExact(100), ShootSpeedExact(23)) },
{ ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(96)) },
{ ItemID.PalladiumRepeater, Do(PointBlank, DamageExact(45)) },
{ ItemID.PalladiumSword, Do(UseTurn, ScaleRatio(1.4f), DamageExact(100)) },
{ ItemID.PalladiumSword, Do(UseTurn, DamageExact(100)) },
{ ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(20), UseDelta(+8), ShootSpeedDelta(+3.4f), KnockbackDelta(+1f)) },
{ ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) },
{ ItemID.PewMaticHorn, Do(DamageExact(24)) },
@@ -192,9 +192,9 @@ namespace CalamityMod.Items
{ ItemID.PoisonStaff, Do(DamageExact(57)) },
{ ItemID.PossessedHatchet, Do(DamageExact(135)) },
{ ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageExact(255)) },
{ ItemID.PurpleClubberfish, Do(UseTurn, ScaleRatio(1.2f), KnockbackExact(10f)) },
{ ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) },
{ ItemID.PurplePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.PurplePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.PurplePhasesaber, Do(DamageExact(60)) },
{ ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(70)) },
{ ItemID.QuadBarrelShotgun, Do(PointBlank, DamageExact(11)) },
{ ItemID.RainbowRod, Do(DamageExact(35), ManaExact(15)) },
@@ -204,7 +204,7 @@ namespace CalamityMod.Items
{ ItemID.RazorbladeTyphoon, Do(DamageExact(103)) },
{ ItemID.Razorpine, Do(DamageExact(40)) },
{ ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.RedPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.RedPhasesaber, Do(DamageExact(60)) },
{ ItemID.RedRyder, Do(PointBlank, DamageExact(24)) },
{ ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's throw and valkyrie's yoyo are the same weapon
{ ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) },
@@ -221,7 +221,7 @@ namespace CalamityMod.Items
{ ItemID.SilverBullet, Do(DamageExact(8)) },
{ ItemID.SilverShortsword, Do(AutoReuse, TrueMelee, DamageExact(14)) },
{ ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) },
{ ItemID.SlapHand, Do(UseTurn, ScaleRatio(1.5f), DamageExact(120)) },
{ ItemID.SlapHand, Do(UseTurn, DamageExact(120)) },
{ ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff
{ ItemID.SolarEruption, Do(DamageExact(157)) },
{ ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain
@@ -237,7 +237,7 @@ namespace CalamityMod.Items
{ ItemID.Stynger, Do(DamageExact(75)) },
{ ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) },
{ ItemID.TacticalShotgun, Do(PointBlank, DamageExact(34)) },
{ ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), UseRatio(0.8f), DamageExact(70)) }, // Classy Cane
{ ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane
{ ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) },
{ ItemID.TerraBlade, Do(DamageExact(122)) },
// Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously,
@@ -249,14 +249,14 @@ namespace CalamityMod.Items
{ ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear
{ ItemID.ThunderStaff, Do(DamageExact(18)) }, //Thunder Zapper
{ ItemID.TitaniumRepeater, Do(PointBlank, DamageExact(52)) },
{ ItemID.TitaniumSword, Do(UseTurn, ScaleRatio(1.45f), DamageExact(77)) },
{ ItemID.TitaniumSword, Do(UseTurn, DamageExact(77)) },
{ ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(72), ShootSpeedRatio(1.25f)) },
{ ItemID.TopazStaff, Do(ManaExact(2)) },
{ ItemID.Toxikarp, Do(UseTimeExact(7), UseAnimationExact(14)) },
{ ItemID.Trident, Do(AutoReuse, TrueMelee, DamageExact(20)) },
{ ItemID.Trimarang, Do(DamageExact(24)) },
{ ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(107)) },
{ ItemID.TrueNightsEdge, Do(DamageExact(105), ScaleRatio(1.2f)) },
{ ItemID.TrueNightsEdge, Do(DamageExact(105)) },
{ ItemID.Tsunami, Do(PointBlank, DamageExact(49)) },
{ ItemID.TungstenBullet, Do(DamageExact(8)) },
{ ItemID.TungstenShortsword, Do(AutoReuse, TrueMelee, DamageExact(15)) },
@@ -268,13 +268,13 @@ namespace CalamityMod.Items
{ ItemID.WaspGun, Do(UseExact(11), DamageExact(58)) },
{ ItemID.WaterBolt, Do(DamageExact(23)) },
{ ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.WhitePhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.WhitePhasesaber, Do(DamageExact(60)) },
{ ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) },
{ ItemID.Yelets, Do(AutoReuse, DamageExact(53)) },
{ ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) },
{ ItemID.YellowPhasesaber, Do(ScaleRatio(1.5f), DamageExact(60)) },
{ ItemID.YellowPhasesaber, Do(DamageExact(60)) },
{ ItemID.Zenith, Do(DamageExact(210)) },
{ ItemID.ZombieArm, Do(AutoReuse, UseTurn, ScaleRatio(1.25f), KnockbackExact(12f)) },
{ ItemID.ZombieArm, Do(AutoReuse, UseTurn, KnockbackExact(12f)) },
#endregion
#region CATEGORY 2: Defense Balancing
-2
View File
@@ -29,8 +29,6 @@ namespace CalamityMod.Items.Tools
Item.hammer = HammerPower;
Item.axe = AxePower;
Item.tileBoost += 5;
Item.scale = 1.5f;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
@@ -20,7 +20,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.height = 26;
Item.damage = 25;
Item.DamageType = DamageClass.Melee;
Item.scale = 1.5f;
Item.useTime = 24;
Item.useAnimation = 24;
Item.useStyle = ItemUseStyleID.Swing;
+1 -1
View File
@@ -30,11 +30,11 @@ namespace CalamityMod.Items.Weapons.Magic
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.UseSound = SoundID.Item9;
Item.scale = 0.9f;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<Icicle>();
Item.shootSpeed = 15f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (!Main.rand.NextBool(4))
-1
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 72;
Item.height = 72;
Item.scale = 1.2f;
Item.damage = 152;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = Item.useTime = 16;
+15 -89
View File
@@ -11,125 +11,51 @@ namespace CalamityMod.Items.Weapons.Melee
public class Aftershock : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
internal const float ShootSpeed = 12f;
public override void SetDefaults()
{
Item.width = 54;
Item.height = 58;
Item.damage = 65;
Item.DamageType = DamageClass.Melee;
Item.scale = 1.75f;
Item.useTime = 28;
Item.useAnimation = 28;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 7.5f;
Item.knockBack = 9f;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shootSpeed = 12f;
Item.shootSpeed = ShootSpeed;
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
var source = player.GetSource_ItemUse(Item);
target.AddBuff(ModContent.BuffType<ArmorCrunch>(), 300);
float rockSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX - Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY - Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = rockSpeed;
}
else
{
mouseDistance = rockSpeed / mouseDistance;
}
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)100;
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
mouseYDist *= -1f;
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = rockSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist;
float speedY5 = mouseYDist + (float)Main.rand.Next(-10, 11) * 0.02f;
Vector2 destination = Main.MouseWorld;
Vector2 position = destination - (Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f)) + (Vector2.UnitX * Main.rand.Next(-160, 161));
Vector2 velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed * Main.rand.NextFloat(0.9f, 1.1f);
int rockDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage);
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType<AftershockRock>(), rockDamage, hit.Knockback, player.whoAmI, 0f, (float)Main.rand.Next(10));
Projectile.NewProjectile(player.GetSource_ItemUse(Item), position, velocity, ModContent.ProjectileType<AftershockRock>(), rockDamage, hit.Knockback, player.whoAmI, 0f, (float)Main.rand.Next(10), target.Center.Y);
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
var source = player.GetSource_ItemUse(Item);
target.AddBuff(ModContent.BuffType<ArmorCrunch>(), 300);
float rockSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX - Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY - Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = rockSpeed;
}
else
{
mouseDistance = rockSpeed / mouseDistance;
}
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)100;
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
mouseYDist *= -1f;
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = rockSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist;
float speedY5 = mouseYDist + (float)Main.rand.Next(-10, 11) * 0.02f;
Vector2 destination = Main.MouseWorld;
Vector2 position = destination - (Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f)) + (Vector2.UnitX * Main.rand.Next(-160, 161));
Vector2 velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed * Main.rand.NextFloat(0.9f, 1.1f);
int rockDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage);
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType<AftershockRock>(), rockDamage, Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10));
Projectile.NewProjectile(player.GetSource_ItemUse(Item), position, velocity, ModContent.ProjectileType<AftershockRock>(), rockDamage, Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10), target.Center.Y);
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.NextBool(5))
{
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Sand);
}
if (Main.rand.NextBool(3))
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Sand);
}
}
}
+17 -28
View File
@@ -16,14 +16,13 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 80;
Item.height = 80;
Item.damage = 85;
Item.damage = 125;
Item.DamageType = DamageClass.Melee;
Item.scale = 1.5f;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 4f;
Item.knockBack = 6f;
Item.value = CalamityGlobalItem.Rarity9BuyPrice;
Item.rare = ItemRarityID.Cyan;
Item.UseSound = SoundID.Item1;
@@ -33,15 +32,9 @@ namespace CalamityMod.Items.Weapons.Melee
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) => target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
public override void MeleeEffects(Player player, Rectangle hitbox)
{
@@ -49,9 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>(), 0.7f, 55, 110, -0.07f, 0.07f);
if (d != null)
{
d.customData = 0.03f;
}
}
}
@@ -62,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee
return;
float lifeRatio = MathHelper.Clamp(target.life / (float)target.lifeMax, 0f, 1f);
float multiplier = MathHelper.Lerp(1f, 2f, lifeRatio);
float multiplier = MathHelper.Lerp(1f, 1.25f, lifeRatio);
modifiers.SourceDamage *= multiplier;
modifiers.Knockback *= multiplier;
@@ -70,21 +61,19 @@ namespace CalamityMod.Items.Weapons.Melee
if (Main.rand.NextBool((int)MathHelper.Clamp((Item.crit + player.GetCritChance<MeleeDamageClass>()) * multiplier, 0f, 99f), 100))
modifiers.SetCrit();
if (multiplier > 1.5f)
SoundEngine.PlaySound(SoundID.Item105, player.Center);
bool blue = Main.rand.NextBool();
float angleStart = Main.rand.NextFloat(0f, MathHelper.TwoPi);
float var = 0.05f + (1.25f - multiplier);
for (float angle = 0f; angle < MathHelper.TwoPi; angle += var)
{
SoundEngine.PlaySound(SoundID.Item105, player.Center);
bool blue = Main.rand.NextBool();
float angleStart = Main.rand.NextFloat(0f, MathHelper.TwoPi);
float var = 0.05f + (2f - multiplier);
for (float angle = 0f; angle < MathHelper.TwoPi; angle += var)
{
blue = !blue;
Vector2 velocity = angle.ToRotationVector2() * (2f + (float)(Math.Sin(angleStart + angle * 3f) + 1) * 2.5f) * Main.rand.NextFloat(0.95f, 1.05f);
Dust d = Dust.NewDustPerfect(target.Center, blue ? ModContent.DustType<AstralBlue>() : ModContent.DustType<AstralOrange>(), velocity);
d.customData = 0.025f;
d.scale = multiplier - 0.75f;
d.noLight = false;
}
blue = !blue;
Vector2 velocity = angle.ToRotationVector2() * (2f + (float)(Math.Sin(angleStart + angle * 3f) + 1) * 2.5f) * Main.rand.NextFloat(0.95f, 1.05f);
Dust d = Dust.NewDustPerfect(target.Center, blue ? ModContent.DustType<AstralBlue>() : ModContent.DustType<AstralOrange>(), velocity);
d.customData = 0.025f;
d.scale = multiplier;
d.noLight = false;
}
}
+1 -2
View File
@@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 64;
Item.height = 64;
Item.scale = 1.5f;
Item.damage = 100;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 35;
@@ -43,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee
for (int k = 0; k < totalProjectiles; k++)
{
Vector2 projRotation = spinningPoint.RotatedBy(radians * k);
Projectile.NewProjectile(source, target.Center, projRotation, type, bombDamage, hit.Knockback, Main.myPlayer);
Projectile.NewProjectile(source, target.Center, projRotation, type, bombDamage, hit.Knockback * 0.5f, Main.myPlayer);
}
}
+5 -4
View File
@@ -9,12 +9,12 @@ namespace CalamityMod.Items.Weapons.Melee
public class BalefulHarvester : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetDefaults()
{
Item.width = 74;
Item.height = 86;
Item.damage = 90;
Item.scale = 1.5f;
Item.damage = 135;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 22;
Item.useStyle = ItemUseStyleID.Swing;
@@ -26,17 +26,18 @@ namespace CalamityMod.Items.Weapons.Melee
Item.value = CalamityGlobalItem.Rarity10BuyPrice;
Item.rare = ItemRarityID.Red;
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
int type = Main.rand.NextBool() ? ModContent.ProjectileType<BalefulHarvesterProjectile>() : ProjectileID.FlamingJack;
CalamityPlayer.HorsemansBladeOnHit(player, target.whoAmI, (int)(Item.damage * 1.5f), Item.knockBack, 0, type);
CalamityPlayer.HorsemansBladeOnHit(player, target.whoAmI, (int)(Item.damage * 0.8f), Item.knockBack * 0.5f, 0, type);
target.AddBuff(BuffID.OnFire3, 300);
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
int type = Main.rand.NextBool() ? ModContent.ProjectileType<BalefulHarvesterProjectile>() : ProjectileID.FlamingJack;
CalamityPlayer.HorsemansBladeOnHit(player, -1, (int)(Item.damage * 1.5f), Item.knockBack, 0, type);
CalamityPlayer.HorsemansBladeOnHit(player, -1, (int)(Item.damage * 0.8f), Item.knockBack * 0.5f, 0, type);
target.AddBuff(BuffID.OnFire3, 300);
}
-1
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 56;
Item.height = 60;
Item.damage = 41;
Item.scale = 1.15f;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 40;
Item.useStyle = ItemUseStyleID.Swing;
-1
View File
@@ -24,7 +24,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = Item.height = 52;
Item.damage = 70;
Item.DamageType = DamageClass.Melee;
Item.scale = 1.5f;
Item.useAnimation = Item.useTime = 28;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
-1
View File
@@ -23,7 +23,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.useTurn = true;
Item.scale = 1.25f;
Item.value = CalamityGlobalItem.Rarity4BuyPrice;
Item.rare = ItemRarityID.LightRed;
}
+34 -86
View File
@@ -10,11 +10,15 @@ namespace CalamityMod.Items.Weapons.Melee
public class CometQuasher : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
internal const float ShootSpeed = 9f;
internal const int TotalMeteors = 2;
public override void SetDefaults()
{
Item.width = 46;
Item.height = 62;
Item.scale = 1.5f;
Item.damage = 141;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 22;
@@ -26,113 +30,57 @@ namespace CalamityMod.Items.Weapons.Melee
Item.autoReuse = true;
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.shootSpeed = 9f;
Item.shootSpeed = ShootSpeed;
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
var source = player.GetSource_ItemUse(Item);
float cometSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = cometSpeed;
}
else
{
mouseDistance = cometSpeed / mouseDistance;
}
Vector2 destination = Main.MouseWorld;
Vector2 position = destination - (Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f));
Vector2 cachedPosition = position;
for (int i = 0; i < 2; i++)
Vector2 velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Vector2 cachedVelocity = velocity;
int meteorDamage = player.CalcIntDamage<MeleeDamageClass>((int)(Item.damage * 0.5));
float meteorKnockback = Item.knockBack * 0.5f;
for (int i = 0; i < TotalMeteors; i++)
{
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X + (float)Main.rand.Next(-40, 41) * 0.03f;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
mouseYDist *= -1f;
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = cometSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float cometSpawnXOffset = mouseXDist;
float cometSpawnYOffset = mouseYDist + (float)Main.rand.Next(-40, 41) * 0.02f;
int proj = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, cometSpawnXOffset * 0.75f, cometSpawnYOffset * 0.75f, ModContent.ProjectileType<CometQuasherMeteor>(), (int)(Item.damage * 0.5f), Item.knockBack, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f);
position += Vector2.UnitX * Main.rand.Next(-320, 321);
velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed * Main.rand.NextFloat(0.9f, 1.1f);
int proj = Projectile.NewProjectile(player.GetSource_ItemUse(Item), position, velocity, ModContent.ProjectileType<CometQuasherMeteor>(), meteorDamage, meteorKnockback, player.whoAmI, 0f, 0.5f + Main.rand.NextFloat() * 0.3f, target.Center.Y);
Main.projectile[proj].Calamity().lineColor = Main.rand.Next(3);
position = cachedPosition;
velocity = cachedVelocity;
}
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
var source = player.GetSource_ItemUse(Item);
float cometSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = cometSpeed;
}
else
{
mouseDistance = cometSpeed / mouseDistance;
}
Vector2 destination = Main.MouseWorld;
Vector2 position = destination - (Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f));
Vector2 cachedPosition = position;
for (int i = 0; i < 2; i++)
Vector2 velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Vector2 cachedVelocity = velocity;
int meteorDamage = player.CalcIntDamage<MeleeDamageClass>((int)(Item.damage * 0.5));
float meteorKnockback = Item.knockBack * 0.5f;
for (int i = 0; i < TotalMeteors; i++)
{
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X + (float)Main.rand.Next(-40, 41) * 0.03f;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
mouseYDist *= -1f;
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = cometSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float cometSpawnXOffset = mouseXDist;
float cometSpawnYOffset = mouseYDist + (float)Main.rand.Next(-40, 41) * 0.02f;
int proj = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, cometSpawnXOffset * 0.75f, cometSpawnYOffset * 0.75f, ModContent.ProjectileType<CometQuasherMeteor>(), (int)(Item.damage * 0.5f), Item.knockBack, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f);
position += Vector2.UnitX * Main.rand.Next(-320, 321);
velocity *= Main.rand.NextFloat(0.9f, 1.1f);
int proj = Projectile.NewProjectile(player.GetSource_ItemUse(Item), position, velocity, ModContent.ProjectileType<CometQuasherMeteor>(), meteorDamage, meteorKnockback, player.whoAmI, 0f, 0.5f + Main.rand.NextFloat() * 0.3f, target.Center.Y);
Main.projectile[proj].Calamity().lineColor = Main.rand.Next(3);
position = cachedPosition;
velocity = cachedVelocity;
}
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.NextBool(3))
{
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Torch);
}
}
public override void AddRecipes()
-1
View File
@@ -17,7 +17,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 92;
Item.height = 104;
Item.scale = 1.5f;
Item.damage = 170;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 16;
-1
View File
@@ -11,7 +11,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 64;
Item.height = 66;
Item.scale = 2f;
Item.damage = 120;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 38;
@@ -15,7 +15,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 74;
Item.height = 74;
Item.scale = 1.5f;
Item.damage = 110;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 55;
+92 -103
View File
@@ -10,146 +10,135 @@ namespace CalamityMod.Items.Weapons.Melee
public class Greentide : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
internal const float ShootSpeed = 20f;
internal const float TeethSpread = 960f;
internal const float HalvedTeethSpread = TeethSpread * 0.5f;
internal const int TotalRows = 2;
internal const int TotalTeeth = 6;
public override void SetDefaults()
{
Item.width = 62;
Item.height = 62;
Item.damage = 95;
Item.DamageType = DamageClass.Melee;
Item.scale = 1.5f;
Item.useTime = 24;
Item.useAnimation = 24;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 7;
Item.knockBack = 7f;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
Item.rare = ItemRarityID.Lime;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shootSpeed = 18f;
Item.shootSpeed = ShootSpeed;
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
var source = player.GetSource_ItemUse(Item);
int i = Main.myPlayer;
float projSpeed = Item.shootSpeed;
float playerKnockback = hit.Knockback;
playerKnockback = player.GetWeaponKnockback(Item, playerKnockback);
player.itemTime = Item.useTime;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX - Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY - Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = projSpeed;
}
else
{
mouseDistance = projSpeed / mouseDistance;
}
Vector2 destination = Main.MouseWorld;
for (int j = 0; j < 3; j++)
Vector2 position = destination - (Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f));
Vector2 cachedPosition = position;
Vector2 secondPosition = cachedPosition + (Vector2.UnitY * (Main.screenHeight + 160f));
Vector2 secondCachedPosition = secondPosition;
Vector2 velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Vector2 cachedVelocity = velocity;
Vector2 secondVelocity = (Main.MouseWorld - secondPosition).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Vector2 secondCachedVelocity = secondVelocity;
int teethDamage = player.CalcIntDamage<MeleeDamageClass>((int)(Item.damage * 0.5));
float teethKnockback = Item.knockBack * 0.2f;
int centralProjectile = TotalTeeth / 2;
int otherCentralProjectile = centralProjectile - 1;
float teethXVelocityReduction = 0.9f;
float minVelocityAdjustment = 0.8f;
float maxVelocityAdjustment = 1f;
float velocityAdjustment = minVelocityAdjustment;
for (int i = 0; i < TotalRows; i++)
{
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * j);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
bool topTeeth = i == 0;
for (int j = 0; j < TotalTeeth; j++)
{
mouseYDist *= -1f;
velocityAdjustment = (j == centralProjectile || j == otherCentralProjectile) ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs((j + 0.5f) - centralProjectile) / (float)centralProjectile);
if (topTeeth)
{
position.X += MathHelper.Lerp(-HalvedTeethSpread, HalvedTeethSpread, j / (float)(TotalTeeth - 1));
velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Projectile.NewProjectile(player.GetSource_ItemUse(Item), position, new Vector2(velocity.X * teethXVelocityReduction, velocity.Y) * velocityAdjustment, ModContent.ProjectileType<GreenWater>(), teethDamage, teethKnockback, player.whoAmI, 0f, i, target.Center.Y);
position = cachedPosition;
velocity = cachedVelocity;
}
else
{
secondPosition.X += MathHelper.Lerp(-HalvedTeethSpread, HalvedTeethSpread, j / (float)(TotalTeeth - 1));
secondVelocity = (Main.MouseWorld - secondPosition).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Projectile.NewProjectile(player.GetSource_ItemUse(Item), secondPosition, new Vector2(secondVelocity.X * teethXVelocityReduction, secondVelocity.Y) * velocityAdjustment, ModContent.ProjectileType<GreenWater>(), teethDamage, teethKnockback, player.whoAmI, 0f, i, target.Center.Y);
secondPosition = secondCachedPosition;
secondVelocity = secondCachedVelocity;
}
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = projSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist;
float speedY5 = mouseYDist + (float)Main.rand.Next(-180, 181) * 0.02f;
int greenWaterDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage);
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType<GreenWater>(), greenWaterDamage, playerKnockback, i, 0f, (float)Main.rand.Next(10));
}
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
var source = player.GetSource_ItemUse(Item);
int i = Main.myPlayer;
float projSpeed = Item.shootSpeed;
float playerKnockback = Item.knockBack;
playerKnockback = player.GetWeaponKnockback(Item, playerKnockback);
player.itemTime = Item.useTime;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX - Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY - Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = projSpeed;
}
else
{
mouseDistance = projSpeed / mouseDistance;
}
Vector2 destination = Main.MouseWorld;
for (int j = 0; j < 4; j++)
Vector2 position = destination - (Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f));
Vector2 cachedPosition = position;
Vector2 secondPosition = cachedPosition + (Vector2.UnitY * (Main.screenHeight + 160f));
Vector2 secondCachedPosition = secondPosition;
Vector2 velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Vector2 cachedVelocity = velocity;
Vector2 secondVelocity = (Main.MouseWorld - secondPosition).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Vector2 secondCachedVelocity = secondVelocity;
int teethDamage = player.CalcIntDamage<MeleeDamageClass>((int)(Item.damage * 0.5));
float teethKnockback = Item.knockBack * 0.2f;
int centralProjectile = TotalTeeth / 2;
int otherCentralProjectile = centralProjectile - 1;
float teethXVelocityReduction = 0.9f;
float minVelocityAdjustment = 0.8f;
float maxVelocityAdjustment = 1f;
float velocityAdjustment = minVelocityAdjustment;
for (int i = 0; i < TotalRows; i++)
{
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * j);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
bool topTeeth = i == 0;
for (int j = 0; j < TotalTeeth; j++)
{
mouseYDist *= -1f;
velocityAdjustment = (j == centralProjectile || j == otherCentralProjectile) ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs((j + 0.5f) - centralProjectile) / (float)centralProjectile);
if (topTeeth)
{
position.X += MathHelper.Lerp(-HalvedTeethSpread, HalvedTeethSpread, j / (float)(TotalTeeth - 1));
velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Projectile.NewProjectile(player.GetSource_ItemUse(Item), position, new Vector2(velocity.X * teethXVelocityReduction, velocity.Y) * velocityAdjustment, ModContent.ProjectileType<GreenWater>(), teethDamage, teethKnockback, player.whoAmI, 0f, i, target.Center.Y);
position = cachedPosition;
velocity = cachedVelocity;
}
else
{
secondPosition.X += MathHelper.Lerp(-HalvedTeethSpread, HalvedTeethSpread, j / (float)(TotalTeeth - 1));
secondVelocity = (Main.MouseWorld - secondPosition).SafeNormalize(Vector2.UnitY) * ShootSpeed;
Projectile.NewProjectile(player.GetSource_ItemUse(Item), secondPosition, new Vector2(secondVelocity.X * teethXVelocityReduction, secondVelocity.Y) * velocityAdjustment, ModContent.ProjectileType<GreenWater>(), teethDamage, teethKnockback, player.whoAmI, 0f, i, target.Center.Y);
secondPosition = secondCachedPosition;
secondVelocity = secondCachedVelocity;
}
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = projSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist;
float speedY5 = mouseYDist + (float)Main.rand.Next(-180, 181) * 0.02f;
int greenWaterDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage);
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType<GreenWater>(), greenWaterDamage, playerKnockback, i, 0f, (float)Main.rand.Next(10));
}
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
int randomDust = Main.rand.Next(2);
if (randomDust == 0)
{
randomDust = 33;
}
else
{
randomDust = 89;
}
if (Main.rand.NextBool(4))
{
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, randomDust);
}
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool() ? 33 : 89);
}
}
}
-1
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 84;
Item.height = 84;
Item.scale = 1f;
Item.damage = 180;
Item.DamageType = DamageClass.Melee;
Item.useTime = Item.useAnimation = 30;
-1
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 94;
Item.height = 80;
Item.scale = 1.5f;
Item.damage = 270;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 22;
-1
View File
@@ -20,7 +20,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.damage = 323;
Item.knockBack = 5.5f;
Item.scale = 1.5f;
Item.useStyle = ItemUseStyleID.Swing;
Item.useAnimation = 15;
Item.useTime = 15;
-1
View File
@@ -11,7 +11,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 100;
Item.height = 100;
Item.scale = 1.5f;
Item.damage = 70;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 22;
-1
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 90;
Item.height = 100;
Item.scale = 1.6f;
Item.damage = 450;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 25;
-1
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 46;
Item.height = 46;
Item.damage = 60;
Item.scale = 1.4f;
Item.DamageType = DamageClass.Melee;
Item.useTurn = true;
Item.useAnimation = 27;
-1
View File
@@ -21,7 +21,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.knockBack = 5.5f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.scale = 1.1f;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
}
-1
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 100;
Item.height = 100;
Item.scale = 1.5f;
Item.damage = 890;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 17;
-1
View File
@@ -17,7 +17,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 94;
Item.height = 94;
Item.scale = 1.5f;
Item.DamageType = DamageClass.Melee;
Item.damage = 360;
Item.knockBack = 8.5f;
-1
View File
@@ -16,7 +16,6 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 90;
Item.height = 90;
Item.scale = 1.5f;
Item.damage = 483;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 18;
-1
View File
@@ -13,7 +13,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 46;
Item.height = 58;
Item.damage = 69;
Item.scale = 1.75f;
Item.knockBack = 80f; //This number doesn't mean anything, but it's not 9001f because that caused bugs.
Item.useAnimation = Item.useTime = 12;
Item.DamageType = DamageClass.Melee;
-1
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.DamageType = DamageClass.Melee;
Item.useTurn = true;
Item.rare = ItemRarityID.Yellow;
Item.scale = 1.5f;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Swing;
-1
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.Items.Weapons.Summon
Item.damage = 9;
Item.mana = 10;
Item.useTime = Item.useAnimation = 30;
Item.scale = 0.85f;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 2.25f;
-1
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.Items.Weapons.Summon
Item.damage = 11;
Item.mana = 10;
Item.useTime = Item.useAnimation = 35;
Item.scale = 0.75f;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 2f;
+1 -1
View File
@@ -374,7 +374,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
NPC.localAI[0] = 0f;
int totalProjectiles = bossRush ? 20 : 10;
int totalProjectiles = bossRush ? 20 : death ? 15 : 10;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ProjectileID.FrostBeam;
int damage = NPC.GetProjectileDamage(type);
+11 -5
View File
@@ -151,8 +151,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.velocity = Vector2.Zero;
npc.netUpdate = true;
if (!NPC.AnyNPCs(NPCID.AncientCultistSquidhead))
NPC.NewNPC(npc.GetSource_FromAI(), (int)Main.projectile[(int)npc.ai[2]].Center.X, (int)Main.projectile[(int)npc.ai[2]].Center.Y, NPCID.AncientCultistSquidhead);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (!NPC.AnyNPCs(NPCID.AncientCultistSquidhead))
NPC.NewNPC(npc.GetSource_FromAI(), (int)Main.projectile[(int)npc.ai[2]].Center.X, (int)Main.projectile[(int)npc.ai[2]].Center.Y, NPCID.AncientCultistSquidhead);
}
Main.projectile[(int)npc.ai[2]].ai[1] = -1f;
Main.projectile[(int)npc.ai[2]].netUpdate = true;
@@ -1327,10 +1330,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
}
if (expertMode)
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (!NPC.AnyNPCs(NPCID.AncientCultistSquidhead))
NPC.NewNPC(npc.GetSource_FromAI(), (int)Main.projectile[(int)npc.ai[2]].Center.X, (int)Main.projectile[(int)npc.ai[2]].Center.Y, NPCID.AncientCultistSquidhead);
if (expertMode)
{
if (!NPC.AnyNPCs(NPCID.AncientCultistSquidhead))
NPC.NewNPC(npc.GetSource_FromAI(), (int)Main.projectile[(int)npc.ai[2]].Center.X, (int)Main.projectile[(int)npc.ai[2]].Center.Y, NPCID.AncientCultistSquidhead);
}
}
Main.projectile[(int)npc.ai[2]].ai[1] = -1f;
@@ -359,7 +359,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
npc.localAI[0] = 0f;
int totalProjectiles = bossRush ? 24 : 12;
int totalProjectiles = bossRush ? 24 : death ? 18 : 12;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ProjectileID.DeathLaser;
int damage = npc.GetProjectileDamage(type);
@@ -506,7 +506,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int type = ProjectileID.Skull;
headCenter += value * 5f;
int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, 250, 0f, Main.myPlayer, -1f, 0f);
int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, 250, 0f, Main.myPlayer, -3f, 0f);
Main.projectile[enragedSkulls].timeLeft = 300;
}
}
@@ -638,8 +638,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
damage = (int)(damage * secondMechMultiplier);
}
headCenter += value * 5f;
int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, damage, 0f, Main.myPlayer, -1f, 0f);
if (npc.localAI[0] % 3f == 0f)
{
int probeLimit = death ? 4 : 2;
if (NPC.CountNPCS(NPCID.Probe) < probeLimit)
NPC.NewNPC(npc.GetSource_FromAI(), (int)headCenter.X, (int)headCenter.Y + 30, NPCID.Probe);
}
int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, damage, 0f, Main.myPlayer, -3f, 0f);
Main.projectile[enragedSkulls].timeLeft = 480;
Main.projectile[enragedSkulls].tileCollide = false;
}
@@ -673,13 +679,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation = npc.velocity.X / 15f;
float flightVelocity = bossRush ? 25f : death ? 20f : 15f;
float flightAcceleration = bossRush ? 0.25f : death ? 0.2f : 0.15f;
float flightVelocity = bossRush ? 30f : death ? 24f : 18f;
float flightAcceleration = bossRush ? 0.5f : death ? 0.4f : 0.3f;
if (masterMode)
{
flightVelocity += 5f;
flightAcceleration += 0.05f;
flightAcceleration += 0.1f;
}
Vector2 destination = new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y - 500f);
@@ -687,7 +693,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Spit homing missiles and then go to floating phase
npc.localAI[3] += 1f;
if (Vector2.Distance(npc.Center, destination) < 160f || npc.ai[2] > 0f || npc.localAI[3] > 120f)
if (Vector2.Distance(npc.Center, destination) < 80f || npc.ai[2] > 0f || npc.localAI[3] > 120f)
{
float missileSpawnDivisor = death ? (masterMode ? 6f : 8f) : (masterMode ? 9f : 12f);
float totalMissiles = masterMode ? 12f : 10f;
@@ -698,9 +704,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 velocity = new Vector2(-1f * (float)Main.rand.NextDouble() * 3f, 1f);
Vector2 velocity = new Vector2(-1f * (float)Main.rand.NextDouble() * 5f, 1f);
velocity = velocity.RotatedBy((Main.rand.NextDouble() - 0.5) * MathHelper.PiOver4);
velocity *= 0.25f;
int type = ProjectileID.RocketSkeleton;
int damage = npc.GetProjectileDamage(type);
@@ -715,7 +720,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
damage = (int)(damage * secondMechMultiplier);
}
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 4f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, npc.target, 1f);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 30f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, npc.target, 1f);
Main.projectile[proj].timeLeft = 540;
}
@@ -1225,12 +1230,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
damage = (int)(damage * secondMechMultiplier);
}
cannonArmTargetDist = 0.5f / cannonArmTargetDist;
float rocketSpeed = 10f;
cannonArmTargetDist = rocketSpeed / cannonArmTargetDist;
cannonArmTargetX *= cannonArmTargetDist;
cannonArmTargetY *= cannonArmTargetDist;
cannonArmPosition.X += cannonArmTargetX * 30f;
cannonArmPosition.Y += cannonArmTargetY * 30f;
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), cannonArmPosition.X, cannonArmPosition.Y, cannonArmTargetX, cannonArmTargetY, type, damage, 0f, Main.myPlayer, npc.target, 1f);
Vector2 rocketVelocity = new Vector2(cannonArmTargetX, cannonArmTargetY);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), cannonArmPosition + rocketVelocity.SafeNormalize(Vector2.UnitY) * 40f, rocketVelocity, type, damage, 0f, Main.myPlayer, npc.target, 1f);
Main.projectile[proj].timeLeft = 600;
}
}
@@ -1272,14 +1278,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
damage = (int)(damage * secondMechMultiplier);
}
Vector2 cannonSpreadTargetDist = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY);
cannonSpreadTargetDist *= 0.5f;
float rocketSpeed = 10f;
Vector2 cannonSpreadTargetDist = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * rocketSpeed;
int numProj = bossRush ? 5 : 3;
float rotation = MathHelper.ToRadians(bossRush ? 8 : 5);
float rotation = MathHelper.ToRadians(bossRush ? 15 : 9);
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = cannonSpreadTargetDist.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 30f, perturbedSpeed, type, damage, 0f, Main.myPlayer, npc.target, 1f);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 40f, perturbedSpeed, type, damage, 0f, Main.myPlayer, npc.target, 1f);
Main.projectile[proj].timeLeft = 600;
}
}
+14 -10
View File
@@ -285,8 +285,9 @@ namespace CalamityMod.Projectiles
bool fromRevSkeletron = projectile.ai[0] < 0f;
bool revSkeletronHomingSkull = projectile.ai[0] == -1f;
bool revSkeletronAcceleratingSkull = projectile.ai[0] == -2f;
bool revSkeletronPrimeHomingSkull = projectile.ai[0] == -3f;
if (revSkeletronHomingSkull)
if (revSkeletronHomingSkull || revSkeletronPrimeHomingSkull)
projectile.alpha = 0;
if (projectile.alpha > 0)
@@ -315,7 +316,7 @@ namespace CalamityMod.Projectiles
}
}
if (!revSkeletronHomingSkull)
if (!revSkeletronHomingSkull && !revSkeletronPrimeHomingSkull)
{
int numDust = revSkeletronAcceleratingSkull ? 1 : 2;
int dustType = revSkeletronAcceleratingSkull ? 91 : 6;
@@ -343,8 +344,10 @@ namespace CalamityMod.Projectiles
int num133 = 0;
num133 = Player.FindClosest(projectile.Center, 1, 1);
projectile.ai[1] += 1f;
float homingStartTime = 30f;
float homingStartTime = revSkeletronPrimeHomingSkull ? 10f : 30f;
float homingEndTime = (Main.masterMode || BossRushEvent.BossRushActive) ? 150f : CalamityWorld.death ? 105f : 90f;
if (revSkeletronPrimeHomingSkull)
homingEndTime += 60f;
// Stop homing when within a certain distance of the target
if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < 80f && projectile.ai[1] < homingEndTime)
@@ -356,7 +359,7 @@ namespace CalamityMod.Projectiles
Vector2 vector24 = Main.player[num133].Center - projectile.Center;
vector24.Normalize();
vector24 *= num134;
float inertia = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 25f : 30f;
float inertia = (CalamityWorld.death || BossRushEvent.BossRushActive) ? (revSkeletronPrimeHomingSkull ? 20f : 25f) : (revSkeletronPrimeHomingSkull ? 25f : 30f);
projectile.velocity = (projectile.velocity * (inertia - 1f) + vector24) / inertia;
projectile.velocity.Normalize();
projectile.velocity *= num134;
@@ -2177,16 +2180,17 @@ namespace CalamityMod.Projectiles
else if (projectile.type == ProjectileID.RocketSkeleton && projectile.ai[1] == 1f)
{
bool homeIn = false;
float spreadOutCutoffTime = 510f;
float homeInCutoffTime = 420f;
float minAcceleration = masterMode ? 0.1f : 0.05f;
float maxAcceleration = masterMode ? 0.2f : 0.1f;
float homingVelocity = 25f;
float homingTime = masterMode ? 210f : 150f;
float spreadOutCutoffTime = 555f;
float homeInCutoffTime = spreadOutCutoffTime - homingTime;
float minAcceleration = 0.04f;
float maxAcceleration = 0.08f;
float homingVelocity = 24f;
if (projectile.timeLeft > homeInCutoffTime && projectile.timeLeft <= spreadOutCutoffTime)
homeIn = true;
else if (projectile.velocity.Length() < (masterMode ? 20f : 15f))
projectile.velocity *= 1.1f;
projectile.velocity *= 1.01f;
if (homeIn)
{
+13 -3
View File
@@ -5,19 +5,29 @@ namespace CalamityMod.Projectiles.Melee
public class AftershockRock : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override void SetDefaults()
{
Projectile.width = 32;
Projectile.height = 34;
Projectile.aiStyle = ProjAIStyleID.GroundProjectile;
Projectile.friendly = true;
Projectile.penetrate = 6;
Projectile.extraUpdates = 1;
Projectile.penetrate = 3;
Projectile.MaxUpdates = 3;
Projectile.DamageType = DamageClass.Melee;
Projectile.ignoreWater = true;
AIType = ProjectileID.BoulderStaffOfEarth;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates;
Projectile.tileCollide = false;
}
public override void AI()
{
if (Projectile.Center.Y > Projectile.ai[2])
Projectile.tileCollide = true;
else
Projectile.tileCollide = false;
}
}
}
@@ -158,11 +158,11 @@ namespace CalamityMod.Projectiles.Melee
target.AddBuff(BuffID.OnFire3, 240);
if (Projectile.owner == Main.myPlayer)
{
for (int k = 0; k < 2; k++)
int maxProjectiles = 2;
for (int k = 0; k < maxProjectiles; k++)
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.InfernoFork, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Main.rand.Next(-35, 36) * 0.2f, Main.rand.Next(-35, 36) * 0.2f, ModContent.ProjectileType<TinyFlare>(),
(int)(Projectile.damage * 0.35), Projectile.knockBack * 0.35f, Main.myPlayer, 0f, 0f);
Vector2 flareVelocity = Main.rand.NextVector2CircularEdge(3.5f, 3.5f) + Projectile.oldVelocity;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, flareVelocity, ModContent.ProjectileType<TinyFlare>(), (int)(Projectile.damage * 0.35), Projectile.knockBack * 0.35f, Main.myPlayer);
}
}
}
+16
View File
@@ -4,11 +4,13 @@ using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class CometQuasherMeteor : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
@@ -27,6 +29,14 @@ namespace CalamityMod.Projectiles.Melee
AIType = ProjectileID.Meteor1;
}
public override void AI()
{
if (Projectile.Center.Y > Projectile.ai[2])
Projectile.tileCollide = true;
else
Projectile.tileCollide = false;
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
@@ -42,9 +52,12 @@ namespace CalamityMod.Projectiles.Melee
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item89, Projectile.position);
Projectile.ExpandHitboxBy((int)(128f * Projectile.scale));
for (int i = 0; i < 8; ++i)
Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.Smoke, 0.0f, 0.0f, 100, new Color(), 1.5f);
for (int j = 0; j < 32; ++j)
{
int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 2.5f);
@@ -56,6 +69,7 @@ namespace CalamityMod.Projectiles.Melee
dust2.velocity *= 2f;
dust2.noGravity = true;
}
if (Main.netMode != NetmodeID.Server)
{
for (int j = 0; j < 2; ++j)
@@ -67,6 +81,7 @@ namespace CalamityMod.Projectiles.Melee
gore.velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
}
}
if (Projectile.owner == Main.myPlayer)
{
Projectile.usesLocalNPCImmunity = true;
@@ -75,6 +90,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.maxPenetrate = 0;
Projectile.Damage();
}
for (int j = 0; j < 5; ++j)
{
int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Utils.SelectRandom<int>(Main.rand, new int[3] { 6, 259, 158 }), 2.5f * (float)Projectile.direction, -2.5f, 0, new Color(), 1f);
+32 -16
View File
@@ -10,6 +10,9 @@ namespace CalamityMod.Projectiles.Melee
public class GreenWater : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
private const int TimeLeft = 300;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
@@ -24,28 +27,45 @@ namespace CalamityMod.Projectiles.Melee
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = 1;
Projectile.timeLeft = 150;
Projectile.timeLeft = TimeLeft;
Projectile.DamageType = DamageClass.Melee;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0f, 0.25f, 0.5f);
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 0.785f;
if (Projectile.ai[1] == 0f)
{
if (Projectile.Center.Y > Projectile.ai[2])
Projectile.tileCollide = true;
else
Projectile.tileCollide = false;
}
else
{
if (Projectile.Center.Y < Projectile.ai[2])
Projectile.tileCollide = true;
else
Projectile.tileCollide = false;
}
Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0f);
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + MathHelper.PiOver4;
if (Projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SoundID.Item21, Projectile.position);
Projectile.localAI[0] += 1f;
}
int hitDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.Blood, 0f, 0f, 100, default, 1f);
Main.dust[hitDust].noGravity = true;
Main.dust[hitDust].velocity *= 0.5f;
Main.dust[hitDust].velocity += Projectile.velocity * 0.1f;
int blood = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.Blood, 0f, 0f, 100, default, Main.rand.NextFloat(1.6f, 2.4f));
Main.dust[blood].noGravity = true;
Main.dust[blood].velocity *= 0.5f;
}
public override bool PreDraw(ref Color lightColor)
{
if (Projectile.timeLeft > 145)
if (Projectile.timeLeft > TimeLeft - 5)
return false;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
@@ -54,9 +74,9 @@ namespace CalamityMod.Projectiles.Melee
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item10, Projectile.Center);
int inc;
for (int i = 4; i < 31; i = inc + 1)
SoundEngine.PlaySound(SoundID.NPCDeath12, Projectile.Center);
for (int i = 4; i < 31; i++)
{
float oldXPos = Projectile.oldVelocity.X * (30f / (float)i);
float oldYPos = Projectile.oldVelocity.Y * (30f / (float)i);
@@ -67,13 +87,9 @@ namespace CalamityMod.Projectiles.Melee
killDust = Dust.NewDust(new Vector2(Projectile.oldPosition.X - oldXPos, Projectile.oldPosition.Y - oldYPos), 8, 8, DustID.Blood, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, 100, default, 1.4f);
dust = Main.dust[killDust];
dust.velocity *= 0.05f;
inc = i;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Venom, 90);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Venom, 90);
}
}
+1
View File
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.DamageType = DamageClass.Melee;
Projectile.penetrate = 1;
Projectile.timeLeft = 180;
Projectile.tileCollide = false;
}
public override bool? CanDamage() => Projectile.ai[0] >= 120f;
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee
{
for (int i = 0; i < 3; i++)
{
int fiery = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.InfernoFork, 0f, 0f, 100, default, 0.75f);
int fiery = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.InfernoFork, 0f, 0f, 100, default, Main.rand.NextFloat(1.5f, 2.5f));
Main.dust[fiery].noGravity = true;
Main.dust[fiery].velocity *= 0f;
}