diff --git a/Buffs/DamageOverTime/HeavyBleeding.cs b/Buffs/DamageOverTime/HeavyBleeding.cs new file mode 100644 index 0000000000..e44fb8e344 --- /dev/null +++ b/Buffs/DamageOverTime/HeavyBleeding.cs @@ -0,0 +1,20 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class HeavyBleeding : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Heavy Bleeding"); + Description.SetDefault("You're losing a lot of blood"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) => player.Calamity().waterLeechBleeding = true; + } +} diff --git a/Buffs/DamageOverTime/HeavyBleeding.png b/Buffs/DamageOverTime/HeavyBleeding.png new file mode 100644 index 0000000000..26ea11ef6b Binary files /dev/null and b/Buffs/DamageOverTime/HeavyBleeding.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d4c11c1220..01f9fe0715 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -777,6 +777,7 @@ namespace CalamityMod.CalPlayer public bool vaporfied = false; public bool energyShellCooldown = false; public bool prismaticCooldown = false; + public bool waterLeechBleeding = false; #endregion #region Buff @@ -1793,6 +1794,7 @@ namespace CalamityMod.CalPlayer vaporfied = false; energyShellCooldown = false; prismaticCooldown = false; + waterLeechBleeding = false; revivify = false; trinketOfChiBuff = false; @@ -2138,11 +2140,12 @@ namespace CalamityMod.CalPlayer vaporfied = false; energyShellCooldown = false; prismaticCooldown = false; - #endregion + waterLeechBleeding = false; + #endregion - #region Rogue - // Stealth - rogueStealth = 0f; + #region Rogue + // Stealth + rogueStealth = 0f; rogueStealthMax = 0f; stealthAcceleration = 1f; @@ -4224,6 +4227,10 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(player.name + " fell prey to their sins."); } + if (waterLeechBleeding && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8) + { + damageSource = PlayerDeathReason.ByCustomReason(player.name + " lost too much blood."); + } if (shadowflame && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8) { damageSource = PlayerDeathReason.ByCustomReason(player.name + "'s spirit was turned to ash."); @@ -7899,7 +7906,7 @@ namespace CalamityMod.CalPlayer } if (BossRushEvent.BossRushActive && CalamityConfig.Instance.BossRushImmunityFrameCurse) { - bossRushImmunityFrameCurseTimer = 300 + player.immuneTime; + bossRushImmunityFrameCurseTimer = 180 + player.immuneTime; } if (damage > 25) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 77ebb26d24..2385889ac0 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -202,7 +202,20 @@ namespace CalamityMod.CalPlayer lifeRegenLost += 16; } - if (modPlayer.pFlames) + if (modPlayer.waterLeechBleeding) + { + if (player.lifeRegen > 0) + player.lifeRegen = 0; + + player.lifeRegenTime = 0; + lifeRegenLost += 6; + if (CalamityWorld.downedAquaticScourge) + lifeRegenLost += 6; + if (CalamityWorld.downedPolterghast) + lifeRegenLost += 12; + } + + if (modPlayer.pFlames) { if (player.lifeRegen > 0) player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index d5cb798ec4..a21a913ce2 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -127,19 +127,33 @@ namespace CalamityMod.CalPlayer float aiTimer = Main.npc[CalamityGlobalNPC.holyBoss].ai[3]; float baseDistance = 2800f; - float shorterFlameCocoonDistance = 1000f; - float shorterSpearCocoonDistance = 1400f; + float shorterFlameCocoonDistance = CalamityWorld.death ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; + float shorterSpearCocoonDistance = CalamityWorld.death ? 1000f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; float shorterDistance = aiState == 2f ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; - float maxDistance = (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; + bool guardianAlive = false; + if (CalamityGlobalNPC.holyBossAttacker != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossDefender != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossDefender].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossHealer != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossHealer].active) + guardianAlive = true; + } + + float maxDistance = guardianAlive ? baseDistance : (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; float drawDarknessDistance = maxDistance - 400f; float intensityScalar = MathHelper.Lerp(0f, 0.9f, MathHelper.Clamp((x - drawDarknessDistance) / 400f, 0f, 1f)); if (!Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Calamity().ZoneAbyss && !Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].headcovered) ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, 1f, intensityScalar); - - // Return to prevent running other darkness code - return; } } } @@ -275,9 +289,10 @@ namespace CalamityMod.CalPlayer else { - // If any boss is alive (or you are between DoG phases), you gain adrenaline smoothly. + // If any boss is alive (or you are between DoG phases or Boss Rush is active), you gain adrenaline smoothly. // EXCEPTION: Wall of Flesh is alive and you are not in hell. Then you don't get anything. - if ((CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0) && !wofAndNotHell) + if ((CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0 || BossRushEvent.BossRushActive) && + !wofAndNotHell) { int numAdrenBoosts = (modPlayer.adrenalineBoostOne ? 1 : 0) + diff --git a/CalamityConfig.cs b/CalamityConfig.cs index f0b38ccf3d..02f132d1c7 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -128,6 +128,24 @@ namespace CalamityMod [Tooltip("Sets Reactive Boss DR to always be full strength, even if the boss has already been defeated.\nIf disabled, the effect is only 66% as powerful after the boss has been defeated.\n\nReactive Boss DR makes bosses smoothly take less damage if they are being killed very quickly.\nIn most cases, the system has no noticeable effect.")] public bool FullPowerReactiveBossDR { get; set; } + [Label("Let Town NPCs spawn at night.")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Allows you to determine if town NPCs (including the Old Man) can spawn at night.")] + public bool CanTownNPCsSpawnAtNight { get; set; } + + private const int MinTownNPCSpawnMultiplier = 1; + private const int MaxTownNPCSpawnMultiplier = 10; + + [Label("Town NPC Spawn Rate Multiplier")] + [BackgroundColor(192, 54, 64, 192)] + [Range(MinTownNPCSpawnMultiplier, MaxTownNPCSpawnMultiplier)] + [Increment(1)] + [DrawTicks] + [DefaultValue(MinTownNPCSpawnMultiplier)] + [Tooltip("Makes town NPCs spawn more quickly, the higher this value is.")] + public int TownNPCSpawnRateMultiplier { get; set; } + private const float MinBossHealthBoost = 0f; private const float MaxBossHealthBoost = 900f; @@ -258,7 +276,7 @@ namespace CalamityMod [Label("Immunity Frame Curse")] [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] - [Tooltip("During the Boss Rush, being hit twice within five seconds will cause instant death.\nThis effect ignores revives.")] + [Tooltip("During the Boss Rush, being hit twice within three seconds will cause instant death.\nThis effect ignores revives.")] public bool BossRushImmunityFrameCurse { get; set; } [Label("Xeroc Curse")] diff --git a/CalamityLists.cs b/CalamityLists.cs index f94ca8d5ec..98ab5c2a9f 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -402,6 +402,7 @@ namespace CalamityMod ProjectileID.VortexBeater, ProjectileID.DD2PhoenixBow, ProjectileID.LastPrism, + ProjectileID.LastPrismLaser, ProjectileID.LaserMachinegun, ProjectileID.ChargedBlasterCannon, ProjectileID.MedusaHead, @@ -418,7 +419,10 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), + // ModContent.ProjectileType(), // TODO: ADD THE APOTHEOSIS WORM HERE LATER. IT IS IN A DIFFERENT BRANCH AS OF WRITING THIS. ModContent.ProjectileType(), ModContent.ProjectileType(), diff --git a/CalamityMod.cs b/CalamityMod.cs index 7e77e19751..d80500291a 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -815,6 +815,13 @@ namespace CalamityMod return true; }, InterfaceScaleType.None)); + // Mode Indicator UI. + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Mode Indicator UI", delegate () + { + ModeIndicatorUI.Draw(Main.spriteBatch); + return true; + }, InterfaceScaleType.UI)); + // Astral Arcanum overlay (if open) layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () { @@ -1338,11 +1345,28 @@ namespace CalamityMod float aiTimer = Main.npc[CalamityGlobalNPC.holyBoss].ai[3]; float baseDistance = 2800f; - float shorterFlameCocoonDistance = 1000f; - float shorterSpearCocoonDistance = 1400f; + float shorterFlameCocoonDistance = CalamityWorld.death ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; + float shorterSpearCocoonDistance = CalamityWorld.death ? 1000f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; float shorterDistance = aiState == 2f ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; - float maxDistance = (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; + bool guardianAlive = false; + if (CalamityGlobalNPC.holyBossAttacker != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossDefender != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossDefender].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossHealer != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossHealer].active) + guardianAlive = true; + } + + float maxDistance = guardianAlive ? baseDistance : (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; float drawDarknessDistance = maxDistance - 400f; float intensityScalar = MathHelper.Lerp(0f, 0.9f, MathHelper.Clamp((x - drawDarknessDistance) / 400f, 0f, 1f)); scale -= intensityScalar; diff --git a/ExtraTextures/UI/ModeIndicatorArea.png b/ExtraTextures/UI/ModeIndicatorArea.png new file mode 100644 index 0000000000..701089c3cc Binary files /dev/null and b/ExtraTextures/UI/ModeIndicatorArea.png differ diff --git a/ExtraTextures/UI/ModeIndicatorArma.png b/ExtraTextures/UI/ModeIndicatorArma.png new file mode 100644 index 0000000000..d5e6ea594e Binary files /dev/null and b/ExtraTextures/UI/ModeIndicatorArma.png differ diff --git a/ExtraTextures/UI/ModeIndicatorDeath.png b/ExtraTextures/UI/ModeIndicatorDeath.png new file mode 100644 index 0000000000..5cb843a4e0 Binary files /dev/null and b/ExtraTextures/UI/ModeIndicatorDeath.png differ diff --git a/ExtraTextures/UI/ModeIndicatorRev.png b/ExtraTextures/UI/ModeIndicatorRev.png new file mode 100644 index 0000000000..b1209d63f8 Binary files /dev/null and b/ExtraTextures/UI/ModeIndicatorRev.png differ diff --git a/ExtraTextures/UI/ModeIndicatorRune.png b/ExtraTextures/UI/ModeIndicatorRune.png new file mode 100644 index 0000000000..51a2ed08d5 Binary files /dev/null and b/ExtraTextures/UI/ModeIndicatorRune.png differ diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 4147572b5e..b4056fd154 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -3,6 +3,7 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using System; using System.Collections.Generic; +using System.Reflection; using Terraria; using Terraria.GameInput; using Terraria.ID; @@ -27,8 +28,13 @@ namespace CalamityMod.ILEditing /// public static void Initialize() { + var spawnTownNPCMethod = typeof(Main).GetMethod("UpdateTime_SpawnTownNPCs", BindingFlags.Static | BindingFlags.NonPublic); + cachedUpdateTime_SpawnTownNPCs = Delegate.CreateDelegate(typeof(Action), spawnTownNPCMethod) as Action; + + On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; ApplyLifeBytesChanges(); SlideDungeonOver(); + AlterTownNPCSpawnRate(); LabDoorFixes(); PreventStupidTreesNearOcean(); } @@ -72,6 +78,48 @@ namespace CalamityMod.ILEditing On.Terraria.WorldGen.OpenDoor += LabDoorsOpen; On.Terraria.WorldGen.CloseDoor += LabDoorsClose; } + + private static void PreventBossSlimeRainSpawns(On.Terraria.NPC.orig_SlimeRainSpawns orig, int plr) + { + if (!Main.player[plr].Calamity().bossZen) + orig(plr); + } + + private static Action cachedUpdateTime_SpawnTownNPCs; + + private static void AlterTownNPCSpawnRate() + { + IL.Terraria.Main.UpdateTime += (il) => + { + // Don't do town NPC spawning at the end (after a !Main.dayTime return). + // Do it at the beginning in spite of time. + + var cursor = new ILCursor(il); + cursor.EmitDelegate(() => + { + // A cached delegate is used here instead of direct reflection for performance reasons + // since UpdateTime is called every frame. + if (Main.dayTime || CalamityConfig.Instance.CanTownNPCsSpawnAtNight) + cachedUpdateTime_SpawnTownNPCs(); + }); + + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCallOrCallvirt
("UpdateTime_SpawnTownNPCs"))) + { + CalamityMod.Instance.Logger.Warn("Town NPC spawn editing code failed."); + return; + } + + cursor.Emit(OpCodes.Ret); + }; + + On.Terraria.Main.UpdateTime_SpawnTownNPCs += (orig) => + { + int oldWorldRate = Main.worldRate; + Main.worldRate *= CalamityConfig.Instance.TownNPCSpawnRateMultiplier; + orig(); + Main.worldRate = oldWorldRate; + }; + } #endregion #region IL Editing Injection Functions diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index 436a162c75..be8033ab9b 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Elemental Quiver"); Tooltip.SetDefault("Ranged projectiles have a chance to split\n" + - "10% increased ranged damage, 5% increased ranged critical strike chance, and 20% reduced ammo usage\n" + + "15% increased ranged damage, 5% increased ranged critical strike chance, and 20% reduced ammo usage\n" + "5 increased defense, 2 increased life regen, and 15% increased pick speed\n" + "Greatly increases arrow speed and grants a 20% chance to not consume arrows"); } @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.eQuiver = true; - player.rangedDamage += 0.1f; + player.rangedDamage += 0.15f; player.rangedCrit += 5; player.ammoCost80 = true; player.lifeRegen += 2; diff --git a/Items/Armor/DemonshadeBreastplate.cs b/Items/Armor/DemonshadeBreastplate.cs index 1614e94852..f61bea8cd9 100644 --- a/Items/Armor/DemonshadeBreastplate.cs +++ b/Items/Armor/DemonshadeBreastplate.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(4, 0, 0, 0); item.defense = 50; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DemonshadeGreaves.cs b/Items/Armor/DemonshadeGreaves.cs index 246b10d6b0..4149f9ef56 100644 --- a/Items/Armor/DemonshadeGreaves.cs +++ b/Items/Armor/DemonshadeGreaves.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(3, 0, 0, 0); item.defense = 50; //15 - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index 3b0de642b0..77c94edcfd 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(5, 0, 0, 0); item.defense = 50; //15 - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index de7826354c..b74c19de94 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; @@ -261,16 +262,16 @@ namespace CalamityMod.Items if (player.whoAmI == Main.myPlayer) { if (item.melee) - Projectile.NewProjectile(position, velocity * 0.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.4, 60), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity * 0.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.6, 60), 0f, player.whoAmI); else if (rogue) - Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.35, 50), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.5, 50), 0f, player.whoAmI); else if (item.ranged) - Projectile.NewProjectile(position, velocity * 1.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.275, 40), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity * 1.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.4, 40), 0f, player.whoAmI); else if (item.magic) - Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.525, 80), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.8, 80), 0f, player.whoAmI); else if (item.summon && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI); @@ -1125,7 +1126,7 @@ namespace CalamityMod.Items break; case CalamityRarity.ItemSpecific: - // Uniquely colored developer weapons + // Uniquely colored developer items if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(Main.DiscoR, 100, 255); if (item.type == ModContent.ItemType()) @@ -1137,19 +1138,31 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(146, 0, 0); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(129, 29, 149); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(220, 20, 60); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(254, 253, 235); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(207, 17, 117); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(227, 226, 180); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); if (item.type == ModContent.ItemType()) { if (Main.GlobalTime % 1f < 0.6f) @@ -1165,6 +1178,22 @@ namespace CalamityMod.Items tt2.overrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTime % 1f - 0.8f) / 0.2f); } } + if (item.type == ModContent.ItemType()) + { + List earthColors = new List() + { + new Color(255, 99, 146), + new Color(255, 228, 94), + new Color(127, 200, 248) + }; + if (tt2 != null) + { + int colorIndex = (int)(Main.GlobalTime / 2 % earthColors.Count); + Color currentColor = earthColors[colorIndex]; + Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; + tt2.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f); + } + } // Uniquely colored legendary weapons and Yharim's Crystal if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) diff --git a/Items/Rock.cs b/Items/Rock.cs index 49c2aa5bf0..15d49b2633 100644 --- a/Items/Rock.cs +++ b/Items/Rock.cs @@ -1,4 +1,6 @@ +using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items @@ -16,6 +18,13 @@ namespace CalamityMod.Items item.width = 20; item.height = 20; item.value = Item.buyPrice(0, 0, 0, 1); + item.createTile = ModContent.TileType(); + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; } } } diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index 1bfe946de1..360c8d3549 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Tools { item.width = 62; item.height = 62; + item.scale = 1.5f; item.damage = 500; item.melee = true; item.useAnimation = 16; diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index a551b39db6..00c8889fbe 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = item.Calamity(); - item.damage = 67; + item.damage = 80; modItem.rogue = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs index 961fc9a277..a55146abb1 100644 --- a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs +++ b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 56; item.height = 52; - item.damage = 84; + item.damage = 100; item.noMelee = true; item.noUseGraphic = true; item.channel = true; @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, swingOffset); return false; } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs index f25b19912e..780a838702 100644 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -24,10 +24,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.melee = true; item.width = 26; item.height = 26; + item.scale = 1.5f; item.useTime = 24; item.useAnimation = 24; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTurn = false; + item.useTurn = true; item.knockBack = 7f; item.value = CalamityGlobalItem.Rarity3BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index a953976c33..ff9b51e329 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.height = 22; item.magic = true; item.mana = 6; - item.damage = 130; + item.damage = 110; item.knockBack = 11f; item.useTime = item.useAnimation = 20; item.autoReuse = true; diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index 1b7b3b1ecc..3a40a34e13 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 22; item.height = 28; - item.damage = 8572; + item.damage = 9572; item.noMelee = true; item.noUseGraphic = true; item.consumable = true; diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 1fbe18dac1..a988bf5811 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class PulseRifle : ModItem { - private int BaseDamage = 6560; + private int BaseDamage = 8560; public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index f4bdd3859a..1cb501276d 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal CalamityGlobalItem modItem = item.Calamity(); item.shootSpeed = 10f; - item.damage = 40; + item.damage = 55; item.mana = 12; item.width = 38; item.height = 24; diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index fe5560b622..19f7a9c04a 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 50; item.height = 26; item.ranged = true; - item.damage = 28; + item.damage = 22; item.knockBack = 0f; item.useTime = item.useAnimation = 28; item.autoReuse = true; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 47125edc7a..4943771a4a 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class TeslaCannon : ModItem { - private int BaseDamage = 10000; + private int BaseDamage = 15000; public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index d1084e1500..17a57f20e0 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = item.Calamity(); - item.damage = 34; + item.damage = 102; modItem.rogue = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Magic/ShadowdropStaff.cs b/Items/Weapons/Magic/ShadowdropStaff.cs index 296c86aa69..d229784ee4 100644 --- a/Items/Weapons/Magic/ShadowdropStaff.cs +++ b/Items/Weapons/Magic/ShadowdropStaff.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Magic num80 = num72 / num80; } - int num107 = 10; + int num107 = 3; for (int num108 = 0; num108 < num107; num108++) { vector2 = 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); @@ -95,8 +95,8 @@ namespace CalamityMod.Items.Weapons.Magic num80 = num72 / num80; num78 *= num80; num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-120, 121) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.02f; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); } return false; diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index 5419d91703..29848a0dd8 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -20,7 +20,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 58; - item.damage = 68; + item.height = 58; + item.scale = 1.5f; + item.damage = 68; item.melee = true; item.useAnimation = item.useTime = 15; item.useTurn = true; @@ -28,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 4.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 58; item.rare = 7; item.value = Item.buyPrice(0, 60, 0, 0); item.shootSpeed = 14f; diff --git a/Items/Weapons/Melee/Aftershock.cs b/Items/Weapons/Melee/Aftershock.cs index 5cbf307cdd..0b74ce2ff5 100644 --- a/Items/Weapons/Melee/Aftershock.cs +++ b/Items/Weapons/Melee/Aftershock.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.width = 54; item.height = 58; + item.scale = 1.5f; item.useTime = 28; item.useAnimation = 28; item.useTurn = true; diff --git a/Items/Weapons/Melee/AncientCrusher.cs b/Items/Weapons/Melee/AncientCrusher.cs index 4aa33271fa..6c95b91503 100644 --- a/Items/Weapons/Melee/AncientCrusher.cs +++ b/Items/Weapons/Melee/AncientCrusher.cs @@ -17,7 +17,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 62; - item.damage = 55; + item.height = 62; + item.scale = 2f; + item.damage = 55; item.melee = true; item.useAnimation = 30; item.useStyle = ItemUseStyleID.SwingThrow; @@ -26,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 8f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 62; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; } diff --git a/Items/Weapons/Melee/Animus.cs b/Items/Weapons/Melee/Animus.cs index 47ecdb8f88..9aa0a4b94c 100644 --- a/Items/Weapons/Melee/Animus.cs +++ b/Items/Weapons/Melee/Animus.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 82; item.height = 84; + item.scale = 1.5f; item.damage = 4000; item.melee = true; item.useAnimation = 11; diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index b97cd7a446..8eb06354a1 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -18,11 +18,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 95; + item.damage = 110; item.crit += 25; item.melee = true; - item.width = 60; - item.height = 60; + item.width = 80; + item.height = 80; + item.scale = 1.5f; item.useTime = 9; item.useAnimation = 9; item.useTurn = true; diff --git a/Items/Weapons/Melee/Avalanche.cs b/Items/Weapons/Melee/Avalanche.cs index c5bfe28f4c..debf7b2db4 100644 --- a/Items/Weapons/Melee/Avalanche.cs +++ b/Items/Weapons/Melee/Avalanche.cs @@ -18,7 +18,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 64; - item.damage = 60; + item.height = 64; + item.scale = 1.5f; + item.damage = 60; item.melee = true; item.useAnimation = 30; item.useTime = 30; @@ -27,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 64; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; } diff --git a/Items/Weapons/Melee/BladeofEnmity.cs b/Items/Weapons/Melee/BladeofEnmity.cs index c7ddba4fe2..7cb1f86660 100644 --- a/Items/Weapons/Melee/BladeofEnmity.cs +++ b/Items/Weapons/Melee/BladeofEnmity.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 60; item.height = 64; + item.scale = 1.5f; item.damage = 158; item.melee = true; item.useAnimation = 10; diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index b3f400c4b6..50af12bac7 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -26,12 +26,14 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 19; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 56; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; } - } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/CometQuasher.cs b/Items/Weapons/Melee/CometQuasher.cs index 902a6676c3..6e30c51ef6 100644 --- a/Items/Weapons/Melee/CometQuasher.cs +++ b/Items/Weapons/Melee/CometQuasher.cs @@ -17,8 +17,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 54; - item.damage = 120; + item.width = 46; + item.height = 62; + item.scale = 1.5f; + item.damage = 120; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -27,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 54; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.shootSpeed = 9f; @@ -81,7 +82,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float num114 = num78; float num115 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.75f), knockback, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); + int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.5f), knockback, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); Main.projectile[proj].Calamity().lineColor = Main.rand.Next(3); } } diff --git a/Items/Weapons/Melee/DiseasedPike.cs b/Items/Weapons/Melee/DiseasedPike.cs index 2bf14a10a8..12fa1f55a6 100644 --- a/Items/Weapons/Melee/DiseasedPike.cs +++ b/Items/Weapons/Melee/DiseasedPike.cs @@ -34,16 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 10f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index d523e08913..ead74ee388 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -25,7 +25,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 92; - item.damage = 840; + item.height = 104; + item.scale = 1.5f; + item.damage = 840; item.melee = true; item.useAnimation = 16; item.useStyle = ItemUseStyleID.SwingThrow; @@ -34,10 +36,9 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 9.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 104; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) diff --git a/Items/Weapons/Melee/EarthenPike.cs b/Items/Weapons/Melee/EarthenPike.cs index c805164c20..b8063b16c9 100644 --- a/Items/Weapons/Melee/EarthenPike.cs +++ b/Items/Weapons/Melee/EarthenPike.cs @@ -27,12 +27,14 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 25; item.knockBack = 7f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 60; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 6f; + item.shootSpeed = 8f; } - } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index bb41ea3578..11bd9c0833 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -17,7 +17,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 62; - item.damage = 55; + item.height = 62; + item.scale = 2f; + item.damage = 55; item.melee = true; item.useAnimation = item.useTime = 30; item.useStyle = ItemUseStyleID.SwingThrow; @@ -25,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 8f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 62; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index e0bd75f771..1384db9587 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 8f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index dec29f09b8..f17f2c2418 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 60; item.height = 64; + item.scale = 1.5f; item.damage = 53; item.melee = true; item.useAnimation = 22; @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; - item.shootSpeed = 6f; + item.shootSpeed = 8f; } public override bool AltFunctionUse(Player player) @@ -46,21 +47,20 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.useStyle = ItemUseStyleID.HoldingOut; - item.autoReuse = false; item.shoot = ModContent.ProjectileType(); - } + return player.ownedProjectileCounts[item.shoot] <= 0; + } else { item.noMelee = false; item.noUseGraphic = false; item.useStyle = ItemUseStyleID.SwingThrow; - item.autoReuse = true; item.shoot = ProjectileID.None; - } - return base.CanUseItem(player); + return base.CanUseItem(player); + } } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 4e275e09ff..1dceada2b2 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -36,16 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.maxProjectiles; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/GoldplumeSpear.cs b/Items/Weapons/Melee/GoldplumeSpear.cs index 9a521df477..216ca2b0bc 100644 --- a/Items/Weapons/Melee/GoldplumeSpear.cs +++ b/Items/Weapons/Melee/GoldplumeSpear.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 23; item.knockBack = 5.75f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 54; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index 05d1284942..6569977637 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.width = 62; item.height = 62; + item.scale = 1.5f; item.useTime = 24; item.useAnimation = 24; item.useTurn = true; diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index bafef201d8..07f52348d2 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 20; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 64; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; @@ -36,7 +36,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 8f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); diff --git a/Items/Weapons/Melee/HolyCollider.cs b/Items/Weapons/Melee/HolyCollider.cs index 6c2242bb99..875e6a1f63 100644 --- a/Items/Weapons/Melee/HolyCollider.cs +++ b/Items/Weapons/Melee/HolyCollider.cs @@ -18,7 +18,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 94; - item.damage = 400; + item.height = 80; + item.scale = 1.5f; + item.damage = 400; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -27,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 80; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.shootSpeed = 10f; diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs index 1c6669f6f7..c9e30784dd 100644 --- a/Items/Weapons/Melee/InsidiousImpaler.cs +++ b/Items/Weapons/Melee/InsidiousImpaler.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 66; - item.damage = 390; + item.damage = 350; item.melee = true; item.noMelee = true; item.useTurn = true; @@ -35,16 +35,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.maxProjectiles; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/MajesticGuard.cs b/Items/Weapons/Melee/MajesticGuard.cs index 71889588be..097db304c8 100644 --- a/Items/Weapons/Melee/MajesticGuard.cs +++ b/Items/Weapons/Melee/MajesticGuard.cs @@ -16,7 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 98; - item.damage = 60; + item.height = 98; + item.scale = 1.5f; + item.damage = 60; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -25,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 98; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; } diff --git a/Items/Weapons/Melee/Mariana.cs b/Items/Weapons/Melee/Mariana.cs index 0d0c869f39..88a1d160db 100644 --- a/Items/Weapons/Melee/Mariana.cs +++ b/Items/Weapons/Melee/Mariana.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 90; item.width = 54; item.height = 62; + item.scale = 1.5f; item.melee = true; item.useAnimation = 24; item.useStyle = ItemUseStyleID.SwingThrow; diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 830da229cf..a239132583 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 21; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 50; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; @@ -33,7 +33,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddRecipeGroup("AnyGoldBar", 5); diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index dda2c9cee2..70e9c9d161 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -43,15 +43,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = ShootSpeed; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.projectile.Length; ++i) - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - return false; - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/Melee/ProfanedSword.cs b/Items/Weapons/Melee/ProfanedSword.cs index aceefd4f42..e853077e62 100644 --- a/Items/Weapons/Melee/ProfanedSword.cs +++ b/Items/Weapons/Melee/ProfanedSword.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 75; item.melee = true; item.width = item.height = 52; + item.scale = 1.5f; item.useTime = 23; item.useAnimation = 23; item.useTurn = true; diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index b82929fc9e..75580890fc 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index fc6cabc9ce..a54dc4ae65 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index 03528cd944..3887697449 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 20; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 42; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 6f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/Items/Weapons/Melee/SpatialLance.cs b/Items/Weapons/Melee/SpatialLance.cs index ac33398c35..3af7fa4015 100644 --- a/Items/Weapons/Melee/SpatialLance.cs +++ b/Items/Weapons/Melee/SpatialLance.cs @@ -37,19 +37,9 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/Melee/StarnightLance.cs b/Items/Weapons/Melee/StarnightLance.cs index 0d710c75aa..52b654659f 100644 --- a/Items/Weapons/Melee/StarnightLance.cs +++ b/Items/Weapons/Melee/StarnightLance.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 23; item.knockBack = 6; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 72; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 6f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index ecd72572cd..21e8255558 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -17,7 +17,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 84; - item.damage = 640; + item.height = 90; + item.scale = 1.5f; + item.damage = 640; item.melee = true; item.useAnimation = 25; item.useStyle = ItemUseStyleID.SwingThrow; @@ -26,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 90; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.shootSpeed = 12f; diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index bc3c708627..9d20e6618c 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow")); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow")); } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/TerraEdge.cs b/Items/Weapons/Melee/TerraEdge.cs index d3451bfce9..f70bb4ba1a 100644 --- a/Items/Weapons/Melee/TerraEdge.cs +++ b/Items/Weapons/Melee/TerraEdge.cs @@ -19,7 +19,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 58; - item.damage = 112; + item.height = 58; + item.scale = 1.5f; + item.damage = 112; item.melee = true; item.useAnimation = 17; item.useStyle = ItemUseStyleID.SwingThrow; @@ -28,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 6.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 58; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/TerraLance.cs b/Items/Weapons/Melee/TerraLance.cs index 7355f241e1..0966f84546 100644 --- a/Items/Weapons/Melee/TerraLance.cs +++ b/Items/Weapons/Melee/TerraLance.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 11f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.ChlorophytePartisan); diff --git a/Items/Weapons/Melee/Terracotta.cs b/Items/Weapons/Melee/Terracotta.cs index 8613959193..c87d88c788 100644 --- a/Items/Weapons/Melee/Terracotta.cs +++ b/Items/Weapons/Melee/Terracotta.cs @@ -19,7 +19,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 50; - item.damage = 125; + item.height = 62; + item.scale = 1.5f; + item.damage = 125; item.melee = true; item.useAnimation = 17; item.useTime = 17; @@ -28,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 62; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.shootSpeed = 5f; diff --git a/Items/Weapons/Melee/TheEnforcer.cs b/Items/Weapons/Melee/TheEnforcer.cs index 315abd8f04..3faf5e8242 100644 --- a/Items/Weapons/Melee/TheEnforcer.cs +++ b/Items/Weapons/Melee/TheEnforcer.cs @@ -20,7 +20,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 100; - item.damage = 1900; + item.height = 100; + item.scale = 1.5f; + item.damage = 1900; item.melee = true; item.useAnimation = 17; item.useStyle = ItemUseStyleID.SwingThrow; @@ -29,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 9f; item.UseSound = SoundID.Item20; item.autoReuse = true; - item.height = 100; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/TheLastMourning.cs b/Items/Weapons/Melee/TheLastMourning.cs index 70975ce34b..31495d54df 100644 --- a/Items/Weapons/Melee/TheLastMourning.cs +++ b/Items/Weapons/Melee/TheLastMourning.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 94; item.height = 94; + item.scale = 1.5f; item.melee = true; item.damage = BaseDamage; item.knockBack = 8.5f; diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index b0660650be..55de807630 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 90; item.height = 90; + item.scale = 1.5f; item.damage = 700; item.melee = true; item.useAnimation = 18; diff --git a/Items/Weapons/Melee/TitanArm.cs b/Items/Weapons/Melee/TitanArm.cs index cf31e4570f..60573b60d7 100644 --- a/Items/Weapons/Melee/TitanArm.cs +++ b/Items/Weapons/Melee/TitanArm.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 46; item.height = 58; + item.scale = 1.5f; item.damage = 60; item.crit += 96; //more knockback huehue item.melee = true; diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index 1cb1f1e4bd..ce64456628 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 25f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index ed8d836c01..d96261fcb8 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -12,16 +12,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Ultimus Cleaver"); - Tooltip.SetDefault("Launches damaging homing sparks"); + Tooltip.SetDefault("Launches damaging homing sparks and explodes on enemy hits"); } public override void SetDefaults() { item.damage = 130; item.melee = true; + item.useTurn = true; item.rare = 8; item.width = 72; item.height = 62; + item.scale = 1.5f; item.useTime = 20; item.useAnimation = 20; item.useStyle = ItemUseStyleID.SwingThrow; @@ -31,7 +33,50 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item1; } - public override void MeleeEffects(Player player, Rectangle hitbox) + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + player.ApplyDamageToNPC(target, (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), 0f, 0, false); + float num50 = 1.7f; + float num51 = 0.8f; + float num52 = 2f; + Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2(); + Vector2 value4 = value3 * target.velocity.Length(); + Main.PlaySound(SoundID.Item14, target.position); + int num3; + for (int num53 = 0; num53 < 40; num53 = num3 + 1) + { + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50); + Dust dust = Main.dust[num54]; + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dust.noGravity = true; + dust.velocity.Y -= 6f; + dust.velocity *= 3f; + dust.velocity += value4 * Main.rand.NextFloat(); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51); + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dust.velocity.Y -= 6f; + dust.velocity *= 2f; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Crimson * 0.5f; + dust.velocity += value4 * Main.rand.NextFloat(); + num3 = num53; + } + for (int num55 = 0; num55 < 20; num55 = num3 + 1) + { + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52); + Dust dust = Main.dust[num56]; + dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; + dust.noGravity = true; + dust.velocity.Y -= 6f; + dust.velocity *= 0.5f; + dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); + num3 = num55; + } + } + + public override void MeleeEffects(Player player, Rectangle hitbox) { if (player.whoAmI == Main.myPlayer) { @@ -97,7 +142,7 @@ namespace CalamityMod.Items.Weapons.Melee num342 *= (float)player.direction; num341 *= player.gravDir; Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, - (float)player.direction * num340, num339 * player.gravDir, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.1f), 0f, player.whoAmI, 0f, 0f); + (float)player.direction * num340, num339 * player.gravDir, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.1), 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Items/Weapons/Melee/UrchinSpear.cs b/Items/Weapons/Melee/UrchinSpear.cs index e251016645..091644aa9c 100644 --- a/Items/Weapons/Melee/UrchinSpear.cs +++ b/Items/Weapons/Melee/UrchinSpear.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 25; item.knockBack = 5f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 56; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 4f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 5488338b04..0180c1efa4 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.noMelee = true; item.channel = true; - item.autoReuse = false; + item.autoReuse = true; item.useTurn = true; item.useStyle = ItemUseStyleID.HoldingOut; @@ -58,19 +58,22 @@ namespace CalamityMod.Items.Weapons.Melee { item.damage = 20; item.channel = false; + item.autoReuse = true; item.useAnimation = 33; item.useTime = 33; item.shootSpeed = 4.5f; - } + return player.ownedProjectileCounts[item.shoot] <= 0; + } else { item.damage = BaseDamage; item.channel = true; + item.autoReuse = false; item.useAnimation = 22; item.useTime = 22; item.shootSpeed = ShootSpeed; - } - return base.CanUseItem(player); + return base.CanUseItem(player); + } } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 9187796a49..48ecdba3e5 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 232; + item.damage = 200; item.ranged = true; item.width = 44; item.height = 100; diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index dab83756fe..d45276c2ed 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 20f; item.useAmmo = AmmoID.Arrow; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index 0b693d6a52..90e3c091de 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -52,8 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged float shardKB = 2f * knockBack; float shardVelocityX = (speedX + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; float shardVelocityY = (speedY + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; - int onyx = Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); - Main.projectile[onyx].timeLeft -= 20; + Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); // Fire three symmetric pairs of bullets alongside it Vector2 baseVelocity = new Vector2(speedX, speedY); diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 2d30871104..23fc80a795 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 30f; item.useAmmo = AmmoID.Bullet; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/TheEmpyrean.cs b/Items/Weapons/Ranged/TheEmpyrean.cs index 9581ff3ffa..a6a6fcf338 100644 --- a/Items/Weapons/Ranged/TheEmpyrean.cs +++ b/Items/Weapons/Ranged/TheEmpyrean.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = 9; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 7.5f; + item.shootSpeed = 9f; item.useAmmo = AmmoID.Gel; } diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 03098ed750..abd66c9e20 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; item.Calamity().rogue = true; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs index a55ae882c3..a7f0f096fc 100644 --- a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.shoot = ModContent.ProjectileType(); item.shootSpeed = 25f; item.Calamity().rogue = true; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index dc30d15300..450a75e411 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -8,6 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; using System.IO; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.NPCs.AcidRain { @@ -27,18 +28,15 @@ namespace CalamityMod.NPCs.AcidRain npc.width = 26; npc.height = 14; - npc.damage = 10; npc.lifeMax = 30; if (CalamityWorld.downedPolterghast) { - npc.damage = 60; npc.lifeMax = 2250; npc.defense = 10; } else if (CalamityWorld.downedAquaticScourge) { - npc.damage = 30; npc.lifeMax = 90; } @@ -120,6 +118,7 @@ namespace CalamityMod.NPCs.AcidRain if (npc.Distance(destination) < 45f) { player.AddBuff(BuffID.Bleeding, 180, true); + player.AddBuff(ModContent.BuffType(), 30, true); } else if (!npc.wet && npc.Distance(destination) > 85f) { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index a13c5ff2a4..e1f4ab3883 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4669,11 +4669,11 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) { - idlePhaseTimer = 35; - idlePhaseAcceleration *= 1.1f; - idlePhaseVelocity *= 1.15f; + idlePhaseTimer = 45; + idlePhaseAcceleration *= 1.06f; + idlePhaseVelocity *= 1.12f; chargeTime -= 3; - chargeVelocity *= 1.25f; + chargeVelocity *= 1.15f; } if (calamityGlobalNPC.newAI[1] == 1f) diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index dd1d483335..d4f1ac75d2 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -4610,7 +4610,7 @@ namespace CalamityMod.NPCs if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { // Laser speed - float projectileSpeed = npc.ai[2] == 0f ? 2f : 4f; + float projectileSpeed = npc.ai[2] == 0f ? 4f : 2f; projectileSpeed += enrageScale; if (phase2) projectileSpeed += 0.25f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 06b3447fc6..ed37f1e70a 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -338,6 +338,13 @@ namespace CalamityMod.NPCs NPCID.TheDestroyerTail }; + public static List DarkEnergyIDs = new List + { + NPCType(), + NPCType(), + NPCType() + }; + public static List StormWeaverIDs = new List { NPCType(), @@ -838,7 +845,7 @@ namespace CalamityMod.NPCs npc.buffImmune[BuffID.Slow] = true; } - if (DestroyerIDs.Contains(npc.type) || (EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel) + if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.SkeletronHead || (EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel) { for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -3051,30 +3058,11 @@ namespace CalamityMod.NPCs GrenadeResist(projectile, ref damage); PierceResistGlobal(projectile, ref damage); - // Old resists - /*if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.1); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.2); - } - else if (projectile.type == player.beeType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.4); - }*/ - - // New resists - if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.2); - } - else if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType()) + if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.25); } - else if (projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } @@ -3087,7 +3075,7 @@ namespace CalamityMod.NPCs damage = (int)(damage * 0.75); } } - else if (CosmicGuardianIDs.Contains(npc.type)) + else if (CosmicGuardianIDs.Contains(npc.type) || DarkEnergyIDs.Contains(npc.type)) { GrenadeResist(projectile, ref damage); PierceResistGlobal(projectile, ref damage); @@ -3115,6 +3103,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.5); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.4); + } else if (ProjectileID.Sets.StardustDragon[projectile.type]) { damage = (int)(damage * 0.1); @@ -3133,6 +3125,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.5); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.45); + } else if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.38); @@ -3151,6 +3147,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.9); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.75); + } if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); @@ -4341,7 +4341,7 @@ namespace CalamityMod.NPCs } else if (DestroyerIDs.Contains(npc.type)) { - if (drawColor != Color.Black && ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))) + if (drawColor != Color.Black && npc.ai[2] == 0f && ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))) { Vector2 halfSize = npc.frame.Size() / 2; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index a59d898176..4311df7117 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -300,15 +300,6 @@ namespace CalamityMod.NPCs.CeaselessVoid return CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active; } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) - { - if (projectile.type == ModContent.ProjectileType()) - damage = (int)(damage * 0.9); - } - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 20, true); diff --git a/NPCs/CeaselessVoid/DarkEnergy2.cs b/NPCs/CeaselessVoid/DarkEnergy2.cs index bb92fd8049..7a719c6f4f 100644 --- a/NPCs/CeaselessVoid/DarkEnergy2.cs +++ b/NPCs/CeaselessVoid/DarkEnergy2.cs @@ -260,15 +260,6 @@ namespace CalamityMod.NPCs.CeaselessVoid return CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active; } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) - { - if (projectile.type == ModContent.ProjectileType()) - damage = (int)(damage * 0.9); - } - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 20, true); diff --git a/NPCs/CeaselessVoid/DarkEnergy3.cs b/NPCs/CeaselessVoid/DarkEnergy3.cs index 3bfe0ba731..ef028c4376 100644 --- a/NPCs/CeaselessVoid/DarkEnergy3.cs +++ b/NPCs/CeaselessVoid/DarkEnergy3.cs @@ -288,15 +288,6 @@ namespace CalamityMod.NPCs.CeaselessVoid return CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active; } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) - { - if (projectile.type == ModContent.ProjectileType()) - damage = (int)(damage * 0.9); - } - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 20, true); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 53c2008df0..102e2903a3 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -694,7 +694,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (bulletHellCounter2 % 30 == 0) //projectiles that move in wave pattern { - int random = Main.rand.Next(-1000, 1001); + int random = Main.rand.Next(-500, 501); Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 865fbb0d8a..71b91bf72a 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.ai[1] += 1f; } - if (npc.ai[1] >= 30f) + if (npc.ai[1] >= 45f) { npc.ai[1] = 0f; Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneHellblastSound"), npc.Center); diff --git a/Projectiles/Boss/DestroyerCursedLaser.cs b/Projectiles/Boss/DestroyerCursedLaser.cs index e83a33b84f..415062837d 100644 --- a/Projectiles/Boss/DestroyerCursedLaser.cs +++ b/Projectiles/Boss/DestroyerCursedLaser.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[1] = 1f; } - if (projectile.velocity.Length() < 14f) + if (projectile.velocity.Length() < 12f) { projectile.velocity *= 1.0025f; } diff --git a/Projectiles/Boss/DestroyerElectricLaser.cs b/Projectiles/Boss/DestroyerElectricLaser.cs index 9957185797..6949be76df 100644 --- a/Projectiles/Boss/DestroyerElectricLaser.cs +++ b/Projectiles/Boss/DestroyerElectricLaser.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[1] = 1f; } - if (projectile.velocity.Length() < 14f) + if (projectile.velocity.Length() < 12f) { projectile.velocity *= 1.0025f; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index b2e8c91591..e9f36da8c4 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -219,7 +219,7 @@ namespace CalamityMod.Projectiles projectile.localAI[1] = 1f; } - if (projectile.velocity.Length() < 14f) + if (projectile.velocity.Length() < 12f) projectile.velocity *= 1.0025f; return false; diff --git a/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs b/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs index 75d07d8d35..7c5807d6af 100644 --- a/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs +++ b/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal set => projectile.ai[0] = value; } public const int TotalSpins = 2; - public const float SpinTime = 60f; + public const float SpinTime = 30f; public override void SetStaticDefaults() { DisplayName.SetDefault("Frequency Manipulator"); diff --git a/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs b/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs index a3b25915a7..ba7f9217d7 100644 --- a/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs +++ b/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.ownerHitCheck = true; projectile.hide = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 6; projectile.alpha = 255; } diff --git a/Projectiles/DraedonsArsenal/GaussPistolShot.cs b/Projectiles/DraedonsArsenal/GaussPistolShot.cs index 06ddbb9a08..6b40c900fc 100644 --- a/Projectiles/DraedonsArsenal/GaussPistolShot.cs +++ b/Projectiles/DraedonsArsenal/GaussPistolShot.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const float MinEnergyParticleSpeed = 0.25f; public const float MaxEnergyParticleSpeed = 4f; public const float EnergyChargeRadiusRatio = 1.45f; - public const float ChargeTime = 60f; + public const float ChargeTime = 30f; public override void SetStaticDefaults() { DisplayName.SetDefault("Gauss Shot"); diff --git a/Projectiles/DraedonsArsenal/GaussRifleBlast.cs b/Projectiles/DraedonsArsenal/GaussRifleBlast.cs index 063519ea10..1854311c52 100644 --- a/Projectiles/DraedonsArsenal/GaussRifleBlast.cs +++ b/Projectiles/DraedonsArsenal/GaussRifleBlast.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Dust dust = Dust.NewDustPerfect(projectile.Center, 263); dust.velocity = angle.ToRotationVector2().RotatedByRandom(0.25f) * Main.rand.NextFloat(6f, 8f); dust.noGravity = true; - dust.scale = 2.1f; + dust.scale = 1.6f; } } // Ring dust. @@ -54,10 +54,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Dust dust = Dust.NewDustPerfect(projectile.Center + angle.ToRotationVector2() * radius, 226); dust.velocity = Vector2.Zero; dust.noGravity = true; - dust.scale = 2f; + dust.scale = 1.5f; } } } + public override void Kill(int timeLeft) { if (Main.myPlayer == projectile.owner) diff --git a/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs b/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs index fa749b237d..6e5a7acee8 100644 --- a/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs +++ b/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs @@ -22,8 +22,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.width = projectile.height = 500; projectile.friendly = true; projectile.ranged = true; - projectile.penetrate = 1; - projectile.timeLeft = 60; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 40; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; } @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.velocity = dust.velocity.RotatedByRandom(0.4f); dust.velocity = dust.velocity.RotatedBy(Time / 60f * MathHelper.ToRadians(720f)); dust.velocity *= Main.rand.NextFloat(20f, 50f); - dust.scale = Main.rand.NextFloat(1.7f, 2.1f); + dust.scale = Main.rand.NextFloat(1.2f, 1.6f); dust.noGravity = true; } } diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index b19e22b415..7e3f51eeb4 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.melee = true; projectile.scale = 1.1f; } + public override void AI() { projectile.timeLeft = 60; @@ -112,6 +113,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.position -= projectile.velocity.ToRotation().ToRotationVector2() * 8f; projectile.velocity.X *= Main.rand.NextFloat(0.97f, 1.03f); } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"), target.Center); @@ -139,6 +141,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public bool TryToSuperchargeNPC(NPC npc) { // Prevent supercharging an enemy twice. @@ -154,7 +157,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType(), - (int)(projectile.damage * 0.35), + (int)(projectile.damage * 0.8), 0f, projectile.owner, 0f, diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index ebdccbf200..0654a43412 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -12,8 +12,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0]; set => projectile.ai[0] = value; } + public const float FallAcceleration = 0.15f; public const float MaxFallSpeed = 12f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Plasma Grenade"); @@ -54,7 +56,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void Kill(int timeLeft) { - if (projectile.Calamity().stealthStrike) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaGrenadeExplosion"), (int)projectile.position.X, (int)projectile.position.Y); + if (projectile.Calamity().stealthStrike) { if (Main.myPlayer == projectile.owner) { diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 68d31b2395..b9800f1a88 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.minion = true; projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 24; + projectile.localNPCHitCooldown = 12; } public override void AI() @@ -70,6 +70,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } Time++; } + public void Initialize(Player player) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); @@ -82,6 +83,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.noGravity = true; } } + // While this projectile cannot attack, the projectiles it shoots derive from the damage. public void AdjustDamage(Player player) { @@ -93,6 +95,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.damage = trueDamage; } } + public void GrantBuffs(Player player) { bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); @@ -109,6 +112,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public void PlayerMovement(Player player) { Vector2 destination = player.Center + Vector2.UnitY.RotatedBy(Time / 16f + AngularOffset + (!North).ToInt() * MathHelper.Pi) * 180f; @@ -116,6 +120,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * 10f; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } + public void NPCMovement(NPC npc) { for (int i = 0; i < Main.projectile.Length; i++) @@ -150,6 +155,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.rotation = projectile.AngleTo(npc.Center) + MathHelper.PiOver2; } } + public void RepelMovement() { // This does not incorporate attraction on purpose. Doing so causes the minions to very easily become distracted. @@ -173,6 +179,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, 1, 2); diff --git a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs index d8209e7b8f..3e153fb70a 100644 --- a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs +++ b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; projectile.tileCollide = true; + projectile.extraUpdates = 1; projectile.Calamity().hasInorganicEnemyHitBoost = true; projectile.Calamity().inorganicEnemyHitBoost = 0.003f; } diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index f070fcf5ee..2a797e3627 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (alreadyTargetedNPCType != Main.npc[i].whoAmI && projectile.Center.ManhattanDistance(Main.npc[i].Center) < 600f) { - Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 2f, projectile.type, projectile.damage / 2, 0f, projectile.owner, target.whoAmI, projectile.ai[1] + 1f); + Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 5f, projectile.type, projectile.damage / 2, 0f, projectile.owner, Main.npc[i].whoAmI, projectile.ai[1] + 1f); break; } } @@ -110,9 +110,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (!target.boss) { if (target.Inorganic()) - { damage += target.lifeMax / 250; - } } } diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index 2606621cc6..b65237fe32 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -13,13 +13,16 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public bool SufferingFromSeparationAnxiety = false; public Vector2 OldCenter; public Vector2 Destination; + public float Time { get => projectile.ai[0]; set => projectile.ai[0] = value; } + public float EyeOutwardness = 1f; public float EyeRotation = 0f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Snake Eyes"); @@ -89,7 +92,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } NPCMovement(potentialTarget); } - if (!SufferingFromSeparationAnxiety && projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1500f)) + if (!SufferingFromSeparationAnxiety && projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1800f)) { SufferingFromSeparationAnxiety = true; projectile.netUpdate = true; @@ -105,6 +108,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } Time++; } + public void Initialize(Player player) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); @@ -118,6 +122,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.noGravity = true; } } + // While this projectile cannot attack, the projectiles it shoots derive from the damage. public void AdjustDamage(Player player) { @@ -129,6 +134,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.damage = trueDamage; } } + public void GrantBuffs(Player player) { bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); @@ -145,6 +151,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public void PlayerMovement(Player player) { projectile.velocity = Vector2.Zero; @@ -170,6 +177,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); } + public void NPCMovement(NPC npc) { projectile.velocity = Vector2.Zero; @@ -210,6 +218,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f); } } + public void GenerateAfterimageDust() { for (int i = 1; i < projectile.oldPos.Length; i++) @@ -238,7 +247,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public override bool CanDamage() => false; + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, Color.White, 0, ProjectileID.Sets.TrailCacheLength[projectile.type]); diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 76e76f03c7..73b122ed85 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -16,11 +16,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public float AcidShootTimer = 0f; public float AcidShootCooldown = 0f; public float FallThroughYPoint = 0f; + public bool ReleasingAcid { get => projectile.ai[0] != 0f; set => projectile.ai[0] = value.ToInt(); } + public override void SetStaticDefaults() { DisplayName.SetDefault("Pet Froge"); @@ -49,6 +51,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal writer.Write(AcidShootTimer); writer.Write(AcidShootCooldown); } + public override void ReceiveExtraAI(BinaryReader reader) { HopCooldown = reader.ReadSingle(); @@ -156,8 +159,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal player.MinionDamage()); projectile.damage = newDamage; } - } + public void HandleHop(Vector2 targetPosition) { if (HopCooldown <= 0f && projectile.oldPosition.Y == projectile.position.Y) @@ -179,6 +182,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal HopCooldown--; } } + public void PlayerSeparationAnxietyAI(Player player, ref int minimumFrame, ref int maximumFrame) { // If the player is extremely far away, don't bother homing. Just go to the player's location. @@ -226,6 +230,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal HandleHop(player.Center); } } + public void NPCTargetingAI(NPC potentialTarget) { HandleHop(potentialTarget.Center); @@ -270,6 +275,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal AcidShootCooldown--; projectile.velocity.X *= 0.8f; } + public void ManipulateFrames(int minimumFrame, int maximumFrame) { if (projectile.frame < minimumFrame) @@ -303,12 +309,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal 0f); return false; } + public override bool OnTileCollide(Vector2 oldVelocity) => false; + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) { fallThrough = projectile.Bottom.Y < FallThroughYPoint - 120f; return base.TileCollideStyle(ref width, ref height, ref fallThrough); } + public override bool CanDamage() => false; } } diff --git a/Projectiles/DraedonsArsenal/TaserHook.cs b/Projectiles/DraedonsArsenal/TaserHook.cs index 10a380270f..59940763fd 100644 --- a/Projectiles/DraedonsArsenal/TaserHook.cs +++ b/Projectiles/DraedonsArsenal/TaserHook.cs @@ -16,22 +16,27 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Electrocuting, ReelingBack } + public TaserAIState AIState { get => (TaserAIState)(int)projectile.ai[0]; set => projectile.ai[0] = (int)value; } + public float Time { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public int ElectrocutionTarget { get => (int)projectile.localAI[0]; set => projectile.localAI[0] = value; } - public const float ReelbackSpeed = 7f; + + public const float ReelbackSpeed = 15f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Taser"); diff --git a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs index 8a2f39e008..63b99d023b 100644 --- a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs +++ b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (projectile.Center.ManhattanDistance(Main.npc[i].Center) < num474) { - Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 2f, projectile.type, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, -1f); + Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 2f, projectile.type, (int)(projectile.damage * 0.6), projectile.knockBack * 0.6f, projectile.owner, 0f, -1f); projectile.ai[1] = 60f; diff --git a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs index a831cd502c..9cc00ac852 100644 --- a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs +++ b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs @@ -18,16 +18,19 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0] == 1f; set => projectile.ai[0] = value.ToInt(); } + public float Time { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public const int LaserFireRate = 20; public const int MaxLaserCountPerShot = 4; // This only applies to stealth strikes. public const float MaxTargetSearchDistance = 480f; public const float ReturnAcceleration = 0.15f; public const float ReturnMaxSpeed = 12f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Tracking Disk"); @@ -74,7 +77,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.velocity.Y += Math.Sign(idealVelocity.Y - projectile.velocity.Y) * ReturnAcceleration; if (Time % LaserFireRate == 0f) - AttemptToFireLasers((int)(projectile.damage * 0.4)); + AttemptToFireLasers((int)(projectile.damage * 0.25)); if (Main.myPlayer == projectile.owner) { diff --git a/Projectiles/DraedonsArsenal/UnstableMatter.cs b/Projectiles/DraedonsArsenal/UnstableMatter.cs index cd00de0eaa..3196c455cb 100644 --- a/Projectiles/DraedonsArsenal/UnstableMatter.cs +++ b/Projectiles/DraedonsArsenal/UnstableMatter.cs @@ -12,11 +12,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0] == 1f; set => projectile.ai[0] = value.ToInt(); } + public float Time { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public override void SetStaticDefaults() { DisplayName.SetDefault("Unstable Matter"); @@ -68,6 +70,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { + if (!HasCollidedWithATile) + damage /= 3; + damage += target.defense / 3; } @@ -81,7 +86,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // And bounce off the tile. Or towards a nearby enemy, if there is one. NPC potentialTarget = projectile.Center.ClosestNPCAt(700f, false); if (potentialTarget != null) - projectile.velocity = projectile.DirectionTo(potentialTarget.Center); + projectile.velocity = projectile.DirectionTo(potentialTarget.Center); else { if (projectile.velocity.X != oldVelocity.X) @@ -97,7 +102,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } return true; } - - public override bool CanDamage() => HasCollidedWithATile; } } diff --git a/Projectiles/DraedonsArsenal/VoltageStream.cs b/Projectiles/DraedonsArsenal/VoltageStream.cs index 76cab78f27..6cc43f4438 100644 --- a/Projectiles/DraedonsArsenal/VoltageStream.cs +++ b/Projectiles/DraedonsArsenal/VoltageStream.cs @@ -14,11 +14,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0]; set => projectile.ai[0] = value; } + public NPC Target { get => Main.npc[(int)projectile.ai[1]]; set => projectile.ai[1] = value.whoAmI; } + public override void SetStaticDefaults() { DisplayName.SetDefault("Voltage Stream"); @@ -111,9 +113,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { projectile.damage = (int)(projectile.damage * 0.75); } - - public override void Kill(int timeLeft) - { - } } } diff --git a/Projectiles/DraedonsArsenal/WavePounderBoom.cs b/Projectiles/DraedonsArsenal/WavePounderBoom.cs index c022f174e2..27eeca7a85 100644 --- a/Projectiles/DraedonsArsenal/WavePounderBoom.cs +++ b/Projectiles/DraedonsArsenal/WavePounderBoom.cs @@ -21,24 +21,29 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Position = position; } } + public class WavePounderBoom : ModProjectile { public ScreenShakeSpot CurrentSpot; + public float Radius { get => projectile.ai[0]; set => projectile.ai[0] = value; } + public float MaxRadius { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public float InterpolationStep { get => projectile.localAI[1]; set => projectile.localAI[1] = value; } + public const int Lifetime = 60; public override void SetStaticDefaults() @@ -94,11 +99,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.scale = MathHelper.Lerp(1.2f, 5f, Utils.InverseLerp(Lifetime, 0f, projectile.timeLeft, true)); CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(Radius * projectile.scale), (int)(Radius * projectile.scale)); } + public override void Kill(int timeLeft) { if (projectile.Calamity().stealthStrike) CalamityWorld.ScreenShakeSpots.Remove(Projectile.GetByUUID(projectile.owner, projectile.whoAmI)); // Remove the explosion associated with this projectile's UUID. } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { spriteBatch.End(); diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index 6dc23c828d..b197c6f61c 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Melee int num3; projectile.rotation -= 0.104719758f; Vector2 vector145 = projectile.Center; - float num1015 = 300f; + float num1015 = 100f; bool flag59 = false; int num1016 = 0; if (projectile.ai[1] == 0f) diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index 47e0d51738..8853e91e7e 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -27,8 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; + projectile.velocity *= 0.985f; if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); @@ -48,9 +47,9 @@ namespace CalamityMod.Projectiles.Melee for (i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, 30, 2f, projectile.owner, 0f, 0f); + int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); Main.projectile[projectile1].Calamity().forceMelee = true; - int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, 30, 2f, projectile.owner, 0f, 0f); + int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); Main.projectile[projectile2].Calamity().forceMelee = true; } } diff --git a/Projectiles/Melee/MourningstarFlail.cs b/Projectiles/Melee/MourningstarFlail.cs index e108572efd..58d3a0702e 100644 --- a/Projectiles/Melee/MourningstarFlail.cs +++ b/Projectiles/Melee/MourningstarFlail.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = 4; + projectile.extraUpdates = 1; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) @@ -32,8 +33,10 @@ namespace CalamityMod.Projectiles.Melee // If it is to be rebalanced, consider replacing it with the FuckYou projectile (which does not mess with I-frames) if (projectile.localAI[1] <= 0f && projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, projectile.damage, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - } + int proj = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, projectile.damage, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].usesLocalNPCImmunity = true; + Main.projectile[proj].localNPCHitCooldown = 4; + } projectile.localAI[1] = 4f; } } diff --git a/Projectiles/Melee/Spears/AstralPikeProj.cs b/Projectiles/Melee/Spears/AstralPikeProj.cs index 3dcb01869d..a1c85d6fa0 100644 --- a/Projectiles/Melee/Spears/AstralPikeProj.cs +++ b/Projectiles/Melee/Spears/AstralPikeProj.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee.Spears speedY = MathHelper.Clamp(speedY, -15f, 15f); if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), 1f, projectile.owner); + int proj = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.4), 1f, projectile.owner, 3f, 0f); Main.projectile[proj].Calamity().forceMelee = true; } } diff --git a/Projectiles/Melee/Spears/EarthenPikeSpear.cs b/Projectiles/Melee/Spears/EarthenPikeSpear.cs index 940739a1db..a5889059b3 100644 --- a/Projectiles/Melee/Spears/EarthenPikeSpear.cs +++ b/Projectiles/Melee/Spears/EarthenPikeSpear.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.melee = true; //Dictates whether projectile is a melee-class weapon. projectile.timeLeft = 90; projectile.height = 40; //The height of the .png file in pixels divided by 2. + projectile.scale = 1.5f; projectile.friendly = true; projectile.hostile = false; projectile.tileCollide = false; diff --git a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs index 839d0b0979..91551c48ee 100644 --- a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs +++ b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs @@ -14,11 +14,12 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void SetDefaults() { - projectile.width = 35; //The width of the .png file in pixels divided by 2. + projectile.width = 40; //The width of the .png file in pixels divided by 2. projectile.aiStyle = 19; projectile.melee = true; //Dictates whether projectile is a melee-class weapon. projectile.timeLeft = 90; - projectile.height = 33; //The height of the .png file in pixels divided by 2. + projectile.height = 40; //The height of the .png file in pixels divided by 2. + projectile.scale = 1.5f; projectile.friendly = true; projectile.hostile = false; projectile.tileCollide = false; diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 1e94a744d9..b6490afd75 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -48,8 +48,11 @@ namespace CalamityMod.Projectiles.Melee.Spears return; Player player = Main.player[projectile.owner]; - player.statLife += 1; - player.HealEffect(1); + if (Main.rand.NextBool(2)) + { + player.statLife += 1; + player.HealEffect(1); + } } } } diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 1df1536735..49bd3f8949 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee.Spears if (Main.myPlayer == projectile.owner) { Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, - projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); + projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.4), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs index 63ecb07dfc..33437ed157 100644 --- a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs +++ b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override Action EffectBeforeReelback => (proj) => { Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, - projectile.velocity.X * 3.5f, projectile.velocity.Y * 3.5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); + projectile.velocity.X * 3.5f, projectile.velocity.Y * 3.5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); }; public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/TrueCausticEdgeProjectile.cs b/Projectiles/Melee/TrueCausticEdgeProjectile.cs index 2267713830..6df6fc0f28 100644 --- a/Projectiles/Melee/TrueCausticEdgeProjectile.cs +++ b/Projectiles/Melee/TrueCausticEdgeProjectile.cs @@ -49,7 +49,6 @@ namespace CalamityMod.Projectiles.Melee public override bool OnTileCollide(Vector2 oldVelocity) { - projectile.damage = (int)(projectile.damage * 1.25); projectile.penetrate--; if (projectile.penetrate <= 0) { diff --git a/Projectiles/Ranged/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs index 7537988e86..2ee30e1520 100644 --- a/Projectiles/Ranged/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -26,10 +26,6 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (projectile.timeLeft > 90) - { - projectile.timeLeft = 90; - } if (projectile.ai[0] > 7f) { float num296 = 1f; diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index a55ec15ef8..763c0c4803 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = -1; projectile.extraUpdates = 3; - projectile.timeLeft = 90; + projectile.timeLeft = 100; } public override void AI() @@ -31,10 +31,6 @@ namespace CalamityMod.Projectiles.Ranged projectile.scale *= 1.01f; } Lighting.AddLight(projectile.Center, 0.25f, 0f, 0.1f); - if (projectile.timeLeft > 90) - { - projectile.timeLeft = 90; - } if (projectile.ai[0] > 7f) { float scalar = 1f; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index 525c749cd1..82e8b0695d 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -32,6 +32,9 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (projectile.ai[0] == 3f) + CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 12f, 20); + if (projectile.ai[0] == 2f) { projectile.Calamity().rogue = true; diff --git a/Projectiles/Typeless/UnstableSpark.cs b/Projectiles/Typeless/UnstableSpark.cs index 96ccb95791..529d00478b 100644 --- a/Projectiles/Typeless/UnstableSpark.cs +++ b/Projectiles/Typeless/UnstableSpark.cs @@ -81,10 +81,6 @@ namespace CalamityMod.Projectiles.Typeless public override bool OnTileCollide(Vector2 oldVelocity) { - if (projectile.penetrate == 0) - { - projectile.Kill(); - } return false; } } diff --git a/Sounds/Item/PlasmaGrenadeExplosion.cs b/Sounds/Item/PlasmaGrenadeExplosion.cs new file mode 100644 index 0000000000..8d2a7939b7 --- /dev/null +++ b/Sounds/Item/PlasmaGrenadeExplosion.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class PlasmaGrenadeExplosion : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/PlasmaGrenadeExplosion.ogg b/Sounds/Item/PlasmaGrenadeExplosion.ogg new file mode 100644 index 0000000000..782b24b685 Binary files /dev/null and b/Sounds/Item/PlasmaGrenadeExplosion.ogg differ diff --git a/Tiles/PlacedRock.cs b/Tiles/PlacedRock.cs new file mode 100644 index 0000000000..742922575a --- /dev/null +++ b/Tiles/PlacedRock.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class PlacedRock : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + + dustType = DustID.Stone; + drop = ModContent.ItemType(); + + AddMapEntry(new Color(83, 91, 102)); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + WorldGen.Check1x1(i, j, Type); + return true; + } + + public override void PlaceInWorld(int i, int j, Item item) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + } +} diff --git a/Tiles/PlacedRock.png b/Tiles/PlacedRock.png new file mode 100644 index 0000000000..26f0ed28a1 Binary files /dev/null and b/Tiles/PlacedRock.png differ diff --git a/UI/ModeIndicatorUI.cs b/UI/ModeIndicatorUI.cs new file mode 100644 index 0000000000..23e7a31a24 --- /dev/null +++ b/UI/ModeIndicatorUI.cs @@ -0,0 +1,47 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.UI +{ + public class ModeIndicatorUI + { + public static readonly Vector2 OffsetToAreaCenter = new Vector2(0f, 4f); + public static Vector2 DifficultyIconOffset => new Vector2(0f, -16f); + public static Vector2 ArmageddonIconOffset => new Vector2(12f, 7f); + public static Vector2 DefiledRuneIconOffset => new Vector2(-12f, 7); + public static void Draw(SpriteBatch spriteBatch) + { + // The mode indicator should only be displayed when the inventory is open, to prevent obstruction. + if (!Main.playerInventory) + return; + + Texture2D outerAreaTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorArea"); + Texture2D revengeanceIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorRev"); + Texture2D deathIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorDeath"); + Texture2D armageddonIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorArma"); + + // CONSIDER: The defiled rune is scheduled to be removed. Possibly change the 3rd slot to occupy death instead of the + // death icon completely overtaking revengeance? + Texture2D defiledRuneIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorRune"); + + Vector2 drawCenter = new Vector2(Main.screenWidth - 400f, 72f) + outerAreaTexture.Size() * 0.5f; + + spriteBatch.Draw(outerAreaTexture, drawCenter, null, Color.White, 0f, outerAreaTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + if (CalamityWorld.revenge) + { + Texture2D difficultyIconToUse = CalamityWorld.death ? deathIconTexture : revengeanceIconTexture; + spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + } + + if (CalamityWorld.armageddon) + spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + + if (CalamityWorld.defiled) + spriteBatch.Draw(defiledRuneIconTexture, drawCenter + DefiledRuneIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + } + } +} diff --git a/build.txt b/build.txt index d530a48340..aadb9fff40 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 1.4.5.004 +version = 1.4.5.006 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes