diff --git a/Buffs/Pets/SirenLightPetBuff.png b/Buffs/Pets/SirenLightPetBuff.png index d3f7aa5885..e2ff5c8780 100644 Binary files a/Buffs/Pets/SirenLightPetBuff.png and b/Buffs/Pets/SirenLightPetBuff.png differ diff --git a/Buffs/StatBuffs/KamiBuff.cs b/Buffs/StatBuffs/KamiBuff.cs new file mode 100644 index 0000000000..0e89d7656b --- /dev/null +++ b/Buffs/StatBuffs/KamiBuff.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class KamiBuff : ModBuff + { + public const float RunSpeedBoost = 0.2f; + public const float RunAccelerationBoost = 0.4f; + public override void SetDefaults() + { + DisplayName.SetDefault("Kami Injection"); + Description.SetDefault("Increased defense, movement speed, and damage"); + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().kamiBoost = true; + } + } +} diff --git a/Buffs/StatBuffs/KamiBuff.png b/Buffs/StatBuffs/KamiBuff.png new file mode 100644 index 0000000000..4fdc0fff94 Binary files /dev/null and b/Buffs/StatBuffs/KamiBuff.png differ diff --git a/Buffs/StatBuffs/XerocRage.png b/Buffs/StatBuffs/XerocRage.png index b4dc31565c..5db048a016 100644 Binary files a/Buffs/StatBuffs/XerocRage.png and b/Buffs/StatBuffs/XerocRage.png differ diff --git a/Buffs/StatBuffs/XerocWrath.png b/Buffs/StatBuffs/XerocWrath.png index e8f6d0c6c1..60b04f7a73 100644 Binary files a/Buffs/StatBuffs/XerocWrath.png and b/Buffs/StatBuffs/XerocWrath.png differ diff --git a/Buffs/StatDebuffs/KamiDebuff.cs b/Buffs/StatDebuffs/KamiDebuff.cs new file mode 100644 index 0000000000..d554fa2441 --- /dev/null +++ b/Buffs/StatDebuffs/KamiDebuff.cs @@ -0,0 +1,33 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatDebuffs +{ + public class KamiDebuff : ModBuff + { + public const float MultiplicativeDamageReduction = 0.8f; + public const float MaxNPCSpeed = 16f; // Hard-cap for npc speed when afflicted with this debuff. Does not affect certain NPCs and does not affect any bosses (Basically only works on boss minions). + public override void SetDefaults() + { + DisplayName.SetDefault("Kami Flu"); + Description.SetDefault("Defenseless and dying"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().kamiFlu < npc.buffTime[buffIndex]) + npc.Calamity().kamiFlu = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().teslaFreeze = true; + } + } +} diff --git a/Buffs/StatDebuffs/KamiDebuff.png b/Buffs/StatDebuffs/KamiDebuff.png new file mode 100644 index 0000000000..df7af84f98 Binary files /dev/null and b/Buffs/StatDebuffs/KamiDebuff.png differ diff --git a/Buffs/Summon/Herring.png b/Buffs/Summon/Herring.png index aed61a6102..cd535e3c29 100644 Binary files a/Buffs/Summon/Herring.png and b/Buffs/Summon/Herring.png differ diff --git a/Buffs/Summon/SandyWaifu.png b/Buffs/Summon/SandyWaifu.png index fa0be1df22..a8e19f8ceb 100644 Binary files a/Buffs/Summon/SandyWaifu.png and b/Buffs/Summon/SandyWaifu.png differ diff --git a/Buffs/Summon/WaterWaifu.png b/Buffs/Summon/WaterWaifu.png index b9e9cafb73..090fe9a059 100644 Binary files a/Buffs/Summon/WaterWaifu.png and b/Buffs/Summon/WaterWaifu.png differ diff --git a/Buffs/Summon/WulfrumDroidBuff.png b/Buffs/Summon/WulfrumDroidBuff.png index 34b1c798e4..bec3e3f78c 100644 Binary files a/Buffs/Summon/WulfrumDroidBuff.png and b/Buffs/Summon/WulfrumDroidBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1d9d009eda..1bd1fede4c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -109,6 +109,9 @@ namespace CalamityMod.CalPlayer public Projectile lastProjectileHit; public double acidRoundMultiplier = 1D; public int waterLeechTarget = -1; + public float KameiTrailXScale = 0.1f; + public int KameiBladeUseDelay = 0; + public Vector2[] KameiOldPositions = new Vector2[4]; public double trueMeleeDamage = 0D; public double contactDamageReduction = 0D; public double projectileDamageReduction = 0D; @@ -253,6 +256,7 @@ namespace CalamityMod.CalPlayer public int throwingCrit = 0; public bool throwingAmmoCost75 = false; public bool throwingAmmoCost66 = false; + public bool throwingAmmoCost55 = false; public bool throwingAmmoCost50 = false; #endregion @@ -477,6 +481,7 @@ namespace CalamityMod.CalPlayer public bool depthCharm = false; public bool anechoicPlating = false; public bool jellyfishNecklace = false; + public bool abyssDivingGear = false; public bool abyssalAmulet = false; public bool lumenousAmulet = false; public bool reaperToothNecklace = false; @@ -626,6 +631,11 @@ namespace CalamityMod.CalPlayer public bool auricBoost = false; public bool daedalusReflect = false; public bool daedalusSplit = false; + public bool titanHeartSet = false; + public bool titanHeartMask = false; + public bool titanHeartMantle = false; + public bool titanHeartBoots = false; + public int titanCooldown = 0; public bool umbraphileSet = false; public bool reaverBlast = false; public bool reaverBurst = false; @@ -811,6 +821,7 @@ namespace CalamityMod.CalPlayer public bool hallowedDefense = false; public bool hallowedPower = false; public bool hallowedRegen = false; + public bool kamiBoost = false; #endregion #region Minion @@ -943,6 +954,10 @@ namespace CalamityMod.CalPlayer public bool snowmanForce; public bool snowmanNoseless; public bool snowmanPower; + public bool meldTransformationPrevious; + public bool meldTransformation; + public bool meldTransformationForce; + public bool meldTransformationPower; #endregion #endregion @@ -1307,6 +1322,7 @@ namespace CalamityMod.CalPlayer throwingCrit = 0; throwingAmmoCost75 = false; throwingAmmoCost66 = false; + throwingAmmoCost55 = false; throwingAmmoCost50 = false; accStealthGenBoost = 0f; @@ -1541,6 +1557,7 @@ namespace CalamityMod.CalPlayer hallowedDefense = false; hallowedRegen = false; hallowedPower = false; + kamiBoost = false; IBoots = false; elysianFire = false; sTracers = false; @@ -1583,6 +1600,7 @@ namespace CalamityMod.CalPlayer depthCharm = false; anechoicPlating = false; jellyfishNecklace = false; + abyssDivingGear = false; abyssalAmulet = false; lumenousAmulet = false; reaperToothNecklace = false; @@ -1607,6 +1625,10 @@ namespace CalamityMod.CalPlayer statigelSet = false; + titanHeartSet = false; + titanHeartMask = false; + titanHeartMantle = false; + titanHeartBoots = false; umbraphileSet = false; plagueReaper = false; plaguebringerPatronSet = false; @@ -1908,6 +1930,9 @@ namespace CalamityMod.CalPlayer snowmanPrevious = snowman; snowman = snowmanHide = snowmanForce = snowmanPower = false; + meldTransformationPrevious = meldTransformation; + meldTransformation = meldTransformationForce = meldTransformationPower = false; + rageModeActive = false; adrenalineModeActive = false; @@ -1964,8 +1989,6 @@ namespace CalamityMod.CalPlayer hallowedRuneCooldown = 0; doubledHorror = false; sulphurBubbleCooldown = 0; - forbiddenCooldown = 0; - tornadoCooldown = 0; ladHearts = 0; prismaticLasers = 0; @@ -2029,6 +2052,7 @@ namespace CalamityMod.CalPlayer throwingCrit = 0; throwingAmmoCost75 = false; throwingAmmoCost66 = false; + throwingAmmoCost55 = false; throwingAmmoCost50 = false; #endregion @@ -2061,6 +2085,7 @@ namespace CalamityMod.CalPlayer rRage = false; xRage = false; xWrath = false; + kamiBoost = false; graxDefense = false; encased = false; sMeleeBoost = false; @@ -2184,6 +2209,11 @@ namespace CalamityMod.CalPlayer reaverDoubleTap = false; shadeRegen = false; dsSetBonus = false; + titanHeartSet = false; + titanHeartMask = false; + titanHeartMantle = false; + titanHeartBoots = false; + titanCooldown = 0; umbraphileSet = false; reaverBlast = false; reaverBurst = false; @@ -2212,6 +2242,8 @@ namespace CalamityMod.CalPlayer desertProwler = false; snowRuffianSet = false; forbiddenCirclet = false; + forbiddenCooldown = 0; + tornadoCooldown = 0; eskimoSet = false; //vanilla armor meteorSet = false; //vanilla armor, for Space Gun nerf victideSet = false; @@ -2249,6 +2281,7 @@ namespace CalamityMod.CalPlayer elysianGuard = false; #endregion + KameiBladeUseDelay = 0; lastProjectileHit = null; if (CalamityWorld.bossRushActive) @@ -3263,6 +3296,10 @@ namespace CalamityMod.CalPlayer profanedCrystalHide = false; profanedCrystalForce = true; } + else if (item.type == ModContent.ItemType()) + { + abyssDivingGear = true; + } } } @@ -3579,6 +3616,7 @@ namespace CalamityMod.CalPlayer ((frostFlare && player.statLife < (int)(player.statLifeMax2 * 0.25)) ? 0.15f : 0f) + (auricSet ? 0.1f : 0f) + (dragonScales ? 0.1f : 0f) + + (kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) + (cTracers ? 0.1f : 0f) + (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + @@ -3598,6 +3636,7 @@ namespace CalamityMod.CalPlayer (cTracers ? 0.1f : 0f) + (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + + (kamiBoost ? KamiBuff.RunSpeedBoost : 0f) + (etherealExtorter && player.ZoneBeach ? 0.05f : 0f) + (stressPills ? 0.05f : 0f) + (laudanum && horror ? 0.1f : 0f) + @@ -3679,7 +3718,6 @@ namespace CalamityMod.CalPlayer } #endregion } - #endregion #region Rogue Mirrors @@ -3706,6 +3744,11 @@ namespace CalamityMod.CalPlayer Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); Main.projectile[lumenyl].frame = Main.rand.Next(0, 4); } + + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } } } @@ -3726,6 +3769,11 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Item68, Main.player[Main.myPlayer].position); int eclipseBurst = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(7000 * player.RogueDamage()), 0, player.whoAmI); + + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } } } #endregion @@ -4127,6 +4175,26 @@ namespace CalamityMod.CalPlayer { knockback *= 1.09f; } + if (titanHeartMask && item.Calamity().rogue) + { + knockback *= 1.05f; + } + if (titanHeartMantle && item.Calamity().rogue) + { + knockback *= 1.05f; + } + if (titanHeartBoots && item.Calamity().rogue) + { + knockback *= 1.05f; + } + if (titanHeartSet && item.Calamity().rogue) + { + knockback *= 1.2f; + } + if (titanHeartSet && StealthStrikeAvailable() && item.Calamity().rogue) + { + knockback *= 2f; + } bool ZoneForest = !ZoneAbyss && !ZoneSulphur && !ZoneAstral && !ZoneCalamity && !ZoneSunkenSea && !player.ZoneSnow && !player.ZoneCorrupt && !player.ZoneCrimson && !player.ZoneHoly && !player.ZoneDesert && !player.ZoneUndergroundDesert && !player.ZoneGlowshroom && !player.ZoneDungeon && !player.ZoneBeach && !player.ZoneMeteor; if (etherealExtorter) { @@ -6950,92 +7018,108 @@ namespace CalamityMod.CalPlayer } #endregion - #region Frame Effects - public override void FrameEffects() - { - if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot || - player.Calamity().andromedaState == AndromedaPlayerState.SpecialAttack) + #region Frame Effects + public override void FrameEffects() + { + if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot || + player.Calamity().andromedaState == AndromedaPlayerState.SpecialAttack) + { + player.head = mod.GetEquipSlot("NoHead", EquipType.Head); // To make the head invisible on the map. The map was having a hissy fit because of hitbox changes. + } + else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) + { + player.legs = mod.GetEquipSlot("ProviLegs", EquipType.Legs); + player.body = mod.GetEquipSlot("ProviBody", EquipType.Body); + player.head = mod.GetEquipSlot("ProviHead", EquipType.Head); + player.wings = mod.GetEquipSlot("ProviWings", EquipType.Wings); + player.face = -1; + + bool enrage = !profanedCrystalForce && profanedCrystalBuffs && player.statLife <= (int)(player.statLifeMax2 * 0.5); + + if (profanedCrystalWingCounter.Value == 0) + { + int key = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 7); + } + + player.wingFrame = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); + player.armorEffectDrawOutlines = true; + if (profanedCrystalBuffs) + { + player.armorEffectDrawShadow = true; + if (enrage) + { + player.armorEffectDrawOutlinesForbidden = true; + } + } + } + else if ((snowmanPower || snowmanForce) && !snowmanHide) + { + player.legs = mod.GetEquipSlot("PopoLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("PopoBody", EquipType.Body); + player.head = snowmanNoseless ? mod.GetEquipSlot("PopoNoselessHead", EquipType.Head) : mod.GetEquipSlot("PopoHead", EquipType.Head); + player.face = -1; + } + else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) + { + player.legs = mod.GetEquipSlot("AbyssalDivingSuitLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("AbyssalDivingSuitBody", EquipType.Body); + player.head = mod.GetEquipSlot("AbyssalDivingSuitHead", EquipType.Head); + player.face = -1; + } + else if ((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) + { + player.legs = mod.GetEquipSlot("SirenLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("SirenBody", EquipType.Body); + player.head = mod.GetEquipSlot("SirenHead", EquipType.Head); + player.face = -1; + } + else if ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide) + { + player.legs = mod.GetEquipSlot("SirenLegAlt", EquipType.Legs); + player.body = mod.GetEquipSlot("SirenBodyAlt", EquipType.Body); + player.head = mod.GetEquipSlot("SirenHeadAlt", EquipType.Head); + player.face = -1; + } + else if (meldTransformationPower || meldTransformationForce) { - player.head = mod.GetEquipSlot("NoHead", EquipType.Head); // To make the head invisible on the map. The map was having a hissy fit because of hitbox changes. + player.legs = mod.GetEquipSlot("MeldTransformationLegs", EquipType.Legs); + player.body = mod.GetEquipSlot("MeldTransformationBody", EquipType.Body); + player.head = mod.GetEquipSlot("MeldTransformationHead", EquipType.Head); } - else if (snowRuffianSet) - { - player.wings = mod.GetEquipSlot("SnowRuffWings", EquipType.Wings); - bool falling = player.gravDir == -1 ? player.velocity.Y < 0.05f : player.velocity.Y > 0.05f; - if (player.controlJump && falling) - { - player.velocity.Y *= 0.9f; - player.wingFrame = 3; + else + { + if (profanedCrystalWingCounter.Key != 1) + profanedCrystalWingCounter = new KeyValuePair(1, 7); + if (profanedCrystalAnimCounter.Key != 0) + profanedCrystalAnimCounter = new KeyValuePair(0, 10); + } + if (snowRuffianSet) + { + player.wings = mod.GetEquipSlot("SnowRuffWings", EquipType.Wings); + bool falling = player.gravDir == -1 ? player.velocity.Y < 0.05f : player.velocity.Y > 0.05f; + if (player.controlJump && falling) + { + player.velocity.Y *= 0.9f; + player.wingFrame = 3; player.noFallDmg = true; player.fallStart = (int)(player.position.Y / 16f); - } - } - else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) - { - player.legs = mod.GetEquipSlot("ProviLegs", EquipType.Legs); - player.body = mod.GetEquipSlot("ProviBody", EquipType.Body); - player.head = mod.GetEquipSlot("ProviHead", EquipType.Head); - player.wings = mod.GetEquipSlot("ProviWings", EquipType.Wings); + } + } + if (abyssDivingGear && (player.head == -1 || player.head == ArmorIDs.Head.FamiliarWig)) + { + player.head = mod.GetEquipSlot("AbyssDivingGearHead", EquipType.Head); + player.face = -1; + } - bool enrage = !profanedCrystalForce && profanedCrystalBuffs && player.statLife <= (int)(player.statLifeMax2 * 0.5); + if (CalamityWorld.defiled) + Defiled(); - if (profanedCrystalWingCounter.Value == 0) - { - int key = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 7); - } - - player.wingFrame = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); - player.armorEffectDrawOutlines = true; - if (profanedCrystalBuffs) - { - player.armorEffectDrawShadow = true; - if (enrage) - { - player.armorEffectDrawOutlinesForbidden = true; - } - } - } - else if ((snowmanPower || snowmanForce) && !snowmanHide) - { - player.legs = mod.GetEquipSlot("PopoLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("PopoBody", EquipType.Body); - player.head = snowmanNoseless ? mod.GetEquipSlot("PopoNoselessHead", EquipType.Head) : mod.GetEquipSlot("PopoHead", EquipType.Head); - } - else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - player.legs = mod.GetEquipSlot("AbyssalDivingSuitLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("AbyssalDivingSuitBody", EquipType.Body); - player.head = mod.GetEquipSlot("AbyssalDivingSuitHead", EquipType.Head); - } - else if ((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) - { - player.legs = mod.GetEquipSlot("SirenLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("SirenBody", EquipType.Body); - player.head = mod.GetEquipSlot("SirenHead", EquipType.Head); - } - else if ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide) - { - player.legs = mod.GetEquipSlot("SirenLegAlt", EquipType.Legs); - player.body = mod.GetEquipSlot("SirenBodyAlt", EquipType.Body); - player.head = mod.GetEquipSlot("SirenHeadAlt", EquipType.Head); - } - else - { - if (profanedCrystalWingCounter.Key != 1) - profanedCrystalWingCounter = new KeyValuePair(1, 7); - if (profanedCrystalAnimCounter.Key != 0) - profanedCrystalAnimCounter = new KeyValuePair(0, 10); - } - - if (CalamityWorld.defiled) - Defiled(); - - if (weakPetrification) - WeakPetrification(); - } - #endregion + if (weakPetrification) + WeakPetrification(); + } + #endregion #region Limitations private void WeakPetrification() @@ -7123,6 +7207,18 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.FemaleHit, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); //female hit noise hurtSoundTimer = 10; } + else if (titanHeartSet) + { + playSound = false; + Terraria.Audio.LegacySoundStyle atlasHurt = Utils.SelectRandom(Main.rand, new Terraria.Audio.LegacySoundStyle[] + { + mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AtlasHurt0"), + mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AtlasHurt1"), + mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AtlasHurt2") + }); + Main.PlaySound(atlasHurt, (int)player.position.X, (int)player.position.Y); + hurtSoundTimer = 10; + } } @@ -8311,11 +8407,11 @@ namespace CalamityMod.CalPlayer Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0) + NPC npc = Main.npc[i]; + if (npc.active && !npc.dontTakeDamage && !npc.friendly && !npc.townNPC && npc.immune[player.whoAmI] <= 0 && npc.damage > 0) { - NPC nPC = Main.npc[i]; Rectangle rect = nPC.getRect(); - if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) { OnDodge(); break; @@ -8324,9 +8420,9 @@ namespace CalamityMod.CalPlayer } for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0) + Projectile proj = Main.projectile[i]; + if (proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { - Projectile proj = Main.projectile[i]; Rectangle rect = proj.getRect(); if (rectangle.Intersects(rect)) { @@ -9319,10 +9415,40 @@ namespace CalamityMod.CalPlayer { if (drawInfo.shadow != 0f) return; - Player drawPlayer = drawInfo.drawPlayer; Item item = drawPlayer.ActiveItem(); + // Kamei trail/afterimage effect. + if (drawPlayer.Calamity().kamiBoost) + { + for (int i = drawPlayer.Calamity().KameiOldPositions.Length - 1; i > 0; i--) + { + if (drawPlayer.Calamity().KameiOldPositions[i - 1] == Vector2.Zero) + drawPlayer.Calamity().KameiOldPositions[i - 1] = drawPlayer.position; + drawPlayer.Calamity().KameiOldPositions[i] = drawPlayer.Calamity().KameiOldPositions[i - 1]; + } + drawPlayer.Calamity().KameiOldPositions[0] = drawPlayer.position; + + List existingDrawData = Main.playerDrawData; + for (int i = 0; i < drawPlayer.Calamity().KameiOldPositions.Length; i++) + { + float scale = MathHelper.Lerp(1f, 0.5f, i / (float)drawPlayer.Calamity().KameiOldPositions.Length); + float opacity = MathHelper.Lerp(0.25f, 0.08f, i / (float)drawPlayer.Calamity().KameiOldPositions.Length); + List afterimage = new List(); + for (int j = 0; j < existingDrawData.Count; j++) + { + var drawData = existingDrawData[j]; + drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; + drawData.color = Color.Cyan * opacity; + drawData.color.G = (byte)(drawData.color.G * 1.6); + drawData.color.B = (byte)(drawData.color.B * 1.2); + drawData.scale = new Vector2(scale); + afterimage.Add(drawData); + } + Main.playerDrawData.InsertRange(0, afterimage); + } + } + if (!drawPlayer.frozen && item.type > ItemID.None && !drawPlayer.dead && @@ -9482,6 +9608,7 @@ namespace CalamityMod.CalPlayer } } }); + public override void ModifyDrawInfo(ref PlayerDrawInfo drawInfo) { if (drawInfo.shadow != 0f) @@ -9881,8 +10008,8 @@ namespace CalamityMod.CalPlayer public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) { - // Dust modifications while high - if (trippy) + // Dust modifications while high + if (trippy) { if (Main.myPlayer == player.whoAmI) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index caacd536ce..1b4d16c477 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -339,8 +339,8 @@ namespace CalamityMod.CalPlayer { player.Calamity().andromedaState = AndromedaPlayerState.Inactive; } - - if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot) + + if(player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot) { player.width = 152; player.height = 212; @@ -905,6 +905,8 @@ namespace CalamityMod.CalPlayer // Cooldowns and timers if (modPlayer.gainRageCooldown > 0) modPlayer.gainRageCooldown--; + if (modPlayer.KameiBladeUseDelay > 0) + modPlayer.KameiBladeUseDelay--; if (modPlayer.galileoCooldown > 0) modPlayer.galileoCooldown--; if (modPlayer.soundCooldown > 0) @@ -981,6 +983,8 @@ namespace CalamityMod.CalPlayer modPlayer.titanBoost--; if (modPlayer.prismaticLasers > 0) modPlayer.prismaticLasers--; + if (modPlayer.titanCooldown > 0) + modPlayer.titanCooldown--; // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) @@ -1139,8 +1143,14 @@ namespace CalamityMod.CalPlayer player.endurance += 0.07f; } - // Absorber bonus - if (modPlayer.absorber) + if (modPlayer.kamiBoost) + { + player.allDamage += 0.3f; + player.statDefense += 20; + } + + // Absorber bonus + if (modPlayer.absorber) { player.moveSpeed += 0.12f; player.jumpSpeedBoost += 1.2f; @@ -3844,7 +3854,7 @@ namespace CalamityMod.CalPlayer #region Rogue Mirrors private static void RogueMirrors(Player player, CalamityPlayer modPlayer) { - Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); + Rectangle rectangle = new Rectangle((int)(player.position.X + player.velocity.X * 0.5f - 4f), (int)(player.position.Y + player.velocity.Y * 0.5f - 4f), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; diff --git a/CalamityMod.cs b/CalamityMod.cs index 0a6ea28421..53a32446b8 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -206,6 +206,7 @@ namespace CalamityMod public static List angryBonesList; public static List hornetList; public static List mossHornetList; + public static List bossMinionList; public static List legOverrideList; @@ -285,6 +286,12 @@ namespace CalamityMod AddEquipTexture(new SnowRuffianWings(), null, EquipType.Wings, "SnowRuffWings", "CalamityMod/Items/Armor/SnowRuffianWings"); + AddEquipTexture(new MeldTransformationHead(), null, EquipType.Head, "MeldTransformationHead", "CalamityMod/Items/Armor/MeldTransformation_Head"); + AddEquipTexture(new MeldTransformationBody(), null, EquipType.Body, "MeldTransformationBody", "CalamityMod/Items/Armor/MeldTransformation_Body", "CalamityMod/Items/Armor/MeldTransformation_Arms"); + AddEquipTexture(new MeldTransformationLegs(), null, EquipType.Legs, "MeldTransformationLegs", "CalamityMod/Items/Armor/MeldTransformation_Legs"); + + AddEquipTexture(new AbyssDivingGearHair(), null, EquipType.Head, "AbyssDivingGearHead", "CalamityMod/Items/Accessories/AbyssalDivingGear_Face"); + AstralCactusTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactus"); AstralCactusGlowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow"); AstralSky = ModContent.GetTexture("CalamityMod/ExtraTextures/AstralSky"); @@ -432,6 +439,7 @@ namespace CalamityMod angryBonesList = null; hornetList = null; mossHornetList = null; + bossMinionList = null; legOverrideList = null; @@ -729,7 +737,10 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType() + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), // Because of potential dust lag. + ModContent.ProjectileType() }; projectileDestroyExceptionList = new List() @@ -2587,6 +2598,107 @@ namespace CalamityMod NPCID.GiantMossHornet }; + bossMinionList = new List() + { + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.SlimeSpiked, + NPCID.ServantofCthulhu, + ModContent.NPCType(), + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.Creeper, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.SkeletronHand, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.LeechHead, + NPCID.LeechBody, + NPCID.LeechTail, + NPCID.WallofFleshEye, + NPCID.TheHungry, + NPCID.TheHungryII, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.PrimeCannon, + NPCID.PrimeLaser, + NPCID.PrimeSaw, + NPCID.PrimeVice, + ModContent.NPCType(), + NPCID.TheDestroyer, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.PlanterasTentacle, + ModContent.NPCType(), + NPCID.Spore, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.GolemFistLeft, + NPCID.GolemFistRight, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.CultistDragonHead, + NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, + NPCID.CultistDragonBody3, + NPCID.CultistDragonBody4, + NPCID.CultistDragonTail, + NPCID.AncientCultistSquidhead, + NPCID.MoonLordFreeEye, + NPCID.MoonLordHand, + NPCID.MoonLordHead, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + }; + Mod thorium = ModLoader.GetMod("ThoriumMod"); if (CalamityConfig.Instance.BuffThoriumBosses && thorium != null) { diff --git a/ExtraTextures/Chains/BallOFuguChain.png b/ExtraTextures/Chains/BallOFuguChain.png index 0a507b3c27..72c9a548c3 100644 Binary files a/ExtraTextures/Chains/BallOFuguChain.png and b/ExtraTextures/Chains/BallOFuguChain.png differ diff --git a/ExtraTextures/Lasers/UltimaRayEnd.png b/ExtraTextures/Lasers/UltimaRayEnd.png new file mode 100644 index 0000000000..26fefb2eb4 Binary files /dev/null and b/ExtraTextures/Lasers/UltimaRayEnd.png differ diff --git a/ExtraTextures/Lasers/UltimaRayMid.png b/ExtraTextures/Lasers/UltimaRayMid.png new file mode 100644 index 0000000000..9a13aa9d6b Binary files /dev/null and b/ExtraTextures/Lasers/UltimaRayMid.png differ diff --git a/ExtraTextures/Lasers/UltimaRayStart.png b/ExtraTextures/Lasers/UltimaRayStart.png new file mode 100644 index 0000000000..6ebfb4d0e7 Binary files /dev/null and b/ExtraTextures/Lasers/UltimaRayStart.png differ diff --git a/ExtraTextures/Tanks/Backpack_TheEmpyrean.png b/ExtraTextures/Tanks/Backpack_TheEmpyrean.png index 585763a882..9a350cbd98 100644 Binary files a/ExtraTextures/Tanks/Backpack_TheEmpyrean.png and b/ExtraTextures/Tanks/Backpack_TheEmpyrean.png differ diff --git a/Gores/LeviathanGores/LeviGore.png b/Gores/LeviathanGores/LeviGore.png new file mode 100644 index 0000000000..2fa7b63295 Binary files /dev/null and b/Gores/LeviathanGores/LeviGore.png differ diff --git a/Gores/LeviathanGores/LeviGore2.png b/Gores/LeviathanGores/LeviGore2.png new file mode 100644 index 0000000000..dd6f7cab00 Binary files /dev/null and b/Gores/LeviathanGores/LeviGore2.png differ diff --git a/Gores/LeviathanGores/LeviGore3.png b/Gores/LeviathanGores/LeviGore3.png new file mode 100644 index 0000000000..3021ab4ddc Binary files /dev/null and b/Gores/LeviathanGores/LeviGore3.png differ diff --git a/Gores/LeviathanGores/LeviGore4.png b/Gores/LeviathanGores/LeviGore4.png new file mode 100644 index 0000000000..be05c90eaa Binary files /dev/null and b/Gores/LeviathanGores/LeviGore4.png differ diff --git a/Gores/Leviathangib1.png b/Gores/Leviathangib1.png deleted file mode 100644 index 0ecb8917b0..0000000000 Binary files a/Gores/Leviathangib1.png and /dev/null differ diff --git a/Gores/Leviathangib2.png b/Gores/Leviathangib2.png deleted file mode 100644 index 439118a08d..0000000000 Binary files a/Gores/Leviathangib2.png and /dev/null differ diff --git a/Gores/Leviathangib3.png b/Gores/Leviathangib3.png deleted file mode 100644 index e574799f70..0000000000 Binary files a/Gores/Leviathangib3.png and /dev/null differ diff --git a/Gores/SirenGores/Siren.png b/Gores/SirenGores/Siren.png deleted file mode 100644 index 5fd3fd11c7..0000000000 Binary files a/Gores/SirenGores/Siren.png and /dev/null differ diff --git a/Gores/SirenGores/Siren2.png b/Gores/SirenGores/Siren2.png deleted file mode 100644 index 773164636b..0000000000 Binary files a/Gores/SirenGores/Siren2.png and /dev/null differ diff --git a/Gores/SirenGores/Siren3.png b/Gores/SirenGores/Siren3.png deleted file mode 100644 index 5fc6575960..0000000000 Binary files a/Gores/SirenGores/Siren3.png and /dev/null differ diff --git a/Gores/SirenGores/Siren4.png b/Gores/SirenGores/Siren4.png deleted file mode 100644 index d819fb0058..0000000000 Binary files a/Gores/SirenGores/Siren4.png and /dev/null differ diff --git a/Gores/SirenGores/Siren5.png b/Gores/SirenGores/Siren5.png deleted file mode 100644 index 21f1e550d5..0000000000 Binary files a/Gores/SirenGores/Siren5.png and /dev/null differ diff --git a/Items/Accessories/AbyssalDivingGear.cs b/Items/Accessories/AbyssalDivingGear.cs index a5ca41427f..202b02f1b9 100644 --- a/Items/Accessories/AbyssalDivingGear.cs +++ b/Items/Accessories/AbyssalDivingGear.cs @@ -6,54 +6,70 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - [AutoloadEquip(EquipType.Face)] - public class AbyssalDivingGear : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyssal Diving Gear"); - Tooltip.SetDefault("Reduces the damage caused by the pressure of the abyss while out of breath\n" + - "Removes the bleed effect caused by the abyss\n" + - "Grants the ability to swim and greatly extends underwater breathing\n" + - "Provides light underwater and extra mobility on ice\n" + - "Provides a moderate amount of light in the abyss\n" + - "Greatly reduces breath loss in the abyss"); - } + //[AutoloadEquip(EquipType.Face)] + public class AbyssalDivingGear : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abyssal Diving Gear"); + Tooltip.SetDefault("Reduces the damage caused by the pressure of the abyss while out of breath\n" + + "Removes the bleed effect caused by the abyss\n" + + "Grants the ability to swim and greatly extends underwater breathing\n" + + "Provides light underwater and extra mobility on ice\n" + + "Provides a moderate amount of light in the abyss\n" + + "Greatly reduces breath loss in the abyss"); + } - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = CalamityGlobalItem.Rarity7BuyPrice; - item.rare = 7; - item.accessory = true; - } + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; + item.accessory = true; + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.depthCharm = true; - modPlayer.jellyfishNecklace = true; - player.arcticDivingGear = true; - player.accFlipper = true; - player.accDivingHelm = true; - player.iceSkate = true; - if (player.wet) - { - Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.2f, 0.8f, 0.9f); - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.depthCharm = true; + modPlayer.jellyfishNecklace = true; + if (!hideVisual) + modPlayer.abyssDivingGear = true; //this bool is just used for drawing + player.arcticDivingGear = true; + player.accFlipper = true; + player.accDivingHelm = true; + player.iceSkate = true; + if (player.wet) + { + Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.2f, 0.8f, 0.9f); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ArcticDivingGear); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void UpdateVanity(Player player, EquipType type) + { + player.Calamity().abyssDivingGear = true; //this bool is just used for drawing + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ArcticDivingGear); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } + + public class AbyssDivingGearHair : EquipTexture + { + public override void DrawHair(ref bool drawHair, ref bool drawAltHair) + { + drawHair = false; + drawAltHair = false; + } + } } diff --git a/Items/Accessories/DarkGodsSheath.cs b/Items/Accessories/DarkGodsSheath.cs index 6726b95ace..4b81fed3d4 100644 --- a/Items/Accessories/DarkGodsSheath.cs +++ b/Items/Accessories/DarkGodsSheath.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 25); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/DarkGodsSheath.png b/Items/Accessories/DarkGodsSheath.png index f2bd3b2b32..0a71033b81 100644 Binary files a/Items/Accessories/DarkGodsSheath.png and b/Items/Accessories/DarkGodsSheath.png differ diff --git a/Items/Accessories/EnchantedPearl.png b/Items/Accessories/EnchantedPearl.png index a036b0d126..db3018d0fe 100644 Binary files a/Items/Accessories/EnchantedPearl.png and b/Items/Accessories/EnchantedPearl.png differ diff --git a/Items/Accessories/LeviathanAmbergris.png b/Items/Accessories/LeviathanAmbergris.png index 88034a76f7..35d439497c 100644 Binary files a/Items/Accessories/LeviathanAmbergris.png and b/Items/Accessories/LeviathanAmbergris.png differ diff --git a/Items/Accessories/LureofEnthrallment.png b/Items/Accessories/LureofEnthrallment.png index 91eb37c1de..d89b82671e 100644 Binary files a/Items/Accessories/LureofEnthrallment.png and b/Items/Accessories/LureofEnthrallment.png differ diff --git a/Items/Accessories/WifeinaBottle.png b/Items/Accessories/WifeinaBottle.png index bc29babf45..79320b4e72 100644 Binary files a/Items/Accessories/WifeinaBottle.png and b/Items/Accessories/WifeinaBottle.png differ diff --git a/Items/Accessories/Wings/MOAB.png b/Items/Accessories/Wings/MOAB.png index e67e251f22..ecafba2594 100644 Binary files a/Items/Accessories/Wings/MOAB.png and b/Items/Accessories/Wings/MOAB.png differ diff --git a/Items/Accessories/Wings/MOAB_Wings.png b/Items/Accessories/Wings/MOAB_Wings.png index b7e594948f..c02706a974 100644 Binary files a/Items/Accessories/Wings/MOAB_Wings.png and b/Items/Accessories/Wings/MOAB_Wings.png differ diff --git a/Items/Accessories/Wings/XerocWings.png b/Items/Accessories/Wings/XerocWings.png index 7e14b06cf9..5044f88358 100644 Binary files a/Items/Accessories/Wings/XerocWings.png and b/Items/Accessories/Wings/XerocWings.png differ diff --git a/Items/Accessories/Wings/XerocWings_Wings.png b/Items/Accessories/Wings/XerocWings_Wings.png index 62064efbca..22d8a51361 100644 Binary files a/Items/Accessories/Wings/XerocWings_Wings.png and b/Items/Accessories/Wings/XerocWings_Wings.png differ diff --git a/Items/Accessories/WulfrumBattery.png b/Items/Accessories/WulfrumBattery.png index 3bc19a4875..ada5ddef24 100644 Binary files a/Items/Accessories/WulfrumBattery.png and b/Items/Accessories/WulfrumBattery.png differ diff --git a/Items/Ammo/ArcticArrow.png b/Items/Ammo/ArcticArrow.png index d667dfa5b6..5fcacaa5de 100644 Binary files a/Items/Ammo/ArcticArrow.png and b/Items/Ammo/ArcticArrow.png differ diff --git a/Items/Ammo/ElysianArrow.png b/Items/Ammo/ElysianArrow.png index ed813a16ae..e0936c2556 100644 Binary files a/Items/Ammo/ElysianArrow.png and b/Items/Ammo/ElysianArrow.png differ diff --git a/Items/Ammo/IcicleArrow.png b/Items/Ammo/IcicleArrow.png index 6812f4d459..6be666a75d 100644 Binary files a/Items/Ammo/IcicleArrow.png and b/Items/Ammo/IcicleArrow.png differ diff --git a/Items/Ammo/NapalmArrow.png b/Items/Ammo/NapalmArrow.png index 254f05c605..48ef48d4c4 100644 Binary files a/Items/Ammo/NapalmArrow.png and b/Items/Ammo/NapalmArrow.png differ diff --git a/Items/Armor/DaedalusVisor.cs b/Items/Armor/DaedalusVisor.cs index 1fee11c457..a61a43b5b4 100644 --- a/Items/Armor/DaedalusVisor.cs +++ b/Items/Armor/DaedalusVisor.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.daedalusSplit = true; modPlayer.rogueStealthMax += 1.05f; - player.Calamity().throwingDamage += 0.05f; - player.Calamity().wearingRogueArmor = true; + modPlayer.throwingDamage += 0.05f; + modPlayer.wearingRogueArmor = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/MeldTransformation_Arms.png b/Items/Armor/MeldTransformation_Arms.png new file mode 100644 index 0000000000..d8caa7f60a Binary files /dev/null and b/Items/Armor/MeldTransformation_Arms.png differ diff --git a/Items/Armor/MeldTransformation_Body.png b/Items/Armor/MeldTransformation_Body.png new file mode 100644 index 0000000000..c35fedf436 Binary files /dev/null and b/Items/Armor/MeldTransformation_Body.png differ diff --git a/Items/Armor/MeldTransformation_Head.png b/Items/Armor/MeldTransformation_Head.png new file mode 100644 index 0000000000..6045927bc4 Binary files /dev/null and b/Items/Armor/MeldTransformation_Head.png differ diff --git a/Items/Armor/MeldTransformation_Legs.png b/Items/Armor/MeldTransformation_Legs.png new file mode 100644 index 0000000000..fbf2427684 Binary files /dev/null and b/Items/Armor/MeldTransformation_Legs.png differ diff --git a/Items/Armor/StatigelArmor.cs b/Items/Armor/StatigelArmor.cs index 86fe23c7e0..42fbd4e999 100644 --- a/Items/Armor/StatigelArmor.cs +++ b/Items/Armor/StatigelArmor.cs @@ -26,10 +26,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.meleeCrit += 5; - player.magicCrit += 5; - player.rangedCrit += 5; - player.Calamity().throwingCrit += 5; + player.Calamity().AllCritBoost(5); } public override void AddRecipes() diff --git a/Items/Armor/TitanHeartBoots.cs b/Items/Armor/TitanHeartBoots.cs new file mode 100644 index 0000000000..68ced6a884 --- /dev/null +++ b/Items/Armor/TitanHeartBoots.cs @@ -0,0 +1,42 @@ +using CalamityMod.Items.Materials; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Legs)] + public class TitanHeartBoots : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titan Heart Boots"); + Tooltip.SetDefault("10% increased rogue velocity and 5% boosted rogue knockback"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(0, 12, 0, 0); + item.rare = 5; + item.defense = 14; + } + + public override void UpdateEquip(Player player) + { + player.Calamity().titanHeartBoots = true; + player.Calamity().throwingVelocity += 0.1f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 14); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/TitanHeartBoots.png b/Items/Armor/TitanHeartBoots.png new file mode 100644 index 0000000000..97012de069 Binary files /dev/null and b/Items/Armor/TitanHeartBoots.png differ diff --git a/Items/Armor/TitanHeartBoots_Legs.png b/Items/Armor/TitanHeartBoots_Legs.png new file mode 100644 index 0000000000..dbd89ea24a Binary files /dev/null and b/Items/Armor/TitanHeartBoots_Legs.png differ diff --git a/Items/Armor/TitanHeartMantle.cs b/Items/Armor/TitanHeartMantle.cs new file mode 100644 index 0000000000..5ddc500f41 --- /dev/null +++ b/Items/Armor/TitanHeartMantle.cs @@ -0,0 +1,43 @@ +using CalamityMod.Items.Materials; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Body)] + public class TitanHeartMantle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titan Heart Mantle"); + Tooltip.SetDefault("45% chance to not consume rogue items\n" + + "5% boosted rogue knockback but 20% lowered rogue shoot speed"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(0, 12, 0, 0); + item.rare = 5; + item.defense = 17; + } + + public override void UpdateEquip(Player player) + { + player.Calamity().titanHeartMantle = true; + player.Calamity().throwingAmmoCost55 = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/TitanHeartMantle.png b/Items/Armor/TitanHeartMantle.png new file mode 100644 index 0000000000..fa0b8a8c39 Binary files /dev/null and b/Items/Armor/TitanHeartMantle.png differ diff --git a/Items/Armor/TitanHeartMantle_Arms.png b/Items/Armor/TitanHeartMantle_Arms.png new file mode 100644 index 0000000000..871f504511 Binary files /dev/null and b/Items/Armor/TitanHeartMantle_Arms.png differ diff --git a/Items/Armor/TitanHeartMantle_Body.png b/Items/Armor/TitanHeartMantle_Body.png new file mode 100644 index 0000000000..2aeac92624 Binary files /dev/null and b/Items/Armor/TitanHeartMantle_Body.png differ diff --git a/Items/Armor/TitanHeartMask.cs b/Items/Armor/TitanHeartMask.cs new file mode 100644 index 0000000000..db9b696842 --- /dev/null +++ b/Items/Armor/TitanHeartMask.cs @@ -0,0 +1,64 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Head)] + public class TitanHeartMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titan Heart Mask"); + Tooltip.SetDefault("5% increased rogue damage and knockback"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(0, 12, 0, 0); + item.rare = 5; + item.defense = 12; //43 + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "20% increased rogue damage and knockback\n" + + "Stealth strikes deal double knockback and cause an astral explosion\n" + + "Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" + + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.titanHeartSet = true; + modPlayer.throwingDamage += 0.2f; + modPlayer.rogueStealthMax += 1f; + modPlayer.wearingRogueArmor = true; + } + + public override void UpdateEquip(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.titanHeartMask = true; + modPlayer.throwingDamage += 0.05f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/TitanHeartMask.png b/Items/Armor/TitanHeartMask.png new file mode 100644 index 0000000000..2d29c5f4a3 Binary files /dev/null and b/Items/Armor/TitanHeartMask.png differ diff --git a/Items/Armor/TitanHeartMask_Head.png b/Items/Armor/TitanHeartMask_Head.png new file mode 100644 index 0000000000..0da57b829a Binary files /dev/null and b/Items/Armor/TitanHeartMask_Head.png differ diff --git a/Items/Armor/Vanity/AnahitaMask.cs b/Items/Armor/Vanity/AnahitaMask.cs new file mode 100644 index 0000000000..dbb1c899ec --- /dev/null +++ b/Items/Armor/Vanity/AnahitaMask.cs @@ -0,0 +1,22 @@ +using Terraria.ModLoader; +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class AnahitaMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Anahita Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() => false; + } +} diff --git a/Items/Armor/Vanity/AnahitaMask.png b/Items/Armor/Vanity/AnahitaMask.png new file mode 100644 index 0000000000..ad122a30d9 Binary files /dev/null and b/Items/Armor/Vanity/AnahitaMask.png differ diff --git a/Items/Armor/Vanity/AnahitaMask_Head.png b/Items/Armor/Vanity/AnahitaMask_Head.png new file mode 100644 index 0000000000..9e9469605b Binary files /dev/null and b/Items/Armor/Vanity/AnahitaMask_Head.png differ diff --git a/Items/Armor/Vanity/LeviathanMask.png b/Items/Armor/Vanity/LeviathanMask.png index cc7e565bfc..8f9f7e506e 100644 Binary files a/Items/Armor/Vanity/LeviathanMask.png and b/Items/Armor/Vanity/LeviathanMask.png differ diff --git a/Items/Armor/Vanity/LeviathanMask_Head.png b/Items/Armor/Vanity/LeviathanMask_Head.png index 28b1546778..ce1b8bbeee 100644 Binary files a/Items/Armor/Vanity/LeviathanMask_Head.png and b/Items/Armor/Vanity/LeviathanMask_Head.png differ diff --git a/Items/Armor/WulfrumArmor.png b/Items/Armor/WulfrumArmor.png index 6b588b347a..f99eacd3b0 100644 Binary files a/Items/Armor/WulfrumArmor.png and b/Items/Armor/WulfrumArmor.png differ diff --git a/Items/Armor/WulfrumArmor_Arms.png b/Items/Armor/WulfrumArmor_Arms.png index f4658bd88d..d746fc89f8 100644 Binary files a/Items/Armor/WulfrumArmor_Arms.png and b/Items/Armor/WulfrumArmor_Arms.png differ diff --git a/Items/Armor/WulfrumArmor_Body.png b/Items/Armor/WulfrumArmor_Body.png index 44e60bb227..0122566d95 100644 Binary files a/Items/Armor/WulfrumArmor_Body.png and b/Items/Armor/WulfrumArmor_Body.png differ diff --git a/Items/Armor/WulfrumArmor_FemaleBody.png b/Items/Armor/WulfrumArmor_FemaleBody.png index 44e60bb227..0122566d95 100644 Binary files a/Items/Armor/WulfrumArmor_FemaleBody.png and b/Items/Armor/WulfrumArmor_FemaleBody.png differ diff --git a/Items/Armor/WulfrumHeadgear.png b/Items/Armor/WulfrumHeadgear.png index 671c39b7f4..e6d08596e8 100644 Binary files a/Items/Armor/WulfrumHeadgear.png and b/Items/Armor/WulfrumHeadgear.png differ diff --git a/Items/Armor/WulfrumHeadgear_Head.png b/Items/Armor/WulfrumHeadgear_Head.png index 4ea3156130..cf9ef4f3ac 100644 Binary files a/Items/Armor/WulfrumHeadgear_Head.png and b/Items/Armor/WulfrumHeadgear_Head.png differ diff --git a/Items/Armor/WulfrumHelm.png b/Items/Armor/WulfrumHelm.png index 500b44d32a..b2611d63d1 100644 Binary files a/Items/Armor/WulfrumHelm.png and b/Items/Armor/WulfrumHelm.png differ diff --git a/Items/Armor/WulfrumHelm_Head.png b/Items/Armor/WulfrumHelm_Head.png index 1498d2b0be..9c56efc53a 100644 Binary files a/Items/Armor/WulfrumHelm_Head.png and b/Items/Armor/WulfrumHelm_Head.png differ diff --git a/Items/Armor/WulfrumHelmet.png b/Items/Armor/WulfrumHelmet.png index a531fdf4a6..e549a7c76e 100644 Binary files a/Items/Armor/WulfrumHelmet.png and b/Items/Armor/WulfrumHelmet.png differ diff --git a/Items/Armor/WulfrumHelmet_Head.png b/Items/Armor/WulfrumHelmet_Head.png index a62f01cf1d..50ce885f3f 100644 Binary files a/Items/Armor/WulfrumHelmet_Head.png and b/Items/Armor/WulfrumHelmet_Head.png differ diff --git a/Items/Armor/WulfrumHood.png b/Items/Armor/WulfrumHood.png index 73ea374b5a..82655fd91e 100644 Binary files a/Items/Armor/WulfrumHood.png and b/Items/Armor/WulfrumHood.png differ diff --git a/Items/Armor/WulfrumHood_Head.png b/Items/Armor/WulfrumHood_Head.png index dc5bcd550e..6b273ef5e1 100644 Binary files a/Items/Armor/WulfrumHood_Head.png and b/Items/Armor/WulfrumHood_Head.png differ diff --git a/Items/Armor/WulfrumLeggings.png b/Items/Armor/WulfrumLeggings.png index 6ed06d8882..ba9f776ea1 100644 Binary files a/Items/Armor/WulfrumLeggings.png and b/Items/Armor/WulfrumLeggings.png differ diff --git a/Items/Armor/WulfrumLeggings_Legs.png b/Items/Armor/WulfrumLeggings_Legs.png index 56268cf5de..9b96d20767 100644 Binary files a/Items/Armor/WulfrumLeggings_Legs.png and b/Items/Armor/WulfrumLeggings_Legs.png differ diff --git a/Items/Armor/WulfrumMask.png b/Items/Armor/WulfrumMask.png index 81852ac847..07edc75dce 100644 Binary files a/Items/Armor/WulfrumMask.png and b/Items/Armor/WulfrumMask.png differ diff --git a/Items/Armor/WulfrumMask_Head.png b/Items/Armor/WulfrumMask_Head.png index 77d7eabf9f..56756bdf03 100644 Binary files a/Items/Armor/WulfrumMask_Head.png and b/Items/Armor/WulfrumMask_Head.png differ diff --git a/Items/Armor/XerocCuisses.cs b/Items/Armor/XerocCuisses.cs index 7d20d317bd..c0ab2a23e2 100644 --- a/Items/Armor/XerocCuisses.cs +++ b/Items/Armor/XerocCuisses.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Armor { public override void SetStaticDefaults() { - DisplayName.SetDefault("Xeroc Cuisses"); + DisplayName.SetDefault("Empyrean Cuisses"); Tooltip.SetDefault("5% increased rogue damage and critical strike chance\n" + "20% increased movement speed\n" + "Speed of the cosmos"); diff --git a/Items/Armor/XerocCuisses.png b/Items/Armor/XerocCuisses.png index b2a9795649..86af5c1d75 100644 Binary files a/Items/Armor/XerocCuisses.png and b/Items/Armor/XerocCuisses.png differ diff --git a/Items/Armor/XerocCuisses_Legs.png b/Items/Armor/XerocCuisses_Legs.png index 38062343b0..9128b5898c 100644 Binary files a/Items/Armor/XerocCuisses_Legs.png and b/Items/Armor/XerocCuisses_Legs.png differ diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index 36ffe653b9..c1e064b27c 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor { public override void SetStaticDefaults() { - DisplayName.SetDefault("Xeroc Mask"); + DisplayName.SetDefault("Empyrean Mask"); Tooltip.SetDefault("11% increased rogue damage and critical strike chance, 22% increased movement speed\n" + "Temporary immunity to lava\n" + "Provides heat protection in Death Mode\n" + @@ -36,6 +36,8 @@ namespace CalamityMod.Items.Armor { player.armorEffectDrawShadow = true; player.armorEffectDrawOutlines = true; + player.Calamity().meldTransformation = true; + player.Calamity().meldTransformationForce = true; } public override void UpdateArmorSet(Player player) @@ -50,7 +52,7 @@ namespace CalamityMod.Items.Armor "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) { player.AddBuff(BuffID.Wrath, 2); player.AddBuff(BuffID.Rage, 2); @@ -78,4 +80,28 @@ namespace CalamityMod.Items.Armor recipe.AddRecipe(); } } + + public class MeldTransformationHead : EquipTexture + { + public override bool DrawHead() + { + return false; + } + } + + public class MeldTransformationBody : EquipTexture + { + public override bool DrawBody() + { + return false; + } + } + + public class MeldTransformationLegs : EquipTexture + { + public override bool DrawLegs() + { + return false; + } + } } diff --git a/Items/Armor/XerocMask.png b/Items/Armor/XerocMask.png index 7fc3160e93..47578c6049 100644 Binary files a/Items/Armor/XerocMask.png and b/Items/Armor/XerocMask.png differ diff --git a/Items/Armor/XerocMask_Head.png b/Items/Armor/XerocMask_Head.png index b7555ffc81..04e8bb52e5 100644 Binary files a/Items/Armor/XerocMask_Head.png and b/Items/Armor/XerocMask_Head.png differ diff --git a/Items/Armor/XerocPlateMail.cs b/Items/Armor/XerocPlateMail.cs index 3d439a6533..3d5091ce9d 100644 --- a/Items/Armor/XerocPlateMail.cs +++ b/Items/Armor/XerocPlateMail.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Armor { public override void SetStaticDefaults() { - DisplayName.SetDefault("Xeroc Plate Mail"); + DisplayName.SetDefault("Empyrean Cloak"); Tooltip.SetDefault("+20 max life\n" + "6% increased movement speed\n" + "7% increased rogue damage and critical strike chance\n" + diff --git a/Items/Armor/XerocPlateMail.png b/Items/Armor/XerocPlateMail.png index df27234edb..6fecf62e4a 100644 Binary files a/Items/Armor/XerocPlateMail.png and b/Items/Armor/XerocPlateMail.png differ diff --git a/Items/Armor/XerocPlateMail_Arms.png b/Items/Armor/XerocPlateMail_Arms.png index bba2164400..dc99ae730b 100644 Binary files a/Items/Armor/XerocPlateMail_Arms.png and b/Items/Armor/XerocPlateMail_Arms.png differ diff --git a/Items/Armor/XerocPlateMail_Body.png b/Items/Armor/XerocPlateMail_Body.png index 6fe45adf32..4b6581a9cb 100644 Binary files a/Items/Armor/XerocPlateMail_Body.png and b/Items/Armor/XerocPlateMail_Body.png differ diff --git a/Items/Armor/XerocPlateMail_FemaleBody.png b/Items/Armor/XerocPlateMail_FemaleBody.png deleted file mode 100644 index 6fe45adf32..0000000000 Binary files a/Items/Armor/XerocPlateMail_FemaleBody.png and /dev/null differ diff --git a/Items/Fishing/FishingRods/WulfrumRod.png b/Items/Fishing/FishingRods/WulfrumRod.png index 3371287464..593ae2bc0c 100644 Binary files a/Items/Fishing/FishingRods/WulfrumRod.png and b/Items/Fishing/FishingRods/WulfrumRod.png differ diff --git a/Items/LoreItems/KnowledgeAquaticScourge.cs b/Items/LoreItems/KnowledgeAquaticScourge.cs index 725d3ce13d..c00a8083ea 100644 --- a/Items/LoreItems/KnowledgeAquaticScourge.cs +++ b/Items/LoreItems/KnowledgeAquaticScourge.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A horror born of pollution and insatiable hunger; based on size alone this was merely a juvenile.\n" + "These scourge creatures are the largest aquatic predators and very rarely do they frequent such shallow waters.\n" + "Place in your inventory to gain immunity to the sulphurous waters and increase the stat gains from the Well Fed buff.\n" + - "However, without the Well Fed buff your stats will decrease due to your insatiable hunger."); + "However, without the Well Fed buff your stats will decrease due to your insatiable hunger.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,11 +32,12 @@ namespace CalamityMod.Items.LoreItems return false; } - public override void UpdateInventory(Player player) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aquaticScourgeLore = true; - } + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + if (item.favorited) + modPlayer.aquaticScourgeLore = true; + } public override void AddRecipes() { diff --git a/Items/LoreItems/KnowledgeAstrumAureus.cs b/Items/LoreItems/KnowledgeAstrumAureus.cs index 7b1d99ae7d..afff87fd71 100644 --- a/Items/LoreItems/KnowledgeAstrumAureus.cs +++ b/Items/LoreItems/KnowledgeAstrumAureus.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Astrum Aureus"); Tooltip.SetDefault("A titanic cyborg infected by a star-borne disease expelled from the belly of an ancient god.\n" + "The destruction of this creature will not prevent the spread of the disease.\n" + - "Place in your inventory to gain increased jump speed in space."); + "Place in your inventory to gain increased jump speed in space.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astrumAureusLore = true; + if (item.favorited) + modPlayer.astrumAureusLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeAstrumDeus.cs b/Items/LoreItems/KnowledgeAstrumDeus.cs index e892c5c7e8..a8b5376105 100644 --- a/Items/LoreItems/KnowledgeAstrumDeus.cs +++ b/Items/LoreItems/KnowledgeAstrumDeus.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Astrum Deus"); Tooltip.SetDefault("God of the stars and largest vessel for the Astral Infection.\n" + "Though struck down from its place among the stars its remnants have gathered strength, aiming to take its rightful place in the cosmos once more.\n" + - "Place in your inventory to gain increased movement speed in space."); + "Place in your inventory to gain increased movement speed in space.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astrumDeusLore = true; + if (item.favorited) + modPlayer.astrumDeusLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.cs b/Items/LoreItems/KnowledgeBrainofCthulhu.cs index 4e6a899dbb..e5f11cc641 100644 --- a/Items/LoreItems/KnowledgeBrainofCthulhu.cs +++ b/Items/LoreItems/KnowledgeBrainofCthulhu.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Most likely another abomination spawned from this inchoate mass of flesh.\n" + "Allows you to teleport similar to the Rod of Discord while in the crimson. Place in your hotbar to use it.\n" + "Teleportation is disabled while Chaos State is active.\n" + - "However, you become confused for a few seconds after you use it due to your overwhelming brain power."); + "However, you become confused for a few seconds after you use it due to your overwhelming brain power.\n" + + "Teleportation only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override bool CanUseItem(Player player) { - return player.ZoneCrimson; + return player.ZoneCrimson && item.favorited; } public override bool UseItem(Player player) diff --git a/Items/LoreItems/KnowledgeBrimstoneElemental.cs b/Items/LoreItems/KnowledgeBrimstoneElemental.cs index 336c1e75a2..d9a666e5d1 100644 --- a/Items/LoreItems/KnowledgeBrimstoneElemental.cs +++ b/Items/LoreItems/KnowledgeBrimstoneElemental.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Brimstone Elemental"); Tooltip.SetDefault("The most powerful of the elementals, bent on exacting revenge upon the bloody inferno that demolished her home.\n" + "Finally put to rest, she will suffer no longer from the grief caused by the deaths of her people.\n" + - "Place in your inventory to improve the inferno potion effect."); + "Place in your inventory to improve the inferno potion effect.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneElementalLore = true; + if (item.favorited) + modPlayer.brimstoneElementalLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCalamitas.cs b/Items/LoreItems/KnowledgeCalamitas.cs index a4f20b294d..d2cddd9d9c 100644 --- a/Items/LoreItems/KnowledgeCalamitas.cs +++ b/Items/LoreItems/KnowledgeCalamitas.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The witch unrivaled. Perhaps the only one amongst my cohorts to have ever given me cause for doubt.\n" + "Now that you have defeated her your destiny is clear.\n" + "Come now, face me.\n" + - "Place in your inventory to die instantly from every hit."); + "Place in your inventory to die instantly from every hit.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.SCalLore = true; + if (item.favorited) + modPlayer.SCalLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCrabulon.cs b/Items/LoreItems/KnowledgeCrabulon.cs index 57bf38da6e..1b2116ca4e 100644 --- a/Items/LoreItems/KnowledgeCrabulon.cs +++ b/Items/LoreItems/KnowledgeCrabulon.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A crab and its mushrooms, a love story.\n" + "It's interesting how creatures can adapt given certain circumstances.\n" + "Place in your inventory to gain the Mushy buff while underground or in the mushroom biome.\n" + - "However, your movement speed will be decreased while in these areas due to you being covered in fungi."); + "However, your movement speed will be decreased while in these areas due to you being covered in fungi.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.crabulonLore = true; + if (item.favorited) + modPlayer.crabulonLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCryogen.cs b/Items/LoreItems/KnowledgeCryogen.cs index 184c4b9776..16b985b6f8 100644 --- a/Items/LoreItems/KnowledgeCryogen.cs +++ b/Items/LoreItems/KnowledgeCryogen.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Cryogen"); Tooltip.SetDefault("The archmage's prison.\n" + "I am unsure if it has grown weaker over the decades of imprisonment.\n" + - "Place in your inventory to gain a frost dash that freezes enemies, at the cost of slightly reduced defense due to your brittle body."); + "Place in your inventory to gain a frost dash that freezes enemies, at the cost of slightly reduced defense due to your brittle body.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dashMod = 6; + if (item.favorited) + modPlayer.dashMod = 6; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDesertScourge.cs b/Items/LoreItems/KnowledgeDesertScourge.cs index 082f206049..a631c734fa 100644 --- a/Items/LoreItems/KnowledgeDesertScourge.cs +++ b/Items/LoreItems/KnowledgeDesertScourge.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "What used to be a majestic beast swimming through the water has now become a dried-up and\n" + "gluttonous husk, constantly on a voracious search for its next meal.\n" + "Place in your inventory for an increase to defense while in the desert or sunken sea.\n" + - "However, you will deal decreased damage while in these areas due to being a husk of your former self."); + "However, you will deal decreased damage while in these areas due to being a husk of your former self.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - player.Calamity().desertScourgeLore = true; + if (item.favorited) + player.Calamity().desertScourgeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDestroyer.cs b/Items/LoreItems/KnowledgeDestroyer.cs index 55303b8bff..5c3141b702 100644 --- a/Items/LoreItems/KnowledgeDestroyer.cs +++ b/Items/LoreItems/KnowledgeDestroyer.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A machine brought to life by the mighty souls of warriors, and built to excavate massive tunnels in planets to gather resources.\n" + "Could have proven useful if Draedon didn't have an obsession with turning everything into a tool of destruction.\n" + "Place in your inventory to gain a boost to your pick speed.\n" + - "However, your max acceleration is decreased slightly due to you feeling heavier."); + "However, your max acceleration is decreased slightly due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.destroyerLore = true; + if (item.favorited) + modPlayer.destroyerLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDevourerofGods.cs b/Items/LoreItems/KnowledgeDevourerofGods.cs index c7b2f2d492..3cf2fa69fd 100644 --- a/Items/LoreItems/KnowledgeDevourerofGods.cs +++ b/Items/LoreItems/KnowledgeDevourerofGods.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("This serpent’s power to assimilate the abilities and energy of those it consumed is unique in almost all the known cosmos, save for its lesser brethren.\n" + "I would have soon had to eliminate it as a threat had it been given more time and creatures to feast upon.\n" + "Place in your inventory to boost the power of your true melee strikes by 25%.\n" + - "However, due to your reckless nature you will take increased damage."); + "However, due to your reckless nature you will take increased damage.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.DoGLore = true; + if (item.favorited) + modPlayer.DoGLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDukeFishron.cs b/Items/LoreItems/KnowledgeDukeFishron.cs index 516bd28ad7..fdc59c60bd 100644 --- a/Items/LoreItems/KnowledgeDukeFishron.cs +++ b/Items/LoreItems/KnowledgeDukeFishron.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The mutant terror of the sea was once the trusted companion of an old king; he tamed it using its favorite treat.\n" + "Long ago, the creature flew in desperation from the raging bloody inferno consuming its home, ultimately finding its way to the ocean.\n" + "Place in your inventory for an increase to all damage, crit and movement speed while submerged in liquid.\n" + - "However, while not submerged in liquid you will have slightly decreased damage, crit and movement speed due to feeling dried out."); + "However, while not submerged in liquid you will have slightly decreased damage, crit and movement speed due to feeling dried out.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dukeFishronLore = true; + if (item.favorited) + modPlayer.dukeFishronLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeEaterofWorlds.cs b/Items/LoreItems/KnowledgeEaterofWorlds.cs index 40a7adf76f..83269fc9a3 100644 --- a/Items/LoreItems/KnowledgeEaterofWorlds.cs +++ b/Items/LoreItems/KnowledgeEaterofWorlds.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Perhaps it was just a giant worm infected by the microbe, given centuries to feed and grow its festering body.\n" + "Seems likely, given the origins of this place.\n" + "Deadly microbes spawn around you while this is placed in your inventory.\n" + - "However, you will have decreased life regen due to your skin rotting off."); + "However, you will have decreased life regen due to your skin rotting off.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.eaterOfWorldsLore = true; + if (item.favorited) + modPlayer.eaterOfWorldsLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeEyeofCthulhu.cs b/Items/LoreItems/KnowledgeEyeofCthulhu.cs index 61a1a60a44..086355307c 100644 --- a/Items/LoreItems/KnowledgeEyeofCthulhu.cs +++ b/Items/LoreItems/KnowledgeEyeofCthulhu.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("That eye...how peculiar.\n" + "I sensed it watching you more intensely as you grew stronger.\n" + "Place in your inventory for night vision at night.\n" + - "However, your vision is reduced during the day."); + "However, your vision is reduced during the day.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,10 +32,13 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (!Main.dayTime) - player.nightVision = true; - else - player.blind = true; + if (item.favorited) + { + if (!Main.dayTime) + player.nightVision = true; + else + player.blind = true; + } } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeGolem.cs b/Items/LoreItems/KnowledgeGolem.cs index 4fc871658b..d661b84483 100644 --- a/Items/LoreItems/KnowledgeGolem.cs +++ b/Items/LoreItems/KnowledgeGolem.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Golem"); Tooltip.SetDefault("A primitive construct.\n" + "I admire the lihzahrd race for their ingenuity, though finding faith in such a flawed idol would invariably lead to their downfall.\n" + - "Place in your inventory to gain increased defense while standing still."); + "Place in your inventory to gain increased defense while standing still.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.golemLore = true; + if (item.favorited) + modPlayer.golemLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeHiveMind.cs b/Items/LoreItems/KnowledgeHiveMind.cs index 2d7b59c989..9ad9b6dbd9 100644 --- a/Items/LoreItems/KnowledgeHiveMind.cs +++ b/Items/LoreItems/KnowledgeHiveMind.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A hive of clustered microbial-infected flesh.\n" + "I do not believe killing it will lessen the corruption here.\n" + "Place in your inventory for all of your projectiles to inflict cursed flames when in the corruption.\n" + - "However, enemy spawn rates will be greatly reduced while in the corruption due to your overwhelmingly-putrid odor."); + "However, enemy spawn rates will be greatly reduced while in the corruption due to your overwhelmingly-putrid odor.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneCorrupt) + if (player.ZoneCorrupt && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.hiveMindLore = true; diff --git a/Items/LoreItems/KnowledgeKingSlime.cs b/Items/LoreItems/KnowledgeKingSlime.cs index 9b7704180f..1af39c4988 100644 --- a/Items/LoreItems/KnowledgeKingSlime.cs +++ b/Items/LoreItems/KnowledgeKingSlime.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Only a fool could be caught by this pitiful excuse for a hunter.\n" + "Unfortunately, our world has no shortage of those.\n" + "Place in your inventory to gain a slight movement speed and jump boost.\n" + - "However, your defense is slightly reduced due to your gelatinous body."); + "However, your defense is slightly reduced due to your gelatinous body.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,7 +32,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - player.Calamity().kingSlimeLore = true; + if (item.favorited) + player.Calamity().kingSlimeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.cs b/Items/LoreItems/KnowledgeLeviathanandSiren.cs index b0207cd611..e95bef421f 100644 --- a/Items/LoreItems/KnowledgeLeviathanandSiren.cs +++ b/Items/LoreItems/KnowledgeLeviathanandSiren.cs @@ -16,7 +16,8 @@ namespace CalamityMod.Items.LoreItems "Perhaps two genetic misfits outcast from their homes that found comfort in assisting one another.\n" + "Place in your inventory to gain increased max health while wearing the siren heart and treasure detect while wearing the strange orb.\n" + "Allows the young siren pet to move normally while outside of liquids.\n" + - "However, if you're not submerged in liquid you will have decreased defense and damage reduction."); + "However, if you're not submerged in liquid you will have decreased defense and damage reduction.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.leviathanAndSirenLore = true; + if (item.favorited) + modPlayer.leviathanAndSirenLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.png b/Items/LoreItems/KnowledgeLeviathanandSiren.png index 155928f2bf..b1e8746bb8 100644 Binary files a/Items/LoreItems/KnowledgeLeviathanandSiren.png and b/Items/LoreItems/KnowledgeLeviathanandSiren.png differ diff --git a/Items/LoreItems/KnowledgeLunaticCultist.cs b/Items/LoreItems/KnowledgeLunaticCultist.cs index 85eefb0946..4ddea4544f 100644 --- a/Items/LoreItems/KnowledgeLunaticCultist.cs +++ b/Items/LoreItems/KnowledgeLunaticCultist.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Someone I once held in such contempt for his actions is now...deceased, his sealing ritual undone...prepare for the end.\n" + "Your impending doom approaches...\n" + "Place in your inventory for an increase to all stats during the lunar event.\n" + - "However, your vision is decreased due to eldritch knowledge damaging your mind."); + "However, your vision is decreased due to eldritch knowledge damaging your mind.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (NPC.LunarApocalypseIsUp) + if (NPC.LunarApocalypseIsUp && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.lunaticCultistLore = true; diff --git a/Items/LoreItems/KnowledgeMoonLord.cs b/Items/LoreItems/KnowledgeMoonLord.cs index de993228b6..6d023e3fcb 100644 --- a/Items/LoreItems/KnowledgeMoonLord.cs +++ b/Items/LoreItems/KnowledgeMoonLord.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Had it been fully restored it would have been a force to behold, but what you fought was an empty shell.\n" + "However, that doesn't diminish the immense potential locked within it, released upon its death.\n" + "Place in your inventory to gain an improved Gravity Globe that gives you an increase to all stats while upside down.\n" + - "However, while not upside down you have permanent featherfall."); + "However, while not upside down you have permanent featherfall.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.moonLordLore = true; + if (item.favorited) + modPlayer.moonLordLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeOldDuke.cs b/Items/LoreItems/KnowledgeOldDuke.cs index 78a1498a80..6df689a8c1 100644 --- a/Items/LoreItems/KnowledgeOldDuke.cs +++ b/Items/LoreItems/KnowledgeOldDuke.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Old Duke"); Tooltip.SetDefault("Strange, to find out that the mutant terror of the seas was not alone in its unique biology.\n" + "Perhaps I was mistaken to classify the creature from its relation to pigrons alone.\n" + - "Place in your inventory to convert negative effects from the Acid Rain debuff to positive effects."); + "Place in your inventory to convert negative effects from the Acid Rain debuff to positive effects.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.boomerDukeLore = true; + if (item.favorited) + modPlayer.boomerDukeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePerforators.cs b/Items/LoreItems/KnowledgePerforators.cs index aed58f7645..53dbe77a77 100644 --- a/Items/LoreItems/KnowledgePerforators.cs +++ b/Items/LoreItems/KnowledgePerforators.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Perforators and their Hive"); Tooltip.SetDefault("An abomination of comingled flesh, bone, and organ, infested primarily by blood-slurping worms.\n" + "Place in your inventory for all of your projectiles to inflict ichor when in the crimson.\n" + - "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus."); + "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneCrimson) + if (player.ZoneCrimson && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.perforatorLore = true; diff --git a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs index 54bc9ee369..4f88bf176c 100644 --- a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs +++ b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Plaguebringer Goliath"); Tooltip.SetDefault("A horrific amalgam of steel, flesh, and infection, capable of destroying an entire civilization in just one onslaught.\n" + "Its plague nuke barrage can leave an entire area uninhabitable for months. A shame that it came to this but the plague must be contained.\n" + - "Place in your inventory to gain increased wing flight time, but at the cost of reduced life regen."); + "Place in your inventory to gain increased wing flight time, but at the cost of reduced life regen.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.plaguebringerGoliathLore = true; + if (item.favorited) + modPlayer.plaguebringerGoliathLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePlantera.cs b/Items/LoreItems/KnowledgePlantera.cs index b5a07a9743..7c71900847 100644 --- a/Items/LoreItems/KnowledgePlantera.cs +++ b/Items/LoreItems/KnowledgePlantera.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Well done, you killed a plant.\n" + "It was used as a vessel to house the spirits of those unfortunate enough to find their way down here.\n" + "I wish you luck in dealing with the fallout.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.planteraLore = true; + if (item.favorited) + modPlayer.planteraLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePolterghast.cs b/Items/LoreItems/KnowledgePolterghast.cs index 80488cdddb..acce6e2081 100644 --- a/Items/LoreItems/KnowledgePolterghast.cs +++ b/Items/LoreItems/KnowledgePolterghast.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Polterghast"); Tooltip.SetDefault("A creature born of hatred and anger, formed by countless human souls with all of their energy entirely devoted to consuming others.\n" + "It seems a waste to have had such a potent source of power ravage mindlessly through these empty halls.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.polterghastLore = true; + if (item.favorited) + modPlayer.polterghastLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeProvidence.cs b/Items/LoreItems/KnowledgeProvidence.cs index 4c6d5cb9e0..16183e5179 100644 --- a/Items/LoreItems/KnowledgeProvidence.cs +++ b/Items/LoreItems/KnowledgeProvidence.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A core surrounded by stone and flame, a simple origin and a simple goal.\n" + "What would have become of us had she not been defeated is a frightening concept to consider.\n" + "Place in your inventory to imbue all projectiles with profaned flames, causing them to inflict extra damage.\n" + - "However, your max life is decreased due to a part of your soul being required to fuel the profaned flames."); + "However, your max life is decreased due to a part of your soul being required to fuel the profaned flames.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.providenceLore = true; + if (item.favorited) + modPlayer.providenceLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeQueenBee.cs b/Items/LoreItems/KnowledgeQueenBee.cs index f4ed7c5ed5..b91706e5ae 100644 --- a/Items/LoreItems/KnowledgeQueenBee.cs +++ b/Items/LoreItems/KnowledgeQueenBee.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("Queen Bee"); Tooltip.SetDefault("As crude as the giant insects are they can prove useful in certain situations...given the ability to control them.\n" + - "Place in your inventory to make small bees and weak hornets friendly."); + "Place in your inventory to make small bees and weak hornets friendly.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -31,7 +32,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.queenBeeLore = true; + if (item.favorited) + modPlayer.queenBeeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeRavager.cs b/Items/LoreItems/KnowledgeRavager.cs index 8a2b2fc156..461310f14d 100644 --- a/Items/LoreItems/KnowledgeRavager.cs +++ b/Items/LoreItems/KnowledgeRavager.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Ravager"); Tooltip.SetDefault("The flesh golem constructed using twisted necromancy during the time of my conquest to counter my unstoppable forces.\n" + "Its creators were slaughtered by it moments after its conception. It is for the best that it has been destroyed.\n" + - "Place in your inventory to gain an increase to all damage, but at the cost of reduced wing flight time."); + "Place in your inventory to gain an increase to all damage, but at the cost of reduced wing flight time.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.ravagerLore = true; + if (item.favorited) + modPlayer.ravagerLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeSkeletron.cs b/Items/LoreItems/KnowledgeSkeletron.cs index 81a3cf3fdc..8f54da002b 100644 --- a/Items/LoreItems/KnowledgeSkeletron.cs +++ b/Items/LoreItems/KnowledgeSkeletron.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The curse is said to only affect the elderly.\n" + "After they are afflicted they become an immortal vessel for an ancient demon of the underworld.\n" + "Place in your inventory to gain increased damage while in the dungeon.\n" + - "However, your max health is decreased due to Skeletron's curse."); + "However, your max health is decreased due to Skeletron's curse.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneDungeon) + if (player.ZoneDungeon && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.skeletronLore = true; diff --git a/Items/LoreItems/KnowledgeSkeletronPrime.cs b/Items/LoreItems/KnowledgeSkeletronPrime.cs index bbb95cff60..22239ad9f4 100644 --- a/Items/LoreItems/KnowledgeSkeletronPrime.cs +++ b/Items/LoreItems/KnowledgeSkeletronPrime.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("What a silly and pointless contraption for something created with the essence of pure terror.\n" + "Draedon obviously took several liberties with its design...I am not impressed.\n" + "Place in your inventory to gain a boost to your armor penetration.\n" + - "However, your max acceleration is decreased due to you feeling heavier."); + "However, your max acceleration is decreased due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.skeletronPrimeLore = true; + if (item.favorited) + modPlayer.skeletronPrimeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index e980523588..c194ec932f 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("It is a travesty, one of the most threatening biological terrors ever created.\n" + "If this creature were allowed to combine every slime on the planet it would become nearly unstoppable.\n" + "Place in your inventory to become slimed and able to slide around on tiles quickly, at the cost of reduced defense.\n" + - "This effect makes dashing more difficult and does not work with mounts."); + "This effect makes dashing more difficult and does not work with mounts.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.mount.Active) + if (player.mount.Active || !item.favorited) return; if (player.dashDelay < 0) diff --git a/Items/LoreItems/KnowledgeTwins.cs b/Items/LoreItems/KnowledgeTwins.cs index 7314c7f2ba..1514675839 100644 --- a/Items/LoreItems/KnowledgeTwins.cs +++ b/Items/LoreItems/KnowledgeTwins.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "These creatures did not belong in this world, it's best to be rid of them.\n" + "Place in your inventory to gain invisibility and rogue bonuses at night.\n" + "However, your defense is reduced while above 50% life due to you feeling softer.\n" + - "Your max acceleration is reduced while below 50% life due to you feeling heavier."); + "Your max acceleration is reduced while below 50% life due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.twinsLore = true; + if (item.favorited) + modPlayer.twinsLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeWallofFlesh.cs b/Items/LoreItems/KnowledgeWallofFlesh.cs index 7f485be3dc..6c4b7a7015 100644 --- a/Items/LoreItems/KnowledgeWallofFlesh.cs +++ b/Items/LoreItems/KnowledgeWallofFlesh.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("I see the deed is done.\n" + "The unholy amalgamation of flesh and hatred has been defeated.\n" + "Prepare to face the terrors that lurk in the light and dark parts of this world.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.wallOfFleshLore = true; + if (item.favorited) + modPlayer.wallOfFleshLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeYharon.cs b/Items/LoreItems/KnowledgeYharon.cs index 535ff8a48d..bbf5a90a42 100644 --- a/Items/LoreItems/KnowledgeYharon.cs +++ b/Items/LoreItems/KnowledgeYharon.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Jungle Dragon, Yharon"); Tooltip.SetDefault("I would not be able to bear a world without my faithful companion by my side.\n" + "Fortunately, fate will have it so that it is a world I shall never have to see, for better or for worse.\n" + - "Place in your inventory to gain nearly-infinite wing flight time, but at the cost of a 25% decrease to all damage."); + "Place in your inventory to gain nearly-infinite wing flight time, but at the cost of a 25% decrease to all damage.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.yharonLore = true; + if (item.favorited) + modPlayer.yharonLore = true; } public override void AddRecipes() diff --git a/Items/Materials/MeldBlob.png b/Items/Materials/MeldBlob.png index 48341ed30c..a24387680f 100644 Binary files a/Items/Materials/MeldBlob.png and b/Items/Materials/MeldBlob.png differ diff --git a/Items/Materials/MeldiateBar.cs b/Items/Materials/MeldiateBar.cs index 570ff475ff..e9d66056da 100644 --- a/Items/Materials/MeldiateBar.cs +++ b/Items/Materials/MeldiateBar.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Materials { public override void SetStaticDefaults() { - DisplayName.SetDefault("Meld Bar"); + DisplayName.SetDefault("Meld Construct"); } public override void SetDefaults() @@ -23,9 +23,8 @@ namespace CalamityMod.Items.Materials public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Ectoplasm); - recipe.AddIngredient(ItemID.HallowedBar); recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 3); recipe.AddRecipe(); diff --git a/Items/Materials/MeldiateBar.png b/Items/Materials/MeldiateBar.png index d2067434db..1150c8db8f 100644 Binary files a/Items/Materials/MeldiateBar.png and b/Items/Materials/MeldiateBar.png differ diff --git a/Items/Materials/TitanHeart.cs b/Items/Materials/TitanHeart.cs new file mode 100644 index 0000000000..3f74cd0867 --- /dev/null +++ b/Items/Materials/TitanHeart.cs @@ -0,0 +1,19 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Materials +{ + public class TitanHeart : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titan Heart"); + } + + public override void SetDefaults() + { + item.CloneDefaults(ItemID.AncientBattleArmorMaterial); + } + } +} diff --git a/Items/Materials/TitanHeart.png b/Items/Materials/TitanHeart.png new file mode 100644 index 0000000000..834d516b56 Binary files /dev/null and b/Items/Materials/TitanHeart.png differ diff --git a/Items/Materials/UnholyCore.png b/Items/Materials/UnholyCore.png index 480bddf481..d13404b0e2 100644 Binary files a/Items/Materials/UnholyCore.png and b/Items/Materials/UnholyCore.png differ diff --git a/Items/Materials/WulfrumShard.png b/Items/Materials/WulfrumShard.png index 58f2d888a5..384f3c9372 100644 Binary files a/Items/Materials/WulfrumShard.png and b/Items/Materials/WulfrumShard.png differ diff --git a/Items/Pets/StrangeOrb.png b/Items/Pets/StrangeOrb.png index 2debd5f599..c7ab860ffb 100644 Binary files a/Items/Pets/StrangeOrb.png and b/Items/Pets/StrangeOrb.png differ diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png b/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png index 8735c3d983..fc114a1b5d 100644 Binary files a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png and b/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png differ diff --git a/Items/Placeables/Furniture/CraftingStations/SilvaBasin.png b/Items/Placeables/Furniture/CraftingStations/SilvaBasin.png index 84a2da8dfd..fe06bed067 100644 Binary files a/Items/Placeables/Furniture/CraftingStations/SilvaBasin.png and b/Items/Placeables/Furniture/CraftingStations/SilvaBasin.png differ diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.png b/Items/Placeables/Furniture/CraftingStations/StaticRefiner.png index d4a0bad1c4..4d7e82cc00 100644 Binary files a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.png and b/Items/Placeables/Furniture/CraftingStations/StaticRefiner.png differ diff --git a/Items/Placeables/Furniture/Trophies/AnahitaTrophy.cs b/Items/Placeables/Furniture/Trophies/AnahitaTrophy.cs new file mode 100644 index 0000000000..c2c772e9fc --- /dev/null +++ b/Items/Placeables/Furniture/Trophies/AnahitaTrophy.cs @@ -0,0 +1,30 @@ +using CalamityMod.Tiles.Furniture; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.Furniture.Trophies +{ + public class AnahitaTrophy : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Anahita Trophy"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 30; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.consumable = true; + item.value = 50000; + item.rare = 1; + item.createTile = ModContent.TileType(); + item.placeStyle = 27; + } + } +} diff --git a/Items/Placeables/Furniture/Trophies/AnahitaTrophy.png b/Items/Placeables/Furniture/Trophies/AnahitaTrophy.png new file mode 100644 index 0000000000..4edfaecab6 Binary files /dev/null and b/Items/Placeables/Furniture/Trophies/AnahitaTrophy.png differ diff --git a/Items/Placeables/Furniture/Trophies/LeviathanTrophy.png b/Items/Placeables/Furniture/Trophies/LeviathanTrophy.png index e9c5717b85..54e4ff532a 100644 Binary files a/Items/Placeables/Furniture/Trophies/LeviathanTrophy.png and b/Items/Placeables/Furniture/Trophies/LeviathanTrophy.png differ diff --git a/Items/Tools/ClimateChange/BloodIdol.png b/Items/Tools/ClimateChange/BloodIdol.png index 6fea635e5d..cdd73b1f65 100644 Binary files a/Items/Tools/ClimateChange/BloodIdol.png and b/Items/Tools/ClimateChange/BloodIdol.png differ diff --git a/Items/Tools/GallantPickaxe.cs b/Items/Tools/GallantPickaxe.cs index b9d891f4f5..06659b65f8 100644 --- a/Items/Tools/GallantPickaxe.cs +++ b/Items/Tools/GallantPickaxe.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Tools { public override void SetStaticDefaults() { - DisplayName.SetDefault("Gallant Pickaxe"); + DisplayName.SetDefault("Genesis Pickaxe"); Tooltip.SetDefault("Can mine Uelibloom Ore"); } @@ -18,20 +18,19 @@ namespace CalamityMod.Items.Tools { item.damage = 80; item.melee = true; - item.width = 54; - item.height = 54; - item.useTime = 6; - item.useAnimation = 12; + item.width = 84; + item.height = 80; + item.useTime = 7; + item.useAnimation = 14; item.useTurn = true; item.pick = 225; item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.5f; - item.value = Item.buyPrice(1, 20, 0, 0); + item.value = Item.buyPrice(1, 0, 0, 0); item.rare = 10; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.tileBoost += 4; - item.Calamity().customRarity = CalamityRarity.Turquoise; + item.tileBoost += 6; item.useTurn = true; } @@ -50,7 +49,7 @@ namespace CalamityMod.Items.Tools { if (Main.rand.NextBool(5)) { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 58); + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 62); } } } diff --git a/Items/Tools/GallantPickaxe.png b/Items/Tools/GallantPickaxe.png index c61cc5f0ab..9937b7fc19 100644 Binary files a/Items/Tools/GallantPickaxe.png and b/Items/Tools/GallantPickaxe.png differ diff --git a/Items/Tools/WulfrumAxe.cs b/Items/Tools/WulfrumAxe.cs index 457e96fb4f..0e2b0fa44c 100644 --- a/Items/Tools/WulfrumAxe.cs +++ b/Items/Tools/WulfrumAxe.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools { item.damage = 5; item.melee = true; - item.width = 62; - item.height = 58; + item.width = 30; + item.height = 38; item.useTime = 26; item.useAnimation = 26; item.useTurn = true; diff --git a/Items/Tools/WulfrumAxe.png b/Items/Tools/WulfrumAxe.png index edac3515c0..7bd72fbc30 100644 Binary files a/Items/Tools/WulfrumAxe.png and b/Items/Tools/WulfrumAxe.png differ diff --git a/Items/Tools/WulfrumHammer.cs b/Items/Tools/WulfrumHammer.cs index c4643b22ca..57a0d6a014 100644 --- a/Items/Tools/WulfrumHammer.cs +++ b/Items/Tools/WulfrumHammer.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools { item.damage = 7; item.melee = true; - item.width = 56; - item.height = 56; + item.width = 28; + item.height = 38; item.useTime = 29; item.useAnimation = 29; item.useTurn = true; diff --git a/Items/Tools/WulfrumHammer.png b/Items/Tools/WulfrumHammer.png index 030ee2396b..05741786eb 100644 Binary files a/Items/Tools/WulfrumHammer.png and b/Items/Tools/WulfrumHammer.png differ diff --git a/Items/Tools/WulfrumPickaxe.cs b/Items/Tools/WulfrumPickaxe.cs index 7c5faf290a..0d8c6a3592 100644 --- a/Items/Tools/WulfrumPickaxe.cs +++ b/Items/Tools/WulfrumPickaxe.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Tools { item.damage = 5; item.melee = true; - item.width = 48; - item.height = 48; + item.width = 46; + item.height = 38; item.useTime = 16; item.useAnimation = 16; item.useTurn = true; diff --git a/Items/Tools/WulfrumPickaxe.png b/Items/Tools/WulfrumPickaxe.png index dcb359dd90..2dc3379335 100644 Binary files a/Items/Tools/WulfrumPickaxe.png and b/Items/Tools/WulfrumPickaxe.png differ diff --git a/Items/TreasureBags/LeviathanBag.cs b/Items/TreasureBags/LeviathanBag.cs index 1dc1bf6a76..72b97af33f 100644 --- a/Items/TreasureBags/LeviathanBag.cs +++ b/Items/TreasureBags/LeviathanBag.cs @@ -33,10 +33,7 @@ namespace CalamityMod.Items.TreasureBags item.expert = true; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void PostUpdate() => CalamityUtils.ForceItemIntoWorld(item); @@ -63,6 +60,7 @@ namespace CalamityMod.Items.TreasureBags // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); // Fishing DropHelper.DropItemChance(player, ItemID.HotlineFishingHook, 10); diff --git a/Items/TreasureBags/LeviathanBag.png b/Items/TreasureBags/LeviathanBag.png index 2928778427..23539eab22 100644 Binary files a/Items/TreasureBags/LeviathanBag.png and b/Items/TreasureBags/LeviathanBag.png differ diff --git a/Items/Weapons/Magic/Atlantis.png b/Items/Weapons/Magic/Atlantis.png index bb16c85109..327b9e0d5c 100644 Binary files a/Items/Weapons/Magic/Atlantis.png and b/Items/Weapons/Magic/Atlantis.png differ diff --git a/Items/Weapons/Magic/BrimroseStaff.png b/Items/Weapons/Magic/BrimroseStaff.png index e6c093ff69..7436cd0e66 100644 Binary files a/Items/Weapons/Magic/BrimroseStaff.png and b/Items/Weapons/Magic/BrimroseStaff.png differ diff --git a/Items/Weapons/Magic/BurningSea.png b/Items/Weapons/Magic/BurningSea.png index 0107454fa0..da9ceb00f5 100644 Binary files a/Items/Weapons/Magic/BurningSea.png and b/Items/Weapons/Magic/BurningSea.png differ diff --git a/Items/Weapons/Magic/SirensSong.png b/Items/Weapons/Magic/SirensSong.png index 5c53c88263..566bc3ee4c 100644 Binary files a/Items/Weapons/Magic/SirensSong.png and b/Items/Weapons/Magic/SirensSong.png differ diff --git a/Items/Weapons/Magic/TomeofFates.png b/Items/Weapons/Magic/TomeofFates.png index d33492dbf1..9ca9f148d3 100644 Binary files a/Items/Weapons/Magic/TomeofFates.png and b/Items/Weapons/Magic/TomeofFates.png differ diff --git a/Items/Weapons/Magic/WulfrumStaff.cs b/Items/Weapons/Magic/WulfrumStaff.cs index 9341c3853b..8f9810e226 100644 --- a/Items/Weapons/Magic/WulfrumStaff.cs +++ b/Items/Weapons/Magic/WulfrumStaff.cs @@ -7,47 +7,46 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Magic { - public class WulfrumStaff : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wulfrum Staff"); - Tooltip.SetDefault("Casts a wulfrum bolt"); - Item.staff[item.type] = true; - } + public class WulfrumStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wulfrum Staff"); + Tooltip.SetDefault("Casts a wulfrum bolt"); + //Item.staff[item.type] = true; + } - public override void SetDefaults() - { - item.damage = 12; - item.magic = true; - item.mana = 4; - item.width = 44; - item.height = 46; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 3; - item.value = Item.buyPrice(0, 1, 0, 0); - item.rare = 1; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 9f; - } + public override void SetDefaults() + { + item.damage = 12; + item.magic = true; + item.mana = 4; + item.width = 44; + item.height = 46; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 3; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 1; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 9f; + } - public override Vector2? HoldoutOrigin() - { - return new Vector2(10, 25); - } + //public override Vector2? HoldoutOrigin() => new Vector2(8, 15); - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override Vector2? HoldoutOffset() => new Vector2(-3, 0); + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Magic/WulfrumStaff.png b/Items/Weapons/Magic/WulfrumStaff.png index 6c20e25a5c..bd38ecf2cd 100644 Binary files a/Items/Weapons/Magic/WulfrumStaff.png and b/Items/Weapons/Magic/WulfrumStaff.png differ diff --git a/Items/Weapons/Melee/BallOFugu.png b/Items/Weapons/Melee/BallOFugu.png index 8325b126c6..b3a2e690c6 100644 Binary files a/Items/Weapons/Melee/BallOFugu.png and b/Items/Weapons/Melee/BallOFugu.png differ diff --git a/Items/Weapons/Melee/Brimlash.cs b/Items/Weapons/Melee/Brimlash.cs index 161eb295ad..7f1a6bcc4b 100644 --- a/Items/Weapons/Melee/Brimlash.cs +++ b/Items/Weapons/Melee/Brimlash.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 50; + item.width = item.height = 54; item.damage = 64; item.melee = true; item.useAnimation = 25; @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 6f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 50; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/Brimlash.png b/Items/Weapons/Melee/Brimlash.png index f3544237e5..d05b7ca683 100644 Binary files a/Items/Weapons/Melee/Brimlash.png and b/Items/Weapons/Melee/Brimlash.png differ diff --git a/Items/Weapons/Melee/BrimlashBuster.cs b/Items/Weapons/Melee/BrimlashBuster.cs index f576976d36..9f9b0afda6 100644 --- a/Items/Weapons/Melee/BrimlashBuster.cs +++ b/Items/Weapons/Melee/BrimlashBuster.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 68; + item.width = item.height = 72; item.damage = 100; item.melee = true; item.useAnimation = 25; @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 8; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 68; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/BrimlashBuster.png b/Items/Weapons/Melee/BrimlashBuster.png index 946e98b5da..c2440eeb9f 100644 Binary files a/Items/Weapons/Melee/BrimlashBuster.png and b/Items/Weapons/Melee/BrimlashBuster.png differ diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index d2b4690363..5e65ceb85b 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -105,7 +105,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ItemID.VampireKnives); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 999); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index d2b8c3c049..05d1284942 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Weapons.Melee { item.damage = 95; item.melee = true; - item.width = 60; - item.height = 60; + item.width = 62; + item.height = 62; item.useTime = 24; item.useAnimation = 24; item.useTurn = true; diff --git a/Items/Weapons/Melee/Greentide.png b/Items/Weapons/Melee/Greentide.png index a3af9daf60..9ec5b48535 100644 Binary files a/Items/Weapons/Melee/Greentide.png and b/Items/Weapons/Melee/Greentide.png differ diff --git a/Items/Weapons/Melee/KelvinCatalystMelee.png b/Items/Weapons/Melee/KelvinCatalystMelee.png index 1d6c440160..86a074d801 100644 Binary files a/Items/Weapons/Melee/KelvinCatalystMelee.png and b/Items/Weapons/Melee/KelvinCatalystMelee.png differ diff --git a/Items/Weapons/Melee/ProfanedSword.cs b/Items/Weapons/Melee/ProfanedSword.cs index 6ed2429af9..aceefd4f42 100644 --- a/Items/Weapons/Melee/ProfanedSword.cs +++ b/Items/Weapons/Melee/ProfanedSword.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.damage = 75; item.melee = true; - item.width = 42; - item.height = 50; + item.width = item.height = 52; item.useTime = 23; item.useAnimation = 23; item.useTurn = true; diff --git a/Items/Weapons/Melee/ProfanedSword.png b/Items/Weapons/Melee/ProfanedSword.png index 41758d95bf..36dfb30fbe 100644 Binary files a/Items/Weapons/Melee/ProfanedSword.png and b/Items/Weapons/Melee/ProfanedSword.png differ diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 8f60a38641..78b2011564 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee { float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.5), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.5), knockBack, player.whoAmI, 0f, 0f); } return false; } @@ -52,7 +52,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); @@ -62,7 +61,6 @@ namespace CalamityMod.Items.Weapons.Melee recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/Melee/WulfrumBlade.cs b/Items/Weapons/Melee/WulfrumBlade.cs index 7dbf7198ae..34b3bbbbb0 100644 --- a/Items/Weapons/Melee/WulfrumBlade.cs +++ b/Items/Weapons/Melee/WulfrumBlade.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,7 +15,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 46; + item.width = 32; + item.height = 46; item.damage = 12; item.melee = true; item.useAnimation = 20; @@ -24,11 +26,15 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 3.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 54; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; } + public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) + { + hitbox = CalamityUtils.FixSwingHitbox(39, 39); + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/WulfrumBlade.png b/Items/Weapons/Melee/WulfrumBlade.png index d607dcf424..121c4cfe6e 100644 Binary files a/Items/Weapons/Melee/WulfrumBlade.png and b/Items/Weapons/Melee/WulfrumBlade.png differ diff --git a/Items/Weapons/Melee/XerocsGreatsword.cs b/Items/Weapons/Melee/XerocsGreatsword.cs index 07a2e2b818..364fa0609a 100644 --- a/Items/Weapons/Melee/XerocsGreatsword.cs +++ b/Items/Weapons/Melee/XerocsGreatsword.cs @@ -11,13 +11,14 @@ namespace CalamityMod.Items.Weapons.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Xeroc Greatsword"); + DisplayName.SetDefault("Entropic Claymore"); Tooltip.SetDefault("Fires a spread of homing plasma balls"); } public override void SetDefaults() { - item.width = 66; + item.width = 130; + item.height = 106; item.damage = 90; item.melee = true; item.useAnimation = 26; @@ -27,13 +28,17 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 5.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 66; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; } + public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) + { + hitbox = CalamityUtils.FixSwingHitbox(118, 118); + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(4, 6); @@ -41,7 +46,24 @@ namespace CalamityMod.Items.Weapons.Melee { float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.75), knockBack, player.whoAmI, 0.0f, 0.0f); + float damageMult = 0.5f; + switch (index) + { + case 0: + type = ModContent.ProjectileType(); + break; + case 1: + type = ModContent.ProjectileType(); + damageMult = 0.65f; + break; + case 2: + type = ModContent.ProjectileType(); + damageMult = 0.8f; + break; + default: + break; + } + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * damageMult), knockBack, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Melee/XerocsGreatsword.png b/Items/Weapons/Melee/XerocsGreatsword.png index 48fe75ebe6..ce89466c6c 100644 Binary files a/Items/Weapons/Melee/XerocsGreatsword.png and b/Items/Weapons/Melee/XerocsGreatsword.png differ diff --git a/Items/Weapons/Ranged/Archerfish.png b/Items/Weapons/Ranged/Archerfish.png index ad368e2088..55448257d1 100644 Binary files a/Items/Weapons/Ranged/Archerfish.png and b/Items/Weapons/Ranged/Archerfish.png differ diff --git a/Items/Weapons/Ranged/BrimstoneFury.png b/Items/Weapons/Ranged/BrimstoneFury.png index 058b9539c3..fff257b092 100644 Binary files a/Items/Weapons/Ranged/BrimstoneFury.png and b/Items/Weapons/Ranged/BrimstoneFury.png differ diff --git a/Items/Weapons/Ranged/Leviatitan.png b/Items/Weapons/Ranged/Leviatitan.png index 89fe64b156..4b56fc017d 100644 Binary files a/Items/Weapons/Ranged/Leviatitan.png and b/Items/Weapons/Ranged/Leviatitan.png differ diff --git a/Items/Weapons/Ranged/TheEmpyrean.cs b/Items/Weapons/Ranged/TheEmpyrean.cs index 0df599984b..e0221afb11 100644 --- a/Items/Weapons/Ranged/TheEmpyrean.cs +++ b/Items/Weapons/Ranged/TheEmpyrean.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public override void SetStaticDefaults() { - DisplayName.SetDefault("The Empyrean"); + DisplayName.SetDefault("God's Bellows"); Tooltip.SetDefault("70% chance to not consume gel"); } diff --git a/Items/Weapons/Ranged/TheEmpyrean.png b/Items/Weapons/Ranged/TheEmpyrean.png index 78910571a1..87df93208a 100644 Binary files a/Items/Weapons/Ranged/TheEmpyrean.png and b/Items/Weapons/Ranged/TheEmpyrean.png differ diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs new file mode 100644 index 0000000000..f51f49efef --- /dev/null +++ b/Items/Weapons/Ranged/Ultima.cs @@ -0,0 +1,70 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class Ultima : ModItem + { + public const float FullChargeTime = 420f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima"); + Tooltip.SetDefault("Casts a continuous stream of plasma bolts\n" + + "Over time the bolts are replaced with powerful lasers\n" + + "Bolts power up into solid beams as you continue shooting\n" + + "90% chance to not consume ammo"); + } + + public override void SetDefaults() + { + item.damage = 210; + item.ranged = true; + item.width = 44; + item.height = 58; + item.useTime = item.useAnimation = 3; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 2f; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = 10; + item.UseSound = SoundID.Item33; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 18f; + item.useAmmo = AmmoID.Arrow; + item.channel = true; + item.useTurn = false; + item.autoReuse = true; + item.noUseGraphic = true; + item.Calamity().customRarity = CalamityRarity.Dedicated; + } + + 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, new Vector2(speedX, speedY).SafeNormalize(Vector2.UnitX * player.direction), ModContent.ProjectileType(), 0, 0f, player.whoAmI); + return false; + } + + public override bool ConsumeAmmo(Player player) => Main.rand.Next(0, 100) >= 90; + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PulseBow); + recipe.AddIngredient(ItemID.LaserRifle); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Ranged/Ultima.png b/Items/Weapons/Ranged/Ultima.png new file mode 100644 index 0000000000..bf77665303 Binary files /dev/null and b/Items/Weapons/Ranged/Ultima.png differ diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index 6462f3e949..0e94240971 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 10; item.ranged = true; - item.width = 34; - item.height = 56; + item.width = 27; + item.height = 38; item.useTime = 25; item.useAnimation = 25; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Ranged/WulfrumBow.png b/Items/Weapons/Ranged/WulfrumBow.png index 3cf54d70b3..ad309cc5e0 100644 Binary files a/Items/Weapons/Ranged/WulfrumBow.png and b/Items/Weapons/Ranged/WulfrumBow.png differ diff --git a/Items/Weapons/Rogue/BrackishFlask.png b/Items/Weapons/Rogue/BrackishFlask.png index c0101e465c..0e5ad78a57 100644 Binary files a/Items/Weapons/Rogue/BrackishFlask.png and b/Items/Weapons/Rogue/BrackishFlask.png differ diff --git a/Items/Weapons/Rogue/Brimblade.png b/Items/Weapons/Rogue/Brimblade.png index d7de00d24b..0d93160ef8 100644 Binary files a/Items/Weapons/Rogue/Brimblade.png and b/Items/Weapons/Rogue/Brimblade.png differ diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index 9a3ad6e804..518361349f 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -106,7 +105,7 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.AddIngredient(ItemID.VampireKnives); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 999); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/KelvinCatalyst.png b/Items/Weapons/Rogue/KelvinCatalyst.png index 1d6c440160..86a074d801 100644 Binary files a/Items/Weapons/Rogue/KelvinCatalyst.png and b/Items/Weapons/Rogue/KelvinCatalyst.png differ diff --git a/Items/Weapons/Rogue/Lionfish.png b/Items/Weapons/Rogue/Lionfish.png index 56025eca70..e97c12862e 100644 Binary files a/Items/Weapons/Rogue/Lionfish.png and b/Items/Weapons/Rogue/Lionfish.png differ diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index 13f3d07d1d..2b3318cd0d 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -92,6 +92,8 @@ namespace CalamityMod.Items.Weapons.Rogue rogueAS -= 0.2f; if (player.Calamity().gloveOfRecklessness) rogueAS += 0.2f; + if (player.Calamity().titanHeartMantle) + rogueAS -= 0.2f; return rogueAS; } @@ -135,6 +137,11 @@ namespace CalamityMod.Items.Weapons.Rogue if (Main.rand.Next(1, 101) > 50) return false; } + if (player.Calamity().throwingAmmoCost55) + { + if (Main.rand.Next(1, 101) > 55) + return false; + } if (player.Calamity().throwingAmmoCost66) { if (Main.rand.Next(1, 101) > 66) diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 98ac50f628..7187589b87 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.width = 86; + item.width = item.height = 94; item.damage = 175; item.noMelee = true; item.noUseGraphic = true; @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 10f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 86; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; item.shoot = ModContent.ProjectileType(); @@ -52,7 +51,6 @@ namespace CalamityMod.Items.Weapons.Rogue { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 30); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/StarofDestruction.png b/Items/Weapons/Rogue/StarofDestruction.png index 732056dac4..46c3428789 100644 Binary files a/Items/Weapons/Rogue/StarofDestruction.png and b/Items/Weapons/Rogue/StarofDestruction.png differ diff --git a/Items/Weapons/Rogue/WulfrumKnife.png b/Items/Weapons/Rogue/WulfrumKnife.png index aab1bf448c..94ca6dcea6 100644 Binary files a/Items/Weapons/Rogue/WulfrumKnife.png and b/Items/Weapons/Rogue/WulfrumKnife.png differ diff --git a/Items/Weapons/Rogue/XerocPitchfork.png b/Items/Weapons/Rogue/XerocPitchfork.png index 6b1f401a25..37d3d40f62 100644 Binary files a/Items/Weapons/Rogue/XerocPitchfork.png and b/Items/Weapons/Rogue/XerocPitchfork.png differ diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 82985b8340..70bc426e7c 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -19,8 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = 20; item.mana = 10; - item.width = 46; - item.height = 46; + item.width = item.height = 48; item.useTime = item.useAnimation = 30; item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; diff --git a/Items/Weapons/Summon/HerringStaff.png b/Items/Weapons/Summon/HerringStaff.png index 00bcdf2e28..4668f74cf8 100644 Binary files a/Items/Weapons/Summon/HerringStaff.png and b/Items/Weapons/Summon/HerringStaff.png differ diff --git a/Items/Weapons/Summon/WulfrumController.png b/Items/Weapons/Summon/WulfrumController.png index c419f9b6ac..7222b843e5 100644 Binary files a/Items/Weapons/Summon/WulfrumController.png and b/Items/Weapons/Summon/WulfrumController.png differ diff --git a/Items/Weapons/Typeless/YanmeisKnife.cs b/Items/Weapons/Typeless/YanmeisKnife.cs new file mode 100644 index 0000000000..fabdacfe67 --- /dev/null +++ b/Items/Weapons/Typeless/YanmeisKnife.cs @@ -0,0 +1,67 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Typeless +{ + public class YanmeisKnife : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yanmei's Knife"); + Tooltip.SetDefault("When hitting a boss or its minions, you gain various boosts and cripple the enemy hit\n" + + "A knife from an unknown world\n" + + "An owner who's heart is pure and free of taint\n" + + "A heart of iron and valor"); + } + + public override void SetDefaults() + { + item.height = 44; + item.width = 48; + item.damage = 8; + item.crit += 6; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = item.useTime = 32; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 4.5f; + item.autoReuse = false; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.UseSound = SoundID.Item71; + item.rare = 8; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 24f; + item.Calamity().customRarity = CalamityRarity.Dedicated; + } + + public override bool CanUseItem(Player player) + { + if (player.Calamity().KameiBladeUseDelay > 0) + return false; + 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) + { + player.Calamity().KameiBladeUseDelay = 180; + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PsychoKnife); + recipe.AddIngredient(ItemID.Obsidian, 10); + recipe.AddIngredient(ItemID.IronBar, 20); + recipe.AddIngredient(ModContent.ItemType(), 50); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Typeless/YanmeisKnife.png b/Items/Weapons/Typeless/YanmeisKnife.png new file mode 100644 index 0000000000..36c6bc6c06 Binary files /dev/null and b/Items/Weapons/Typeless/YanmeisKnife.png differ diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 82b3dddb13..57478d54b2 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -1,3 +1,4 @@ +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -39,11 +40,14 @@ namespace CalamityMod.NPCs.AquaticScourge npc.dontCountMe = true; npc.chaseable = false; npc.canGhostHeal = false; - if (Main.expertMode) - { - npc.scale = 1.15f; - } - } + + if (CalamityWorld.death || CalamityWorld.bossRushActive) + npc.scale = 1.2f; + else if (CalamityWorld.revenge) + npc.scale = 1.15f; + else if (Main.expertMode) + npc.scale = 1.1f; + } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 36599322df..7c757d090d 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -1,3 +1,4 @@ +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -39,11 +40,14 @@ namespace CalamityMod.NPCs.AquaticScourge npc.dontCountMe = true; npc.chaseable = false; npc.canGhostHeal = false; - if (Main.expertMode) - { - npc.scale = 1.15f; - } - } + + if (CalamityWorld.death || CalamityWorld.bossRushActive) + npc.scale = 1.2f; + else if (CalamityWorld.revenge) + npc.scale = 1.15f; + else if (Main.expertMode) + npc.scale = 1.1f; + } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index e50a123e29..61f704b9e1 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AquaticScourge { npc.npcSlots = 16f; npc.damage = 80; - npc.width = 100; + npc.width = 90; npc.height = 90; npc.defense = 10; npc.DR_NERD(0.1f); @@ -57,10 +57,13 @@ namespace CalamityMod.NPCs.AquaticScourge npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; bossBag = ModContent.ItemType(); - if (Main.expertMode) - { - npc.scale = 1.15f; - } + + if (CalamityWorld.death || CalamityWorld.bossRushActive) + npc.scale = 1.2f; + else if (CalamityWorld.revenge) + npc.scale = 1.15f; + else if (Main.expertMode) + npc.scale = 1.1f; } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 05b29875a0..e7e675c560 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -1,3 +1,4 @@ +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -15,8 +16,8 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { npc.damage = 45; - npc.width = 30; - npc.height = 50; + npc.width = 32; + npc.height = 32; npc.defense = 25; npc.DR_NERD(0.15f); npc.aiStyle = -1; @@ -39,11 +40,14 @@ namespace CalamityMod.NPCs.AquaticScourge npc.dontCountMe = true; npc.chaseable = false; npc.canGhostHeal = false; - if (Main.expertMode) - { - npc.scale = 1.15f; - } - } + + if (CalamityWorld.death || CalamityWorld.bossRushActive) + npc.scale = 1.2f; + else if (CalamityWorld.revenge) + npc.scale = 1.15f; + else if (Main.expertMode) + npc.scale = 1.1f; + } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.png b/NPCs/AquaticScourge/AquaticScourgeTail.png index 93fe7cd462..c6f723a2a0 100644 Binary files a/NPCs/AquaticScourge/AquaticScourgeTail.png and b/NPCs/AquaticScourge/AquaticScourgeTail.png differ diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index ce8c8f0e40..67f601ec44 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -635,8 +635,10 @@ namespace CalamityMod.NPCs.Astral int minStardust = Main.expertMode ? 7 : 6; int maxStardust = Main.expertMode ? 9 : 8; DropHelper.DropItem(npc, ModContent.ItemType(), minStardust, maxStardust); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedAstrageldon, 7, 1, 1); + DropHelper.DropItem(npc, ModContent.ItemType()); + //not guarantee to prevent inventory spam + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedAstrageldon, 7, 1, 1); } } } diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index d12cc4334e..bcdc08d81c 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.Calamitas public override void SetStaticDefaults() { DisplayName.SetDefault("Life Seeker"); - Main.npcFrameCount[npc.type] = 2; + Main.npcFrameCount[npc.type] = 6; NPCID.Sets.TrailingMode[npc.type] = 1; } @@ -31,7 +31,6 @@ namespace CalamityMod.NPCs.Calamitas npc.aiStyle = 5; aiType = NPCID.Probe; npc.knockBackResist = CalamityWorld.bossRushActive ? 0f : 0.25f; - animationType = NPCID.DemonEye; npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; @@ -40,14 +39,22 @@ namespace CalamityMod.NPCs.Calamitas npc.buffImmune[BuffID.OnFire] = true; } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Texture2D texture = Main.npcTexture[npc.type]; + Vector2 vector11 = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[npc.type] / 2)); Color color36 = Color.White; float amount9 = 0.5f; int num153 = 5; @@ -61,18 +68,18 @@ namespace CalamityMod.NPCs.Calamitas color38 = npc.GetAlpha(color38); color38 *= (float)(num153 - num155) / 15f; Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector41 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/LifeSeekerGlow"); + texture = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/LifeSeekerGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); if (CalamityConfig.Instance.Afterimages) @@ -83,13 +90,13 @@ namespace CalamityMod.NPCs.Calamitas color41 = Color.Lerp(color41, color36, amount9); color41 *= (float)(num153 - num163) / 15f; Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector44 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } - spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/Calamitas/LifeSeeker.png b/NPCs/Calamitas/LifeSeeker.png index ced67f60ae..5dea135f9f 100644 Binary files a/NPCs/Calamitas/LifeSeeker.png and b/NPCs/Calamitas/LifeSeeker.png differ diff --git a/NPCs/Calamitas/LifeSeekerGlow.png b/NPCs/Calamitas/LifeSeekerGlow.png index 36dee76491..d15b05bd68 100644 Binary files a/NPCs/Calamitas/LifeSeekerGlow.png and b/NPCs/Calamitas/LifeSeekerGlow.png differ diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 7e7f32fca1..aad823eb9e 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; @@ -125,7 +126,7 @@ namespace CalamityMod.NPCs } } else - npc.localAI[1] = (npc.Center.X - player.Center.X < 0 ? 1f : -1f); + npc.localAI[1] = npc.Center.X - player.Center.X < 0 ? 1f : -1f; } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -135,7 +136,7 @@ namespace CalamityMod.NPCs // Spawn segments if (calamityGlobalNPC.newAI[2] == 0f && npc.ai[0] == 0f) { - int maxLength = death ? 41 : 31; + int maxLength = death ? 50 : revenge ? 40 : expertMode ? 35 : 30; int Previous = npc.whoAmI; for (int num36 = 0; num36 < maxLength; num36++) { @@ -143,9 +144,9 @@ namespace CalamityMod.NPCs if (num36 >= 0 && num36 < maxLength - 1) { if (num36 % 2 == 0) - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); - else lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); + else + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); } else lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); @@ -2806,6 +2807,16 @@ namespace CalamityMod.NPCs Player player = Main.player[npc.target]; + // Inflict Extreme Gravity to nearby players + if (revenge) + { + if (Main.netMode != NetmodeID.Server) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < 5600f) + Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); + } + } + // Life float lifeRatio = npc.life / (float)npc.lifeMax; diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index be56f8bd1d..c06a10bbd7 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -7214,37 +7214,32 @@ namespace CalamityMod.NPCs if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 64f) { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (NPC.CountNPCS(NPCID.Probe) < 3) - NPC.NewNPC((int)npc.Center.X, (int)(npc.Center.Y + 4f), NPCID.Probe); - else - { - Vector2 vector16 = npc.Center; - float num159 = CalamityWorld.bossRushActive ? 6f : 4f; - float num160 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector16.X + Main.rand.Next(-20, 21); - float num161 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector16.Y + Main.rand.Next(-20, 21); - float num162 = (float)Math.Sqrt(num160 * num160 + num161 * num161); - num162 = num159 / num162; - num160 *= num162; - num161 *= num162; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 vector16 = npc.Center; + float num159 = CalamityWorld.bossRushActive ? 6f : 4f; + float num160 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector16.X + Main.rand.Next(-20, 21); + float num161 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector16.Y + Main.rand.Next(-20, 21); + float num162 = (float)Math.Sqrt(num160 * num160 + num161 * num161); + num162 = num159 / num162; + num160 *= num162; + num161 *= num162; - Vector2 value = new Vector2(num160 * 1f + Main.rand.Next(-50, 51) * 0.01f, num161 * 1f + Main.rand.Next(-50, 51) * 0.01f); - value.Normalize(); - value *= num159; - num160 = value.X; - num161 = value.Y; + Vector2 value = new Vector2(num160 * 1f + Main.rand.Next(-50, 51) * 0.01f, num161 * 1f + Main.rand.Next(-50, 51) * 0.01f); + value.Normalize(); + value *= num159; + num160 = value.X; + num161 = value.Y; - int num163 = 28; - if (death) - num163 += 3; - int num164 = ProjectileID.Skull; - vector16 += value * 5f; - int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, num164, num163, 0f, Main.myPlayer, -1f, 0f); - Main.projectile[num165].timeLeft = 180; - Main.projectile[num165].tileCollide = false; - } - } + int num163 = 28; + if (death) + num163 += 3; + int num164 = ProjectileID.Skull; + vector16 += value * 5f; + int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, num164, num163, 0f, Main.myPlayer, -1f, 0f); + Main.projectile[num165].timeLeft = 180; + Main.projectile[num165].tileCollide = false; + } } // Go to floating phase, or spinning phase if in phase 2 diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8e32715a40..1bbe449db9 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -143,6 +143,7 @@ namespace CalamityMod.NPCs public int clamDebuff = 0; public int sulphurPoison = 0; public int ladHearts = 0; + public int kamiFlu = 0; public int relicOfResilienceCooldown = 0; public int relicOfResilienceWeakness = 0; @@ -685,6 +686,7 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(nightwither, 200, 40, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(dFlames, 2500, 500, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(kamiFlu, 250, 25, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(sulphurPoison, 180, 36, ref npc.lifeRegen, ref damage); if (npc.velocity.X == 0) ApplyDPSDebuff(electrified, 10, 2, ref npc.lifeRegen, ref damage); @@ -1537,6 +1539,8 @@ namespace CalamityMod.NPCs calcDR *= 0.66f; if (wCleave > 0) calcDR *= 0.75f; + if (npc.Calamity().kamiFlu > 0) + calcDR *= KamiDebuff.MultiplicativeDamageReduction; if (npc.onFire2) calcDR *= 0.8f; @@ -3128,6 +3132,8 @@ namespace CalamityMod.NPCs clamDebuff--; if (sulphurPoison > 0) sulphurPoison--; + if (kamiFlu > 0) + kamiFlu--; if (relicOfResilienceCooldown > 0) relicOfResilienceCooldown--; if (relicOfResilienceWeakness > 0) @@ -3139,6 +3145,11 @@ namespace CalamityMod.NPCs if (npc.boss || CalamityMod.movementImpairImmuneList.Contains(npc.type)) return; + if (kamiFlu > 0) + { + npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-KamiDebuff.MaxNPCSpeed), new Vector2(KamiDebuff.MaxNPCSpeed)); + } + if (!CalamityPlayer.areThereAnyDamnBosses) { if (pearlAura > 0) @@ -4518,6 +4529,11 @@ namespace CalamityMod.NPCs return new Color(200, 50, 50, npc.alpha); } + if (npc.Calamity().kamiFlu > 0) + { + return new Color(51, 197, 108, npc.alpha); + } + return null; } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 7106bab359..debfe75091 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1683,6 +1683,7 @@ namespace CalamityMod.NPCs case NPCID.SolarDrakomireRider: case NPCID.SolarDrakomire: case NPCID.SolarCrawltipedeHead: + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 4 : 5); DropHelper.DropItemChance(npc, ItemID.FragmentSolar, Main.expertMode ? 4 : 5); break; @@ -1691,6 +1692,7 @@ namespace CalamityMod.NPCs case NPCID.VortexHornet: //Alien Hornet case NPCID.VortexHornetQueen: //Alien Queen case NPCID.VortexRifleman: //Storm Diver + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 4 : 5); DropHelper.DropItemChance(npc, ItemID.FragmentVortex, Main.expertMode ? 4 : 5); break; @@ -1698,7 +1700,7 @@ namespace CalamityMod.NPCs case NPCID.NebulaSoldier: //Predictor case NPCID.NebulaHeadcrab: //Brain Suckler case NPCID.NebulaBeast: //Evolution Beast - DropHelper.DropItemChance(npc, ModContent.ItemType(), 4, Main.expertMode ? 2 : 1, Main.expertMode ? 3 : 2); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 4 : 5); DropHelper.DropItemChance(npc, ItemID.FragmentNebula, Main.expertMode ? 4 : 5); break; @@ -1707,6 +1709,7 @@ namespace CalamityMod.NPCs case NPCID.StardustJellyfishBig: //Flow Invader case NPCID.StardustCellBig: //Star Cell case NPCID.StardustWormHead: //Milkyway Weaver + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 4 : 5); DropHelper.DropItemChance(npc, ItemID.FragmentStardust, Main.expertMode ? 4 : 5); break; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 3cd80f7221..50ba7c0d68 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -23,20 +23,21 @@ namespace CalamityMod.NPCs.Leviathan [AutoloadBossHead] public class Leviathan : ModNPC { - private bool altTextureSwap = false; + int counter = 0; + bool initialised = false; public override void SetStaticDefaults() { DisplayName.SetDefault("The Leviathan"); - Main.npcFrameCount[npc.type] = 3; + Main.npcFrameCount[npc.type] = 6; } public override void SetDefaults() { npc.npcSlots = 20f; npc.damage = 90; - npc.width = 850; - npc.height = 450; + npc.width = 650; + npc.height = 300; npc.defense = 40; npc.DR_NERD(0.35f); npc.LifeMaxNERB(69000, 90700, 7000000); @@ -87,14 +88,16 @@ namespace CalamityMod.NPCs.Leviathan public override void SendExtraAI(BinaryWriter writer) { - writer.Write(altTextureSwap); writer.Write(npc.dontTakeDamage); + writer.Write(counter); + writer.Write(initialised); } public override void ReceiveExtraAI(BinaryReader reader) { - altTextureSwap = reader.ReadBoolean(); npc.dontTakeDamage = reader.ReadBoolean(); + counter = reader.ReadInt32(); + initialised = reader.ReadBoolean(); } public override void AI() @@ -120,23 +123,16 @@ namespace CalamityMod.NPCs.Leviathan sirenAlive = Main.npc[CalamityGlobalNPC.siren].active; } - int soundChoice = Main.rand.Next(3); int soundChoiceRage = 92; - if (soundChoice == 0) - { - soundChoice = 38; - } - else if (soundChoice == 1) - { - soundChoice = 39; - } - else - { - soundChoice = 40; - } + int soundChoice = Utils.SelectRandom(Main.rand, new int[] + { + 38, + 39, + 40 + }); if (Main.rand.NextBool(600)) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, (sirenAlive && !death) ? soundChoice : soundChoiceRage); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, (sirenAlive && !death) ? soundChoice : soundChoiceRage); } if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -334,7 +330,7 @@ namespace CalamityMod.NPCs.Leviathan if (flag103 && (spawnParasea || spawnAberration)) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, soundChoice); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, soundChoice); if (Main.netMode != NetmodeID.MultiplayerClient) { int type = spawnAberration ? ModContent.NPCType() : ModContent.NPCType(); @@ -466,7 +462,7 @@ namespace CalamityMod.NPCs.Leviathan npc.velocity.X = num1045 * num1047; npc.velocity.Y = num1046 * num1047; npc.spriteDirection = npc.direction; - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, soundChoiceRage); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, soundChoiceRage); return; } @@ -567,7 +563,7 @@ namespace CalamityMod.NPCs.Leviathan npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -577,16 +573,17 @@ namespace CalamityMod.NPCs.Leviathan } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib1"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib2"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib3"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore4"), 1f); } } @@ -598,6 +595,9 @@ namespace CalamityMod.NPCs.Leviathan // The Leviathan runs the same loot code as Anahita, but only if she dies last. public override void NPCLoot() { + //Trophy dropped regardless of Anahita, precedent of Twins + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + if (!NPC.AnyNPCs(ModContent.NPCType())) DropSirenLeviLoot(npc); } @@ -607,7 +607,6 @@ namespace CalamityMod.NPCs.Leviathan { DropHelper.DropBags(npc); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedLeviathan); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedLeviathan); DropHelper.DropResidentEvilAmmo(npc, CalamityWorld.downedLeviathan, 4, 2, 1); @@ -628,6 +627,7 @@ namespace CalamityMod.NPCs.Leviathan // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); // Fishing DropHelper.DropItemChance(npc, ItemID.HotlineFishingHook, 10); @@ -656,46 +656,60 @@ namespace CalamityMod.NPCs.Leviathan public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { Texture2D texture = Main.npcTexture[npc.type]; - Texture2D texture2 = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanTexTwo"); - Texture2D texture3 = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanAltTexOne"); - Texture2D texture4 = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanAltTexTwo"); if (npc.ai[0] == 1f) { - if (!altTextureSwap) - { - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor, true); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture2, 0, npc, drawColor, true); - } + texture = Main.npcTexture[npc.type]; } else { - if (!altTextureSwap) - { - CalamityMod.DrawTexture(spriteBatch, texture3, 0, npc, drawColor, true); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture4, 0, npc, drawColor, true); - } + texture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanAttack"); } + int verticalFrameCount = 3; + int horizontalFrameCount = 2; + int height = texture.Height / verticalFrameCount; + int width = texture.Width / horizontalFrameCount; + SpriteEffects spriteEffects = SpriteEffects.FlipHorizontally; + if (npc.spriteDirection == -1) + spriteEffects = SpriteEffects.None; + Main.spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0f, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, new Vector2((float)width / 2f, (float)height / 2f), npc.scale, spriteEffects, 0f); return false; } public override void FindFrame(int frameHeight) { - npc.frameCounter += 1.0; - if (npc.frameCounter > 6.0) + Texture2D texture = Main.npcTexture[npc.type]; + int verticalFrameCount = 3; + int horizontalFrameCount = 2; + int height = texture.Height / verticalFrameCount; + int width = texture.Width / horizontalFrameCount; + int timeBetweenFrames = 8; + + if (!initialised) { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; + counter = verticalFrameCount; + npc.frameCounter = timeBetweenFrames; + initialised = true; } - if (npc.frame.Y >= frameHeight * 3) + + //ensure width and height are set. + npc.frame.Width = width; + npc.frame.Height = height; + npc.frameCounter++; + if (npc.frameCounter >= timeBetweenFrames) { + npc.frame.X = counter >= verticalFrameCount ? width + 3 : 0; + if (counter == verticalFrameCount) + npc.frame.Y = 0; + else + npc.frame.Y += height; + npc.frameCounter = 0; + counter++; + } + if (counter == Main.npcFrameCount[npc.type]) + { + counter = 1; npc.frame.Y = 0; - altTextureSwap = !altTextureSwap; + npc.frame.X = 0; } } diff --git a/NPCs/Leviathan/Leviathan.png b/NPCs/Leviathan/Leviathan.png index 5bd4cf58e8..6bd923b971 100644 Binary files a/NPCs/Leviathan/Leviathan.png and b/NPCs/Leviathan/Leviathan.png differ diff --git a/NPCs/Leviathan/LeviathanAltTexOne.png b/NPCs/Leviathan/LeviathanAltTexOne.png deleted file mode 100644 index 9f98f74ae9..0000000000 Binary files a/NPCs/Leviathan/LeviathanAltTexOne.png and /dev/null differ diff --git a/NPCs/Leviathan/LeviathanAltTexTwo.png b/NPCs/Leviathan/LeviathanAltTexTwo.png deleted file mode 100644 index 1c8019853c..0000000000 Binary files a/NPCs/Leviathan/LeviathanAltTexTwo.png and /dev/null differ diff --git a/NPCs/Leviathan/LeviathanAttack.png b/NPCs/Leviathan/LeviathanAttack.png new file mode 100644 index 0000000000..650e015b7a Binary files /dev/null and b/NPCs/Leviathan/LeviathanAttack.png differ diff --git a/NPCs/Leviathan/LeviathanOpenMouth_UNUSED.png b/NPCs/Leviathan/LeviathanOpenMouth_UNUSED.png new file mode 100644 index 0000000000..34c3c55b6a Binary files /dev/null and b/NPCs/Leviathan/LeviathanOpenMouth_UNUSED.png differ diff --git a/NPCs/Leviathan/LeviathanTexTwo.png b/NPCs/Leviathan/LeviathanTexTwo.png deleted file mode 100644 index 23779c9d83..0000000000 Binary files a/NPCs/Leviathan/LeviathanTexTwo.png and /dev/null differ diff --git a/NPCs/Leviathan/Leviathan_Head_Boss.png b/NPCs/Leviathan/Leviathan_Head_Boss.png index f8b1338143..640bfa01d0 100644 Binary files a/NPCs/Leviathan/Leviathan_Head_Boss.png and b/NPCs/Leviathan/Leviathan_Head_Boss.png differ diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index a2ef7193da..c6253fab8e 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -19,6 +20,9 @@ namespace CalamityMod.NPCs.Leviathan private bool secondClone = false; private bool forceChargeFrames = false; private int frameUsed = 0; + private static Texture2D sirenStabTexture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/SirenStabbing"); + + //IMPORTANT: Do NOT remove the empty space on the sprites. This is intentional for framing. The sprite is centered and hitbox is fine already. public override void SetStaticDefaults() { @@ -106,7 +110,7 @@ namespace CalamityMod.NPCs.Leviathan CalamityGlobalNPC.siren = npc.whoAmI; // Light - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 0.3f); + Lighting.AddLight((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f), 0f, 0.5f, 0.3f); // Target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -703,12 +707,12 @@ namespace CalamityMod.NPCs.Leviathan if (num22 != 0) { if (npc.ai[1] == 0f && num22 != npc.direction) - npc.rotation += 3.14159274f; + npc.rotation += MathHelper.Pi; npc.direction = num22; if (npc.spriteDirection != -npc.direction) - npc.rotation += 3.14159274f; + npc.rotation += MathHelper.Pi; npc.spriteDirection = -npc.direction; } @@ -717,123 +721,62 @@ namespace CalamityMod.NPCs.Leviathan public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) - Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 187, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren5"), 1f); - for (int k = 0; k < 50; k++) - Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 187, hitDirection, -1f, 0, default, 1f); } } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) // 2 total states (ice shield or no ice shield) + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { Texture2D texture = Main.npcTexture[npc.type]; - if (npc.dontTakeDamage) - { - switch (frameUsed) - { - case 0: - texture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/SirenAlt"); - break; - case 1: - texture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/SirenAltSinging"); - break; - case 2: - texture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/SirenAltStabbing"); - break; - } - } - else - { - switch (frameUsed) - { - case 0: - texture = Main.npcTexture[npc.type]; - break; - case 1: - texture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/SirenSinging"); - break; - case 2: - texture = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/SirenStabbing"); - break; - } - } + switch (frameUsed) + { + case 0: + texture = Main.npcTexture[npc.type]; + break; + case 1: + texture = sirenStabTexture; + break; + } - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - if (npc.ai[0] > 2f || forceChargeFrames) - { - int width = 106; - Vector2 vector = new Vector2((float)(width / 2), (float)(texture.Height / Main.npcFrameCount[npc.type] / 2)); - Rectangle frame = new Rectangle(0, 0, width, texture.Height / Main.npcFrameCount[npc.type]); - frame.Y = 146 * (int)(npc.frameCounter / 12.0); // 1 to 6 - if (frame.Y >= 146 * 6 || npc.ai[0] == 4f) - frame.Y = 0; - - Main.spriteBatch.Draw(texture, - new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + vector.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)texture.Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector.Y * npc.scale + 0f + npc.gfxOffY), - new Microsoft.Xna.Framework.Rectangle?(frame), - npc.GetAlpha(drawColor), - npc.rotation, - vector, - npc.scale, - spriteEffects, - 0f); - return false; - } - - Rectangle frame2 = npc.frame; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); - Main.spriteBatch.Draw(texture, - new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + 0f + npc.gfxOffY), - new Microsoft.Xna.Framework.Rectangle?(frame2), - npc.GetAlpha(drawColor), - npc.rotation, - vector11, - npc.scale, - spriteEffects, - 0f); + bool charging = npc.ai[0] > 2f || forceChargeFrames; + int height = texture.Height / Main.npcFrameCount[npc.type]; + int width = texture.Width; + SpriteEffects spriteEffects = charging ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + if (npc.spriteDirection == -1) + spriteEffects = charging ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0f, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, new Vector2((float)width / 2f, (float)height / 2f), npc.scale, spriteEffects, 0f); return false; } - public override void FindFrame(int frameHeight) // 6 total frames, 3 total texture types + public override void FindFrame(int frameHeight) { - if (forceChargeFrames) - frameUsed = 2; - else if (npc.ai[0] == 2f) - frameUsed = 0; - else if (npc.ai[0] <= 1f) + Texture2D texture = Main.npcTexture[npc.type]; + if (npc.ai[0] > 2f || forceChargeFrames) + { frameUsed = 1; + } else - frameUsed = 2; + { + frameUsed = 0; + } + int frameY = texture.Height / Main.npcFrameCount[npc.type]; + int timeBetweenFrames = 8; - npc.frameCounter += 1.0; - if (npc.ai[0] == 3f || forceChargeFrames) - { - if (npc.frameCounter > 72.0) - npc.frameCounter = 0.0; - } - else if (npc.ai[0] != 4f) - { - int frameY = 146; - if (npc.frameCounter > 72.0) - npc.frameCounter = 0.0; + npc.frameCounter++; + if (npc.frameCounter > timeBetweenFrames * Main.npcFrameCount[npc.type]) + npc.frameCounter = 0; - npc.frame.Y = frameY * (int)(npc.frameCounter / 12.0); - if (npc.frame.Y >= frameHeight * 6) - npc.frame.Y = 0; - } + npc.frame.Y = frameY * (int)(npc.frameCounter / timeBetweenFrames); + if (npc.frame.Y >= frameHeight * Main.npcFrameCount[npc.type]) + npc.frame.Y = 0; + + //100x1140 + //200x636 } public override void BossLoot(ref string name, ref int potionType) @@ -844,6 +787,9 @@ namespace CalamityMod.NPCs.Leviathan // Anahita runs the same loot code as the Leviathan, but only if she dies last. public override void NPCLoot() { + //Trophy dropped regardless of Levi, precedent of Twins + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + if (!NPC.AnyNPCs(ModContent.NPCType())) Leviathan.DropSirenLeviLoot(npc); } diff --git a/NPCs/Leviathan/Siren.png b/NPCs/Leviathan/Siren.png index 56d3a69d45..4be01908da 100644 Binary files a/NPCs/Leviathan/Siren.png and b/NPCs/Leviathan/Siren.png differ diff --git a/NPCs/Leviathan/SirenAlt.png b/NPCs/Leviathan/SirenAlt.png deleted file mode 100644 index 793607a326..0000000000 Binary files a/NPCs/Leviathan/SirenAlt.png and /dev/null differ diff --git a/NPCs/Leviathan/SirenAltSinging.png b/NPCs/Leviathan/SirenAltSinging.png deleted file mode 100644 index 365c439126..0000000000 Binary files a/NPCs/Leviathan/SirenAltSinging.png and /dev/null differ diff --git a/NPCs/Leviathan/SirenAltStabbing.png b/NPCs/Leviathan/SirenAltStabbing.png deleted file mode 100644 index cf57a094f5..0000000000 Binary files a/NPCs/Leviathan/SirenAltStabbing.png and /dev/null differ diff --git a/NPCs/Leviathan/SirenSinging.png b/NPCs/Leviathan/SirenSinging.png deleted file mode 100644 index 064adc1694..0000000000 Binary files a/NPCs/Leviathan/SirenSinging.png and /dev/null differ diff --git a/NPCs/Leviathan/SirenStabbing.png b/NPCs/Leviathan/SirenStabbing.png index 8d69d7de7b..36d13de7dc 100644 Binary files a/NPCs/Leviathan/SirenStabbing.png and b/NPCs/Leviathan/SirenStabbing.png differ diff --git a/NPCs/Leviathan/Siren_Head_Boss.png b/NPCs/Leviathan/Siren_Head_Boss.png index 6c4a70aad2..20f6e2deaf 100644 Binary files a/NPCs/Leviathan/Siren_Head_Boss.png and b/NPCs/Leviathan/Siren_Head_Boss.png differ diff --git a/NPCs/Leviathan/SirenandLevi_BossChecklist.png b/NPCs/Leviathan/SirenandLevi_BossChecklist.png index 047c54cff8..c59d4c2139 100644 Binary files a/NPCs/Leviathan/SirenandLevi_BossChecklist.png and b/NPCs/Leviathan/SirenandLevi_BossChecklist.png differ diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 48df531d90..3fa97855bb 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -7,570 +7,568 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class ShockstormShuttle : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shockstorm Shuttle"); - } + public class ShockstormShuttle : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shockstorm Shuttle"); + Main.npcFrameCount[npc.type] = 4; + } - public override void SetDefaults() - { - npc.npcSlots = 3f; - npc.damage = 30; - npc.width = 64; - npc.height = 38; - npc.defense = 15; + public override void SetDefaults() + { + npc.npcSlots = 3f; + npc.damage = 30; + npc.width = 64; + npc.height = 38; + npc.defense = 15; npc.DR_NERD(0.15f); - npc.lifeMax = 150; - npc.aiStyle = -1; - aiType = -1; - npc.knockBackResist = 0f; - npc.value = Item.buyPrice(0, 0, 5, 0); - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.noGravity = true; - npc.noTileCollide = true; - banner = npc.type; - bannerItem = ModContent.ItemType(); - } + npc.lifeMax = 150; + npc.aiStyle = -1; + aiType = -1; + npc.knockBackResist = 0f; + npc.value = Item.buyPrice(0, 0, 5, 0); + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.noGravity = true; + npc.noTileCollide = true; + banner = npc.type; + bannerItem = ModContent.ItemType(); + } - public override void AI() - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[0] += (float)Main.rand.Next(4); //adds to localAI to fire projectiles at random times - if (npc.localAI[0] >= (float)Main.rand.Next(100, 120)) //rate at which projectiles are shot - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num179 = 12f; //speed of projectile - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int num184 = 30; //projectile damage - if (Main.expertMode) - { - num184 = 22; - } - int num185 = ProjectileID.MartianTurretBolt; //projectile ID - if (Main.rand.NextBool(8)) - { - num185 = ProjectileID.SaucerLaser; //more powerful projectile ID - } - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 2; num186++) //shoots two projectiles by looping twice - { - num180 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - value9.X; - num182 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = 12f / num183; - num180 += (float)Main.rand.Next(-20, 21); //projectile spreadX - num182 += (float)Main.rand.Next(-20, 21); //projectile spreadY - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - if (npc.localAI[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[3] = 1f; - } - Vector2 center16 = npc.Center; - Player player8 = Main.player[npc.target]; - if (npc.target < 0 || npc.target == 255 || player8.dead || !player8.active) - { - npc.TargetClosest(true); - player8 = Main.player[npc.target]; - npc.netUpdate = true; - } - if ((player8.dead || Vector2.Distance(player8.Center, center16) > 3200f) && npc.ai[0] != 1f) - { - if (npc.ai[0] == 0f) - { - npc.ai[0] = -1f; - } - if (npc.ai[0] == 2f) - { - npc.ai[0] = -2f; - } - npc.netUpdate = true; - } - if (npc.ai[0] == -1f || npc.ai[0] == -2f) - { - npc.velocity.Y = npc.velocity.Y - 0.4f; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - } - if (!player8.dead) - { - npc.timeLeft = 300; - if (npc.ai[0] == -2f) - { - npc.ai[0] = 2f; - } - if (npc.ai[0] == 0f) - { - npc.ai[0] = 0f; - } - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 0f) - { - int num1580 = 0; - if (npc.ai[3] >= 580f) - { - num1580 = 0; - } - else if (npc.ai[3] >= 440f) - { - num1580 = 5; - } - else if (npc.ai[3] >= 420f) - { - num1580 = 4; - } - else if (npc.ai[3] >= 280f) - { - num1580 = 3; - } - else if (npc.ai[3] >= 260f) - { - num1580 = 2; - } - else if (npc.ai[3] >= 20f) - { - num1580 = 1; - } - npc.ai[3] += 1f; - if (npc.ai[3] >= 600f) - { - npc.ai[3] = 0f; - } - int num1581 = num1580; - if (npc.ai[3] >= 580f) - { - num1580 = 0; - } - else if (npc.ai[3] >= 440f) - { - num1580 = 5; - } - else if (npc.ai[3] >= 420f) - { - num1580 = 4; - } - else if (npc.ai[3] >= 280f) - { - num1580 = 3; - } - else if (npc.ai[3] >= 260f) - { - num1580 = 2; - } - else if (npc.ai[3] >= 20f) - { - num1580 = 1; - } - if (num1580 != num1581) - { - if (num1580 == 0) - { - npc.ai[2] = 0f; - } - if (num1580 == 1) - { - npc.ai[2] = (float)((Math.Sign((player8.Center - center16).X) == 1) ? 1 : -1); - } - if (num1580 == 2) - { - npc.ai[2] = 0f; - } - npc.netUpdate = true; - } - if (num1580 == 0) - { - if (npc.ai[2] == 0f) - { - npc.ai[2] = (float)(-600 * Math.Sign((center16 - player8.Center).X)); - } - Vector2 vector196 = player8.Center + new Vector2(npc.ai[2], -250f) - center16; - if (vector196.Length() < 50f) - { - npc.ai[3] = 19f; - } - else - { - vector196.Normalize(); - npc.velocity = Vector2.Lerp(npc.velocity, vector196 * 16f, 0.1f); - } - } - if (num1580 == 1) - { - int num1582 = (int)npc.Center.X / 16; - int num1583 = (int)(npc.position.Y + (float)npc.height) / 16; - int num1584 = 0; - bool flag149 = Main.tile[num1582, num1583].nactive() && Main.tileSolid[(int)Main.tile[num1582, num1583].type] && !Main.tileSolidTop[(int)Main.tile[num1582, num1583].type]; - if (flag149) - { - num1584 = 1; - } - else - { - while (num1584 < 150 && num1583 + num1584 < Main.maxTilesY) - { - int num1585 = num1583 + num1584; - bool flag150 = Main.tile[num1582, num1585].nactive() && Main.tileSolid[(int)Main.tile[num1582, num1585].type] && !Main.tileSolidTop[(int)Main.tile[num1582, num1585].type]; - if (flag150) - { - num1584--; - break; - } - num1584++; - } - } - float num1586 = (float)(num1584 * 16); - float num1587 = 250f; - if (num1586 < num1587) - { - float num1588 = -4f; - if (-num1588 > num1586) - { - num1588 = -num1586; - } - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, num1588, 0.05f); - } - else - { - npc.velocity.Y = npc.velocity.Y * 0.95f; - } - npc.velocity.X = 3.5f * npc.ai[2]; - } - if (num1580 == 2) - { - if (npc.ai[2] == 0f) - { - npc.ai[2] = (float)(300 * Math.Sign((center16 - player8.Center).X)); - } - Vector2 vector197 = player8.Center + new Vector2(npc.ai[2], -170f) - center16; - int num1589 = (int)npc.Center.X / 16; - int num1590 = (int)(npc.position.Y + (float)npc.height) / 16; - int num1591 = 0; - bool flag151 = Main.tile[num1589, num1590].nactive() && Main.tileSolid[(int)Main.tile[num1589, num1590].type] && !Main.tileSolidTop[(int)Main.tile[num1589, num1590].type]; - if (flag151) - { - num1591 = 1; - } - else - { - while (num1591 < 150 && num1590 + num1591 < Main.maxTilesY) - { - int num1592 = num1590 + num1591; - bool flag152 = Main.tile[num1589, num1592].nactive() && Main.tileSolid[(int)Main.tile[num1589, num1592].type] && !Main.tileSolidTop[(int)Main.tile[num1589, num1592].type]; - if (flag152) - { - num1591--; - break; - } - num1591++; - } - } - float num1593 = (float)(num1591 * 16); - float num1594 = 170f; - if (num1593 < num1594) - { - vector197.Y -= num1594 - num1593; - } - if (vector197.Length() < 70f) - { - npc.ai[3] = 279f; - } - else - { - vector197.Normalize(); - npc.velocity = Vector2.Lerp(npc.velocity, vector197 * 20f, 0.1f); - } - } - else if (num1580 == 3) - { - float num1595 = 0.85f; - int num1596 = (int)npc.Center.X / 16; - int num1597 = (int)(npc.position.Y + (float)npc.height) / 16; - int num1598 = 0; - bool flag153 = Main.tile[num1596, num1597].nactive() && Main.tileSolid[(int)Main.tile[num1596, num1597].type] && !Main.tileSolidTop[(int)Main.tile[num1596, num1597].type]; - if (flag153) - { - num1598 = 1; - } - else - { - while (num1598 < 150 && num1597 + num1598 < Main.maxTilesY) - { - int num1599 = num1597 + num1598; - bool flag154 = Main.tile[num1596, num1599].nactive() && Main.tileSolid[(int)Main.tile[num1596, num1599].type] && !Main.tileSolidTop[(int)Main.tile[num1596, num1599].type]; - if (flag154) - { - num1598--; - break; - } - num1598++; - } - } - float num1600 = (float)(num1598 * 16); - float num1601 = 170f; - if (num1600 < num1601) - { - float num1602 = -4f; - if (-num1602 > num1600) - { - num1602 = -num1600; - } - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, num1602, 0.05f); - } - else - { - npc.velocity.Y = npc.velocity.Y * num1595; - } - npc.velocity.X = npc.velocity.X * num1595; - } - if (num1580 == 4) - { - Vector2 vector198 = player8.Center + new Vector2(0f, -250f) - center16; - if (vector198.Length() < 50f) - { - npc.ai[3] = 439f; - return; - } - vector198.Normalize(); - npc.velocity = Vector2.Lerp(npc.velocity, vector198 * 16f, 0.1f); - return; - } - else if (num1580 == 5) - { - npc.velocity *= 0.85f; - return; - } - } - else if (npc.ai[0] == 1f) - { - npc.velocity *= 0.96f; - float num1603 = 150f; - npc.ai[1] += 1f; - if (npc.ai[1] >= num1603) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.rotation = 0f; - npc.netUpdate = true; - return; - } - if (npc.ai[1] < 40f) - { - npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 40f * 6.28318548f), default).Y * 0.2f; - return; - } - if (npc.ai[1] < 80f) - { - npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 20f * 6.28318548f), default).Y * 0.3f; - return; - } - if (npc.ai[1] < 120f) - { - npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 10f * 6.28318548f), default).Y * 0.4f; - return; - } - npc.rotation = (npc.ai[1] - 120f) / 30f * 6.28318548f; - return; - } - else if (npc.ai[0] == 2f) - { - float num1605 = 3600f; - float num1606 = 120f; - float num1607 = 60f; - int num1608 = 0; - if (npc.ai[3] % num1606 >= num1607) - { - num1608 = 1; - } - int num1609 = num1608; - num1608 = 0; - npc.ai[3] += 1f; - if (npc.ai[3] % num1606 >= num1607) - { - num1608 = 1; - } - if (num1608 != num1609) - { - if (num1608 == 1) - { - npc.ai[2] = (float)((Math.Sign((player8.Center - center16).X) == 1) ? 1 : -1); - if (Main.netMode != NetmodeID.MultiplayerClient) //second projectile being shot. Didn't use this - { - npc.localAI[0] += (float)Main.rand.Next(4); - if (npc.localAI[0] >= (float)Main.rand.Next(50, 100)) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num179 = 11f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int num184 = 50; - if (Main.expertMode) - { - num184 = 28; - } - if (Main.hardMode) - { - num184 = 40; - if (NPC.downedMoonlord) - { - num184 = 80; - if (Main.expertMode) - { - num184 = 45; - } - } - } - int num185 = ProjectileID.SaucerLaser; - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 2; num186++) - { - num180 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - value9.X; - num182 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = 12f / num183; - num180 += (float)Main.rand.Next(-20, 21); - num182 += (float)Main.rand.Next(-20, 21); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, num185, num184, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - Main.PlaySound(SoundID.Item12, npc.position); - } - npc.netUpdate = true; - } - if (npc.ai[3] >= num1605) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - else if (num1608 == 0) - { - Vector2 vector199 = player8.Center + new Vector2(npc.ai[2] * 350f, -250f) - center16; - vector199.Normalize(); - npc.velocity = Vector2.Lerp(npc.velocity, vector199 * 16f, 0.1f); - } - else - { - int num1610 = (int)npc.Center.X / 16; - int num1611 = (int)(npc.position.Y + (float)npc.height) / 16; - int num1612 = 0; - bool flag155 = Main.tile[num1610, num1611].nactive() && Main.tileSolid[(int)Main.tile[num1610, num1611].type] && !Main.tileSolidTop[(int)Main.tile[num1610, num1611].type]; - if (flag155) - { - num1612 = 1; - } - else - { - while (num1612 < 150 && num1611 + num1612 < Main.maxTilesY) - { - int num1613 = num1611 + num1612; - bool flag156 = Main.tile[num1610, num1613].nactive() && Main.tileSolid[(int)Main.tile[num1610, num1613].type] && !Main.tileSolidTop[(int)Main.tile[num1610, num1613].type]; - if (flag156) - { - num1612--; - break; - } - num1612++; - } - } - float num1614 = (float)(num1612 * 16); - float num1615 = 250f; - if (num1614 < num1615) - { - float num1616 = -4f; - if (-num1616 > num1614) - { - num1616 = -num1614; - } - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, num1616, 0.05f); - } - else - { - npc.velocity.Y = npc.velocity.Y * 0.95f; - } - npc.velocity.X = 8f * npc.ai[2]; - } - npc.rotation = 0f; - } - } + public override void AI() + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[0] += (float)Main.rand.Next(4); //adds to localAI to fire projectiles at random times + if (npc.localAI[0] >= (float)Main.rand.Next(100, 120)) //rate at which projectiles are shot + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float projSpeed = 12f; //speed of projectile + Vector2 npcPos = npc.Center; + float targetX = Main.player[npc.target].Center.X - npcPos.X; + float YAdjust = Math.Abs(targetX) * 0.1f; + float targetY = Main.player[npc.target].Center.Y - npcPos.Y - YAdjust; + Vector2 velocity = new Vector2(targetX, targetY); + float targetDist = velocity.Length(); + npc.netUpdate = true; + targetDist = projSpeed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + int projDmg = 30; //projectile damage + if (Main.expertMode) + { + projDmg = 22; + } + int projType = ProjectileID.MartianTurretBolt; //projectile ID + if (Main.rand.NextBool(8)) + { + projType = ProjectileID.SaucerLaser; //more powerful projectile ID + } + npcPos.X += velocity.X; + npcPos.Y += velocity.Y; + for (int num186 = 0; num186 < 2; num186++) //shoots two projectiles by looping twice + { + velocity = Main.player[npc.target].Center - npcPos; + targetDist = velocity.Length(); + targetDist = projSpeed / targetDist; + velocity.X += (float)Main.rand.Next(-20, 21); //projectile spreadX + velocity.Y += (float)Main.rand.Next(-20, 21); //projectile spreadY + velocity.X *= targetDist; + velocity.Y *= targetDist; + Projectile.NewProjectile(npcPos, velocity, projType, projDmg, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + if (npc.localAI[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[3] = 1f; + } + Vector2 center16 = npc.Center; + Player player8 = Main.player[npc.target]; + if (npc.target < 0 || npc.target == Main.maxPlayers || player8.dead || !player8.active) + { + npc.TargetClosest(true); + player8 = Main.player[npc.target]; + npc.netUpdate = true; + } + if ((player8.dead || Vector2.Distance(player8.Center, center16) > 3200f) && npc.ai[0] != 1f) + { + if (npc.ai[0] == 0f) + { + npc.ai[0] = -1f; + } + if (npc.ai[0] == 2f) + { + npc.ai[0] = -2f; + } + npc.netUpdate = true; + } + if (npc.ai[0] == -1f || npc.ai[0] == -2f) + { + npc.velocity.Y = npc.velocity.Y - 0.4f; + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + } + if (!player8.dead) + { + npc.timeLeft = 300; + if (npc.ai[0] == -2f) + { + npc.ai[0] = 2f; + } + if (npc.ai[0] == 0f) + { + npc.ai[0] = 0f; + } + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 0f) + { + int num1580 = 0; + if (npc.ai[3] >= 580f) + { + num1580 = 0; + } + else if (npc.ai[3] >= 440f) + { + num1580 = 5; + } + else if (npc.ai[3] >= 420f) + { + num1580 = 4; + } + else if (npc.ai[3] >= 280f) + { + num1580 = 3; + } + else if (npc.ai[3] >= 260f) + { + num1580 = 2; + } + else if (npc.ai[3] >= 20f) + { + num1580 = 1; + } + npc.ai[3] += 1f; + if (npc.ai[3] >= 600f) + { + npc.ai[3] = 0f; + } + int num1581 = num1580; + if (npc.ai[3] >= 580f) + { + num1580 = 0; + } + else if (npc.ai[3] >= 440f) + { + num1580 = 5; + } + else if (npc.ai[3] >= 420f) + { + num1580 = 4; + } + else if (npc.ai[3] >= 280f) + { + num1580 = 3; + } + else if (npc.ai[3] >= 260f) + { + num1580 = 2; + } + else if (npc.ai[3] >= 20f) + { + num1580 = 1; + } + if (num1580 != num1581) + { + if (num1580 == 0) + { + npc.ai[2] = 0f; + } + if (num1580 == 1) + { + npc.ai[2] = (float)((Math.Sign((player8.Center - center16).X) == 1) ? 1 : -1); + } + if (num1580 == 2) + { + npc.ai[2] = 0f; + } + npc.netUpdate = true; + } + if (num1580 == 0) + { + if (npc.ai[2] == 0f) + { + npc.ai[2] = (float)(-600 * Math.Sign((center16 - player8.Center).X)); + } + Vector2 vector196 = player8.Center + new Vector2(npc.ai[2], -250f) - center16; + if (vector196.Length() < 50f) + { + npc.ai[3] = 19f; + } + else + { + vector196.Normalize(); + npc.velocity = Vector2.Lerp(npc.velocity, vector196 * 16f, 0.1f); + } + } + if (num1580 == 1) + { + int num1582 = (int)npc.Center.X / 16; + int num1583 = (int)(npc.position.Y + (float)npc.height) / 16; + int num1584 = 0; + bool flag149 = Main.tile[num1582, num1583].nactive() && Main.tileSolid[(int)Main.tile[num1582, num1583].type] && !Main.tileSolidTop[(int)Main.tile[num1582, num1583].type]; + if (flag149) + { + num1584 = 1; + } + else + { + while (num1584 < 150 && num1583 + num1584 < Main.maxTilesY) + { + int num1585 = num1583 + num1584; + bool flag150 = Main.tile[num1582, num1585].nactive() && Main.tileSolid[(int)Main.tile[num1582, num1585].type] && !Main.tileSolidTop[(int)Main.tile[num1582, num1585].type]; + if (flag150) + { + num1584--; + break; + } + num1584++; + } + } + float num1586 = (float)(num1584 * 16); + float num1587 = 250f; + if (num1586 < num1587) + { + float num1588 = -4f; + if (-num1588 > num1586) + { + num1588 = -num1586; + } + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, num1588, 0.05f); + } + else + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + npc.velocity.X = 3.5f * npc.ai[2]; + } + if (num1580 == 2) + { + if (npc.ai[2] == 0f) + { + npc.ai[2] = (float)(300 * Math.Sign((center16 - player8.Center).X)); + } + Vector2 vector197 = player8.Center + new Vector2(npc.ai[2], -170f) - center16; + int num1589 = (int)npc.Center.X / 16; + int num1590 = (int)(npc.position.Y + (float)npc.height) / 16; + int num1591 = 0; + bool flag151 = Main.tile[num1589, num1590].nactive() && Main.tileSolid[(int)Main.tile[num1589, num1590].type] && !Main.tileSolidTop[(int)Main.tile[num1589, num1590].type]; + if (flag151) + { + num1591 = 1; + } + else + { + while (num1591 < 150 && num1590 + num1591 < Main.maxTilesY) + { + int num1592 = num1590 + num1591; + bool flag152 = Main.tile[num1589, num1592].nactive() && Main.tileSolid[(int)Main.tile[num1589, num1592].type] && !Main.tileSolidTop[(int)Main.tile[num1589, num1592].type]; + if (flag152) + { + num1591--; + break; + } + num1591++; + } + } + float num1593 = (float)(num1591 * 16); + float num1594 = 170f; + if (num1593 < num1594) + { + vector197.Y -= num1594 - num1593; + } + if (vector197.Length() < 70f) + { + npc.ai[3] = 279f; + } + else + { + vector197.Normalize(); + npc.velocity = Vector2.Lerp(npc.velocity, vector197 * 20f, 0.1f); + } + } + else if (num1580 == 3) + { + float num1595 = 0.85f; + int num1596 = (int)npc.Center.X / 16; + int num1597 = (int)(npc.position.Y + (float)npc.height) / 16; + int num1598 = 0; + bool flag153 = Main.tile[num1596, num1597].nactive() && Main.tileSolid[(int)Main.tile[num1596, num1597].type] && !Main.tileSolidTop[(int)Main.tile[num1596, num1597].type]; + if (flag153) + { + num1598 = 1; + } + else + { + while (num1598 < 150 && num1597 + num1598 < Main.maxTilesY) + { + int num1599 = num1597 + num1598; + bool flag154 = Main.tile[num1596, num1599].nactive() && Main.tileSolid[(int)Main.tile[num1596, num1599].type] && !Main.tileSolidTop[(int)Main.tile[num1596, num1599].type]; + if (flag154) + { + num1598--; + break; + } + num1598++; + } + } + float num1600 = (float)(num1598 * 16); + float num1601 = 170f; + if (num1600 < num1601) + { + float num1602 = -4f; + if (-num1602 > num1600) + { + num1602 = -num1600; + } + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, num1602, 0.05f); + } + else + { + npc.velocity.Y = npc.velocity.Y * num1595; + } + npc.velocity.X = npc.velocity.X * num1595; + } + if (num1580 == 4) + { + Vector2 vector198 = player8.Center + new Vector2(0f, -250f) - center16; + if (vector198.Length() < 50f) + { + npc.ai[3] = 439f; + return; + } + vector198.Normalize(); + npc.velocity = Vector2.Lerp(npc.velocity, vector198 * 16f, 0.1f); + return; + } + else if (num1580 == 5) + { + npc.velocity *= 0.85f; + return; + } + } + else if (npc.ai[0] == 1f) + { + npc.velocity *= 0.96f; + float num1603 = 150f; + npc.ai[1] += 1f; + if (npc.ai[1] >= num1603) + { + npc.ai[0] = 2f; + npc.ai[1] = 0f; + npc.rotation = 0f; + npc.netUpdate = true; + return; + } + if (npc.ai[1] < 40f) + { + npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 40f * MathHelper.TwoPi), default).Y * 0.2f; + return; + } + if (npc.ai[1] < 80f) + { + npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 20f * MathHelper.TwoPi), default).Y * 0.3f; + return; + } + if (npc.ai[1] < 120f) + { + npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 10f * MathHelper.TwoPi), default).Y * 0.4f; + return; + } + npc.rotation = (npc.ai[1] - 120f) / 30f * MathHelper.TwoPi; + return; + } + else if (npc.ai[0] == 2f) + { + float num1605 = 3600f; + float num1606 = 120f; + float num1607 = 60f; + int num1608 = 0; + if (npc.ai[3] % num1606 >= num1607) + { + num1608 = 1; + } + int num1609 = num1608; + num1608 = 0; + npc.ai[3] += 1f; + if (npc.ai[3] % num1606 >= num1607) + { + num1608 = 1; + } + if (num1608 != num1609) + { + if (num1608 == 1) + { + npc.ai[2] = (float)((Math.Sign((player8.Center - center16).X) == 1) ? 1 : -1); + if (Main.netMode != NetmodeID.MultiplayerClient) //second projectile being shot. Didn't use this + { + npc.localAI[0] += (float)Main.rand.Next(4); + if (npc.localAI[0] >= (float)Main.rand.Next(50, 100)) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float projSpeed = 11f; + Vector2 npcPos = npc.Center; + float targetX = Main.player[npc.target].Center.X - npcPos.X; + float YAdjust = Math.Abs(targetX) * 0.1f; + float targetY = Main.player[npc.target].Center.Y - npcPos.Y - YAdjust; + Vector2 velocity = new Vector2(targetX, targetY); + float targetDist = velocity.Length(); + npc.netUpdate = true; + targetDist = projSpeed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + int projDmg = 50; + if (Main.expertMode) + { + projDmg = 28; + } + int projType = ProjectileID.SaucerLaser; + npcPos.X += velocity.X; + npcPos.Y += velocity.Y; + for (int num186 = 0; num186 < 2; num186++) + { + velocity.X = Main.player[npc.target].Center.X - npcPos.X; + velocity.Y = Main.player[npc.target].Center.Y - npcPos.Y; + targetDist = velocity.Length(); + targetDist = projSpeed / targetDist; + velocity.X += (float)Main.rand.Next(-20, 21); + velocity.Y += (float)Main.rand.Next(-20, 21); + velocity.X *= targetDist; + velocity.Y *= targetDist; + Projectile.NewProjectile(npcPos, velocity, projType, projDmg, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + Main.PlaySound(SoundID.Item12, npc.position); + } + npc.netUpdate = true; + } + if (npc.ai[3] >= num1605) + { + npc.ai[0] = 2f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + } + else if (num1608 == 0) + { + Vector2 vector199 = player8.Center + new Vector2(npc.ai[2] * 350f, -250f) - center16; + vector199.Normalize(); + npc.velocity = Vector2.Lerp(npc.velocity, vector199 * 16f, 0.1f); + } + else + { + int num1610 = (int)npc.Center.X / 16; + int num1611 = (int)(npc.position.Y + (float)npc.height) / 16; + int num1612 = 0; + bool flag155 = Main.tile[num1610, num1611].nactive() && Main.tileSolid[(int)Main.tile[num1610, num1611].type] && !Main.tileSolidTop[(int)Main.tile[num1610, num1611].type]; + if (flag155) + { + num1612 = 1; + } + else + { + while (num1612 < 150 && num1611 + num1612 < Main.maxTilesY) + { + int num1613 = num1611 + num1612; + bool flag156 = Main.tile[num1610, num1613].nactive() && Main.tileSolid[(int)Main.tile[num1610, num1613].type] && !Main.tileSolidTop[(int)Main.tile[num1610, num1613].type]; + if (flag156) + { + num1612--; + break; + } + num1612++; + } + } + float num1614 = (float)(num1612 * 16); + float num1615 = 250f; + if (num1614 < num1615) + { + float num1616 = -4f; + if (-num1616 > num1614) + { + num1616 = -num1614; + } + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, num1616, 0.05f); + } + else + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + npc.velocity.X = 8f * npc.ai[2]; + } + npc.rotation = 0f; + } + } - public override void HitEffect(int hitDirection, double damage) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default, 1f); - } - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default, 1f); - } - } - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.playerSafe || !Main.hardMode) - { - return 0f; - } - return SpawnCondition.Sky.Chance * 0.1f; - } + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default, 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default, 1f); + } + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(BuffID.Electrified, 120, true); - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe || !Main.hardMode) + { + return 0f; + } + return SpawnCondition.Sky.Chance * 0.1f; + } - public override void NPCLoot() - { - DropHelper.DropItemCondition(npc, ItemID.MartianConduitPlating, NPC.downedGolemBoss, 1, 10, 30); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); - } - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Electrified, 120, true); + } + + public override void NPCLoot() + { + DropHelper.DropItemCondition(npc, ItemID.MartianConduitPlating, NPC.downedGolemBoss, 1, 10, 30); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + } + } } diff --git a/NPCs/NormalNPCs/ShockstormShuttle.png b/NPCs/NormalNPCs/ShockstormShuttle.png index 6f56a972bf..ef2147cbc0 100644 Binary files a/NPCs/NormalNPCs/ShockstormShuttle.png and b/NPCs/NormalNPCs/ShockstormShuttle.png differ diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 36109b3678..cc5c553066 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -1546,6 +1546,9 @@ namespace CalamityMod.NPCs.Yharon case 3: npc.dontTakeDamage = phase4; break; + case 4: + npc.dontTakeDamage = false; + break; } if (!npc.dontTakeDamage) diff --git a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs new file mode 100644 index 0000000000..2bdecf4355 --- /dev/null +++ b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs @@ -0,0 +1,169 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.BaseProjectiles +{ + public abstract class BaseLaserbeamProjectile : ModProjectile + { + public float RotationalSpeed + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float Time + { + get => projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + public float LaserLength + { + get => projectile.localAI[1]; + set => projectile.localAI[1] = value; + } + public virtual void Behavior() + { + // Attach to some arbitrary thing/position optionally. (The ai[1] value is a reserved for this in vanilla's Phantasmal Deathray) + AttachToSomething(); + + // Ensure the the velocity is a unit vector and is not a <0,0> vector. + projectile.velocity = projectile.velocity.SafeNormalize(-Vector2.UnitY); + + Time++; + if (Time >= Lifetime) + { + projectile.Kill(); + return; + } + + DetermineScale(); + + UpdateLaserMotion(); + + float idealLaserLength = DetermineLaserLength(); + LaserLength = MathHelper.Lerp(LaserLength, idealLaserLength, 0.9f); // Very quickly approach the ideal laser length. + + DelegateMethods.v3_1 = LightCastColor.ToVector3(); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + public virtual void UpdateLaserMotion() + { + // This part is rather complicated at a glance. + // What it's doing is converting the velocity to an angle, doing something with that angle, and changing it back into the velocity. + // In this case, "doing something with that angle" means incrementing it by a constant. + // You could attempt to make it intelligent by having it move towards the target like the Last Prism, but that's not done here. + // This allows one to cause an arcing motion. + + float updatedVelocityDirection = projectile.velocity.ToRotation() + RotationalSpeed; + projectile.rotation = updatedVelocityDirection - MathHelper.PiOver2; // Pretty much all lasers have a vertical sheet. + projectile.velocity = updatedVelocityDirection.ToRotationVector2(); + } + public virtual void DetermineScale() + { + projectile.scale = (float)Math.Sin(Time / Lifetime * MathHelper.Pi) * 6f * MaxScale; + if (projectile.scale > MaxScale) + { + projectile.scale = MaxScale; + } + } + public virtual void AttachToSomething() { } // Does nothing by default. + public virtual float DetermineLaserLength() => MaxLaserLength; // Go with the default length and ignore any obstacles by default. + public virtual void ExtraBehavior() { } + public override void AI() + { + Behavior(); + ExtraBehavior(); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + // This should never happen, but just in case- + if (projectile.velocity == Vector2.Zero) + return false; + + // Start texture drawing. + spriteBatch.Draw(LaserBeginTexture, + projectile.Center - Main.screenPosition, + null, + LaserOverlayColor, + projectile.rotation, + LaserBeginTexture.Size() / 2f, + projectile.scale, + SpriteEffects.None, + 0f); + + // Prepare things for body drawing. + float laserBodyLength = LaserLength; + laserBodyLength -= (LaserBeginTexture.Height / 2 + LaserEndTexture.Height) * projectile.scale; + Vector2 centerOnLaser = projectile.Center; + centerOnLaser += projectile.velocity * projectile.scale * LaserBeginTexture.Height / 2f; + + // Body drawing. + if (laserBodyLength > 0f) + { + float laserOffset = LaserMiddleTexture.Height * projectile.scale; + float incrementalBodyLength = 0f; + while (incrementalBodyLength + 1f < laserBodyLength) + { + spriteBatch.Draw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + null, + LaserOverlayColor, + projectile.rotation, + LaserMiddleTexture.Width * 0.5f * Vector2.UnitX, + projectile.scale, + SpriteEffects.None, + 0f); + incrementalBodyLength += laserOffset; + centerOnLaser += projectile.velocity * laserOffset; + } + } + + // End texture drawing. + if (Math.Abs(LaserLength - DetermineLaserLength()) < 30f) + { + Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; + spriteBatch.Draw(LaserEndTexture, + laserEndCenter, + null, + LaserOverlayColor, + projectile.rotation, + LaserEndTexture.Frame(1, 1, 0, 0).Top(), + projectile.scale, + SpriteEffects.None, + 0f); + } + return false; + } + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackMelee; + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + return true; + float unused = 69420f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, ref unused)) + { + return true; + } + return false; + } + + #region Virtual Values + public virtual float Lifetime => 120f; + public virtual float MaxScale => 1f; + public virtual float MaxLaserLength => 2400f; // Be careful with this. Going too high will cause lag. + public virtual Color LightCastColor => Color.White; + public virtual Color LaserOverlayColor => Color.White * 0.9f; + public virtual Texture2D LaserBeginTexture { get; } + public virtual Texture2D LaserMiddleTexture { get; } + public virtual Texture2D LaserEndTexture { get; } + #endregion + } +} diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 74a0e0b614..6df3f39e6f 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { DisplayName.SetDefault("Frost Mist"); - Main.projFrames[projectile.type] = 6; + Main.projFrames[projectile.type] = 8; ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } diff --git a/Projectiles/Boss/FrostMist.png b/Projectiles/Boss/FrostMist.png index 8349afb42d..ef17040dd0 100644 Binary files a/Projectiles/Boss/FrostMist.png and b/Projectiles/Boss/FrostMist.png differ diff --git a/Projectiles/Boss/SirenSong.cs b/Projectiles/Boss/SirenSong.cs index 8aa5ed76aa..6858829227 100644 --- a/Projectiles/Boss/SirenSong.cs +++ b/Projectiles/Boss/SirenSong.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - projectile.width = 26; + projectile.width = 24; projectile.height = 58; projectile.hostile = true; projectile.penetrate = -1; diff --git a/Projectiles/Boss/SirenSong.png b/Projectiles/Boss/SirenSong.png index 418fb2622c..af5f7c5eb7 100644 Binary files a/Projectiles/Boss/SirenSong.png and b/Projectiles/Boss/SirenSong.png differ diff --git a/Projectiles/Boss/WaterSpear.png b/Projectiles/Boss/WaterSpear.png index b923a9ea8b..a50659774e 100644 Binary files a/Projectiles/Boss/WaterSpear.png and b/Projectiles/Boss/WaterSpear.png differ diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index ae4ad3447a..7f40b271f5 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1486,6 +1486,22 @@ namespace CalamityMod.Projectiles } } + if (modPlayer.titanHeartSet && stealthStrike && modPlayer.titanCooldown <= 0) + { + int dmg = (int)(85 + (projectile.damage * 0.05f)); + int boom = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), dmg, projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[boom].Calamity().forceRogue = true; + Main.PlaySound(SoundID.Item14, projectile.position); + for (int dustexplode = 0; dustexplode < 360; dustexplode++) + { + Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode)); + int d = Dust.NewDust(projectile.Center, projectile.width, projectile.height, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), dustd.X, dustd.Y, 100, default, 3f); + Main.dust[d].noGravity = true; + Main.dust[d].position = projectile.Center; + } + modPlayer.titanCooldown = 15; + } + if (modPlayer.corrosiveSpine && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType()) { for (int i = 0; i < 3; i++) diff --git a/Projectiles/Healing/XerocHealOrb.cs b/Projectiles/Healing/XerocHealOrb.cs index c5d09d22e5..4c9f4ecb0a 100644 --- a/Projectiles/Healing/XerocHealOrb.cs +++ b/Projectiles/Healing/XerocHealOrb.cs @@ -26,11 +26,14 @@ namespace CalamityMod.Projectiles.Healing projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[num500]; - dust.noGravity = true; - dust.position.X -= num498; - dust.position.Y -= num499; + if (projectile.timeLeft % 2 == 0) + { + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[num500]; + dust.noGravity = true; + dust.position.X -= num498; + dust.position.Y -= num499; + } } } } diff --git a/Projectiles/Healing/XerocHealOrb.png b/Projectiles/Healing/XerocHealOrb.png index 15e8775737..c1fdbf1381 100644 Binary files a/Projectiles/Healing/XerocHealOrb.png and b/Projectiles/Healing/XerocHealOrb.png differ diff --git a/Projectiles/Hybrid/KelvinCatalystBoomerang.png b/Projectiles/Hybrid/KelvinCatalystBoomerang.png index 1d6c440160..86a074d801 100644 Binary files a/Projectiles/Hybrid/KelvinCatalystBoomerang.png and b/Projectiles/Hybrid/KelvinCatalystBoomerang.png differ diff --git a/Projectiles/Magic/AtlantisSpear.png b/Projectiles/Magic/AtlantisSpear.png index 122a12fd18..626938fb51 100644 Binary files a/Projectiles/Magic/AtlantisSpear.png and b/Projectiles/Magic/AtlantisSpear.png differ diff --git a/Projectiles/Magic/BrimstoneTentacle.cs b/Projectiles/Magic/BrimstoneTentacle.cs index 80915bf57b..02c463fd8f 100644 --- a/Projectiles/Magic/BrimstoneTentacle.cs +++ b/Projectiles/Magic/BrimstoneTentacle.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { + projectile.localAI[1]++; if (projectile.velocity.X != projectile.velocity.X) { if (Math.Abs(projectile.velocity.X) < 1f) @@ -53,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic projectile.height = projectile.width; projectile.position.X = center10.X - (float)(projectile.width / 2); projectile.position.Y = center10.Y - (float)(projectile.height / 2); - if ((double)projectile.localAI[0] < 0.1) + if (projectile.localAI[0] < 0.1f) { projectile.localAI[0] += 0.01f; } @@ -74,7 +75,7 @@ namespace CalamityMod.Projectiles.Magic } projectile.ai[0] *= 1.05f; projectile.ai[1] *= 1.05f; - if (projectile.scale < 1f) + if (projectile.scale < 1f && projectile.localAI[1] > 5f) { int num897 = 0; while ((float)num897 < projectile.scale * 10f) diff --git a/Projectiles/Magic/CosmicTentacle.cs b/Projectiles/Magic/CosmicTentacle.cs index 450e3a9de4..3cd1698c27 100644 --- a/Projectiles/Magic/CosmicTentacle.cs +++ b/Projectiles/Magic/CosmicTentacle.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { + projectile.localAI[1]++; if (projectile.velocity.X != projectile.velocity.X) { if (Math.Abs(projectile.velocity.X) < 1f) @@ -53,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic projectile.height = projectile.width; projectile.position.X = center10.X - (float)(projectile.width / 2); projectile.position.Y = center10.Y - (float)(projectile.height / 2); - if ((double)projectile.localAI[0] < 0.1) + if (projectile.localAI[0] < 0.1f) { projectile.localAI[0] += 0.01f; } @@ -74,12 +75,12 @@ namespace CalamityMod.Projectiles.Magic } projectile.ai[0] *= 1.05f; projectile.ai[1] *= 1.05f; - if (projectile.scale < 1f) + if (projectile.scale < 1f && projectile.localAI[1] > 5f) { int num897 = 0; while ((float)num897 < projectile.scale * 10f) { - int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.1f); + int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.1f); Main.dust[num898].position = (Main.dust[num898].position + projectile.Center) / 2f; Main.dust[num898].noGravity = true; Main.dust[num898].velocity *= 0.1f; diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index cfbd639b34..8139dc9f72 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Magic projectile.height = 4; projectile.extraUpdates = 100; projectile.friendly = true; - projectile.timeLeft = 90; + projectile.timeLeft = 45; projectile.magic = true; } @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[num448].position = vector33; Main.dust[num448].noGravity = true; Main.dust[num448].noLight = true; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num448].scale = Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.1f; } } diff --git a/Projectiles/Magic/FabOrb.cs b/Projectiles/Magic/FabOrb.cs index 7ffb1f294b..4d13216330 100644 --- a/Projectiles/Magic/FabOrb.cs +++ b/Projectiles/Magic/FabOrb.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic projectile.friendly = true; projectile.alpha = 255; projectile.penetrate = -1; - projectile.timeLeft = 300; + projectile.timeLeft = 30; projectile.magic = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType()); } } } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 55c9ed27ad..0e52433323 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -25,9 +25,8 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - Lighting.AddLight(projectile.Center, 0.2f, 0.01f, 0.1f); projectile.localAI[1] += 1f; - if (projectile.localAI[1] >= 9f && projectile.owner == Main.myPlayer) + if (projectile.localAI[1] >= 6f && projectile.owner == Main.myPlayer) { projectile.localAI[1] = 0f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); @@ -39,12 +38,12 @@ namespace CalamityMod.Projectiles.Magic for (int num447 = 0; num447 < 2; num447++) { Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * ((float)num447 * 0.25f); - int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1.25f); + vector33 -= projectile.velocity * (num447 * 0.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1f); Main.dust[num448].noGravity = true; Main.dust[num448].noLight = true; Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num448].scale = Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.1f; } } diff --git a/Projectiles/Magic/SirensSongNote.png b/Projectiles/Magic/SirensSongNote.png index 2ec8ea38c0..e323ebc6e3 100644 Binary files a/Projectiles/Magic/SirensSongNote.png and b/Projectiles/Magic/SirensSongNote.png differ diff --git a/Projectiles/Melee/BallOFuguProj.png b/Projectiles/Melee/BallOFuguProj.png index f4673a0825..ca90c057a0 100644 Binary files a/Projectiles/Melee/BallOFuguProj.png and b/Projectiles/Melee/BallOFuguProj.png differ diff --git a/Projectiles/Melee/ChaosFlameSmall.cs b/Projectiles/Melee/ChaosFlameSmall.cs index 2c334e743c..4cba2dbd61 100644 --- a/Projectiles/Melee/ChaosFlameSmall.cs +++ b/Projectiles/Melee/ChaosFlameSmall.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.frame = 0; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + projectile.rotation = projectile.velocity.ToRotation(); Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f); if (Main.rand.NextBool(4)) { diff --git a/Projectiles/Melee/MeldGreatswordBigProjectile.cs b/Projectiles/Melee/MeldGreatswordBigProjectile.cs new file mode 100644 index 0000000000..ebbeb8d830 --- /dev/null +++ b/Projectiles/Melee/MeldGreatswordBigProjectile.cs @@ -0,0 +1,64 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class MeldGreatswordBigProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.melee = true; + projectile.timeLeft = 600; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation(); + Vector2 value7 = new Vector2(6f, 12f); + projectile.localAI[0] += 1f; + if (projectile.localAI[0] == 48f) + { + projectile.localAI[0] = 0f; + } + else + { + for (int num41 = 0; num41 < 2; num41++) + { + Vector2 value8 = Vector2.UnitX * -15f; + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; + int num42 = Dust.NewDust(projectile.Center, 0, 0, 27, 0f, 0f, 160, default, 1f); + Main.dust[num42].scale = 1f; + Main.dust[num42].noGravity = true; + Main.dust[num42].position = projectile.Center + value8; + Main.dust[num42].velocity = projectile.velocity; + } + } + + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, 0f, 0f, 100, default, 0.8f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0f; + + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 12f, 20f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Melee/MeldGreatswordBigProjectile.png b/Projectiles/Melee/MeldGreatswordBigProjectile.png new file mode 100644 index 0000000000..d2e1ad5ddb Binary files /dev/null and b/Projectiles/Melee/MeldGreatswordBigProjectile.png differ diff --git a/Projectiles/Melee/PlasmaBall.cs b/Projectiles/Melee/MeldGreatswordMediumProjectile.cs similarity index 74% rename from Projectiles/Melee/PlasmaBall.cs rename to Projectiles/Melee/MeldGreatswordMediumProjectile.cs index fd5f2a8405..0c511c7c71 100644 --- a/Projectiles/Melee/PlasmaBall.cs +++ b/Projectiles/Melee/MeldGreatswordMediumProjectile.cs @@ -1,15 +1,18 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PlasmaBall : ModProjectile + public class MeldGreatswordMediumProjectile : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ball"); + DisplayName.SetDefault("Bolt"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; } public override void SetDefaults() @@ -24,6 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { + projectile.rotation = projectile.velocity.ToRotation(); Vector2 value7 = new Vector2(6f, 12f); projectile.localAI[0] += 1f; if (projectile.localAI[0] == 48f) @@ -50,5 +54,11 @@ namespace CalamityMod.Projectiles.Melee CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 12f, 20f); } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } } } diff --git a/Projectiles/Melee/MeldGreatswordMediumProjectile.png b/Projectiles/Melee/MeldGreatswordMediumProjectile.png new file mode 100644 index 0000000000..90aede20e7 Binary files /dev/null and b/Projectiles/Melee/MeldGreatswordMediumProjectile.png differ diff --git a/Projectiles/Melee/MeldGreatswordSmallProjectile.cs b/Projectiles/Melee/MeldGreatswordSmallProjectile.cs new file mode 100644 index 0000000000..c472068f63 --- /dev/null +++ b/Projectiles/Melee/MeldGreatswordSmallProjectile.cs @@ -0,0 +1,64 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class MeldGreatswordSmallProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.melee = true; + projectile.timeLeft = 600; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation(); + Vector2 value7 = new Vector2(6f, 12f); + projectile.localAI[0] += 1f; + if (projectile.localAI[0] == 48f) + { + projectile.localAI[0] = 0f; + } + else + { + for (int num41 = 0; num41 < 2; num41++) + { + Vector2 value8 = Vector2.UnitX * -15f; + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; + int num42 = Dust.NewDust(projectile.Center, 0, 0, 27, 0f, 0f, 160, default, 1f); + Main.dust[num42].scale = 1f; + Main.dust[num42].noGravity = true; + Main.dust[num42].position = projectile.Center + value8; + Main.dust[num42].velocity = projectile.velocity; + } + } + + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, 0f, 0f, 100, default, 0.8f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0f; + + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 12f, 20f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Melee/MeldGreatswordSmallProjectile.png b/Projectiles/Melee/MeldGreatswordSmallProjectile.png new file mode 100644 index 0000000000..7930994094 Binary files /dev/null and b/Projectiles/Melee/MeldGreatswordSmallProjectile.png differ diff --git a/Projectiles/Melee/PlasmaBall.png b/Projectiles/Melee/PlasmaBall.png deleted file mode 100644 index 139ef2e822..0000000000 Binary files a/Projectiles/Melee/PlasmaBall.png and /dev/null differ diff --git a/Projectiles/Melee/ProfanedSwordProj.cs b/Projectiles/Melee/ProfanedSwordProj.cs index dbaef5da37..3e8e17d725 100644 --- a/Projectiles/Melee/ProfanedSwordProj.cs +++ b/Projectiles/Melee/ProfanedSwordProj.cs @@ -30,14 +30,14 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.ToRadians(45f); if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (projectile.spriteDirection == -1) { - projectile.rotation -= 1.57f; + projectile.rotation -= MathHelper.ToRadians(90f); } } diff --git a/Projectiles/Melee/ProfanedSwordProj.png b/Projectiles/Melee/ProfanedSwordProj.png index 0967c869b9..36dfb30fbe 100644 Binary files a/Projectiles/Melee/ProfanedSwordProj.png and b/Projectiles/Melee/ProfanedSwordProj.png differ diff --git a/Projectiles/Pets/SirenFlopping.png b/Projectiles/Pets/SirenFlopping.png deleted file mode 100644 index 62bcb652ae..0000000000 Binary files a/Projectiles/Pets/SirenFlopping.png and /dev/null differ diff --git a/Projectiles/Pets/SirenYoung.cs b/Projectiles/Pets/SirenYoung.cs index 0e59557428..ea4a75c9bf 100644 --- a/Projectiles/Pets/SirenYoung.cs +++ b/Projectiles/Pets/SirenYoung.cs @@ -11,11 +11,13 @@ namespace CalamityMod.Projectiles.Pets public class SirenYoung : ModProjectile { private bool underwater = false; + private int sleepyTimer = 0; + private int lightLevel = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Siren"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 17; Main.projPet[projectile.type] = true; ProjectileID.Sets.LightPet[projectile.type] = true; } @@ -23,12 +25,13 @@ namespace CalamityMod.Projectiles.Pets public override void SetDefaults() { projectile.netImportant = true; - projectile.width = 30; - projectile.height = 30; + projectile.width = 38; + projectile.height = 58; projectile.friendly = true; projectile.penetrate = -1; projectile.timeLeft *= 5; projectile.ignoreWater = true; + projectile.tileCollide = false; } public override void AI() @@ -48,325 +51,91 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - projectile.frameCounter++; - if (projectile.frameCounter > 6) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - underwater = Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) || modPlayer.leviathanAndSirenLore; + if (sleepyTimer < 180) + { + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + } + if (underwater) + { + if (projectile.frame >= 8) + { + projectile.frame = 0; + } + } + else + { + if (projectile.frame >= 16) + { + projectile.frame = sleepyTimer >= 180 ? 16 : 8; + } + } + underwater = player.IsUnderwater() || modPlayer.leviathanAndSirenLore; if (underwater) { - projectile.width = 30; - projectile.height = 30; + if (projectile.frame == 16) + projectile.frame = 0; + if (sleepyTimer > 0) + sleepyTimer--; if (projectile.localAI[0] == 0f) { - Lighting.AddLight(projectile.Center, 2.5f, 2f, 0f); //4.5 + lightLevel = 0; } else { - Lighting.AddLight(projectile.Center, 1.65f, 1.32f, 0f); //3 + lightLevel = 1; } } - else - { - projectile.width = 54; - projectile.height = 54; - Lighting.AddLight(projectile.Center, 0.825f, 0.66f, 0f); //1.5 - Vector2 vector54 = player.Center; - vector54.X -= (float)((15 + player.width / 2) * player.direction); - vector54.X -= (float)(40 * player.direction); - if (projectile.ai[0] == 1f) - { - projectile.tileCollide = false; - float num663 = 0.2f; - float num664 = 10f; - int num665 = 200; - if (num664 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) - { - num664 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - } - Vector2 vector58 = vector54 - projectile.Center; - float num666 = vector58.Length(); - if (num666 > 2000f) - { - projectile.position = player.Center - new Vector2((float)projectile.width, (float)projectile.height) / 2f; - } - if (num666 < (float)num665 && player.velocity.Y == 0f && projectile.position.Y + (float)projectile.height <= player.position.Y + (float)player.height && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - if (projectile.velocity.Y < -6f) - { - projectile.velocity.Y = -6f; - } - } - if (num666 >= 60f) - { - vector58.Normalize(); - vector58 *= num664; - if (projectile.velocity.X < vector58.X) - { - projectile.velocity.X = projectile.velocity.X + num663; - if (projectile.velocity.X < 0f) - { - projectile.velocity.X = projectile.velocity.X + num663 * 1.5f; - } - } - if (projectile.velocity.X > vector58.X) - { - projectile.velocity.X = projectile.velocity.X - num663; - if (projectile.velocity.X > 0f) - { - projectile.velocity.X = projectile.velocity.X - num663 * 1.5f; - } - } - if (projectile.velocity.Y < vector58.Y) - { - projectile.velocity.Y = projectile.velocity.Y + num663; - if (projectile.velocity.Y < 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num663 * 1.5f; - } - } - if (projectile.velocity.Y > vector58.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num663; - if (projectile.velocity.Y > 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num663 * 1.5f; - } - } - } - if (projectile.velocity.X != 0f) - { - projectile.spriteDirection = Math.Sign(projectile.velocity.X); - } - } - if (projectile.ai[0] == 2f) - { - projectile.friendly = true; - projectile.spriteDirection = projectile.direction; - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - if (projectile.velocity.Y > 10f) - { - projectile.velocity.Y = 10f; - } - projectile.ai[1] -= 1f; - if (projectile.ai[1] <= 0f) - { - projectile.ai[1] = 0f; - projectile.ai[0] = 0f; - projectile.friendly = false; - projectile.netUpdate = true; - return; - } - } - if (projectile.ai[0] == 0f) - { - float num671 = 200f; - if (player.rocketDelay2 > 0) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - Vector2 vector59 = vector54 - projectile.Center; - if (vector59.Length() > 2000f) - { - projectile.position = vector54 - new Vector2((float)projectile.width, (float)projectile.height) / 2f; - } - else if (vector59.Length() > num671 || Math.Abs(vector59.Y) > 300f) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - if (projectile.velocity.Y > 0f && vector59.Y < 0f) - { - projectile.velocity.Y = 0f; - } - if (projectile.velocity.Y < 0f && vector59.Y > 0f) - { - projectile.velocity.Y = 0f; - } - } - projectile.tileCollide = true; - float num672 = 0.5f; - float num673 = 4f; - float num674 = 4f; - float num675 = 0.1f; - if (num674 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) - { - num674 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - num672 = 0.7f; - } - int num676 = 0; - bool flag29 = false; - float num677 = vector54.X - projectile.Center.X; - if (Math.Abs(num677) > 5f) - { - if (num677 < 0f) - { - num676 = -1; - if (projectile.velocity.X > -num673) - { - projectile.velocity.X = projectile.velocity.X - num672; - } - else - { - projectile.velocity.X = projectile.velocity.X - num675; - } - } - else - { - num676 = 1; - if (projectile.velocity.X < num673) - { - projectile.velocity.X = projectile.velocity.X + num672; - } - else - { - projectile.velocity.X = projectile.velocity.X + num675; - } - } - flag29 = true; - } - else - { - projectile.velocity.X = projectile.velocity.X * 0.9f; - if (Math.Abs(projectile.velocity.X) < num672 * 2f) - { - projectile.velocity.X = 0f; - } - } - if (num676 != 0) - { - int num678 = (int)(projectile.position.X + (float)(projectile.width / 2)) / 16; - int num679 = (int)projectile.position.Y / 16; - num678 += num676; - num678 += (int)projectile.velocity.X; - int num3; - for (int num680 = num679; num680 < num679 + projectile.height / 16 + 1; num680 = num3 + 1) - { - if (WorldGen.SolidTile(num678, num680)) - { - flag29 = true; - } - num3 = num680; - } - } - if (projectile.velocity.X != 0f) - { - flag29 = true; - } - Collision.StepUp(ref projectile.position, ref projectile.velocity, projectile.width, projectile.height, ref projectile.stepSpeed, ref projectile.gfxOffY, 1, false, 0); - if (projectile.velocity.Y == 0f && flag29) - { - int num3; - for (int num681 = 0; num681 < 3; num681 = num3 + 1) - { - int num682 = (int)(projectile.position.X + (float)(projectile.width / 2)) / 16; - if (num681 == 0) - { - num682 = (int)projectile.position.X / 16; - } - if (num681 == 2) - { - num682 = (int)(projectile.position.X + (float)projectile.width) / 16; - } - int num683 = (int)(projectile.position.Y + (float)projectile.height) / 16; - if (WorldGen.SolidTile(num682, num683) || Main.tile[num682, num683].halfBrick() || Main.tile[num682, num683].slope() > 0 || (TileID.Sets.Platforms[(int)Main.tile[num682, num683].type] && Main.tile[num682, num683].active() && !Main.tile[num682, num683].inActive())) - { - try - { - num682 = (int)(projectile.position.X + (float)(projectile.width / 2)) / 16; - num683 = (int)(projectile.position.Y + (float)(projectile.height / 2)) / 16; - num682 += num676; - num682 += (int)projectile.velocity.X; - if (!WorldGen.SolidTile(num682, num683 - 1) && !WorldGen.SolidTile(num682, num683 - 2)) - { - projectile.velocity.Y = -5.1f; - } - else if (!WorldGen.SolidTile(num682, num683 - 2)) - { - projectile.velocity.Y = -7.1f; - } - else if (WorldGen.SolidTile(num682, num683 - 5)) - { - projectile.velocity.Y = -11.1f; - } - else if (WorldGen.SolidTile(num682, num683 - 4)) - { - projectile.velocity.Y = -10.1f; - } - else - { - projectile.velocity.Y = -9.1f; - } - } catch - { - projectile.velocity.Y = -9.1f; - } - } - num3 = num681; - } - } - if (projectile.velocity.X > num674) - { - projectile.velocity.X = num674; - } - if (projectile.velocity.X < -num674) - { - projectile.velocity.X = -num674; - } - if (projectile.velocity.X < 0f) - { - projectile.direction = -1; - } - if (projectile.velocity.X > 0f) - { - projectile.direction = 1; - } - if (projectile.velocity.X > num672 && num676 == 1) - { - projectile.direction = 1; - } - if (projectile.velocity.X < -num672 && num676 == -1) - { - projectile.direction = -1; - } - projectile.spriteDirection = projectile.direction; - projectile.velocity.Y = projectile.velocity.Y + 0.4f; - if (projectile.velocity.Y > 10f) - { - projectile.velocity.Y = 10f; - } - } - return; - } + else + { + if (sleepyTimer < 180) + { + sleepyTimer++; + lightLevel = 1; + } + else + { + lightLevel = 2; + projectile.frame = 16; + } + } + switch (lightLevel) + { + case 0: + Lighting.AddLight(projectile.Center, 0f, 2f, 2.5f); //4.5 + break; + case 1: + Lighting.AddLight(projectile.Center, 0f, 1.32f, 1.65f); //3 + break; + case 2: + Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.7f); + break; + } + float num23 = 0.2f; float num24 = 5f; - projectile.tileCollide = false; Vector2 vector4 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num25 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector4.X; - float num26 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].gfxOffY + (float)(Main.player[projectile.owner].height / 2) - vector4.Y; - if (Main.player[projectile.owner].controlLeft) + float num25 = player.position.X + (float)(player.width / 2) - vector4.X; + float num26 = player.position.Y + player.gfxOffY + (float)(player.height / 2) - vector4.Y; + if (player.controlLeft && sleepyTimer < 180) { num25 -= 120f; } - else if (Main.player[projectile.owner].controlRight) + else if (player.controlRight && sleepyTimer < 180) { num25 += 120f; } - if (Main.player[projectile.owner].controlDown) + if (player.controlDown && sleepyTimer < 180) { num26 += 120f; } else { - if (Main.player[projectile.owner].controlUp) + if (player.controlUp && sleepyTimer < 180) { num26 -= 120f; } @@ -375,12 +144,12 @@ namespace CalamityMod.Projectiles.Pets float num27 = (float)Math.Sqrt((double)(num25 * num25 + num26 * num26)); if (num27 > 1000f) { - projectile.position.X = projectile.position.X + num25; - projectile.position.Y = projectile.position.Y + num26; + projectile.position.X += num25; + projectile.position.Y += num26; } if (projectile.localAI[0] == 1f) { - if (num27 < 10f && Math.Abs(Main.player[projectile.owner].velocity.X) + Math.Abs(Main.player[projectile.owner].velocity.Y) < num24 && Main.player[projectile.owner].velocity.Y == 0f) + if (num27 < 10f && Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) < num24 && player.velocity.Y == 0f) { projectile.localAI[0] = 0f; } @@ -396,11 +165,11 @@ namespace CalamityMod.Projectiles.Pets projectile.velocity.X = num25 * num27; projectile.velocity.Y = num26 * num27; } - if ((double)projectile.velocity.X > 0.5) + if (projectile.velocity.X > 0.5f) { projectile.direction = -1; } - else if ((double)projectile.velocity.X < -0.5) + else if (projectile.velocity.X < -0.5f) { projectile.direction = 1; } @@ -412,11 +181,11 @@ namespace CalamityMod.Projectiles.Pets { projectile.localAI[0] = 1f; } - if ((double)projectile.velocity.X > 0.5) + if (projectile.velocity.X > 0.5f) { projectile.direction = -1; } - else if ((double)projectile.velocity.X < -0.5) + else if (projectile.velocity.X < -0.5f) { projectile.direction = 1; } @@ -432,14 +201,14 @@ namespace CalamityMod.Projectiles.Pets projectile.velocity *= 0f; num23 = 0f; } - projectile.direction = -Main.player[projectile.owner].direction; + projectile.direction = -player.direction; } num27 = num24 / num27; num25 *= num27; num26 *= num27; if (projectile.velocity.X < num25) { - projectile.velocity.X = projectile.velocity.X + num23; + projectile.velocity.X += num23; if (projectile.velocity.X < 0f) { projectile.velocity.X = projectile.velocity.X * 0.99f; @@ -447,7 +216,7 @@ namespace CalamityMod.Projectiles.Pets } if (projectile.velocity.X > num25) { - projectile.velocity.X = projectile.velocity.X - num23; + projectile.velocity.X -= num23; if (projectile.velocity.X > 0f) { projectile.velocity.X = projectile.velocity.X * 0.99f; @@ -455,7 +224,7 @@ namespace CalamityMod.Projectiles.Pets } if (projectile.velocity.Y < num26) { - projectile.velocity.Y = projectile.velocity.Y + num23; + projectile.velocity.Y += num23; if (projectile.velocity.Y < 0f) { projectile.velocity.Y = projectile.velocity.Y * 0.99f; @@ -463,7 +232,7 @@ namespace CalamityMod.Projectiles.Pets } if (projectile.velocity.Y > num26) { - projectile.velocity.Y = projectile.velocity.Y - num23; + projectile.velocity.Y -= num23; if (projectile.velocity.Y > 0f) { projectile.velocity.Y = projectile.velocity.Y * 0.99f; @@ -473,15 +242,6 @@ namespace CalamityMod.Projectiles.Pets { projectile.rotation = projectile.velocity.X * 0.05f; } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = underwater ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Pets/SirenFlopping"); - int height = (underwater ? Main.projectileTexture[projectile.type].Height : 256) / Main.projFrames[projectile.type]; - int frameHeight = height * projectile.frame; - Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, SpriteEffects.None, 0f); - return false; - } + } } } diff --git a/Projectiles/Pets/SirenYoung.png b/Projectiles/Pets/SirenYoung.png index 41481d1dba..70e101e4e1 100644 Binary files a/Projectiles/Pets/SirenYoung.png and b/Projectiles/Pets/SirenYoung.png differ diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index 04652dbf92..ff3cf364b6 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -2,8 +2,8 @@ using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; 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); diff --git a/Projectiles/Ranged/ArcticArrowProj.png b/Projectiles/Ranged/ArcticArrowProj.png index e4023c5037..5fcacaa5de 100644 Binary files a/Projectiles/Ranged/ArcticArrowProj.png and b/Projectiles/Ranged/ArcticArrowProj.png differ diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index 08fd53fe89..fc45b2f130 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -51,12 +51,12 @@ namespace CalamityMod.Projectiles.Ranged num296 = 0.75f; } projectile.ai[0] += 1f; - int num297 = 58; + int dustType = 62; if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 77878e655d..c1549dff6d 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/ElysianArrowProj.png b/Projectiles/Ranged/ElysianArrowProj.png index bf8d18b65e..e0936c2556 100644 Binary files a/Projectiles/Ranged/ElysianArrowProj.png and b/Projectiles/Ranged/ElysianArrowProj.png differ diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 0ef5baaf68..ff134707ac 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -50,12 +51,12 @@ namespace CalamityMod.Projectiles.Ranged num296 = 0.75f; } projectile.ai[0] += 1f; - int num297 = 173; + int dustType = (int)CalamityDusts.PurpleCosmolite; if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index dedd67315a..ff82a970b4 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); diff --git a/Projectiles/Ranged/NapalmArrowProj.png b/Projectiles/Ranged/NapalmArrowProj.png index 53fb0e274a..48ef48d4c4 100644 Binary files a/Projectiles/Ranged/NapalmArrowProj.png and b/Projectiles/Ranged/NapalmArrowProj.png differ diff --git a/Projectiles/Ranged/UltimaBolt.cs b/Projectiles/Ranged/UltimaBolt.cs new file mode 100644 index 0000000000..1201e4a9ae --- /dev/null +++ b/Projectiles/Ranged/UltimaBolt.cs @@ -0,0 +1,112 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaBolt : ModProjectile + { + public float Bounces + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float DefaultHue => ((float)Math.Sin(Main.GlobalTime * 2.5f) + 1) * 0.5f; + public const int MaxBounces = 1; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; + DisplayName.SetDefault("Ultima Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 42; + projectile.friendly = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + public Color GetColorFromHue(float hue) => Main.hslToRgb(hue, 1f, 0.725f) * projectile.Opacity; + public override Color? GetAlpha(Color lightColor) => GetColorFromHue(DefaultHue); + + public void ProduceExplosionDust(int dustCount) + { + if (!Main.dedServ) + { + for (int i = 0; i < dustCount; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 267); + dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.8f); + dust.scale = Main.rand.NextFloat(1f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(7f, 7f); + dust.noGravity = true; + } + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Bounces >= MaxBounces) + { + projectile.Kill(); + return false; + } + + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + Bounces++; + ProduceExplosionDust(24); + + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModContent.GetTexture(Texture); + for (int i = 0; i < projectile.oldPos.Length; i++) + { + if (i > 0) + { + CalamityUtils.DistanceClamp(ref projectile.oldPos[i], ref projectile.oldPos[i - 1], 8f); // Ensure the max distance between the old positions isn't too great. It looks weird if it is. + } + float completionRatio = i / (float)projectile.oldPos.Length; + Color color = GetColorFromHue((DefaultHue + completionRatio * 0.5f) % 1f) * (float)Math.Pow(1f - completionRatio, 2); + spriteBatch.Draw(texture, + projectile.oldPos[i] + texture.Size() * 0.5f - Main.screenPosition, + null, + color, + projectile.rotation, + texture.Size() * 0.5f, + projectile.scale, + SpriteEffects.None, + 0f); + } + return false; + } + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 90, 90); + projectile.Damage(); + ProduceExplosionDust(32); + } + } +} diff --git a/Projectiles/Ranged/UltimaBolt.png b/Projectiles/Ranged/UltimaBolt.png new file mode 100644 index 0000000000..4e0b7c7f9b Binary files /dev/null and b/Projectiles/Ranged/UltimaBolt.png differ diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs new file mode 100644 index 0000000000..c5f44980fe --- /dev/null +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -0,0 +1,108 @@ +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaBowProjectile : ModProjectile + { + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public const float PositioningOffset = 35f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima"); + } + + public override void SetDefaults() + { + projectile.width = 82; + projectile.height = 144; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + projectile.direction = (Math.Cos(projectile.velocity.ToRotation()) > 0).ToDirectionInt(); + AttemptToFireProjectiles(player); + AttachToPlayer(player); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + Time++; + } + + public void AttemptToFireProjectiles(Player player) + { + bool canFire = player.channel && player.HasAmmo(player.ActiveItem(), true) && !player.noItems && !player.CCed; + if (!canFire) + { + projectile.Kill(); + return; + } + if (Main.netMode != NetmodeID.MultiplayerClient && Time % player.ActiveItem().useTime == 0) + { + int type = ProjectileID.WoodenArrowFriendly; // This doesn't really matter. It's overwritten anyway. But it is passed into the PickAmmo method. + float shotSpeed = player.ActiveItem().shootSpeed; + int damage = player.GetWeaponDamage(player.ActiveItem()); + float knockBack = player.ActiveItem().knockBack; + + player.PickAmmo(player.ActiveItem(), ref type, ref shotSpeed, ref canFire, ref damage, ref knockBack); // Pick ammo and consume it (this incorporates the bow's chance to not consume ammo). + + Main.PlaySound(player.ActiveItem().UseSound, projectile.Center); + + type = ModContent.ProjectileType(); + float shootLaserChance = Utils.InverseLerp(Ultima.FullChargeTime * 0.35f, Ultima.FullChargeTime, Time, true); + Vector2 shotPosition = player.RotatedRelativePoint(player.MountedCenter, true); + shotPosition += projectile.velocity.ToRotation().ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(40f)).RotatedBy(-0.25f * projectile.spriteDirection) * 42f; + + projectile.velocity = projectile.DirectionTo(Main.MouseWorld); + + Vector2 shotVelocity = projectile.velocity * shotSpeed; // The velocity should always be a unit vector. + + // Fire a laser. + if (Main.rand.NextFloat() <= shootLaserChance) + { + type = ModContent.ProjectileType(); + shotVelocity = shotVelocity.RotatedByRandom(0.03f); + damage *= 2; + } + // Sometimes fire little sparks if the bow is fully charged. + if (Time >= Ultima.FullChargeTime * 0.7f && Main.rand.NextBool(6)) + { + // To ensure that the sparks don't spawn on top of the laser itself. + float offsetAngle = Main.rand.NextFloat(0.2f, 0.5f) * Main.rand.NextBool(2).ToDirectionInt(); + Vector2 sparkVelocity = projectile.DirectionTo(Main.MouseWorld).RotatedByRandom(0.5f) * 13f; + sparkVelocity = sparkVelocity.RotatedBy(offsetAngle); + Projectile.NewProjectile(shotPosition, sparkVelocity, ModContent.ProjectileType(), damage / 3, knockBack, projectile.owner); + } + knockBack = player.GetWeaponKnockback(player.ActiveItem(), knockBack); + + Projectile.NewProjectile(shotPosition, shotVelocity, type, damage, knockBack, projectile.owner); + projectile.netUpdate = true; + } + } + + public void AttachToPlayer(Player player) + { + projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + projectile.velocity.ToRotation().ToRotationVector2() * PositioningOffset; + projectile.spriteDirection = projectile.direction; + projectile.timeLeft = 2; + player.ChangeDir(projectile.direction); + player.heldProj = projectile.whoAmI; + player.itemTime = player.itemAnimation = 2; + player.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Ranged/UltimaBowProjectile.png b/Projectiles/Ranged/UltimaBowProjectile.png new file mode 100644 index 0000000000..a5e99993fd Binary files /dev/null and b/Projectiles/Ranged/UltimaBowProjectile.png differ diff --git a/Projectiles/Ranged/UltimaRay.cs b/Projectiles/Ranged/UltimaRay.cs new file mode 100644 index 0000000000..43742db73f --- /dev/null +++ b/Projectiles/Ranged/UltimaRay.cs @@ -0,0 +1,51 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaRay : BaseLaserbeamProjectile + { + public float HueOffset + { + get => projectile.ai[1]; + set => projectile.ai[1] = value; + } + public override float MaxScale => 0.7f; + public override float MaxLaserLength => 1599.999999f; + public override float Lifetime => 50f; + public override Color LaserOverlayColor => Main.hslToRgb((float)Math.Sin(Main.GlobalTime * 2.3f + HueOffset) * 0.5f + 0.5f, 1f, 0.775f) * Utils.InverseLerp(Lifetime, 0f, Time, true); + public override Color LightCastColor => LaserOverlayColor; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima Ray"); + } + public override void SetDefaults() + { + projectile.width = projectile.height = 22; + projectile.friendly = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.localNPCHitCooldown = 8; + projectile.usesLocalNPCImmunity = true; + } + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base laser's code, and we don't want that. + if (projectile.localAI[0] == 0f) + { + HueOffset = Main.rand.NextFloat(MathHelper.Pi / 5f); + projectile.localAI[0] = 1f; + } + return true; + } + public override bool ShouldUpdatePosition() => false; + } +} diff --git a/Projectiles/Ranged/UltimaRay.png b/Projectiles/Ranged/UltimaRay.png new file mode 100644 index 0000000000..15e8775737 Binary files /dev/null and b/Projectiles/Ranged/UltimaRay.png differ diff --git a/Projectiles/Ranged/UltimaSpark.cs b/Projectiles/Ranged/UltimaSpark.cs new file mode 100644 index 0000000000..277bb81070 --- /dev/null +++ b/Projectiles/Ranged/UltimaSpark.cs @@ -0,0 +1,91 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaSpark : ModProjectile + { + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public const int DustType = 261; + public const float MaxHomingDistance = 1200f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima Spark"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 8; + projectile.friendly = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.penetrate = 1; + projectile.timeLeft = 240; + projectile.extraUpdates = 1; + } + + public override void AI() + { + if (!Main.dedServ && Time > 5f) + { + for (int i = 0; i < 3; i++) + { + Vector2 spawnPosition = Vector2.Lerp(projectile.oldPosition, projectile.position, i / 3f); + Dust dust = Dust.NewDustPerfect(spawnPosition, DustType); + dust.color = Main.hslToRgb((Main.rand.NextFloat(-0.04f, 0.04f) + Time / 80f) % 1f, 0.8f, 0.6f); + dust.scale = 2.3f; + dust.fadeIn = 1f; + dust.rotation = Main.rand.NextFloat(MathHelper.TwoPi); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + } + } + + NPC potentialTarget = projectile.Center.ClosestNPCAt(MaxHomingDistance); + if (potentialTarget != null) + { + projectile.velocity = (projectile.velocity * 8f + projectile.DirectionTo(potentialTarget.Center) * 18f) / 9f; + return; + } + + if (Time > 30f) + { + float updatedTime = Time - 30f; + // Make a complete 90 degree turn in 30 frames. + if (updatedTime % 120f > 90f) + { + projectile.velocity = projectile.velocity.RotatedBy(MathHelper.PiOver2 / 20f); + } + // Arc around quickly for 60 frames. + else if (updatedTime % 120f > 30f) + { + projectile.velocity = projectile.velocity.RotatedBy((float)Math.Sin((updatedTime - 30f) % 60f / 60f * MathHelper.TwoPi) * MathHelper.ToRadians(15f)); + } + } + + Time++; + } + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 60, 60); + projectile.Damage(); + if (!Main.dedServ) + { + for (int i = 0; i < 20; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, DustType); + dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.7f); + dust.scale = Main.rand.NextFloat(0.9f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(6f, 6f); + dust.noGravity = true; + } + } + } + } +} diff --git a/Projectiles/Ranged/UltimaSpark.png b/Projectiles/Ranged/UltimaSpark.png new file mode 100644 index 0000000000..a799dbbc35 Binary files /dev/null and b/Projectiles/Ranged/UltimaSpark.png differ diff --git a/Projectiles/Rogue/BrackishFlaskProj.cs b/Projectiles/Rogue/BrackishFlaskProj.cs index fe00874d77..e5683ce1d5 100644 --- a/Projectiles/Rogue/BrackishFlaskProj.cs +++ b/Projectiles/Rogue/BrackishFlaskProj.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Projectiles.Rogue double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; if (projectile.owner == Main.myPlayer) { if (projectile.Calamity().stealthStrike) @@ -51,11 +50,11 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 1f, 0f); } } } diff --git a/Projectiles/Rogue/BrackishFlaskProj.png b/Projectiles/Rogue/BrackishFlaskProj.png index c0101e465c..0e5ad78a57 100644 Binary files a/Projectiles/Rogue/BrackishFlaskProj.png and b/Projectiles/Rogue/BrackishFlaskProj.png differ diff --git a/Projectiles/Rogue/BrackishWater.cs b/Projectiles/Rogue/BrackishWater.cs index 78719abe3c..77bfdf8c6e 100644 --- a/Projectiles/Rogue/BrackishWater.cs +++ b/Projectiles/Rogue/BrackishWater.cs @@ -26,23 +26,23 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.5f / 255f); - if (projectile.localAI[0] == 0f) + if (projectile.localAI[0] == 0f && projectile.ai[0] == 1f) { Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 21); projectile.localAI[0] += 1f; } - int randomDust = Utils.SelectRandom(Main.rand, new int[] + if (projectile.timeLeft % 2 == 0) { - 33, - 89 - }); - for (int num457 = 0; num457 < 3; num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; - } + int randomDust = Utils.SelectRandom(Main.rand, new int[] + { + 33, + 89 + }); + int water = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); + Main.dust[water].noGravity = true; + Main.dust[water].velocity *= 0.5f; + Main.dust[water].velocity += projectile.velocity * 0.1f; + } } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/BrackishWater.png b/Projectiles/Rogue/BrackishWater.png index 831f72cfc8..29d231bf6d 100644 Binary files a/Projectiles/Rogue/BrackishWater.png and b/Projectiles/Rogue/BrackishWater.png differ diff --git a/Projectiles/Rogue/Brimblade2.png b/Projectiles/Rogue/Brimblade2.png index d7de00d24b..0d93160ef8 100644 Binary files a/Projectiles/Rogue/Brimblade2.png and b/Projectiles/Rogue/Brimblade2.png differ diff --git a/Projectiles/Rogue/BrimbladeProj.png b/Projectiles/Rogue/BrimbladeProj.png index d7de00d24b..0d93160ef8 100644 Binary files a/Projectiles/Rogue/BrimbladeProj.png and b/Projectiles/Rogue/BrimbladeProj.png differ diff --git a/Projectiles/Rogue/DestructionBolt.png b/Projectiles/Rogue/DestructionBolt.png index bb6630a736..66a812cf0b 100644 Binary files a/Projectiles/Rogue/DestructionBolt.png and b/Projectiles/Rogue/DestructionBolt.png differ diff --git a/Projectiles/Rogue/DestructionStar.cs b/Projectiles/Rogue/DestructionStar.cs index 3e4ba4e834..8faa224bca 100644 --- a/Projectiles/Rogue/DestructionStar.cs +++ b/Projectiles/Rogue/DestructionStar.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public class DestructionStar : ModProjectile { public int hitCount = 0; - private static float Radius = 43f; + private static float Radius = 47f; public override void SetStaticDefaults() { @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - projectile.width = 86; - projectile.height = 86; + projectile.width = 94; + projectile.height = 94; projectile.friendly = true; projectile.penetrate = 16; projectile.usesLocalNPCImmunity = true; @@ -89,8 +89,7 @@ namespace CalamityMod.Projectiles.Rogue } if (projectile.owner == Main.myPlayer) { - int i; - for (i = 0; i < hitCount; i++) + for (int i = 0; i < hitCount; i++) { Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); while (value15.X == 0f && value15.Y == 0f) @@ -99,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Projectiles/Rogue/DestructionStar.png b/Projectiles/Rogue/DestructionStar.png index 732056dac4..46c3428789 100644 Binary files a/Projectiles/Rogue/DestructionStar.png and b/Projectiles/Rogue/DestructionStar.png differ diff --git a/Projectiles/Rogue/LionfishProj.png b/Projectiles/Rogue/LionfishProj.png index 56025eca70..e97c12862e 100644 Binary files a/Projectiles/Rogue/LionfishProj.png and b/Projectiles/Rogue/LionfishProj.png differ diff --git a/Projectiles/Rogue/ScourgeVenomCloud.cs b/Projectiles/Rogue/ScourgeVenomCloud.cs index c874e06e43..81c622266b 100644 --- a/Projectiles/Rogue/ScourgeVenomCloud.cs +++ b/Projectiles/Rogue/ScourgeVenomCloud.cs @@ -1,7 +1,8 @@ +using CalamityMod.Buffs.DamageOverTime; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { @@ -10,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Venom Cloud"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 10; } public override void SetDefaults() @@ -30,41 +31,37 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + projectile.ai[0] += 1f; projectile.frameCounter++; - if (projectile.frameCounter > 9) + if (projectile.frameCounter > 6) { projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) - { - projectile.frame = 0; - } + if (projectile.ai[0] < 219f) //255 - frameCounter tick * number of disippation frames + { + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + } + else if (projectile.owner == Main.myPlayer && projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.Kill(); + } projectile.velocity *= 0.98f; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 120f) - { - if (projectile.alpha < 255) - { - projectile.alpha += 5; - if (projectile.alpha > 255) - { - projectile.alpha = 255; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.Kill(); - } - } - else if (projectile.alpha > 80) + if (projectile.alpha > 110) { projectile.alpha -= 30; - if (projectile.alpha < 80) + if (projectile.alpha < 110) { - projectile.alpha = 80; + projectile.alpha = 110; } } + if (Math.Abs(projectile.velocity.X) > 0.1f) + { + projectile.spriteDirection = -projectile.direction; + } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/ScourgeVenomCloud.png b/Projectiles/Rogue/ScourgeVenomCloud.png index 412c5607a5..2a1c0b9502 100644 Binary files a/Projectiles/Rogue/ScourgeVenomCloud.png and b/Projectiles/Rogue/ScourgeVenomCloud.png differ diff --git a/Projectiles/Rogue/WulfrumKnifeProj.png b/Projectiles/Rogue/WulfrumKnifeProj.png index aab1bf448c..94ca6dcea6 100644 Binary files a/Projectiles/Rogue/WulfrumKnifeProj.png and b/Projectiles/Rogue/WulfrumKnifeProj.png differ diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs index 710588bed7..38d1edc8b2 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; + projectile.width = 20; + projectile.height = 20; projectile.friendly = true; projectile.penetrate = -1; projectile.extraUpdates = 1; @@ -32,10 +32,10 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(135f); if (Main.rand.NextBool(3)) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (projectile.spriteDirection == -1) { diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.png b/Projectiles/Rogue/XerocPitchforkProjectile.png index 5ff0fa6cf6..ca5e3d8840 100644 Binary files a/Projectiles/Rogue/XerocPitchforkProjectile.png and b/Projectiles/Rogue/XerocPitchforkProjectile.png differ diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index b80a01a5a3..2742d3a92d 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Mist"); - Main.projFrames[projectile.type] = 6; + Main.projFrames[projectile.type] = 8; ProjectileID.Sets.MinionShot[projectile.type] = true; } @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } diff --git a/Projectiles/Summon/FrostMistFriendly.png b/Projectiles/Summon/FrostMistFriendly.png index 8349afb42d..ef17040dd0 100644 Binary files a/Projectiles/Summon/FrostMistFriendly.png and b/Projectiles/Summon/FrostMistFriendly.png differ diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index 36d87f9dba..ea46870676 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Herring"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 8; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Summon projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } diff --git a/Projectiles/Summon/HerringMinion.png b/Projectiles/Summon/HerringMinion.png index 9d384c9345..5e8bef7fba 100644 Binary files a/Projectiles/Summon/HerringMinion.png and b/Projectiles/Summon/HerringMinion.png differ diff --git a/Projectiles/Summon/MagicBullet.cs b/Projectiles/Summon/MagicBullet.cs index 5e92de59ea..f87517bbc9 100644 --- a/Projectiles/Summon/MagicBullet.cs +++ b/Projectiles/Summon/MagicBullet.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -60,5 +61,7 @@ namespace CalamityMod.Projectiles.Summon { return new Color(189, 51, 164, projectile.alpha); } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) => projectile.timeLeft < 600; } } diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index 4ccf243923..d803995de9 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -75,12 +75,12 @@ namespace CalamityMod.Projectiles.Summon projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 1f / 255f, (255 - projectile.alpha) * 0f / 255f); - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; - if (Main.player[projectile.owner].gravDir == -1f) + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + if (player.gravDir == -1f) { projectile.position.Y = projectile.position.Y + 120f; - projectile.rotation = 3.14f; + projectile.rotation = MathHelper.Pi; } else { diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index ffa5c68efd..f7361227a3 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 2f60590d2d..803cb848d5 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/Summon/SandElementalMinion.png b/Projectiles/Summon/SandElementalMinion.png index 22e16e792d..a0b71ad531 100644 Binary files a/Projectiles/Summon/SandElementalMinion.png and b/Projectiles/Summon/SandElementalMinion.png differ diff --git a/Projectiles/Summon/SirenSongFriendly.png b/Projectiles/Summon/SirenSongFriendly.png index c2832ae6e8..1738907123 100644 Binary files a/Projectiles/Summon/SirenSongFriendly.png and b/Projectiles/Summon/SirenSongFriendly.png differ diff --git a/Projectiles/Summon/WaterSpearFriendly.png b/Projectiles/Summon/WaterSpearFriendly.png index b923a9ea8b..a50659774e 100644 Binary files a/Projectiles/Summon/WaterSpearFriendly.png and b/Projectiles/Summon/WaterSpearFriendly.png differ diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index cbc19cb5d6..1f0624e0fa 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -15,19 +15,18 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Wulfrum Droid"); - Main.projFrames[projectile.type] = 3; + Main.projFrames[projectile.type] = 12; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = 26; + projectile.height = 32; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - //projectile.aiStyle = 62; projectile.minionSlots = 1f; projectile.timeLeft = 18000; projectile.penetrate = -1; @@ -44,24 +43,23 @@ namespace CalamityMod.Projectiles.Summon { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) + int dustAmt = 36; + for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 61, vector7.X * 1.1f, vector7.Y * 1.1f, 100, default, 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; + Vector2 source = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + source = source.RotatedBy((double)((float)(dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; + Vector2 dustVel = source - projectile.Center; + int green = Dust.NewDust(source + dustVel, 0, 0, 61, dustVel.X * 1.1f, dustVel.Y * 1.1f, 100, default, 1.4f); + Main.dust[green].noGravity = true; + Main.dust[green].noLight = true; + Main.dust[green].velocity = dustVel; } dust += 1f; } if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; } projectile.frameCounter++; @@ -70,13 +68,13 @@ namespace CalamityMod.Projectiles.Summon projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame >= 3) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } - bool flag64 = projectile.type == ModContent.ProjectileType(); + bool correctMinion = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + if (correctMinion) { if (player.dead) { @@ -88,135 +86,132 @@ namespace CalamityMod.Projectiles.Summon } } projectile.MinionAntiClump(); - Vector2 vector2_3 = projectile.position; - float num7 = 450f; - bool flag = false; - int num8 = -1; + Vector2 targetVector = projectile.position; + float range = 450f; + bool foundTarget = false; + int targetIndex = -1; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy((object) this, false)) { - float num1 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag && num1 < num7) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if ((!foundTarget && targetDist < range) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num7 = num1; - vector2_3 = npc.Center; - flag = true; - num8 = npc.whoAmI; + range = targetDist; + targetVector = npc.Center; + foundTarget = true; + targetIndex = npc.whoAmI; } } } - if (!flag) + if (!foundTarget) { - for (int index2 = 0; index2 < Main.npc.Length; ++index2) + for (int npcIndex = 0; npcIndex < Main.npc.Length; ++npcIndex) { - NPC npc = Main.npc[index2]; + NPC npc = Main.npc[npcIndex]; if (npc.CanBeChasedBy((object) this, false)) { - float num1 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag && num1 < num7) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if ((!foundTarget && targetDist < range) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num7 = num1; - vector2_3 = npc.Center; - flag = true; - num8 = index2; + range = targetDist; + targetVector = npc.Center; + foundTarget = true; + targetIndex = npcIndex; } } } } - int num9 = 500; - if (flag) - num9 = 1000; - if ((double) Vector2.Distance(player.Center, projectile.Center) > (double) num9) + float separationAnxietyDist = 500f; + if (foundTarget) + separationAnxietyDist = 1000f; + if (Vector2.Distance(player.Center, projectile.Center) > separationAnxietyDist) { projectile.ai[0] = 1f; projectile.netUpdate = true; } - if ((double) projectile.ai[0] == 1.0) + if (projectile.ai[0] == 1f) projectile.tileCollide = false; - if (flag && (double) projectile.ai[0] == 0.0) + if (foundTarget && projectile.ai[0] == 0f) { - Vector2 vector2_1 = vector2_3 - projectile.Center; - float num1 = vector2_1.Length(); - vector2_1.Normalize(); - if ((double) num1 > 200.0) + Vector2 targetPos = targetVector - projectile.Center; + float targetDist = targetPos.Length(); + targetPos.Normalize(); + if (targetDist > 200f) { - float num2 = 6f; - Vector2 vector2_2 = vector2_1 * num2; - projectile.velocity.X = (float) (((double) projectile.velocity.X * 40.0 + (double) vector2_2.X) / 41.0); - projectile.velocity.Y = (float) (((double) projectile.velocity.Y * 40.0 + (double) vector2_2.Y) / 41.0); + float speed = 6f; + Vector2 goToTarget = targetPos * speed; + projectile.velocity.X = (projectile.velocity.X * 40f + goToTarget.X) / 41f; + projectile.velocity.Y = (projectile.velocity.Y * 40f + goToTarget.Y) / 41f; } - else if ((double) projectile.velocity.Y > -1.0) + else if (projectile.velocity.Y > -1f) projectile.velocity.Y -= 0.1f; } else { if (!Collision.CanHitLine(projectile.Center, 1, 1, player.Center, 1, 1)) projectile.ai[0] = 1f; - float num1 = 6f; - if ((double) projectile.ai[0] == 1.0) - num1 = 15f; - Vector2 center = projectile.Center; - Vector2 vector2_1 = player.Center - center + new Vector2(0.0f, -60f); - float num3 = vector2_1.Length(); - if ((double) num3 > 200.0 && (double) num1 < 9.0) - num1 = 9f; - if ((double) num3 < 100.0 && (double) projectile.ai[0] == 1.0 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + float returnSpeed = 6f; + if (projectile.ai[0] == 1f) + returnSpeed = 15f; + Vector2 playerVec = player.Center - projectile.Center + new Vector2(0f, -60f); + float playerDist = playerVec.Length(); + if (playerDist > 200f && returnSpeed < 9f) + returnSpeed = 9f; + if (playerDist < 100f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { - projectile.ai[0] = 0.0f; + projectile.ai[0] = 0f; projectile.netUpdate = true; } - if ((double) num3 > 2000.0) + if (playerDist > 2000f) { projectile.position.X = player.Center.X - (float) (projectile.width / 2); projectile.position.Y = player.Center.Y - (float) (projectile.width / 2); + projectile.netUpdate = true; } - else if ((double) num3 > 70.0) + else if (playerDist > 70f) { - vector2_1.Normalize(); - projectile.velocity = (projectile.velocity * 20f + vector2_1 * num1) / 21f; + playerVec.Normalize(); + projectile.velocity = (projectile.velocity * 20f + playerVec * returnSpeed) / 21f; } else { - if ((double) projectile.velocity.X == 0.0 && (double) projectile.velocity.Y == 0.0) + if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) { projectile.velocity.X = -0.15f; projectile.velocity.Y = -0.05f; } - projectile.velocity = projectile.velocity * 1.01f; + projectile.velocity *= 1.01f; } } projectile.rotation = projectile.velocity.X * 0.05f; - if ((double) projectile.velocity.X > 0.0) + if (projectile.velocity.X > 0f) projectile.spriteDirection = projectile.direction = 1; - else if ((double) projectile.velocity.X < 0.0) + else if (projectile.velocity.X < 0f) projectile.spriteDirection = projectile.direction = -1; - if ((double) projectile.ai[1] > 0.0) + if (projectile.ai[1] > 0f) projectile.ai[1] += (float) Main.rand.Next(1, 4); - if ((double) projectile.ai[1] > 90.0) + if (projectile.ai[1] > 90f) { projectile.ai[1] = 0.0f; projectile.netUpdate = true; } - if ((double) projectile.ai[1] != 0.0) + if (projectile.ai[1] != 0f) return; ++projectile.ai[1]; if (Main.myPlayer != projectile.owner) return; - if (!flag) + if (!foundTarget) return; - Vector2 vec = vector2_3 - projectile.Center; - vec.Normalize(); - Vector2 vec2 = vec * 10f; - int bolt = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vec2.X, vec2.Y, ModContent.ProjectileType(), projectile.damage, 0.0f, Main.myPlayer, 0.0f, 0.0f); + Vector2 velocity = targetVector - projectile.Center; + velocity.Normalize(); + velocity *= 10f; + int bolt = Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); Main.projectile[bolt].netUpdate = true; projectile.netUpdate = true; } - public override bool CanDamage() - { - return false; - } + public override bool CanDamage() => false; } } diff --git a/Projectiles/Summon/WulfrumDroid.png b/Projectiles/Summon/WulfrumDroid.png index c227fdff07..fec767973b 100644 Binary files a/Projectiles/Summon/WulfrumDroid.png and b/Projectiles/Summon/WulfrumDroid.png differ diff --git a/Projectiles/Typeless/KelvinCatalystStar.png b/Projectiles/Typeless/KelvinCatalystStar.png index 63cf056df5..4c9d479f3b 100644 Binary files a/Projectiles/Typeless/KelvinCatalystStar.png and b/Projectiles/Typeless/KelvinCatalystStar.png differ diff --git a/Projectiles/Typeless/WulfrumBobber.cs b/Projectiles/Typeless/WulfrumBobber.cs index 2668a7b540..f178c2fbf2 100644 --- a/Projectiles/Typeless/WulfrumBobber.cs +++ b/Projectiles/Typeless/WulfrumBobber.cs @@ -24,8 +24,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDrawExtras(SpriteBatch spriteBatch) { - Player player = Main.player[projectile.owner]; - CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType(), new Color(200, 200, 200, 100)); + CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType(), new Color(200, 200, 200, 100), 38, 28f); return false; } } diff --git a/Projectiles/Typeless/WulfrumBobber.png b/Projectiles/Typeless/WulfrumBobber.png index 7d03394d6f..19d0f06aea 100644 Binary files a/Projectiles/Typeless/WulfrumBobber.png and b/Projectiles/Typeless/WulfrumBobber.png differ diff --git a/Projectiles/Typeless/XerocBlast.cs b/Projectiles/Typeless/XerocBlast.cs index 498481348e..3a1db33347 100644 --- a/Projectiles/Typeless/XerocBlast.cs +++ b/Projectiles/Typeless/XerocBlast.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 1f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, 0f, 0f, 100, default, 1f); Dust dust = Main.dust[num467]; dust.noGravity = true; dust.position.X = projectile.Center.X; diff --git a/Projectiles/Typeless/XerocBubble.cs b/Projectiles/Typeless/XerocBubble.cs index 4503b2e48d..986923299c 100644 --- a/Projectiles/Typeless/XerocBubble.cs +++ b/Projectiles/Typeless/XerocBubble.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num468 = 0; num468 < 1; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Typeless/XerocBubble.png b/Projectiles/Typeless/XerocBubble.png index 637b8391b1..1c0aafc145 100644 Binary files a/Projectiles/Typeless/XerocBubble.png and b/Projectiles/Typeless/XerocBubble.png differ diff --git a/Projectiles/Typeless/XerocFire.cs b/Projectiles/Typeless/XerocFire.cs index 1cb3dbfa08..f3d8d7e5f1 100644 --- a/Projectiles/Typeless/XerocFire.cs +++ b/Projectiles/Typeless/XerocFire.cs @@ -41,8 +41,8 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[0] = 5f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + projectile.velocity.X *= 0.97f; + if (projectile.velocity.X > -0.01f && projectile.velocity.X < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; @@ -51,16 +51,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.75f); - Dust dust = Main.dust[num199]; - dust.position.X -= 2f; - dust.position.Y += 2f; - dust.scale += (float)Main.rand.Next(50) * 0.01f; - dust.noGravity = true; - dust.velocity.Y -= 2f; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool(3)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.75f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 62, 0f, 0f, 100, default, 0.75f); Dust dust2 = Main.dust[num200]; dust2.position.X -= 2f; dust2.position.Y += 2f; @@ -68,9 +61,19 @@ namespace CalamityMod.Projectiles.Typeless dust2.noGravity = true; dust2.velocity *= 0.1f; } - if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) + else + { + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 62, 0f, 0f, 100, default, 0.75f); + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; + } + if (projectile.velocity.Y < 0.25f && projectile.velocity.Y > 0.15f) { - projectile.velocity.X = projectile.velocity.X * 0.8f; + projectile.velocity.X *= 0.8f; } projectile.rotation = -projectile.velocity.X * 0.05f; if (projectile.velocity.Y > 16f) diff --git a/Projectiles/Typeless/XerocFire.png b/Projectiles/Typeless/XerocFire.png index 28f94674d6..297ed01ef2 100644 Binary files a/Projectiles/Typeless/XerocFire.png and b/Projectiles/Typeless/XerocFire.png differ diff --git a/Projectiles/Typeless/XerocOrb.cs b/Projectiles/Typeless/XerocOrb.cs index 5a7607f9da..00a76b1ba2 100644 --- a/Projectiles/Typeless/XerocOrb.cs +++ b/Projectiles/Typeless/XerocOrb.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 7f, 20f); diff --git a/Projectiles/Typeless/XerocOrb.png b/Projectiles/Typeless/XerocOrb.png index 15e8775737..c1fdbf1381 100644 Binary files a/Projectiles/Typeless/XerocOrb.png and b/Projectiles/Typeless/XerocOrb.png differ diff --git a/Projectiles/Typeless/XerocStar.cs b/Projectiles/Typeless/XerocStar.cs index 285ed3a9b2..511f7f198e 100644 --- a/Projectiles/Typeless/XerocStar.cs +++ b/Projectiles/Typeless/XerocStar.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num468 = 0; num468 < 1; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Typeless/XerocStar.png b/Projectiles/Typeless/XerocStar.png index 454174ef8a..3ccaa4660b 100644 Binary files a/Projectiles/Typeless/XerocStar.png and b/Projectiles/Typeless/XerocStar.png differ diff --git a/Projectiles/Typeless/YanmeisKnifeSlash.cs b/Projectiles/Typeless/YanmeisKnifeSlash.cs new file mode 100644 index 0000000000..599ff27179 --- /dev/null +++ b/Projectiles/Typeless/YanmeisKnifeSlash.cs @@ -0,0 +1,113 @@ +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class YanmeisKnifeSlash : ModProjectile + { + // This is a rather weird thing, but it's what the patron asked for. + public static readonly Func CanRecieveCoolEffectsFrom = (npc) => npc.boss || CalamityMod.bossMinionList.Contains(npc.type); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yanmei's Knife"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = 180; + projectile.height = 96; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ownerHitCheck = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + projectile.Calamity().trueMelee = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + + // Frames and crap + projectile.frameCounter++; + if (projectile.frameCounter % 7 == 0) + { + projectile.frame++; + if (projectile.frame >= Main.projFrames[projectile.type]) + projectile.Kill(); + } + + // Create idle light and dust. + Vector2 origin = projectile.Center + projectile.velocity * 3f; + Lighting.AddLight(origin, 0f, 1.5f, 0.1f); + + Vector2 playerRotatedPoint = player.RotatedRelativePoint(player.MountedCenter, true); + + // Rotation and directioning. + float velocityAngle = projectile.velocity.ToRotation(); + projectile.rotation = velocityAngle + (projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + projectile.direction = (Math.Cos(velocityAngle) > 0).ToDirectionInt(); + + // Positioning close to the end of the player's arm. + projectile.position = playerRotatedPoint - projectile.Size * 0.5f + velocityAngle.ToRotationVector2() * 80f; + + // Sprite and player directioning. + projectile.spriteDirection = projectile.direction; + player.ChangeDir(projectile.direction); + + // Prevents the projectile from dying + projectile.timeLeft = 2; + + // Player item-based field manipulation. + player.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + player.heldProj = projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + } + + public void HandleAttachmentMovement(Player player, Vector2 playerRotatedPoint) + { + float speed = 1f; + if (player.ActiveItem().shoot == projectile.type) + { + speed = player.ActiveItem().shootSpeed * projectile.scale; + } + Vector2 newVelocity = (Main.MouseWorld - playerRotatedPoint).SafeNormalize(Vector2.UnitX * player.direction) * speed; + + // Sync if a velocity component changes. + if (projectile.velocity.X != newVelocity.X || projectile.velocity.Y != newVelocity.Y) + { + projectile.netUpdate = true; + } + projectile.velocity = newVelocity; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (!CanRecieveCoolEffectsFrom(target)) + return; + target.AddBuff(ModContent.BuffType(), 600); + if (!Main.dedServ) + { + for (int i = 0; i < 60; i++) + { + Dust dust = Dust.NewDustDirect(Main.player[projectile.owner].position, Main.player[projectile.owner].width, Main.player[projectile.owner].height, 267); + dust.position.X += Main.rand.NextFloat(-16f, 16f); + dust.color = Main.hslToRgb(Main.rand.NextFloat(0.26f, 0.37f), 1f, 0.75f); + dust.velocity = Main.rand.NextVector2Circular(24f, 24f); + dust.scale = Main.rand.NextFloat(1.4f, 1.8f); + dust.noGravity = true; + } + } + Main.PlaySound(SoundID.Zombie, Main.player[projectile.owner].Center, 104); + Main.player[projectile.owner].AddBuff(ModContent.BuffType(), 600); + } + public override Color? GetAlpha(Color lightColor) => new Color(0, 215, 0, 0); + } +} diff --git a/Projectiles/Typeless/YanmeisKnifeSlash.png b/Projectiles/Typeless/YanmeisKnifeSlash.png new file mode 100644 index 0000000000..e0b03d728c Binary files /dev/null and b/Projectiles/Typeless/YanmeisKnifeSlash.png differ diff --git a/Tiles/Furniture/BossTrophy.cs b/Tiles/Furniture/BossTrophy.cs index 752e6ce492..e6731142a8 100644 --- a/Tiles/Furniture/BossTrophy.cs +++ b/Tiles/Furniture/BossTrophy.cs @@ -110,6 +110,9 @@ namespace CalamityMod.Tiles.Furniture break; case 26: item = ModContent.ItemType(); + break; + case 27: + item = ModContent.ItemType(); break; } if (item > 0) diff --git a/Tiles/Furniture/BossTrophy.png b/Tiles/Furniture/BossTrophy.png index b521b489bd..3970e3d5cb 100644 Binary files a/Tiles/Furniture/BossTrophy.png and b/Tiles/Furniture/BossTrophy.png differ diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinFlame.png b/Tiles/FurnitureCosmilite/CosmiliteBasinFlame.png new file mode 100644 index 0000000000..4bda7186c9 Binary files /dev/null and b/Tiles/FurnitureCosmilite/CosmiliteBasinFlame.png differ diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs index a76b519ecc..78d10a7148 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs @@ -1,14 +1,18 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using CalamityMod.Items.Placeables.FurnitureCosmilite; namespace CalamityMod.Tiles.FurnitureCosmilite { public class CosmiliteBasinTile : ModTile { + int animationFrame = 0; + public override void SetDefaults() { Main.tileLighted[Type] = true; @@ -42,6 +46,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite if (frameCounter >= 6) { frame = (frame + 1) % 6; + animationFrame = frame; frameCounter = 0; } } @@ -67,5 +72,19 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawStaticFlameEffect(ModContent.GetTexture("CalamityMod/Tiles/FurnitureCosmilite/CosmiliteBasinFlame"), i, j, offsetY: animationFrame * animationFrameHeight); + } + + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + { + Tile tile = Main.tile[i, j]; + if (tile.frameY == 18) + { + CalamityUtils.DrawFlameSparks((int)CalamityDusts.PurpleCosmolite, 5, i, j); + } + } } } \ No newline at end of file diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png index 4abbed3430..cee44a5c37 100644 Binary files a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png and b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png differ diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index ca8c0ebecb..89a2e24768 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -1032,8 +1032,7 @@ namespace CalamityMod ItemID.SolarFlarePickaxe, ItemID.VortexPickaxe, ItemID.NebulaPickaxe, - ItemID.StardustPickaxe, - ModContent.ItemType() + ItemID.StardustPickaxe }); RecipeGroup.RegisterGroup("LunarPickaxe", group); diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 203d628e24..30ed3cb883 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -958,6 +958,8 @@ namespace CalamityMod { newDamage = (int)((dmgInput - cap) * 0.1) + cap; } + if (newDamage < 1) + newDamage = 1; return newDamage; } @@ -2909,12 +2911,13 @@ namespace CalamityMod public static void DrawFishingLine(this Projectile projectile, int fishingRodType, Color poleColor, int xPositionAdditive = 45, float yPositionAdditive = 35f) { Player player = Main.player[projectile.owner]; - if (projectile.bobber && player.ActiveItem().holdStyle > 0) + Item item = Main.mouseItem.IsAir ? player.HeldItem : Main.mouseItem; + if (projectile.bobber && item.holdStyle > 0) { float pPosX = player.MountedCenter.X; float pPosY = player.MountedCenter.Y; pPosY += player.gfxOffY; - int type = player.ActiveItem().type; + int type = item.type; float gravDir = player.gravDir; if (type == fishingRodType) @@ -3371,6 +3374,20 @@ namespace CalamityMod return (t - from) / (to - from); } + /// + /// Clamps the distance between vectors via normalization. + /// + /// The starting point. + /// The ending point. + /// The maximum possible distance between the two vectors before they get clamped. + public static void DistanceClamp(ref Vector2 start, ref Vector2 end, float maxDistance) + { + if (Vector2.Distance(end, start) > maxDistance) + { + end = start + Vector2.Normalize(end - start) * maxDistance; + } + } + // REMOVE THIS IN CALAMITY 1.4, it's a 1.4 World.cs function public static Rectangle ClampToWorld(Rectangle tileRectangle) {