diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 60ba704791..30ecff2d9f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4,9 +4,6 @@ using System.Linq; using CalamityMod.Balancing; using CalamityMod.BiomeManagers; using CalamityMod.Buffs; -using CalamityMod.Buffs.Alcohol; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer.Dashes; @@ -71,6 +68,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; +using Terraria.Graphics.Effects; using static Terraria.ModLoader.ModContent; namespace CalamityMod.CalPlayer @@ -919,7 +917,11 @@ namespace CalamityMod.CalPlayer public bool sSpiritAmulet = false; public int sSpiritAmuletTimer = 0; public bool sSpiritAmuletVisual = false; - public bool lumenousAmulet = false; + public bool dOfTheDeep = false; + public int dOfTheDeepTimer = 0; + public bool dOfTheDeepVisual = false; + public int dOfTheDeepDefenseBuffMax = 420; + public int dOfTheDeepDefenseBuffTimer = 0; public bool oceanCrest = false; public bool aquaticEmblem = false; public bool spiritOrigin = false; @@ -1688,6 +1690,11 @@ namespace CalamityMod.CalPlayer #region Mouse Controls Syncing public bool mouseRight = false; private bool oldMouseRight = false; + + public float oldGravDir = 1; + public float tempGravDir = 1; + public bool justChangedGravity = false; + public Vector2 mouseWorld; private Vector2 oldMouseWorld; @@ -1982,8 +1989,6 @@ namespace CalamityMod.CalPlayer Player.statLifeMax2 += 45; int percentMaxLifeIncrease = 0; - if (ZoneAbyss && lumenousAmulet) - percentMaxLifeIncrease += 25; // Blood Pact and Chalice of the Blood God stack their HP bonuses if you want to equip both if (bloodPact) @@ -2337,7 +2342,7 @@ namespace CalamityMod.CalPlayer flameWakerBoots = false; hellfireTreads = false; sSpiritAmulet = false; - lumenousAmulet = false; + dOfTheDeep = false; oceanCrest = false; aquaticEmblem = false; if (!spiritOrigin) @@ -5634,7 +5639,7 @@ namespace CalamityMod.CalPlayer } public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs - { + { bool validEquipSlot = Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) || Player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && validEquipSlot) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 8abe73398a..a0a028f93d 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -32,6 +32,7 @@ using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; @@ -1384,11 +1385,11 @@ namespace CalamityMod.CalPlayer } else if (proj.type == ProjectileID.Stinger || proj.type == ProjectileID.QueenBeeStinger) { - // 66.6% chance of Poison for 3 seconds, 1 guaranteed second of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds) + // 66.6% chance of Poison for 5 seconds, 2 guaranteed seconds of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds) if (Main.rand.Next(3) > 0) - Player.AddBuff(BuffID.Poisoned, 180); + Player.AddBuff(BuffID.Poisoned, 300); else - Player.AddBuff(BuffID.Poisoned, 60); + Player.AddBuff(BuffID.Poisoned, 120); } else if (proj.type == ProjectileID.PoisonSeedPlantera) { @@ -1400,11 +1401,11 @@ namespace CalamityMod.CalPlayer } else if (proj.type == ProjectileID.ThornBall) { - Player.AddBuff(BuffID.Poisoned, 300); + Player.AddBuff(BuffID.Poisoned, 420); } else if (proj.type == ProjectileID.CultistBossFireBall) { - Player.AddBuff(ModContent.BuffType(), 120); + Player.AddBuff(ModContent.BuffType(), 180); } else if (proj.type == ProjectileID.CultistBossIceMist) { @@ -1415,7 +1416,7 @@ namespace CalamityMod.CalPlayer } else if (proj.type == ProjectileID.CultistBossLightningOrbArc) { - Player.AddBuff(BuffID.Electrified, 120); + Player.AddBuff(BuffID.Electrified, 180); } else if (proj.type == ProjectileID.AncientDoomProjectile) { @@ -1423,15 +1424,15 @@ namespace CalamityMod.CalPlayer } else if (proj.type == ProjectileID.CultistBossFireBallClone) { - Player.AddBuff(ModContent.BuffType(), 120); + Player.AddBuff(ModContent.BuffType(), 180); } else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye) { - Player.AddBuff(ModContent.BuffType(), 60); + Player.AddBuff(ModContent.BuffType(), 120); } else if (proj.type == ProjectileID.PhantasmalSphere) { - Player.AddBuff(ModContent.BuffType(), 120); + Player.AddBuff(ModContent.BuffType(), 210); } else if (proj.type == ProjectileID.PhantasmalDeathray) { @@ -1439,23 +1440,23 @@ namespace CalamityMod.CalPlayer } else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged()) { - Player.AddBuff(ModContent.BuffType(), 60); + Player.AddBuff(ModContent.BuffType(), 120); } else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged()) { - Player.AddBuff(ModContent.BuffType(), 120); + Player.AddBuff(ModContent.BuffType(), 210); } else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged()) { - Player.AddBuff(ModContent.BuffType(), 180); + Player.AddBuff(ModContent.BuffType(), 300); } else if (proj.type == ProjectileID.BloodNautilusShot) { - Player.AddBuff(ModContent.BuffType(), 120); + Player.AddBuff(ModContent.BuffType(), 240); } else if (proj.type == ProjectileID.BloodShot) { - Player.AddBuff(ModContent.BuffType(), 60); + Player.AddBuff(ModContent.BuffType(), 180); } else if (proj.type == ProjectileID.RuneBlast && Main.zenithWorld) { @@ -2634,20 +2635,25 @@ namespace CalamityMod.CalPlayer } } // TODO -- Make Deific Amulet and Rampart of Deities' retaliation effects way cooler + // In the meantime, gave them homing astral bombers instead of the lame falling stars if (dAmulet) { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - for (int n = 0; n < 3; n++) + int projAmount = (rampartOfDeities ? 12 : 6); + for (int n = 0; n < projAmount; n++) { int baseDamage = 130 * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1); - int deificStarDamage = (int)Player.GetBestClassDamage().ApplyTo(baseDamage); + int deificProjDamage = (int)Player.GetBestClassDamage().ApplyTo(baseDamage); - Projectile star = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.StarVeilStar, deificStarDamage, 4f, Player.whoAmI); - if (star.whoAmI.WithinBounds(Main.maxProjectiles)) + Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType(), deificProjDamage, 4f, Player.whoAmI)]; + if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles)) { - star.DamageType = DamageClass.Generic; - star.usesLocalNPCImmunity = true; - star.localNPCHitCooldown = 5; + onHitProj.DamageType = DamageClass.Generic; + onHitProj.usesLocalNPCImmunity = true; + onHitProj.localNPCHitCooldown = 5; + onHitProj.tileCollide = false; + onHitProj.extraUpdates = 1; + onHitProj.Calamity().conditionalHomingRange = 500f; } } } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 0b0a4a5b17..ed7e3ac147 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -4,6 +4,7 @@ using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; +using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; using CalamityMod.Enums; using CalamityMod.Items.Accessories; @@ -105,36 +106,37 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(weakBrimstoneFlames, 7); ApplyDoTDebuff(bBlood, 8, purity); ApplyDoTDebuff(brainRot, 8, purity); - ApplyDoTDebuff(heavybleeding, 30, purity); - ApplyDoTDebuff(laceration, 40, purity); + ApplyDoTDebuff(heavybleeding, 16, purity); + ApplyDoTDebuff(laceration, 24, purity); ApplyDoTDebuff(vaporfied, 8, purity); int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); ApplyDoTDebuff(staticDischarge, staticDoT, purity); - ApplyDoTDebuff(bFlames, abaddon ? 10 : 30, purity); - ApplyDoTDebuff(demonicFlames, 33, purity); - ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity); - ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity); - ApplyDoTDebuff(hFlames, 40, purity); - ApplyDoTDebuff(voidfrost, 40, purity); - ApplyDoTDebuff(vHex, 35); - ApplyDoTDebuff(trueVHex, 50); - ApplyDoTDebuff(cDepth, 18, purity); - ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); - ApplyDoTDebuff(hPressure, 40, purity); - ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity); - ApplyDoTDebuff(cragsLava, 30); + ApplyDoTDebuff(bFlames, abaddon ? 10 : 20, purity); + ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player + ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 15 : 30, purity); + ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 15 : 30, purity); + ApplyDoTDebuff(hFlames, 24, purity); + ApplyDoTDebuff(voidfrost, 30, purity); + ApplyDoTDebuff(vHex, 24); + ApplyDoTDebuff(trueVHex, 36); + ApplyDoTDebuff(cDepth, 15, purity); + ApplyDoTDebuff(astralInfection, 18, infectedJewel || hideOfDeus || purity); + ApplyDoTDebuff(hPressure, 30, purity); + ApplyDoTDebuff(pFlames, alchFlask ? 12 : 24, purity); + ApplyDoTDebuff(cragsLava, 30); // Being literally submerged in crags lava should do more than brimstone flames ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(elementalMix, 50, purity); - ApplyDoTDebuff(banishingFire, 60); + ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player + ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player + // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno - ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 60 : 50); - int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 60 : 15) / (eleResist ? 2 : 1); + ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 45 : 35); + int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); ApplyDoTDebuff(vermillionFlux, fluxDoT); - int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 60) / (dynamoStemCells ? 2 : 1); + int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 40) / (dynamoStemCells ? 2 : 1); ApplyDoTDebuff(dragonFire, dragonfireDoT); int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 75 : 15) / (eleResist ? 2 : 1); ApplyDoTDebuff(auricRebuke, rebukeDoT); - ApplyDoTDebuff(miracleBlight, 80); + ApplyDoTDebuff(miracleBlight, 50); // Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets. bool nearSafeZone = false; @@ -498,7 +500,7 @@ namespace CalamityMod.CalPlayer #endregion // During Silva revive or God Slayer dash, all negative life regen is canceled - if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) + if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (LastUsedDashID == GodslayerArmorDash.ID && Player.dashDelay < 0)) { if (Player.lifeRegen < 0) Player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index d2860cad67..db3a3c7409 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; @@ -68,7 +69,6 @@ using CalamityMod.World; using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Mono.Cecil; using ReLogic.Content; using Terraria; using Terraria.Audio; @@ -1658,15 +1658,18 @@ namespace CalamityMod.CalPlayer Projectile projectile = null; if (Player.dashDelay == -1) // When the player dashes, make all the energies exit idle phase { + int energyCount = 0; for (int x = 0; x < Main.maxProjectiles; x++) { projectile = Main.projectile[x]; if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == 0 && projectile.owner == Player.whoAmI) { projectile.ai[2] = 5; + energyCount++; } } - sSpiritAmuletTimer = -spawnTime; // The spawn cooldown after launching energies is twice as long + if (energyCount > 0) + sSpiritAmuletTimer = -spawnTime; // The spawn cooldown after launching energies is twice as long } int numOfEnergy = 0; for (int x = 0; x < Main.maxProjectiles; x++) // Get a count of energies in idle mode @@ -1680,7 +1683,7 @@ namespace CalamityMod.CalPlayer if (numOfEnergy < energyCap) { int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(22); - Projectile energy = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, (Vector2.One * 4).RotatedByRandom(Math.PI), ModContent.ProjectileType(), energyDamage, 0f, Player.whoAmI, 0, numOfEnergy); + Projectile energy = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, (Vector2.One * 4).RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType(), energyDamage, 0f, Player.whoAmI, 0, numOfEnergy); if (numOfEnergy + 1 == energyCap && Player.Calamity().sSpiritAmuletVisual) { SoundStyle transform = new("CalamityMod/Sounds/Item/WaterSplash1"); @@ -1688,7 +1691,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i <= 14; i++) { - Vector2 vel = (Vector2.One * 5).RotatedByRandom(Math.PI) * Main.rand.NextFloat(0.4f, 1.2f); + Vector2 vel = (Vector2.One * 5).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.4f, 1.2f); Dust dust2 = Dust.NewDustPerfect(Player.Center, ModContent.DustType(), vel); dust2.scale = Main.rand.NextFloat(0.8f, 1.4f); @@ -1751,6 +1754,77 @@ namespace CalamityMod.CalPlayer fallingBootVelCheckTimer = 0; } + if (dOfTheDeep) + { + if (dOfTheDeepDefenseBuffTimer > 0) + { + int maxDefense = 15; + int givenDefense = (int)Utils.Remap(dOfTheDeepDefenseBuffTimer, 0, dOfTheDeepDefenseBuffMax * 0.5f, 0, maxDefense); + Player.statDefense += givenDefense; + dOfTheDeepDefenseBuffTimer--; + } + + int spawnTime = 150; // Time between energy spawns + int energyCap = 3; // Max number of energies that can be alive at a time + + Projectile projectile = null; + if (Player.dashDelay == -1 && dOfTheDeepTimer > 0) // When the player dashes, make all the energies exit idle phase + { + int energyCount = 0; + for (int x = 0; x < Main.maxProjectiles; x++) + { + projectile = Main.projectile[x]; + if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == 0 && projectile.owner == Player.whoAmI) + { + projectile.ai[2] = 5; + energyCount++; + } + } + if (energyCount > 0) + dOfTheDeepTimer = (int)(-spawnTime * 0.5f); // The spawn cooldown after launching energies is longer + } + int numOfEnergy = 0; + for (int x = 0; x < Main.maxProjectiles; x++) // Get a count of energies in idle mode + { + projectile = Main.projectile[x]; + if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == 0 && projectile.owner == Player.whoAmI) + numOfEnergy++; + } + if (dOfTheDeepTimer >= spawnTime) + { + if (numOfEnergy < energyCap) + { + int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(400); + int energyType = (numOfEnergy % 3); + Projectile energy = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, (Vector2.One * 4).RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType(), energyDamage, 0f, Player.whoAmI, 0, numOfEnergy); + energy.localAI[2] = energyType; + if (numOfEnergy + 1 == energyCap && Player.Calamity().dOfTheDeepVisual) + { + SoundStyle max = new("CalamityMod/Sounds/Item/WaterSplash1"); + SoundEngine.PlaySound(max with { Volume = 0.35f, Pitch = 0.8f, MaxInstances = -1 }, Player.Center); + + for (int i = 0; i <= 14; i++) + { + Vector2 vel = (Vector2.One * 5).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.4f, 1.2f); + + Dust dust2 = Dust.NewDustPerfect(Player.Center, ModContent.DustType(), vel); + dust2.scale = Main.rand.NextFloat(0.8f, 1.4f); + dust2.noGravity = false; + dust2.alpha = 180; + dust2.color = Main.rand.NextBool() ? Color.Turquoise : Color.Aquamarine; + dust2.noLight = true; + dust2.noLightEmittence = true; + } + } + } + dOfTheDeepTimer = 0; + } + else if (!Player.dead) + { + dOfTheDeepTimer++; + } + } + if (unstableGraniteCore) { zapActivity += 1; @@ -2145,7 +2219,7 @@ namespace CalamityMod.CalPlayer MiniSwarmerCooldown--; // God Slayer Armor dash debuff immunity - if (DashID == GodSlayerDash.ID && Player.dashDelay < 0) + if (LastUsedDashID == GodslayerArmorDash.ID && Player.dashDelay < 0) { foreach (int debuff in DebuffsList.List) Player.buffImmune[debuff] = true; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index de6931aa50..8a6a023475 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -85,7 +85,7 @@ namespace CalamityMod.CalPlayer target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart; target.Calamity().IncreasedWaterEffects_Amulet1 = sSpiritAmulet; - target.Calamity().IncreasedWaterEffects_Amulet2 = false; + target.Calamity().IncreasedWaterEffects_Amulet2 = dOfTheDeep; target.Calamity().IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin; target.Calamity().IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine; @@ -222,7 +222,7 @@ namespace CalamityMod.CalPlayer cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart; cgn.IncreasedWaterEffects_Amulet1 = sSpiritAmulet; - cgn.IncreasedWaterEffects_Amulet2 = false; + cgn.IncreasedWaterEffects_Amulet2 = dOfTheDeep; cgn.IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin; cgn.IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine; @@ -1255,10 +1255,6 @@ namespace CalamityMod.CalPlayer int duration = 60; target.AddBuff(BuffType(), duration); } - if (lumenousAmulet) - { - CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); - } if (corrosiveSpine) { target.AddBuff(BuffType(), 120); diff --git a/CalamityConfig.cs b/CalamityConfig.cs index e98b6a34cd..7db9709350 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -59,6 +59,10 @@ namespace CalamityMod #region Graphics Changes [Header("Graphics")] + + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + public bool DisableGravityScreenSwap { get; set; } [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index c09e181762..d03b60e0a8 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -19,6 +19,7 @@ namespace CalamityMod public static ModKeybind RageHotKey { get; private set; } public static ModKeybind SpectralVeilHotKey { get; private set; } public static ModKeybind TransformerHotKey { get; private set; } + public static ModKeybind SwitchGravityHotkey {get; private set;} public override void Load() { @@ -38,6 +39,7 @@ namespace CalamityMod RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V"); SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K"); + SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T"); } public override void Unload() diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 2a5c4cd5f2..5d9a73271a 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -206,6 +206,10 @@ namespace CalamityMod.Effects internal static Effect TeslaTrailShader; #endregion + #region Doze's Shaders + internal static Effect FlipScreenShader; + #endregion + public override void PostSetupContent() { AssetRepository calAss = CalamityMod.Instance.Assets; @@ -408,6 +412,11 @@ namespace CalamityMod.Effects TeslaTrailShader = LoadShader("TeslaTrail"); RegisterMiscShader(TeslaTrailShader, "TrailPass", "TeslaTrail"); #endregion + + #region Loading Doze's Shaders + FlipScreenShader = LoadShader("ScreenShaders/FlipScreen"); + RegisterScreenShader(FlipScreenShader, "FlipTheScreen", "FlipScreen",EffectPriority.VeryHigh); + #endregion } // Shorthand to register a loaded shader in Terraria's graphics engine diff --git a/Effects/ScreenShaders/FlipScreen.fx b/Effects/ScreenShaders/FlipScreen.fx new file mode 100644 index 0000000000..39ad44126c --- /dev/null +++ b/Effects/ScreenShaders/FlipScreen.fx @@ -0,0 +1,38 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +sampler uImage2 : register(s2); +sampler uImage3 : register(s3); +float3 uColor; +float3 uSecondaryColor; +float2 uScreenResolution; +float2 uScreenPosition; +float2 uTargetPosition; +float2 uDirection; +float uOpacity; +float uTime; +float uIntensity; +float uProgress; +float2 uImageSize1; +float2 uImageSize2; +float2 uImageSize3; +float2 uImageOffset; +float uSaturation; +float4 uSourceRect; +float2 uZoom; + +float4 FilterMyShader(float2 coords : TEXCOORD0) : COLOR0 +{ + float2 newCoords; + newCoords.x = coords.x; + newCoords.y = 1 - coords.y; + float4 color = tex2D(uImage0, newCoords); + return color; +} + +technique Technique1 +{ + pass FlipTheScreen + { + PixelShader = compile ps_2_0 FilterMyShader(); + } +} \ No newline at end of file diff --git a/Effects/ScreenShaders/FlipScreen.xnb b/Effects/ScreenShaders/FlipScreen.xnb new file mode 100644 index 0000000000..842a5d7873 Binary files /dev/null and b/Effects/ScreenShaders/FlipScreen.xnb differ diff --git a/Effects/StormlionEffects.cs b/Effects/StormlionEffects.cs new file mode 100644 index 0000000000..0f754ef3b3 --- /dev/null +++ b/Effects/StormlionEffects.cs @@ -0,0 +1,24 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Effects +{ + public class StormlionEffects + { + // Energy + public static int EnergyDust = ModContent.DustType(); + public static Color EnergyColor = new Color(5, 187, 177); + // Flesh + public static int FleshDust = 192; + public static Color FleshColor = new Color(171, 113, 91); + + // Sounds + public static readonly SoundStyle Hit = new("CalamityMod/Sounds/NPCHit/StormlionAltHit"); + public static readonly SoundStyle Killed = new("CalamityMod/Sounds/NPCKilled/StormlionAltDeath"); + public static readonly SoundStyle Attack = new("CalamityMod/Sounds/Custom/StormlionAltShoot"); + public static readonly SoundStyle Idle1 = new("CalamityMod/Sounds/Custom/StormlionAltIdle1"); + public static readonly SoundStyle Idle2 = new("CalamityMod/Sounds/Custom/StormlionAltIdle2"); + } +} diff --git a/ExtraJumps/GravityJump.cs b/ExtraJumps/GravityJump.cs new file mode 100644 index 0000000000..3a4e37d850 --- /dev/null +++ b/ExtraJumps/GravityJump.cs @@ -0,0 +1,45 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.ExtraJumps +{ + public class GravityJump : ExtraJump + { + public override Position GetDefaultPosition() => BeforeBottleJumps; + public override float GetDurationMultiplier(Player player) => 3f; + public override void UpdateHorizontalSpeeds(Player player) + { + player.runAcceleration *= 2f; + player.maxRunSpeed *= 4f; + } + + public override void OnStarted(Player player, ref bool playSound) + { + playSound = true; + if (player.wingsLogic <= 0) { + player.velocity.Y *= player.slowFall ? 2.0f : 2.75f; + } else { + player.velocity.Y *= 1.7f; + } + player.StopExtraJumpInProgress(); + for (int i = 0; i < 3; i++) + { + Vector2 position = player.Center; + Vector2 velocity = (Vector2.UnitY * -(2.5f + 2f*i)) * player.gravDir; + int lifetime = 120; + float scale = MathHelper.Lerp(0.05f,0.1f,i/3f); + Color color = new Color(94,229,163); + Vector2 stretch = new Vector2(0.5f,1.5f); + float shrink = -0.3f; + Particle boostRing = new CustomSpark(position, velocity, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false,lifetime,scale,color,stretch,shrinkSpeed: shrink); + GeneralParticleHandler.SpawnParticle(boostRing); + } + } + public override void ShowVisuals(Player player) + { + player.StopExtraJumpInProgress(); + } + } +} diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index cc41e86400..fcf29214a6 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -1,8 +1,12 @@ using System; +using System.Collections.Generic; +using System.Numerics; using System.Reflection; using CalamityMod.Graphics.Renderers.CalamityRenderers; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.FurnitureExo; +using MonoMod.RuntimeDetour; using Terraria; using Terraria.DataStructures; using Terraria.GameContent; @@ -12,6 +16,7 @@ using Terraria.GameContent.ItemDropRules; using Terraria.GameContent.Liquid; using Terraria.GameContent.UI.Elements; using Terraria.GameContent.UI.States; +using Terraria.GameInput; using Terraria.Graphics.Light; using Terraria.Map; using Terraria.ModLoader; @@ -209,6 +214,11 @@ namespace CalamityMod.ILEditing On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges; IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar; On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs; + + On_Player.UpdateControlHolds += DelayGravity; + On_PlayerInput.SetZoom_MouseInWorld += GravityMouse; + On_Main.DrawPlayerChatBubbles += UI_Unflip_Start; + On_Main.DrawInterface += UI_Unflip_End; // Fix vanilla bugs exposed by Calamity mechanics IL_NPC.NPCLoot += FixSplittingWormBannerDrops; diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 0cf37992d2..a7c1ac0020 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -20,6 +20,8 @@ using Terraria.GameContent.Drawing; using Terraria.GameContent.Personalities; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Graphics.Effects; +using Terraria.GameInput; namespace CalamityMod.ILEditing { @@ -1183,6 +1185,85 @@ namespace CalamityMod.ILEditing } #endregion + #region Allow disabling gravity swap visual && allow gravity keybind + private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player) + { + var cplay = Player.Calamity(); + if (CalamityKeybinds.SwitchGravityHotkey.GetAssignedKeys().Count != 0 && (Player.gravControl || Player.gravControl2) && !Player.mount.Active) + { + if (Player.controlUp && Player.releaseUp) { + Player.gravDir *= -1; + } + if (CalamityKeybinds.SwitchGravityHotkey.JustPressed) + { + Player.gravDir *= -1; + Player.fallStart = (int)(Player.position.Y / 16f); + Player.jump = 0; + SoundEngine.PlaySound(SoundID.Item8, Player.position); + } + + if (Player.forcedGravity > 0) { + Player.gravDir = -1f; + } + } + + if (cplay.justChangedGravity) { + Player.gravDir = cplay.oldGravDir; + } + cplay.justChangedGravity = cplay.oldGravDir != Player.gravDir; + + cplay.oldGravDir = Player.gravDir; + if (Main.netMode != NetmodeID.Server && !Main.gameMenu && CalamityClientConfig.Instance.DisableGravityScreenSwap) + { + if (Player.gravDir == -1) { + if (!Filters.Scene["CalamityMod:FlipScreen"].IsActive()) { + Filters.Scene.Activate("CalamityMod:FlipScreen"); + Filters.Scene["CalamityMod:FlipScreen"].Opacity = 1f; + + } + } else { + if (Filters.Scene["CalamityMod:FlipScreen"].IsActive()) { + Filters.Scene["CalamityMod:FlipScreen"].Opacity = 0f; + Filters.Scene.Deactivate("CalamityMod:FlipScreen"); + + } + } + } + if (cplay.justChangedGravity) + { + Player.gravDir *= -1; + } + orig(Player); + } + + private static void GravityMouse(On_PlayerInput.orig_SetZoom_MouseInWorld orig) { + orig(); + if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive())//((Main.LocalPlayer.gravDir == -1 && !Main.LocalPlayer.Calamity().justChangedGravity) || (Main.LocalPlayer.Calamity().oldGravDir == -1 && Main.LocalPlayer.Calamity().justChangedGravity)) + { + var center = Main.screenHeight / 2; + Main.mouseY = center - (Main.mouseY - center); + }; + } + private static void UI_Unflip_Start(On_Main.orig_DrawPlayerChatBubbles orig, Main self) + { + if (!Main.gameMenu && (Filters.Scene["CalamityMod:FlipScreen"].IsActive() || Main.LocalPlayer.Calamity().justChangedGravity)) + { + Main.LocalPlayer.Calamity().tempGravDir = Main.LocalPlayer.gravDir; + Main.LocalPlayer.gravDir = 1; + } + orig(self); + } + + private static void UI_Unflip_End(On_Main.orig_DrawInterface orig, Main self, GameTime gameTime) + { + orig(self, gameTime); + if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive()) + { + Main.LocalPlayer.gravDir = Main.LocalPlayer.Calamity().tempGravDir; + } + } + #endregion + // 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value. #region Store The Stupid Fucking Private Wind Map In Public Property [/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)] diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index 8fa999b765..17b15c0aba 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(15). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/AscendantInsignia.cs b/Items/Accessories/AscendantInsignia.cs index 307cc2620b..d1d22d9a12 100644 --- a/Items/Accessories/AscendantInsignia.cs +++ b/Items/Accessories/AscendantInsignia.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(5). AddIngredient(5). AddIngredient(ItemID.SoulofFlight, 10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/AuricSoulArtifact.cs b/Items/Accessories/AuricSoulArtifact.cs index f20364b034..794f987a70 100644 --- a/Items/Accessories/AuricSoulArtifact.cs +++ b/Items/Accessories/AuricSoulArtifact.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Plates; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(5). AddIngredient(25). AddIngredient(25). - AddTile(TileID.DemonAltar). + AddTile(). Register(); } } diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index 8f68dd37c7..14d252e5f0 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(ItemID.WarriorEmblem). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/BlunderBooster.cs b/Items/Accessories/BlunderBooster.cs index f702b21117..1a1b2bac13 100644 --- a/Items/Accessories/BlunderBooster.cs +++ b/Items/Accessories/BlunderBooster.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(8). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/DaawnlightSpiritOrigin.cs b/Items/Accessories/DaawnlightSpiritOrigin.cs index 41291522ae..58ac8d754c 100644 --- a/Items/Accessories/DaawnlightSpiritOrigin.cs +++ b/Items/Accessories/DaawnlightSpiritOrigin.cs @@ -152,7 +152,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(15). AddIngredient(ItemID.LunarBar, 10). AddIngredient(4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/LumenousAmulet.cs b/Items/Accessories/DiamondOfTheDeep.cs similarity index 66% rename from Items/Accessories/LumenousAmulet.cs rename to Items/Accessories/DiamondOfTheDeep.cs index 7b07d0c8f0..e9a835f0cc 100644 --- a/Items/Accessories/LumenousAmulet.cs +++ b/Items/Accessories/DiamondOfTheDeep.cs @@ -2,14 +2,16 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [LegacyName("LumenousAmulet")] [AutoloadEquip(EquipType.Neck)] - public class LumenousAmulet : ModItem, ILocalizedModType + public class DiamondOfTheDeep : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() @@ -24,16 +26,20 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.lumenousAmulet = true; - player.buffImmune[ModContent.BuffType()] = true; - player.buffImmune[ModContent.BuffType()] = true; + modPlayer.dOfTheDeep = true; + modPlayer.dOfTheDeepVisual = !hideVisual; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). - AddIngredient(15). + AddIngredient(10). + AddIngredient(5). + AddIngredient(10). + AddIngredient(5). + AddIngredient(10). + AddIngredient(5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/LumenousAmulet.png b/Items/Accessories/DiamondOfTheDeep.png similarity index 100% rename from Items/Accessories/LumenousAmulet.png rename to Items/Accessories/DiamondOfTheDeep.png diff --git a/Items/Accessories/LumenousAmulet_Neck.png b/Items/Accessories/DiamondOfTheDeep_Neck.png similarity index 100% rename from Items/Accessories/LumenousAmulet_Neck.png rename to Items/Accessories/DiamondOfTheDeep_Neck.png diff --git a/Items/Accessories/DimensionalSoulArtifact.cs b/Items/Accessories/DimensionalSoulArtifact.cs index e449c12a33..434063f4be 100644 --- a/Items/Accessories/DimensionalSoulArtifact.cs +++ b/Items/Accessories/DimensionalSoulArtifact.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Plates; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(5). AddIngredient(25). AddIngredient(25). - AddTile(TileID.DemonAltar). + AddTile(). Register(); } } diff --git a/Items/Accessories/EldritchSoulArtifact.cs b/Items/Accessories/EldritchSoulArtifact.cs index 5bb6405a7c..0e1299f0ed 100644 --- a/Items/Accessories/EldritchSoulArtifact.cs +++ b/Items/Accessories/EldritchSoulArtifact.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(5). AddIngredient(25). AddIngredient(25). - AddTile(TileID.DemonAltar). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 8ea3582908..223d3dc0c0 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -183,6 +183,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(). AddIngredient(). + AddIngredient(ItemID.FragmentStardust, 6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Accessories/OccultSkullCrown.cs b/Items/Accessories/OccultSkullCrown.cs index 96480eb4f3..60b9a16ca6 100644 --- a/Items/Accessories/OccultSkullCrown.cs +++ b/Items/Accessories/OccultSkullCrown.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index 15ea7c2134..12171a8034 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(5). AddIngredient(25). AddIngredient(20). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 01232cb368..0450a4c4fe 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(5). AddIngredient(25). AddIngredient(25). - AddTile(TileID.DemonAltar). + AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/QuiverofNihility.cs b/Items/Accessories/QuiverofNihility.cs index 11717b66cd..9efd1466f7 100644 --- a/Items/Accessories/QuiverofNihility.cs +++ b/Items/Accessories/QuiverofNihility.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories AddRecipeGroup("AnyQuiver"). AddIngredient(5). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index efe65bb8df..5e6decb0b0 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(ItemID.FragmentStardust, 10). + AddIngredient(ItemID.FragmentStardust, 6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Accessories/StatisNinjaBelt.cs b/Items/Accessories/StatisNinjaBelt.cs index 9ac868fe4a..e42a2bbca1 100644 --- a/Items/Accessories/StatisNinjaBelt.cs +++ b/Items/Accessories/StatisNinjaBelt.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(ItemID.FrogFlipper). AddIngredient(25). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); CreateRecipe(). @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(ItemID.FrogGear). AddIngredient(25). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Accessories/Wings/TarragonWings.cs b/Items/Accessories/Wings/TarragonWings.cs index 7692df6166..7dea37ee71 100644 --- a/Items/Accessories/Wings/TarragonWings.cs +++ b/Items/Accessories/Wings/TarragonWings.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Accessories.Wings CreateRecipe(). AddIngredient(ItemID.SoulofFlight, 20). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Ammo/BloodfireArrow.cs b/Items/Ammo/BloodfireArrow.cs index 93de0fc981..6fd88990ef 100644 --- a/Items/Ammo/BloodfireArrow.cs +++ b/Items/Ammo/BloodfireArrow.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Ammo { CreateRecipe(333). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Ammo/BloodfireBullet.cs b/Items/Ammo/BloodfireBullet.cs index 915a56bf28..91630337cb 100644 --- a/Items/Ammo/BloodfireBullet.cs +++ b/Items/Ammo/BloodfireBullet.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Ammo { CreateRecipe(333). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Ammo/ElysianArrow.cs b/Items/Ammo/ElysianArrow.cs index 7f60191950..52dcc7ba58 100644 --- a/Items/Ammo/ElysianArrow.cs +++ b/Items/Ammo/ElysianArrow.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Ammo CreateRecipe(150). AddIngredient(ItemID.HolyArrow, 150). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Ammo/HallowPointRound.cs b/Items/Ammo/HallowPointRound.cs index c3316d90fa..725c8dab0a 100644 --- a/Items/Ammo/HallowPointRound.cs +++ b/Items/Ammo/HallowPointRound.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Ammo CreateRecipe(100). AddIngredient(ItemID.EmptyBullet, 100). AddIngredient(ItemID.HallowedBar). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Ammo/HolyFireBullet.cs b/Items/Ammo/HolyFireBullet.cs index 794853a48b..f92a3dbda8 100644 --- a/Items/Ammo/HolyFireBullet.cs +++ b/Items/Ammo/HolyFireBullet.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Ammo CreateRecipe(333). AddIngredient(ItemID.ExplodingBullet, 333). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs index 7139b25e18..c1fee61ca3 100644 --- a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs +++ b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(16). AddIngredient(4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareCuisses.cs b/Items/Armor/Bloodflare/BloodflareCuisses.cs index a34517488d..e604477feb 100644 --- a/Items/Armor/Bloodflare/BloodflareCuisses.cs +++ b/Items/Armor/Bloodflare/BloodflareCuisses.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(13). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index f3da4ef71c..8a4569fc13 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(11). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs index 542373cdbc..a65be7a702 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(11). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index a1bef0cca6..b8a9e4f5ef 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(11). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index 75e086447a..fbf4e7f488 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(11). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs index 0aa577c5bb..20e647a2cb 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Bloodflare CreateRecipe(). AddIngredient(11). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs index 86e43aab19..0f02976040 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue AddIngredient(5). AddIngredient(18). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index b40932ff94..9f284fee8e 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue AddIngredient(3). AddIngredient(12). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs index 54f1cbbf0a..8c853d54f7 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue AddIngredient(4). AddIngredient(15). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/Prismatic/PrismaticGreaves.cs b/Items/Armor/Prismatic/PrismaticGreaves.cs index ea73d76edf..2af82a1c33 100644 --- a/Items/Armor/Prismatic/PrismaticGreaves.cs +++ b/Items/Armor/Prismatic/PrismaticGreaves.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor.Prismatic AddIngredient(5). AddIngredient(6). AddIngredient(ItemID.Nanites, 300). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/Prismatic/PrismaticHelmet.cs b/Items/Armor/Prismatic/PrismaticHelmet.cs index fa39d36891..d21c375da9 100644 --- a/Items/Armor/Prismatic/PrismaticHelmet.cs +++ b/Items/Armor/Prismatic/PrismaticHelmet.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Armor.Prismatic AddIngredient(5). AddIngredient(4). AddIngredient(ItemID.Nanites, 300). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Prismatic/PrismaticRegalia.cs b/Items/Armor/Prismatic/PrismaticRegalia.cs index fbb6023108..05f840849e 100644 --- a/Items/Armor/Prismatic/PrismaticRegalia.cs +++ b/Items/Armor/Prismatic/PrismaticRegalia.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Armor.Prismatic AddIngredient(5). AddIngredient(8). AddIngredient(ItemID.Nanites, 300). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Tarragon/TarragonBreastplate.cs b/Items/Armor/Tarragon/TarragonBreastplate.cs index 0596b39c82..c68efe1199 100644 --- a/Items/Armor/Tarragon/TarragonBreastplate.cs +++ b/Items/Armor/Tarragon/TarragonBreastplate.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(15). AddIngredient(18). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Armor/Tarragon/TarragonHeadMagic.cs b/Items/Armor/Tarragon/TarragonHeadMagic.cs index d51fa12857..815101dd45 100644 --- a/Items/Armor/Tarragon/TarragonHeadMagic.cs +++ b/Items/Armor/Tarragon/TarragonHeadMagic.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(7). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Tarragon/TarragonHeadMelee.cs b/Items/Armor/Tarragon/TarragonHeadMelee.cs index 94f2ae5883..3fe7096a8a 100644 --- a/Items/Armor/Tarragon/TarragonHeadMelee.cs +++ b/Items/Armor/Tarragon/TarragonHeadMelee.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(7). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Tarragon/TarragonHeadRanged.cs b/Items/Armor/Tarragon/TarragonHeadRanged.cs index 7d29dbab8a..c225f23b8c 100644 --- a/Items/Armor/Tarragon/TarragonHeadRanged.cs +++ b/Items/Armor/Tarragon/TarragonHeadRanged.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(7). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Tarragon/TarragonHeadRogue.cs b/Items/Armor/Tarragon/TarragonHeadRogue.cs index 91f8785758..77a1ddca54 100644 --- a/Items/Armor/Tarragon/TarragonHeadRogue.cs +++ b/Items/Armor/Tarragon/TarragonHeadRogue.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(7). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Tarragon/TarragonHeadSummon.cs b/Items/Armor/Tarragon/TarragonHeadSummon.cs index ebaadb2a02..503c51a98a 100644 --- a/Items/Armor/Tarragon/TarragonHeadSummon.cs +++ b/Items/Armor/Tarragon/TarragonHeadSummon.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(7). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Tarragon/TarragonLeggings.cs b/Items/Armor/Tarragon/TarragonLeggings.cs index 4aeeca59c1..3d52ab04c0 100644 --- a/Items/Armor/Tarragon/TarragonLeggings.cs +++ b/Items/Armor/Tarragon/TarragonLeggings.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Tarragon CreateRecipe(). AddIngredient(11). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 724b013cae..105195722a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -30,6 +30,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; +using CalamityMod.ExtraJumps; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -1391,6 +1392,13 @@ namespace CalamityMod.Items if (item.type == ItemID.GravityGlobe) { + player.GetJumpState().Enable(); + if (player.Calamity().justChangedGravity) { + player.GetJumpState().Available = true; + } + if (player.wingsLogic <= 0 && player.velocity.Y != 0 && player.maxRunSpeed < 8) { + player.maxRunSpeed = 5f; + } player.jumpSpeedBoost += 1.6f; if (player.controlDown) player.maxFallSpeed *= 1.5f; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index bfb8475015..3e7c1050ba 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -570,12 +570,17 @@ namespace CalamityMod.Items if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotionMultiplier != 1f) EditTooltipByName("HealLife", (line) => line.Text = Language.GetOrRegister("CommonItemTooltip.RestoresLife").Format((int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier))); + // Ancient Manipulator also crafts stuff with Astral Bars + if (item.type == ItemID.LunarCraftingStation) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("LunarCraftingStation")); + + // Reworked Gravity Globe if (item.type == ItemID.GravityGlobe) - EditTooltipByName("Tooltip1", (line) => line.Text = EditedTooltip("GravityGlobe")); - + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("GravityGlobe")); + // "Buffed" Step Stool if (item.type == ItemID.PortableStool) - EditTooltipByName("Tooltip0", (line) => line.Text += AddedTooltip("Stepstool")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("PortableStool")); #endregion // For boss summon item clarity diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs index 149fc0e488..08079cd86a 100644 --- a/Items/DraedonMisc/VoltageRegulationSystem.cs +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.DraedonMisc AddIngredient(5). AddIngredient(ItemID.LunarBar, 5). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Fishing/FishingRods/EarlyBloomRod.cs b/Items/Fishing/FishingRods/EarlyBloomRod.cs index fa92d6cf33..ea7cbacd81 100644 --- a/Items/Fishing/FishingRods/EarlyBloomRod.cs +++ b/Items/Fishing/FishingRods/EarlyBloomRod.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Fishing.FishingRods CreateRecipe(). AddIngredient(ItemID.WoodFishingPole). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index 731d9c31c9..de3467dd4f 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Materials AddIngredient(5). AddIngredient(5). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index 494cdca070..fd301108ee 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -94,8 +94,7 @@ namespace CalamityMod.Items.Materials CreateRecipe(5). AddIngredient(50). AddIngredient(). - //Not Cosmic Anvil because making a bar at an anvil is a little odd? also allows pre-moon lord scal for those who really want to do it. win-win. - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); } } diff --git a/Items/Materials/BloodstoneCore.cs b/Items/Materials/BloodstoneCore.cs index 68cbb03212..2e5607f957 100644 --- a/Items/Materials/BloodstoneCore.cs +++ b/Items/Materials/BloodstoneCore.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Materials AddIngredient(5). AddIngredient(). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Mounts/Brimrose.cs b/Items/Mounts/Brimrose.cs index f23f2c5298..ce4728ef24 100644 --- a/Items/Mounts/Brimrose.cs +++ b/Items/Mounts/Brimrose.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Mounts CreateRecipe(). AddIngredient(5). AddIngredient(20). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/NormalityRelocator.cs b/Items/NormalityRelocator.cs index 12efc351c0..65138dcd96 100644 --- a/Items/NormalityRelocator.cs +++ b/Items/NormalityRelocator.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items AddIngredient(ItemID.FragmentStardust, 30). AddIngredient(5). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index ad1b42d30f..974b0cbc05 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -73,8 +73,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.LifeFruit, 5). AddIngredient(5). AddIngredient(12). - //Not an anvil because making fruit at an anvil is a little weird, so here's something more magical. - AddTile(TileID.DemonAltar). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/PermanentBoosters/PhantomHeart.cs b/Items/PermanentBoosters/PhantomHeart.cs index 2ec582f5fd..79b1f0ce12 100644 --- a/Items/PermanentBoosters/PhantomHeart.cs +++ b/Items/PermanentBoosters/PhantomHeart.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.PermanentBoosters CreateRecipe(). AddIngredient(5). AddIngredient(25). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/PermanentBoosters/SacredStrawberry.cs b/Items/PermanentBoosters/SacredStrawberry.cs index 623ccd1731..d6e040021e 100644 --- a/Items/PermanentBoosters/SacredStrawberry.cs +++ b/Items/PermanentBoosters/SacredStrawberry.cs @@ -76,8 +76,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.LifeFruit, 5). AddIngredient(5). AddIngredient(). - //Not an anvil because making fruit at an anvil is a little weird, so here's something more magical. - AddTile(TileID.LunarCraftingStation). + AddTile(). Register(); } } diff --git a/Items/PermanentBoosters/SanguineTangerine.cs b/Items/PermanentBoosters/SanguineTangerine.cs index 49ab59f968..1348fda9fe 100644 --- a/Items/PermanentBoosters/SanguineTangerine.cs +++ b/Items/PermanentBoosters/SanguineTangerine.cs @@ -76,8 +76,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.SoulofFright, 5). AddIngredient(ItemID.SoulofMight, 5). AddIngredient(ItemID.SoulofSight, 5). - //Not an anvil because making fruit at an anvil is a little weird, so here's something more magical. - AddTile(TileID.DemonAltar). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/PermanentBoosters/TaintedCloudberry.cs b/Items/PermanentBoosters/TaintedCloudberry.cs index 67207446de..56fc3b45ac 100644 --- a/Items/PermanentBoosters/TaintedCloudberry.cs +++ b/Items/PermanentBoosters/TaintedCloudberry.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.LifeFruit, 5). AddIngredient(10). AddIngredient(8). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Placeables/Furniture/AstralBeaconItem.cs b/Items/Placeables/Furniture/AstralBeaconItem.cs index 97e7a66d44..b63a91fa2c 100644 --- a/Items/Placeables/Furniture/AstralBeaconItem.cs +++ b/Items/Placeables/Furniture/AstralBeaconItem.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Placeables.Furniture AddIngredient(5). AddIngredient(20). AddIngredient(30). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs b/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs index 63ab5d8089..bdaac5f684 100644 --- a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.JungleSpores, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs index 8f6217f917..b7a9a85f65 100644 --- a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs +++ b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations AddIngredient(ItemID.LunarCraftingStation). AddIngredient(15). AddIngredient(12). - AddIngredient(25). + AddIngredient(15). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs b/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs index da3038d601..38cd253bdc 100644 --- a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs +++ b/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations CreateRecipe(). AddIngredient(10). AddRecipeGroup("AnyGoldBar", 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs b/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs index 67c0ddf555..dc9fb777f9 100644 --- a/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs +++ b/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations CreateRecipe(). AddIngredient(10). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs b/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs index 3fd80fc669..ece5bf1f44 100644 --- a/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs +++ b/Items/Placeables/Furniture/Monoliths/DraconicIncense.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Monoliths { CreateRecipe(). AddIngredient(15). - AddTile(TileID.LunarCraftingStation). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs index 36312630cf..65070a845f 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { CreateRecipe(). AddIngredient(14). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs index f3140813d1..353a1c5f8c 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs index d3df9dcdc5..f3ff94fd47 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs index 11c794c0f6..033e29b840 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs index ba12961307..d6a2c55a98 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs index d2d7338feb..133d1339f9 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { CreateRecipe(). AddIngredient(4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs index 3de2820561..d90850b4d3 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs index 88192ef233..d3f1b0136c 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs index f0ff836923..1a7282ccef 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs index 2a3a1e7b02..b6508de82b 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { CreateRecipe(). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs index 61a8967584..f347347fb4 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { CreateRecipe(). AddIngredient(16). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs index 65d2590d83..3970db46da 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs index 41dcfc2525..1833b7a940 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs index d84715b21d..208c7a75d3 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs index 75ced4a50f..da49bd9456 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs index 3e992a78d7..b95b3622d4 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs index 718a840b8c..3e7acb41e0 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly AddIngredient(). AddIngredient(). AddIngredient(ItemID.Silk, 10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs index d390b64ae9..8517f93ef5 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { CreateRecipe(). AddIngredient(8). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs index 2cf9018b78..f1efd85ac8 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { CreateRecipe(). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). Register(); } } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs b/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs index 2100d817a9..6202b9a5e6 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned CreateRecipe(50). AddIngredient(ItemID.Glass, 50). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureProfaned/ProfanedRock.cs b/Items/Placeables/FurnitureProfaned/ProfanedRock.cs index 7a5b532e7c..bb3ca2015c 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedRock.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedRock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned CreateRecipe(50). AddRecipeGroup("AnyStoneBlock", 50). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs b/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs index c3d7fc12d3..f91de46d0a 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned { CreateRecipe(5). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs b/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs index b975aced10..1e8e4c6e6e 100644 --- a/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs +++ b/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned CreateRecipe(5). AddIngredient(4). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureStratus/StratusBathtub.cs b/Items/Placeables/FurnitureStratus/StratusBathtub.cs index 3f5e3b6b76..ff810e5010 100644 --- a/Items/Placeables/FurnitureStratus/StratusBathtub.cs +++ b/Items/Placeables/FurnitureStratus/StratusBathtub.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(14). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBed.cs b/Items/Placeables/FurnitureStratus/StratusBed.cs index 6ce98dccab..65c93798ec 100644 --- a/Items/Placeables/FurnitureStratus/StratusBed.cs +++ b/Items/Placeables/FurnitureStratus/StratusBed.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBookcase.cs b/Items/Placeables/FurnitureStratus/StratusBookcase.cs index 558a78bfec..ac1226a1f8 100644 --- a/Items/Placeables/FurnitureStratus/StratusBookcase.cs +++ b/Items/Placeables/FurnitureStratus/StratusBookcase.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBricks.cs b/Items/Placeables/FurnitureStratus/StratusBricks.cs index c8e4ecead9..36f87a04c9 100644 --- a/Items/Placeables/FurnitureStratus/StratusBricks.cs +++ b/Items/Placeables/FurnitureStratus/StratusBricks.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(3). AddIngredient(). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs index 3f4a616950..63228f55f2 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusCandle.cs b/Items/Placeables/FurnitureStratus/StratusCandle.cs index 1e0c3bc8ea..f8dd4f71ea 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandle.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandle.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChair.cs b/Items/Placeables/FurnitureStratus/StratusChair.cs index 20dd9f148d..8a6ff76d53 100644 --- a/Items/Placeables/FurnitureStratus/StratusChair.cs +++ b/Items/Placeables/FurnitureStratus/StratusChair.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChandelier.cs b/Items/Placeables/FurnitureStratus/StratusChandelier.cs index 84b7f7fe5d..5f21142e57 100644 --- a/Items/Placeables/FurnitureStratus/StratusChandelier.cs +++ b/Items/Placeables/FurnitureStratus/StratusChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChest.cs b/Items/Placeables/FurnitureStratus/StratusChest.cs index 9137ca711c..753df53dec 100644 --- a/Items/Placeables/FurnitureStratus/StratusChest.cs +++ b/Items/Placeables/FurnitureStratus/StratusChest.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusClock.cs b/Items/Placeables/FurnitureStratus/StratusClock.cs index 35591f9dac..01b94235d7 100644 --- a/Items/Placeables/FurnitureStratus/StratusClock.cs +++ b/Items/Placeables/FurnitureStratus/StratusClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDoor.cs b/Items/Placeables/FurnitureStratus/StratusDoor.cs index c0086b86cc..9182e72e40 100644 --- a/Items/Placeables/FurnitureStratus/StratusDoor.cs +++ b/Items/Placeables/FurnitureStratus/StratusDoor.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDresser.cs b/Items/Placeables/FurnitureStratus/StratusDresser.cs index 3371fd2794..12e18ed01a 100644 --- a/Items/Placeables/FurnitureStratus/StratusDresser.cs +++ b/Items/Placeables/FurnitureStratus/StratusDresser.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(16). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLamp.cs b/Items/Placeables/FurnitureStratus/StratusLamp.cs index 10dd94a614..3d1e1f2488 100644 --- a/Items/Placeables/FurnitureStratus/StratusLamp.cs +++ b/Items/Placeables/FurnitureStratus/StratusLamp.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLantern.cs b/Items/Placeables/FurnitureStratus/StratusLantern.cs index 96d8746e51..050ea27365 100644 --- a/Items/Placeables/FurnitureStratus/StratusLantern.cs +++ b/Items/Placeables/FurnitureStratus/StratusLantern.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusPiano.cs b/Items/Placeables/FurnitureStratus/StratusPiano.cs index daf3753343..8d305c2cc2 100644 --- a/Items/Placeables/FurnitureStratus/StratusPiano.cs +++ b/Items/Placeables/FurnitureStratus/StratusPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSink.cs b/Items/Placeables/FurnitureStratus/StratusSink.cs index adbc891824..82c625509b 100644 --- a/Items/Placeables/FurnitureStratus/StratusSink.cs +++ b/Items/Placeables/FurnitureStratus/StratusSink.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSofa.cs b/Items/Placeables/FurnitureStratus/StratusSofa.cs index 53c00d843d..705a35948b 100644 --- a/Items/Placeables/FurnitureStratus/StratusSofa.cs +++ b/Items/Placeables/FurnitureStratus/StratusSofa.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusTable.cs b/Items/Placeables/FurnitureStratus/StratusTable.cs index dd7749ac4f..3e21e4e5b8 100644 --- a/Items/Placeables/FurnitureStratus/StratusTable.cs +++ b/Items/Placeables/FurnitureStratus/StratusTable.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(8). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusWorkBench.cs b/Items/Placeables/FurnitureStratus/StratusWorkBench.cs index 12f8d5edcd..69f1b33b25 100644 --- a/Items/Placeables/FurnitureStratus/StratusWorkBench.cs +++ b/Items/Placeables/FurnitureStratus/StratusWorkBench.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). Register(); } } diff --git a/Items/Placeables/UelibloomBrick.cs b/Items/Placeables/UelibloomBrick.cs index b90fd18f95..4866fe0c39 100644 --- a/Items/Placeables/UelibloomBrick.cs +++ b/Items/Placeables/UelibloomBrick.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables CreateRecipe(50). AddRecipeGroup("AnyStoneBlock", 50). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.AdamantiteForge). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index fb810a7c9e..7b3e79c937 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.SummonItems AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register() .DisableDecraft(); @@ -63,9 +63,8 @@ namespace CalamityMod.Items.SummonItems AddIngredient(ItemID.LunarBar, 40). AddIngredient(10). AddIngredient(40). - AddTile(TileID.LunarCraftingStation). - Register() - .DisableDecraft(); + AddTile(TileID.MythrilAnvil). + Register(); } } } diff --git a/Items/SummonItems/DeathWhistle.cs b/Items/SummonItems/DeathWhistle.cs index 017f3eddee..7fa4d05df6 100644 --- a/Items/SummonItems/DeathWhistle.cs +++ b/Items/SummonItems/DeathWhistle.cs @@ -52,7 +52,14 @@ namespace CalamityMod.Items.SummonItems CreateRecipe(). AddIngredient(ItemID.LunarTabletFragment, 15). AddIngredient(ItemID.LihzahrdBrick, 25). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.DemonAltar). + Register(); + + + CreateRecipe(). + AddIngredient(ItemID.LunarTabletFragment, 15). + AddIngredient(ItemID.LihzahrdBrick, 25). + AddTile(TileID.LihzahrdAltar). Register(); } } diff --git a/Items/SummonItems/MarkofProvidence.cs b/Items/SummonItems/MarkofProvidence.cs index d41c16641b..fb8b8032d1 100644 --- a/Items/SummonItems/MarkofProvidence.cs +++ b/Items/SummonItems/MarkofProvidence.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Items.SummonItems AddIngredient(ItemID.LunarBar, 3). AddIngredient(40). AddIngredient(ItemID.FragmentSolar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/SummonItems/NecroplasmicBeacon.cs b/Items/SummonItems/NecroplasmicBeacon.cs index ff4eabadb1..93b6e698ef 100644 --- a/Items/SummonItems/NecroplasmicBeacon.cs +++ b/Items/SummonItems/NecroplasmicBeacon.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.SummonItems CreateRecipe(). AddRecipeGroup("Wood", 25). AddIngredient(50). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index 11a1a9a4df..4899ececdd 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.SummonItems CreateRecipe(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(25). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/SummonItems/YharonEgg.cs b/Items/SummonItems/YharonEgg.cs index ccd197a89e..2a91bbe100 100644 --- a/Items/SummonItems/YharonEgg.cs +++ b/Items/SummonItems/YharonEgg.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.SummonItems CreateRecipe(). AddIngredient(10). AddIngredient(15). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Tools/BlossomPickaxe.cs b/Items/Tools/BlossomPickaxe.cs index 6030917674..3af6f63a84 100644 --- a/Items/Tools/BlossomPickaxe.cs +++ b/Items/Tools/BlossomPickaxe.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Tools { CreateRecipe(). AddIngredient(7). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index dfa90262bf..1cd4cc87d7 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Tools AddIngredient(). AddRecipeGroup("LunarHamaxe"). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/DraedonsArsenal/PhalanxSurge.cs b/Items/Weapons/DraedonsArsenal/PhalanxSurge.cs index e7cf6bd724..00ab2ba3b1 100644 --- a/Items/Weapons/DraedonsArsenal/PhalanxSurge.cs +++ b/Items/Weapons/DraedonsArsenal/PhalanxSurge.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal AddIngredient(8). AddIngredient(ItemID.LunarBar, 4). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 544c5818aa..cbeeac183f 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal AddIngredient(8). AddIngredient(ItemID.LunarBar, 4). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/DraedonsArsenal/PulseDragon.cs b/Items/Weapons/DraedonsArsenal/PulseDragon.cs index 25fd1376a2..321f65a022 100644 --- a/Items/Weapons/DraedonsArsenal/PulseDragon.cs +++ b/Items/Weapons/DraedonsArsenal/PulseDragon.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal AddIngredient(8). AddIngredient(ItemID.LunarBar, 4). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 1b041e028e..f5ca444db6 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal AddIngredient(8). AddIngredient(ItemID.LunarBar, 4). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index cd2d2ec4c1..26be6ef44b 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal AddIngredient(8). AddIngredient(ItemID.LunarBar, 4). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Func condition), condition). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/AethersWhisper.cs b/Items/Weapons/Magic/AethersWhisper.cs index ebb944edd7..1dbbdb3623 100644 --- a/Items/Weapons/Magic/AethersWhisper.cs +++ b/Items/Weapons/Magic/AethersWhisper.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/ChronomancersScythe.cs b/Items/Weapons/Magic/ChronomancersScythe.cs index 2902fe0d98..7785365ef0 100644 --- a/Items/Weapons/Magic/ChronomancersScythe.cs +++ b/Items/Weapons/Magic/ChronomancersScythe.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.FastClock). AddIngredient(ItemID.LunarBar, 10). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/ClamorNoctus.cs b/Items/Weapons/Magic/ClamorNoctus.cs index a54e500163..feef2c3ed4 100644 --- a/Items/Weapons/Magic/ClamorNoctus.cs +++ b/Items/Weapons/Magic/ClamorNoctus.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(6). AddIngredient(5). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index bfb28a081d..ed3956944a 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(10). AddIngredient(20). AddIngredient(30). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/DivineRetribution.cs b/Items/Weapons/Magic/DivineRetribution.cs index 91f0211d95..c45ed84228 100644 --- a/Items/Weapons/Magic/DivineRetribution.cs +++ b/Items/Weapons/Magic/DivineRetribution.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(8). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index 971a031c93..e594491c7e 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.BubbleGun). AddIngredient(ItemID.LunarBar, 5). AddIngredient(ItemID.ShimmerBlock, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/Genesis.cs b/Items/Weapons/Magic/Genesis.cs index 20af5325b0..85f3e019ea 100644 --- a/Items/Weapons/Magic/Genesis.cs +++ b/Items/Weapons/Magic/Genesis.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.LaserRifle). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/MagneticMeltdown.cs b/Items/Weapons/Magic/MagneticMeltdown.cs index 0e5266cef6..c3a329728b 100644 --- a/Items/Weapons/Magic/MagneticMeltdown.cs +++ b/Items/Weapons/Magic/MagneticMeltdown.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(ItemID.MagnetSphere). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/Mistlestorm.cs b/Items/Weapons/Magic/Mistlestorm.cs index 17811fcf7d..426c3841ea 100644 --- a/Items/Weapons/Magic/Mistlestorm.cs +++ b/Items/Weapons/Magic/Mistlestorm.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.LeafBlower). AddIngredient(5). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/NanoPurge.cs b/Items/Weapons/Magic/NanoPurge.cs index c5cd65b095..d78bf8a75f 100644 --- a/Items/Weapons/Magic/NanoPurge.cs +++ b/Items/Weapons/Magic/NanoPurge.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.LaserMachinegun). AddIngredient(7). AddIngredient(ItemID.Nanites, 100). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/NebulousCataclysm.cs b/Items/Weapons/Magic/NebulousCataclysm.cs index ad891db07e..9ba21a61be 100644 --- a/Items/Weapons/Magic/NebulousCataclysm.cs +++ b/Items/Weapons/Magic/NebulousCataclysm.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -52,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.NebulaBlaze). AddIngredient(8). AddIngredient(20). - AddTile(TileID.LunarCraftingStation). + AddTile(). Register(); } } diff --git a/Items/Weapons/Magic/Nucleosynthesis.cs b/Items/Weapons/Magic/Nucleosynthesis.cs index f00df0ee15..76e953984c 100644 --- a/Items/Weapons/Magic/Nucleosynthesis.cs +++ b/Items/Weapons/Magic/Nucleosynthesis.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentNebula, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/PhantasmalFury.cs b/Items/Weapons/Magic/PhantasmalFury.cs index 067916b491..c28e307911 100644 --- a/Items/Weapons/Magic/PhantasmalFury.cs +++ b/Items/Weapons/Magic/PhantasmalFury.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.SpectreStaff). AddIngredient(2). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 74e0e20fe0..e5262ae1e6 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -20,6 +20,9 @@ namespace CalamityMod.Items.Weapons.Magic { public new string LocalizationCategory => "Items.Weapons.Magic"; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/AnomalysNanogunMPFBShot"); + public static readonly SoundStyle VacuumStart = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumStart"); + public static readonly SoundStyle VacuumLoop = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumLoop"); + public static readonly SoundStyle VacuumEnd = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumEnd"); public const int ShotsPerSoul = 50; public int storedSoulpower = 0; @@ -157,8 +160,9 @@ namespace CalamityMod.Items.Weapons.Magic public override bool CanUseItem(Player player) { Item.channel = Item.noUseGraphic = player.altFunctionUse == 2; - return (player.altFunctionUse == 0 && (storedSoulpower > 0 || (FindSoulForAmmo(player) != -1))) || - (player.altFunctionUse == 2 && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0); + Item.UseSound = player.altFunctionUse == 2 ? null : FireSound; + return ((player.altFunctionUse == 0 && (storedSoulpower > 0 || (FindSoulForAmmo(player) != -1))) || player.altFunctionUse == 2) && + player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; } public override bool? UseItem(Player player) @@ -206,7 +210,6 @@ namespace CalamityMod.Items.Weapons.Magic { if (player.altFunctionUse == 2) { - SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, player.Center); Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), 0, 0f, player.whoAmI); return false; } diff --git a/Items/Weapons/Magic/SanguineFlare.cs b/Items/Weapons/Magic/SanguineFlare.cs index bc7827c338..a2e52d3dac 100644 --- a/Items/Weapons/Magic/SanguineFlare.cs +++ b/Items/Weapons/Magic/SanguineFlare.cs @@ -21,12 +21,13 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 56; Item.height = 60; - Item.damage = 143; + Item.damage = 1000; Item.DamageType = DamageClass.Magic; Item.mana = 22; Item.useTime = 25; Item.useAnimation = 25; Item.useStyle = ItemUseStyleID.Shoot; + Item.channel = true; Item.noMelee = true; Item.knockBack = 8f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; @@ -39,11 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i < 7; i++) - { - Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(5f)) * Main.rand.NextFloat(0.8f, 1.2f); - Projectile.NewProjectile(source, position, spreadVelocity, type, damage, knockback, Main.myPlayer); - } + velocity *= 0; return true; // Fires one directly with no randomness, totaling 8 projectiles } @@ -51,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index c5073452b4..4fb9bc890a 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.ShadowbeamStaff). AddIngredient(2). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/TacticiansTrumpCard.cs b/Items/Weapons/Magic/TacticiansTrumpCard.cs index 4e26e129e7..f6e98b2b9f 100644 --- a/Items/Weapons/Magic/TacticiansTrumpCard.cs +++ b/Items/Weapons/Magic/TacticiansTrumpCard.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(5). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); CreateRecipe(). AddIngredient(ItemID.TinShortsword). @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(5). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/Teslastaff.cs b/Items/Weapons/Magic/Teslastaff.cs index ac23efa9d6..ac1a2b30c9 100644 --- a/Items/Weapons/Magic/Teslastaff.cs +++ b/Items/Weapons/Magic/Teslastaff.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic AddRecipeGroup("AnyCopperBar", 20). AddIngredient(6). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/ThePrince.cs b/Items/Weapons/Magic/ThePrince.cs index 2cf5bc192a..7aec53e0f5 100644 --- a/Items/Weapons/Magic/ThePrince.cs +++ b/Items/Weapons/Magic/ThePrince.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(15). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index e727186d01..d948d7f944 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(10). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 1095523651..6dc127929d 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.AquaScepter). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index 407eaf612a..4ef2d9ec6c 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.InfernoFork). AddIngredient(2). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Magic/Viscera.cs b/Items/Weapons/Magic/Viscera.cs index ec75d92d53..72b80b47bd 100644 --- a/Items/Weapons/Magic/Viscera.cs +++ b/Items/Weapons/Magic/Viscera.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 39b95d5473..8a65882035 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -211,7 +211,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentSolar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/BlightedCleaver.cs b/Items/Weapons/Melee/BlightedCleaver.cs index ec16818ed4..cf51e42102 100644 --- a/Items/Weapons/Melee/BlightedCleaver.cs +++ b/Items/Weapons/Melee/BlightedCleaver.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.BrokenHeroSword). AddIngredient(ItemID.ChlorophyteBar, 15). AddIngredient(ItemID.VialofVenom, 10). - AddTile(TileID.DemonAltar). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/CrescentMoon.cs b/Items/Weapons/Melee/CrescentMoon.cs index 4452ea6789..d873cada7f 100644 --- a/Items/Weapons/Melee/CrescentMoon.cs +++ b/Items/Weapons/Melee/CrescentMoon.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(8). AddIngredient(3). AddIngredient(16). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index a71bc50700..b180aeca3d 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(4). AddIngredient(ItemID.SoulofNight, 15). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/DefiledGreatsword.cs b/Items/Weapons/Melee/DefiledGreatsword.cs index b46bdb4425..b5f9b9150a 100644 --- a/Items/Weapons/Melee/DefiledGreatsword.cs +++ b/Items/Weapons/Melee/DefiledGreatsword.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(). AddIngredient(). AddIngredient(15). - AddTile(TileID.DemonAltar). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 0706ed19c2..99c244a22e 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.Terragrim). AddIngredient(25). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index a1b1ac172f..7ba9adab64 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.VampireKnives). AddIngredient(). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index d729006844..046c14ccfa 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -297,7 +297,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index eeddb62413..93ba5d4a87 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.StarWrath). AddIngredient(10). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/GalileoGladius.cs b/Items/Weapons/Melee/GalileoGladius.cs index fa34986a90..d8f2e8341b 100644 --- a/Items/Weapons/Melee/GalileoGladius.cs +++ b/Items/Weapons/Melee/GalileoGladius.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(8). AddIngredient(5). AddIngredient(15). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index 05109ea63c..5be0d1d2a9 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } public override void OnSpawn(IEntitySource source) diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index f0b0564e82..a23c35ba04 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/LifehuntScythe.cs b/Items/Weapons/Melee/LifehuntScythe.cs index 54c3aaf1e1..488dc49969 100644 --- a/Items/Weapons/Melee/LifehuntScythe.cs +++ b/Items/Weapons/Melee/LifehuntScythe.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(15). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/Mourningstar.cs b/Items/Weapons/Melee/Mourningstar.cs index c04ecb3315..672286eabd 100644 --- a/Items/Weapons/Melee/Mourningstar.cs +++ b/Items/Weapons/Melee/Mourningstar.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(6). AddIngredient(6). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/NeptunesBounty.cs b/Items/Weapons/Melee/NeptunesBounty.cs index 91c8905696..7b14d34968 100644 --- a/Items/Weapons/Melee/NeptunesBounty.cs +++ b/Items/Weapons/Melee/NeptunesBounty.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(). AddIngredient(6). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/RemsRevenge.cs b/Items/Weapons/Melee/RemsRevenge.cs index 6b59d9ff1b..9be51a7c3a 100644 --- a/Items/Weapons/Melee/RemsRevenge.cs +++ b/Items/Weapons/Melee/RemsRevenge.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.BlueMoon). AddIngredient(ItemID.LunarBar, 5). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/SeekingScorcher.cs b/Items/Weapons/Melee/SeekingScorcher.cs index f7fb0a7c67..b84e6481c7 100644 --- a/Items/Weapons/Melee/SeekingScorcher.cs +++ b/Items/Weapons/Melee/SeekingScorcher.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.PossessedHatchet). AddIngredient(5). AddIngredient(8). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/StarburstShiv.cs b/Items/Weapons/Melee/StarburstShiv.cs index 5fdd6a0f4f..88897649f7 100644 --- a/Items/Weapons/Melee/StarburstShiv.cs +++ b/Items/Weapons/Melee/StarburstShiv.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentSolar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/TaintedBlade.cs b/Items/Weapons/Melee/TaintedBlade.cs index eb0e887f73..82b65ddff0 100644 --- a/Items/Weapons/Melee/TaintedBlade.cs +++ b/Items/Weapons/Melee/TaintedBlade.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(10). AddRecipeGroup("Boss2Material", 8). AddIngredient(ItemID.Deathweed, 2). - AddTile(TileID.DemonAltar). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 519bed62e3..b8b499265d 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.TerraBlade). AddIngredient(7). AddIngredient(9). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/TheLastMourning.cs b/Items/Weapons/Melee/TheLastMourning.cs index ebe94fe490..8f59702b28 100644 --- a/Items/Weapons/Melee/TheLastMourning.cs +++ b/Items/Weapons/Melee/TheLastMourning.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.SoulofNight, 30). AddIngredient(5). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index 0c217455a0..1953ce9c2f 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -1,8 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -10,73 +13,78 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class TheMutilator : ModItem, ILocalizedModType + public class TheMutilator : BaseSwordHoldoutItem, ILocalizedModType { + public static int MaximumCharge = 10; + public int Charge = 0; + + public int DecayTimer = 0; public new string LocalizationCategory => "Items.Weapons.Melee"; + public override int ProjectileType => ModContent.ProjectileType(); public override void SetDefaults() { Item.width = 90; Item.height = 90; - Item.damage = 483; + Item.damage = 1111; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 18; + Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 18; - Item.useTurn = true; + Item.useTime = 30; Item.knockBack = 8f; Item.UseSound = SoundID.Item1; - Item.autoReuse = true; Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); + base.SetDefaults(); } - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - if (target.life <= (target.lifeMax * 0.2f)) + public override void ModifyWeaponDamage(Player player, ref StatModifier damage) + { + damage *= 1 + Charge / 7f; + } + public override void UpdateInventory(Player player) + { + if (DecayTimer > 0) DecayTimer--; + else { - if (!CalamityPlayer.areThereAnyDamnBosses || Main.rand.NextBool()) + if (Charge > 0) { - int heartDrop = CalamityPlayer.areThereAnyDamnBosses ? 1 : Main.rand.Next(1, 3); - for (int i = 0; i < heartDrop; i++) - { - Item.NewItem(player.GetSource_OnHit(target), (int)target.position.X, (int)target.position.Y, target.width, target.height, 58, 1, false, 0, false, false); - } - } - SoundEngine.PlaySound(SoundID.Item14, target.Center); - target.position.X += target.width / 2; - target.position.Y += target.height / 2; - target.position.X -= target.width / 2; - target.position.Y -= target.height / 2; - for (int i = 0; i < 30; i++) - { - int bloodDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.Blood, 0f, 0f, 100, default, 2f); - Main.dust[bloodDust].velocity *= 3f; - if (Main.rand.NextBool()) - { - Main.dust[bloodDust].scale = 0.5f; - Main.dust[bloodDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; - } - } - for (int j = 0; j < 50; j++) - { - int bloodDust2 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.Blood, 0f, 0f, 100, default, 3f); - Main.dust[bloodDust2].noGravity = true; - Main.dust[bloodDust2].velocity *= 5f; - bloodDust2 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.Blood, 0f, 0f, 100, default, 2f); - Main.dust[bloodDust2].velocity *= 2f; + Charge--; + DecayTimer = 60; } } } + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + float fill = Charge / (float)MaximumCharge; + if (fill <= 0) + return; + + float barScale = 3f; + + var barBG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; + var barFG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; + + Vector2 barOrigin = barBG.Size() * 0.5f; + float yOffset = 44f; + Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); + Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); + Color colorBG = Color.Crimson; + Color colorFG = Color.Lerp(Color.OrangeRed, Color.DarkOrange, fill); + + spriteBatch.Draw(barBG, drawPos, null, colorBG, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, colorFG, 0f, barOrigin, scale * barScale, 0f, 0f); + } + + public override void AddRecipes() { CreateRecipe(). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Melee/TrueCausticEdge.cs b/Items/Weapons/Melee/TrueCausticEdge.cs index ccfead5620..8a73810a4e 100644 --- a/Items/Weapons/Melee/TrueCausticEdge.cs +++ b/Items/Weapons/Melee/TrueCausticEdge.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(). AddRecipeGroup("CursedFlameIchor", 8). AddIngredient(ItemID.SpiderFang, 8). - AddTile(TileID.DemonAltar). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Weapons/Melee/VanishingPoint.cs b/Items/Weapons/Melee/VanishingPoint.cs index 5aee60aefa..3ff7b24a5e 100644 --- a/Items/Weapons/Melee/VanishingPoint.cs +++ b/Items/Weapons/Melee/VanishingPoint.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentSolar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/AcesHigh.cs b/Items/Weapons/Ranged/AcesHigh.cs index f6152e10a7..02b9c4d72b 100644 --- a/Items/Weapons/Ranged/AcesHigh.cs +++ b/Items/Weapons/Ranged/AcesHigh.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Typeless; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index 4057a09072..3f2a2b21ce 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.SunplateBlock, 75). AddIngredient(15). AddIngredient(7). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 9a37c667b7..643bf310ea 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -1,6 +1,8 @@ using System; +using CalamityMod.Items.Ammo; using CalamityMod.Items.Materials; using CalamityMod.Projectiles; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -13,14 +15,16 @@ namespace CalamityMod.Items.Weapons.Ranged public class ArterialAssault : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + int shotNum = 0; public override void SetDefaults() { Item.width = 44; Item.height = 100; - Item.damage = 110; + Item.damage = 500; Item.DamageType = DamageClass.Ranged; - Item.useTime = 3; - Item.useAnimation = 15; + Item.useTime = 6; + Item.useAnimation = 40; Item.reuseDelay = 10; Item.useLimitPerAnimation = 5; Item.useStyle = ItemUseStyleID.Shoot; @@ -34,52 +38,20 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 30f; Item.useAmmo = AmmoID.Arrow; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float arrowSpeed = Item.shootSpeed; - Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (player.gravDir == -1f) - { - mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y; - } - float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f)) - { - mouseXDist = (float)player.direction; - mouseYDist = 0f; - mouseDistance = arrowSpeed; - } - else - { - mouseDistance = arrowSpeed / mouseDistance; - } - - realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (-(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f; - realPlayerPos.Y -= 100f; - mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (mouseYDist < 0f) - { - mouseYDist *= -1f; - } - if (mouseYDist < 20f) - { - mouseYDist = 20f; - } - mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - mouseDistance = arrowSpeed / mouseDistance; - mouseXDist *= mouseDistance; - mouseYDist *= mouseDistance; - Vector2 arrowVel = new Vector2(mouseXDist, mouseYDist); - - Projectile shotArrow = Projectile.NewProjectileDirect(source, realPlayerPos, arrowVel, type, damage, knockback, player.whoAmI); + float rotateBy = 0.75f * ((shotNum*3) % 5 - 2); + position += velocity.SafeNormalize(Vector2.Zero).RotatedBy(rotateBy) * 64; + velocity = position.DirectionTo(Main.MouseWorld) * velocity.Length()*2; + type = ModContent.ProjectileType(); + Projectile shotArrow = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); shotArrow.noDropItem = true; shotArrow.tileCollide = false; - shotArrow.Calamity().conditionalHomingRange = 300f; + (shotArrow.ModProjectile as BloodfireArrowProj).DisableEffects = true; + shotArrow.Calamity().conditionalHomingRange = 175f; + shotArrow.Calamity().BloodstoneOrbValue = 20; + shotNum++; + if (shotNum > 4) shotNum = 0; return false; } @@ -87,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/AstrealDefeat.cs b/Items/Weapons/Ranged/AstrealDefeat.cs index 4bef0633a7..d28afd895a 100644 --- a/Items/Weapons/Ranged/AstrealDefeat.cs +++ b/Items/Weapons/Ranged/AstrealDefeat.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.ShadowFlameBow). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index 1d5ca3004e..8de3d051de 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(5). AddIngredient(5). AddIngredient(50). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/BarracudaGun.cs b/Items/Weapons/Ranged/BarracudaGun.cs index 87895c9b14..086e5fb6b6 100644 --- a/Items/Weapons/Ranged/BarracudaGun.cs +++ b/Items/Weapons/Ranged/BarracudaGun.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.PiranhaGun). AddIngredient(ItemID.LunarBar, 5). AddIngredient(ItemID.SharkFin, 2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 2a6a2f5255..3067ec1c17 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 60; Item.height = 30; - Item.damage = 115; + Item.damage = 135; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 25; @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { shotReturn = !shotReturn; - if (Main.rand.NextFloat() > 0.60f) + if (Main.rand.NextFloat() > 0.20f) player.statLife -= 1; if (player.statLife <= 0) { @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/ChromaticEruption.cs b/Items/Weapons/Ranged/ChromaticEruption.cs index dd1cab2c5d..050e7ec691 100644 --- a/Items/Weapons/Ranged/ChromaticEruption.cs +++ b/Items/Weapons/Ranged/ChromaticEruption.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentVortex, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/ClaretCannon.cs b/Items/Weapons/Ranged/ClaretCannon.cs deleted file mode 100644 index 2fa1f265cf..0000000000 --- a/Items/Weapons/Ranged/ClaretCannon.cs +++ /dev/null @@ -1,58 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class ClaretCannon : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetDefaults() - { - Item.width = 48; - Item.height = 30; - Item.damage = 148; - Item.DamageType = DamageClass.Ranged; - Item.useTime = 3; - Item.useAnimation = 9; - Item.reuseDelay = 10; - Item.useLimitPerAnimation = 3; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 5.5f; - Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); - Item.UseSound = SoundID.Item40; - Item.autoReuse = true; - Item.shootSpeed = 24f; - Item.shoot = ModContent.ProjectileType(); - Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; - } - - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(4). - AddTile(TileID.LunarCraftingStation). - Register(); - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (type == ProjectileID.Bullet) - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - else - Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - - return false; - } - } -} diff --git a/Items/Weapons/Ranged/ClockworkBow.cs b/Items/Weapons/Ranged/ClockworkBow.cs index d2de85e06e..78a96f7bd5 100644 --- a/Items/Weapons/Ranged/ClockworkBow.cs +++ b/Items/Weapons/Ranged/ClockworkBow.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(ItemID.Cog, 50). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/CorinthPrime.cs b/Items/Weapons/Ranged/CorinthPrime.cs index 2bcfaa60db..77b516c7f8 100644 --- a/Items/Weapons/Ranged/CorinthPrime.cs +++ b/Items/Weapons/Ranged/CorinthPrime.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.VortexBeater). AddIngredient(ItemID.IllegalGunParts). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index f36fde133d..5e7c814098 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(ItemID.LunarBar, 15). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/FreedomStar.cs b/Items/Weapons/Ranged/FreedomStar.cs index cf45be4de1..2f24196d9f 100644 --- a/Items/Weapons/Ranged/FreedomStar.cs +++ b/Items/Weapons/Ranged/FreedomStar.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(18). AddIngredient(8). AddIngredient(ItemID.LunarBar, 4). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 4068714c06..5ba8938841 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(6). AddIngredient(4). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index aec808cfbe..9e0189cacd 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddRecipeGroup("IronBar", 50). AddIngredient(5). AddIngredient(ItemID.TigerSkin). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 0efe846d37..803457a30d 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(6). AddIngredient(10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/NettlevineGreatbow.cs b/Items/Weapons/Ranged/NettlevineGreatbow.cs index db0811ac93..683f4a03bd 100644 --- a/Items/Weapons/Ranged/NettlevineGreatbow.cs +++ b/Items/Weapons/Ranged/NettlevineGreatbow.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Weapons.Ranged { CreateRecipe(). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 935f42b12a..5e8eb56f16 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(2). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index 659e5b422e..e0ec40a167 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.OnyxBlaster). AddIngredient(ItemID.ChainGun). AddIngredient(ItemID.LunarBar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index d5b25e3154..60f8d757f1 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(5). AddIngredient(2). AddIngredient(ItemID.WhitePearl). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs index 6838dd2b28..380832d89e 100644 --- a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs +++ b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentVortex, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs index fd0a634b5e..baefda8bf8 100644 --- a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.Uzi). AddIngredient(ItemID.LunarBar, 5). AddIngredient(ItemID.FragmentVortex, 10). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 6e4b33c8a2..39ca453361 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(9). AddIngredient(10). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 25edac78bc..a31575ec1d 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(). AddIngredient(ItemID.LunarBar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/Spyker.cs b/Items/Weapons/Ranged/Spyker.cs index 52c0aa0e0a..739a788ce0 100644 --- a/Items/Weapons/Ranged/Spyker.cs +++ b/Items/Weapons/Ranged/Spyker.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(ItemID.Stynger). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/Starfleet.cs b/Items/Weapons/Ranged/Starfleet.cs index d3797af0c3..1c00b9b89b 100644 --- a/Items/Weapons/Ranged/Starfleet.cs +++ b/Items/Weapons/Ranged/Starfleet.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(6). AddIngredient(4). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index 9f5f5c080d..45a7d7984d 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentVortex, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/TauCannon.cs b/Items/Weapons/Ranged/TauCannon.cs index 189682bcad..e1cbe89f59 100644 --- a/Items/Weapons/Ranged/TauCannon.cs +++ b/Items/Weapons/Ranged/TauCannon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(15). AddIngredient(10). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/TheMaelstrom.cs b/Items/Weapons/Ranged/TheMaelstrom.cs index 81342eb7a0..5a2e736fee 100644 --- a/Items/Weapons/Ranged/TheMaelstrom.cs +++ b/Items/Weapons/Ranged/TheMaelstrom.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(3). AddIngredient(20). AddIngredient(50). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Ranged/TheSevensStriker.cs b/Items/Weapons/Ranged/TheSevensStriker.cs index 347ed65b3a..398c0e4c66 100644 --- a/Items/Weapons/Ranged/TheSevensStriker.cs +++ b/Items/Weapons/Ranged/TheSevensStriker.cs @@ -174,7 +174,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.GoldCoin, 77). AddIngredient(ItemID.LunarBar, 12). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/BloodsoakedCrasher.cs b/Items/Weapons/Rogue/BloodsoakedCrasher.cs index f2387e8a45..6c1da5bf6e 100644 --- a/Items/Weapons/Rogue/BloodsoakedCrasher.cs +++ b/Items/Weapons/Rogue/BloodsoakedCrasher.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/JawsOfOblivion.cs b/Items/Weapons/Rogue/JawsOfOblivion.cs index 82b1ec85be..b910cf3358 100644 --- a/Items/Weapons/Rogue/JawsOfOblivion.cs +++ b/Items/Weapons/Rogue/JawsOfOblivion.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(6). AddIngredient(15). AddIngredient(2). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index 04afde8631..a986396917 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(7). AddIngredient(4). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index c6d2aec7aa..51b0207b43 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(). AddIngredient(25). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/RealityRupture.cs b/Items/Weapons/Rogue/RealityRupture.cs index f88d479661..715d4575c6 100644 --- a/Items/Weapons/Rogue/RealityRupture.cs +++ b/Items/Weapons/Rogue/RealityRupture.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/ReboundingRainbow.cs b/Items/Weapons/Rogue/ReboundingRainbow.cs index a874f6347d..e006335ca7 100644 --- a/Items/Weapons/Rogue/ReboundingRainbow.cs +++ b/Items/Weapons/Rogue/ReboundingRainbow.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 0c81d9d686..1aa1b4dd1f 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/ShatteredDawn.cs b/Items/Weapons/Rogue/ShatteredDawn.cs index ddd03e1541..0602d4e927 100644 --- a/Items/Weapons/Rogue/ShatteredDawn.cs +++ b/Items/Weapons/Rogue/ShatteredDawn.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(). AddIngredient(6). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/TarragonThrowingDart.cs b/Items/Weapons/Rogue/TarragonThrowingDart.cs index cc2beb46e3..d76c7cc2d6 100644 --- a/Items/Weapons/Rogue/TarragonThrowingDart.cs +++ b/Items/Weapons/Rogue/TarragonThrowingDart.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue { CreateRecipe(). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/TimeBolt.cs b/Items/Weapons/Rogue/TimeBolt.cs index 6d48b1f18c..f5605f6e5f 100644 --- a/Items/Weapons/Rogue/TimeBolt.cs +++ b/Items/Weapons/Rogue/TimeBolt.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(ItemID.FastClock). AddIngredient(5). AddIngredient(20). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Rogue/TwistingThunder.cs b/Items/Weapons/Rogue/TwistingThunder.cs index 55cfb38d91..1ff0517975 100644 --- a/Items/Weapons/Rogue/TwistingThunder.cs +++ b/Items/Weapons/Rogue/TwistingThunder.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(). AddIngredient(15). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/AquasScepter.cs b/Items/Weapons/Summon/AquasScepter.cs index f97b61c3c5..8ac9423c62 100644 --- a/Items/Weapons/Summon/AquasScepter.cs +++ b/Items/Weapons/Summon/AquasScepter.cs @@ -50,12 +50,12 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { - Recipe recipe = Recipe.Create(ModContent.ItemType()); - recipe.AddIngredient(ItemID.NimbusRod); - recipe.AddIngredient(ItemID.AquaScepter); - recipe.AddIngredient(3); - recipe.AddTile(TileID.LunarCraftingStation); //LunarCraftingStation = Ancient Manipulator - recipe.Register(); + CreateRecipe(). + AddIngredient(ItemID.NimbusRod). + AddIngredient(ItemID.AquaScepter). + AddIngredient(3). + AddTile(TileID.MythrilAnvil). + Register(); } } } diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index 2adca37808..c27c8fb840 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index 2778b1c5a0..ee43914ad1 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentStardust, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/KingofConstellationsTenryu.cs b/Items/Weapons/Summon/KingofConstellationsTenryu.cs index c8e3d512af..f8c677a7a7 100644 --- a/Items/Weapons/Summon/KingofConstellationsTenryu.cs +++ b/Items/Weapons/Summon/KingofConstellationsTenryu.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(ItemID.DarkShard). AddIngredient(ItemID.LightShard). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.Bookcases). Register(); } } diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index 227aa6aed1..4e49f639e6 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). AddIngredient(ItemID.FragmentStardust, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index deee425550..4c39a7837c 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(5). AddIngredient(2). AddIngredient(12). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 2540e43a21..23e2df9b9d 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(ItemID.XenoStaff). AddIngredient(ItemID.FragmentStardust, 6). AddIngredient(3). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index f29284f1c7..2a672d25f5 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(). AddIngredient(). AddIngredient(ItemID.LunarBar, 5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index 0da9bba37e..affd241fee 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Weapons.Summon { CreateRecipe(). AddIngredient(15). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index b346171917..edc2b0338b 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(10). AddIngredient(5). AddIngredient(5). - AddTile(TileID.LunarCraftingStation). + AddTile(TileID.MythrilAnvil). Register(); } } diff --git a/Items/Weapons/Typeless/ClaretCannon.cs b/Items/Weapons/Typeless/ClaretCannon.cs new file mode 100644 index 0000000000..01a5c409e2 --- /dev/null +++ b/Items/Weapons/Typeless/ClaretCannon.cs @@ -0,0 +1,109 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Rarities; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Items.Weapons.Typeless +{ + public class ClaretCannon : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.Typeless"; + + public int ClaretCooldown = 0; + + public static int ClaretCooldownMax = 300; + + public float baseUseDir = 0; + public override void SetDefaults() + { + Item.width = 48; + Item.height = 30; + Item.damage = 500; + Item.DamageType = AverageDamageClass.Instance; + Item.useTime = 10; + Item.useAnimation = 10; + Item.useLimitPerAnimation = 1; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.knockBack = 5.5f; + Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + Item.rare = ModContent.RarityType(); + Item.UseSound = SoundID.Item40; + Item.autoReuse = true; + Item.shootSpeed = 12f; + Item.shoot = ModContent.ProjectileType(); + } + + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + + public override void UpdateInventory(Player player) + { + ClaretCooldown--; + if (ClaretCooldown < 0) + ClaretCooldown = 0; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.MythrilAnvil). + Register(); + } + + public override bool CanUseItem(Player player) + { + if (ClaretCooldown > 0) + return false; + return true; + } + + public override void UseAnimation(Player player) + { + } + + public override void UseItemFrame(Player player) + { + float comp = 1 - player.itemTime / (float)player.itemTimeMax; + float lerpValue1 = MathHelper.Lerp(0, 90, MathF.Pow(comp, 0.3f)); + float lerpValue2 = MathHelper.Lerp(90, 0, MathF.Pow(comp, 2)); + player.itemRotation = baseUseDir - MathHelper.ToRadians(Math.Min(lerpValue1, lerpValue2)) * player.direction; + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + baseUseDir = player.itemRotation; + ClaretCooldown = ClaretCooldownMax; + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + return false; + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + float fill = ClaretCooldown / (float)ClaretCooldownMax; + if (fill <= 0) + return; + + float barScale = 1.5f; + + var barBG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; + var barFG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; + + Vector2 barOrigin = barBG.Size() * 0.5f; + float yOffset = 5f; + Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); + Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); + Color colorBG = Color.Crimson; + Color colorFG = Color.Lerp(Color.OrangeRed, Color.DarkOrange, fill); + + spriteBatch.Draw(barBG, drawPos, null, colorBG, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, colorFG, 0f, barOrigin, scale * barScale, 0f, 0f); + } + + } +} diff --git a/Items/Weapons/Ranged/ClaretCannon.png b/Items/Weapons/Typeless/ClaretCannon.png similarity index 100% rename from Items/Weapons/Ranged/ClaretCannon.png rename to Items/Weapons/Typeless/ClaretCannon.png diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index 18f2769d31..83678e425a 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -142,6 +142,7 @@ Searslug: A distant cousin of the Slugbuns which can withstand the extreme heat Sharkoon: The bulbous Sharkoon wanders the reefs on the outskirts of the Sunken Sea. It retaliates against threats through the unusual method of exploding a sac on its body that stores highly reactive chemicals, fleeing in the confusion caused by its shockwave. Slugbun: The name of these cute sea dwellers is actually a misnomer given to them by outside visitors of the sea kingdom, who often sold them as exotic pets. In fact, their "bunny ear" appendages are actually their antennae taking on the appearance of the various sea prisms scattered throughout their home. Stormlion: Some Ilmerian survivors claim that enough magical lightning surged through the sea during its final days that there existed not a single drop of water without levin coursing through it. Even now, electricity remains buried in the sands, with several antlion species having learned to channel the former kingdom's power. +StormlionSentry: Some Ilmeran survivors claim that enough magical lightning surged through the sea during its final days that there existed not a single drop of water without levin coursing through it. Even now, electricity remains buried in the sands, with several antlion species having learned to channel the former kingdom's power. //Town NPCs AndroombaFriendly: Reverse-engineered Androombas that have been retrofitted to spread the Steampunker's solutions rather than clean dust and debris off of floors. They can be used to purify the world– or ruin it further, if one so desires. Archmage: One of the world's foremost experts on magical theory, he is renowned for his skill with the arcane arts. In his days when he traveled with Yharim's entourage, he acted as the Godseeker's advisor, due to both his status and his distaste for actively participating in battle. diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index 1e0a46ab2a..c086e50426 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -50,7 +50,7 @@ CalamityClientConfig: { Label: "[i:CalamityMod/DesertProwlerHat] Calamity Armor Set Bonuses Can Use Vanilla Hotkey" Tooltip: ''' - When enabled, allows Calamity armor set bonuses to be triggered by the vanilla double-tap DOWN hotkey (or UP depending on your settings). + Allows Calamity armor set bonuses to be triggered by the vanilla double-tap DOWN hotkey (or UP depending on your settings). Also allows vanilla armor set bonuses to be triggered by Calamity's armor set bonus hotkey. ''' } @@ -101,6 +101,15 @@ CalamityClientConfig: { Tooltip: Plays Calamity Mod OST - "Scourge of the Universe (Eulogy for the Ego)", after the Devourer of Gods has been defeated. } + DisableGravityScreenSwap: { + Label: Disable Gravity Screen Flip + Tooltip: + ''' + Disables vanilla's screen-flipping from changing gravity, flipping the player instead. + Enable this if the screen-flipping is distracting or induces motion sickness. + ''' + } + EnableVanillaTextureEdits: { Label: "[i:Paintbrush] Enable Vanilla Texture Edits" Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index fe1083024a..97c8a4c75a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -4,7 +4,7 @@ Abaddon: { ''' 8% increased critical strike chance Critical strikes explode, causing nearby enemies to ignite with Brimstone Flames - Greatly reduces the damage taken by the Brimstone Flames debuff + Reduces the damage of the Brimstone Flames debuff by 50% ''' } @@ -73,7 +73,7 @@ AlchemicalFlask: { DisplayName: Alchemical Flask Tooltip: ''' - All attacks inflict the Plague and reduces damage taken from the Plague + All attacks inflict the Plague and reduces damage taken from the Plague by 50% Projectiles spawn plague seekers on enemy hits Releases plague bees when damaged and douses you in honey ''' @@ -1068,13 +1068,19 @@ LivingDew: { ''' } -LumenousAmulet: { - DisplayName: Lumenous Amulet +DiamondOfTheDeep: { + DisplayName: Diamond of the Deep Tooltip: ''' - Attacks inflict Crush Depth, and grants immunity to Crush Depth and Riptide - While in the abyss you gain 25% increased max life - {$Common.AbyssLightLevel2} + Multiplies all water debuff damage by 1.75x + Slowly accrue up to three different abyssal spirits + Dash to disperse the spirits and have them attack enemies + When dispersed [c/CB7AD7:below 50% life], the spirits support you instead + The spirits appear in order and have different effects based on color: + [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] + [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 15 temporarily] + [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] + Spirits are transparent and silent when visibility is toggled off ''' } @@ -2015,7 +2021,7 @@ VoidofExtinction: { ''' 13% increased critical strike chance Critical strikes explode, igniting enemies with Brimstone Flames - Partially resist the Brimstone Flames debuff + Reduces the damage of the Brimstone Flames debuff by 50% ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index e3103c79a5..927906d00d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -749,7 +749,12 @@ SandstreamScepter: { SanguineFlare: { DisplayName: Sanguine Flare - Tooltip: Fires a blast of sanguine flares that drain enemy life + Tooltip: + ''' + Charges up a sanguine flare that gains power over time + When striking an enemy, this flare causes a bloodsplosion and splits into blood orbs + Picking up these blood orbs reduces the duration of [Potion Sickness] + ''' } SeethingDischarge: { @@ -994,7 +999,9 @@ Viscera: { DisplayName: Viscera Tooltip: ''' - Fires a rapid barrage of piercing blood beams that heal you on enemy hit + Fires a rapid barrage of piercing blood beams + The first enemy struck by each beam will burst into blood orbs + Picking up these blood orbs reduces the duration of [Potion Sickness] Each successive beam in the barrage deals more damage The last beam of the barrage instead explodes upon hitting an enemy ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index fbba76be1c..4e7f11d90c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1359,8 +1359,9 @@ TheMutilator: { DisplayName: The Mutilator Tooltip: ''' - Striking an enemy below 20% life will trigger a bloodsplosion - Bloodsplosions cause hearts to drop that can be picked up to heal you + Striking enemies empowers The Mutilator, increasing its damage + At full charge, striking enemies causes a blood orb explosion + Picking up these blood orbs reduces the duration of [Potion Sickness] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index d4036cd346..b758d92ecd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -113,8 +113,9 @@ ArterialAssault: { DisplayName: Arterial Assault Tooltip: ''' - Fires a chain of 5 arrows from the sky - All arrows will rapidly home in on nearby enemies + Fires a group of 5 homing blood arrows + These blood arrows burst into blood orbs upon striking an enemy + Picking up these blood orbs reduces the duration of [Potion Sickness] ''' } @@ -201,9 +202,10 @@ BloodBoiler: { DisplayName: Blood Boiler Tooltip: ''' - Fires twin streams of life stealing bloodfire that returns to you + Fires twin streams of bloodfire that returns to you + Retuning bloodfire reduces [Potion Sickness] if it struck an enemy Uses your health as ammo - 40% chance to save health + 20% chance to save health ''' } @@ -271,15 +273,6 @@ ClamorRifle: { Tooltip: Converts musket balls into homing energy bolts } -ClaretCannon: { - DisplayName: Claret Cannon - Tooltip: - ''' - Fires strings of 3 bullets - Converts musket balls into bloody tears that drain enemy health - ''' -} - CleansingBlaze: { DisplayName: Cleansing Blaze Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 2d5549e4c7..cc686427ce 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -85,8 +85,9 @@ BloodsoakedCrasher: { ''' Throws a bloody axe that is affected by gravity and can bounce twice The axe speeds up over time, but will slow down upon hitting an enemy - Heals on enemy hits - Stealth strikes spawn homing blood on enemy hits + Spews blood orbs upon enemy hits + Picking up these blood orbs reduces the duration of [Potion Sickness] + Stealth strikes spawn homing blood bolts on hit ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index dff9c92674..a3751a23b3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -292,7 +292,8 @@ DragonbloodDisgorger: { Tooltip: ''' Summons a skeletal dragon and her two children - Baby spits passively heal the player + Baby spits burst into blood orbs upon hitting an enemy + Picking up these blood orbs reduces the duration of [Potion Sickness] Requires 6 minion slots to be summoned There can only be one family at a time ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index cad73bc9d5..0de017e498 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -7,6 +7,19 @@ Aestheticus: { ''' } +ClaretCannon: { + DisplayName: Claret Cannon + Tooltip: + ''' + Fires a hypercondensed claret round + The round explodes upon striking an enemy and releases blood orbs + The explosion shreds enemies, inflicting [Laceration] and dramatically reducing their defense + Picking up the blood orbs will reduce [Potion Sickness] when possible + If you do not have [Potion Sickness], your natural regeneration will be enhanced + Can only fire once every 5 seconds + ''' +} + EyeofMagnus: { DisplayName: Eye of Magnus Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index 8f12f250f0..93d081e17b 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -13,3 +13,4 @@ NormalityRelocator.DisplayName: Normality Relocator RageMode.DisplayName: Rage Mode SpectralVeilTeleport.DisplayName: Spectral Veil Teleport TransformerHotKey.DisplayName: Transformer Hot Key +GravitySwapOverride.DisplayName: Gravity Swap Override diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 3724bf122c..f376f08317 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -196,6 +196,7 @@ SkeletronPrime2.DisplayName: Skeletron Alpha AlphaVice.DisplayName: Alpha Vice AlphaCannon.DisplayName: Alpha Cannon Stormlion.DisplayName: Stormlion +StormlionSentry.DisplayName: Stormlion Sentry Sunskater.DisplayName: Sunskater SuperDummyNPC.DisplayName: Super Dummy WildBumblefuck.DisplayName: Draconic Swarmer diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Enemy.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Enemy.hjson index 419816de53..1dc8f2232b 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Enemy.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Enemy.hjson @@ -40,6 +40,7 @@ PodobooSpitUltima.DisplayName: Ultima Podoboo Spit PrismBackCrystal.DisplayName: Prism-Back Shard PufferExplosion.DisplayName: Explosion SharkoonExplosion.DisplayName: Sharkoon Explosion +StormlionSentryBullet.DisplayName: Stormlion Sentry Bullet StormMarkHostile.DisplayName: Mark SulphuricAcidBubble.DisplayName: Acid Bubble SulphuricAcidMist.DisplayName: Acid Mist diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson index 6f207a3da2..211c3eb65d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson @@ -19,3 +19,4 @@ RoyalHeal.DisplayName: Heal ShinobiHealOrb.DisplayName: Blue Healing Orb SilvaOrb.DisplayName: Silva Orb TransfusionTrail.DisplayName: Heal +BloodstoneHealOrb.DisplayName: Bloodstone Heal Orb diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 72ae489a01..692b19f7df 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -306,3 +306,4 @@ WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard +MutilatorSwordProj.DisplayName: The Mutilator diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 07a9b5dd8a..97efe5b804 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -46,7 +46,6 @@ ChromaticFlare.DisplayName: Chromatic Flare CinderArrowProj.DisplayName: Cinder Arrow ClamorRifleProj.DisplayName: Clamor Bolt ClamorRifleProjSplit.DisplayName: Clamor Bolt -ClaretCannonProj.DisplayName: Claret Cannon CondemnationArrow.DisplayName: Condemning Arrow CondemnationArrowHoming.DisplayName: Condemning Echo ContagionArrow.DisplayName: Contagion Arrow diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 6277888d79..06fbcda6ad 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -32,6 +32,7 @@ BossRushTierAnimation.DisplayName: Boss Rush Tier Animation ChaoticGeyser.DisplayName: Chaotic Geyser ChlorophyteLifePulse.DisplayName: Life Pulse ChronoClock.DisplayName: Chrono Clock +ClaretCannonProj.DisplayName: Claret Round CoralBubble.DisplayName: Bubble CoralBubbleSmall.DisplayName: Bubble CosmicDashExplosion.DisplayName: Cosmic Dash Explosion @@ -43,6 +44,7 @@ DarkIce.DisplayName: Dark Ice DeepseaBlaze.DisplayName: Deepsea Blaze DemonshadeRedDevil.DisplayName: Red Devil DevourerofCodsBobber.DisplayName: Devourer of Cods Bobber +DiamondOfTheDeepProjectile.DisplayName: Abyss Spirit DirectStrike.DisplayName: Nondescript Damaging Entity DragonDust.DisplayName: Dust EarlyBloomBobber.DisplayName: Early Bloom Bobber diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index e5915809b6..130ede50d9 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -29,7 +29,8 @@ AddedTooltip: { WarmthPotion: Greatly reduces the duration of Chilled, Frozen, and Glacial State HandWarmer: Provides a regeneration boost while wearing the Snow armor GoldenFishingRod: Its fishing line will never break - Stepstool: Standing on the stool grants 5% increased critical strike chance + // Step Stool + PortableStool: Standing on the stool grants 5% increased critical strike chance Tombstones: ''' 13 of any tombstone turns the surrounding area into a graveyard @@ -149,6 +150,8 @@ EditedTooltip: { Throws a mixture of slime and sparkling crystals Slimed enemies take more damage from fire-based debuffs ''' + // Ancient Manipulator + LunarCraftingStation: Used to craft items from Lunar Fragments, Luminite, and Astral Bars AnkhShield1: Grants immunity to knockback AnkhShield2: Grants immunity to most debuffs, including Mighty Wind Campfires: Life regen is increased by 0.5 HP/s when near a campfire @@ -278,6 +281,8 @@ EditedTooltip: { GravityGlobe: ''' Provides 32% increased jump speed and increased fall speed + Provides a gravitational boost jump, which recharges whenever gravity is flipped + Slightly improves wingless air movement speed Press UP to change gravity Press DOWN to fall faster ''' @@ -470,7 +475,4 @@ WitchDoctorChat: { Jungle: I wonder how my relatives are doing, last time I checked on them they were too busy praising the... Sun, I think. } -WizardChat: { - Hardmode: Space just got way too close for comfort. - MentionRoD: I saw some teleporting pink apparitions in the Hallow. If you let me live nearby, I should be able to channel their magic into a special staff for you. -} +WizardChat.Hardmode: Space just got way too close for comfort. diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index 3852e1e332..fb20344f3a 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -224,7 +224,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemID.JellyfishNecklace, 100); + npcLoot.Add(ItemID.JellyfishNecklace, 25); var postSkeletron = npcLoot.DefineConditionalDropSet(() => NPC.downedBoss3); postSkeletron.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 50, 40)); } diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 536cbf9a7e..ce1ea981bd 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.Abyss { npcLoot.Add(ItemID.Bomb); npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Bezoar, 100, 50)); - npcLoot.Add(ItemID.JellyfishNecklace, 100); + npcLoot.Add(ItemID.JellyfishNecklace, 25); } } } diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index db902d9ae9..a050ec9730 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 180); if (puffedUp) { diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index fcdb2bf9cd..3dde3202c5 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Darkness, 120, true); + target.AddBuff(BuffID.Darkness, 300); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 27b32a2a22..3a5ae03dcf 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -249,8 +249,8 @@ namespace CalamityMod.NPCs.Abyss { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 180, true); - target.AddBuff(BuffID.Darkness, 180, true); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.Darkness, 300); } } diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index fffdbe9751..d8366f56db 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -180,11 +180,5 @@ namespace CalamityMod.NPCs.Abyss } } } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); - } } } diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 700c7a225a..8ffd9061fa 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -180,11 +180,5 @@ namespace CalamityMod.NPCs.Abyss } } } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); - } } } diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index edd3285342..faae8d5302 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -179,11 +179,5 @@ namespace CalamityMod.NPCs.Abyss } } } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); - } } } diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index dcbd788354..69c7dc7c72 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Venom, 30, true); + target.AddBuff(BuffID.Venom, 120); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemID.Flipper, 20); + npcLoot.Add(ItemID.Flipper, 8); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index c59d64fa26..9d36a1bf4c 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index a595aa9e36..b85836d81a 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -303,6 +303,7 @@ namespace CalamityMod.NPCs.Abyss return false; return null; } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) @@ -384,6 +385,7 @@ namespace CalamityMod.NPCs.Abyss break; } } + // the crab is invincible while hiding public override bool? CanBeHitByItem(Player player, Item item) => CurrentPhase > (int)AIState.IdleAnim; @@ -462,11 +464,13 @@ namespace CalamityMod.NPCs.Abyss } } } + public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } + public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (!NPC.IsABestiaryIconDummy) diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index 55856d0640..5dfecc0272 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Astraglomerate.cs b/NPCs/Astral/Astraglomerate.cs index 0d611c3384..0be0820f7c 100644 --- a/NPCs/Astral/Astraglomerate.cs +++ b/NPCs/Astral/Astraglomerate.cs @@ -153,12 +153,6 @@ namespace CalamityMod.NPCs.Astral return 0f; } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); - } - public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 1, 3, 1, 4)); diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index faddb06bef..741efed4a0 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral public override void SetDefaults() { - NPC.damage = 0; // 0 contact damage, laser damage in handled separately + NPC.damage = 0; // 0 contact damage, laser damage is handled separately NPC.width = 30; //324 NPC.height = 30; //216 NPC.defense = 10; @@ -351,11 +351,5 @@ namespace CalamityMod.NPCs.Astral } return 0f; } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); - } } } diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 573a6b45a8..20af8be840 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index dbd069a50d..13373f41c5 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) => AstralachneaWall.ModifyAstralachneaLoot(npcLoot); diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index b4dd27e74b..9cf146f5d7 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 180); } public static void ModifyAstralachneaLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 435dcc51a2..363ff9bb8b 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -651,7 +651,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 150, true); + target.AddBuff(ModContent.BuffType(), 300); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index 818c5c67b4..f9373dd5c2 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -308,7 +308,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Glomerling.cs b/NPCs/Astral/Glomerling.cs index d4b64e4d1f..ccbe4388c2 100644 --- a/NPCs/Astral/Glomerling.cs +++ b/NPCs/Astral/Glomerling.cs @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 25, true); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 8f004e0ea7..76e15717a4 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -217,7 +217,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index de94ff79cf..07658108a6 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -245,7 +245,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 45, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index d14ec0d4dd..31482df041 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 45, true); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index 95120b8a6c..3689d48278 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 25, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 6287515398..7163f98338 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 45, true); + target.AddBuff(ModContent.BuffType(), 180, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) @@ -278,7 +278,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 45, true); + target.AddBuff(ModContent.BuffType(), 180); } private void DoKillDust() diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 1da35af01f..f8ed4ceff0 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 45, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 808571e2b7..77c122d094 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -582,7 +582,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 200, true); + target.AddBuff(ModContent.BuffType(), 360); } } } diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index cb5ac7cbd0..3daa83d2c7 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { int debuffType = Main.zenithWorld ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(debuffType, (int)(75 * NPC.scale), true); + target.AddBuff(debuffType, (int)(120 * NPC.scale)); } } } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 7579665455..ecfa2a3a11 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 100, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 794418819e..eb5c436317 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 200, true); + target.AddBuff(ModContent.BuffType(), 360); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 5c2009b644..127a782e6c 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -205,7 +205,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 75, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index e275bc5335..7a5a563e17 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 360); } public override void FindFrame(int frameHeight) // 9 total frames diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 45c24c69f1..a5b097b190 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -458,11 +458,13 @@ namespace CalamityMod.NPCs.Bumblebirb // Lore npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); } + public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), Main.zenithWorld ? 360 : 180); } + public override void OnKill() { // Don't bother running any of this in Boss Rush. diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 8807c9748c..1fa25a84ae 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -317,7 +317,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 150, true); + target.AddBuff(ModContent.BuffType(), 360); } } } diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index c5b3cbf9c1..bec5c00aa9 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -237,7 +237,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index ee72d7ea16..dcae21a2da 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 79831c548d..86c30b1902 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6242,6 +6242,10 @@ namespace CalamityMod.NPCs target.AddBuff(BuffID.BrokenArmor, 300); break; + case NPCID.PossessedArmor: + target.AddBuff(BuffID.Cursed, 60); + break; + case NPCID.Ghost: case NPCID.PirateGhost: target.AddBuff(BuffID.Cursed, 60); @@ -6293,25 +6297,25 @@ namespace CalamityMod.NPCs case NPCID.Spazmatism: if (npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) - target.AddBuff(BuffType(), 180, true); + target.AddBuff(BuffType(), 180); break; case NPCID.SkeletronPrime: if (npc.ai[1] == 1f || npc.ai[1] == 2f) - target.AddBuff(BuffType(), 180, true); + target.AddBuff(BuffType(), 180); break; case NPCID.PrimeSaw: - target.AddBuff(BuffType(), 120, true); + target.AddBuff(BuffType(), 120); break; case NPCID.Plantera: if (npc.life < npc.lifeMax / 2) - target.AddBuff(BuffID.Poisoned, 300); + target.AddBuff(BuffID.Poisoned, 360); break; case NPCID.PlanterasTentacle: - target.AddBuff(BuffID.Poisoned, 120); + target.AddBuff(BuffID.Poisoned, 180); break; case NPCID.Golem: @@ -6326,7 +6330,7 @@ namespace CalamityMod.NPCs break; case NPCID.DukeFishron: - target.AddBuff(BuffType(), 120, true); + target.AddBuff(BuffType(), 180); break; case NPCID.AncientLight: @@ -6335,7 +6339,7 @@ namespace CalamityMod.NPCs case NPCID.HallowBoss: if (NPC.ShouldEmpressBeEnraged()) - target.AddBuff(BuffType(), 240); + target.AddBuff(BuffType(), 360); break; case NPCID.BloodNautilus: @@ -6348,7 +6352,7 @@ namespace CalamityMod.NPCs break; case NPCID.Lavabat: - target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.OnFire, 300); break; case NPCID.RuneWizard: @@ -6370,7 +6374,7 @@ namespace CalamityMod.NPCs case NPCID.AngryBonesBig: case NPCID.AngryBonesBigMuscle: case NPCID.AngryBonesBigHelmet: - target.AddBuff(BuffType(), 60); + target.AddBuff(BuffType(), 120); break; default: @@ -6393,7 +6397,7 @@ namespace CalamityMod.NPCs case NPCID.HellArmoredBonesSpikeShield: case NPCID.HellArmoredBonesMace: case NPCID.HellArmoredBonesSword: - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffType(), 240); break; default: @@ -6407,7 +6411,7 @@ namespace CalamityMod.NPCs switch (npc.type) { case NPCID.Hellbat: - target.AddBuff(BuffID.OnFire, 60); + target.AddBuff(BuffID.OnFire, 120); break; default: @@ -6480,13 +6484,12 @@ namespace CalamityMod.NPCs } // True melee resists - if (DesertScourgeIDList.Includes(npc.type) || EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || - PerforatorWormIDList.Includes(npc.type) || AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || - AstrumDeusIDList.Includes(npc.type) || StormWeaverIDList.Includes(npc.type) || ThanatosIDList.Includes(npc.type) || - npc.type == NPCType() || npc.type == NPCType() || AresIDList.Includes(npc.type) || npc.type == NPCType() || - npc.type == NPCType()) + if (EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || PerforatorWormIDList.Includes(npc.type) || + AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || AstrumDeusIDList.Includes(npc.type) || + StormWeaverIDList.Includes(npc.type) || ThanatosIDList.Includes(npc.type) || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCType()) { - float damageMult = ThanatosIDList.Includes(npc.type) ? 0.35f : (DesertScourgeIDList.Includes(npc.type) || npc.type == NPCType()) ? 0.75f : 0.5f; + float damageMult = ThanatosIDList.Includes(npc.type) ? 0.35f : 0.5f; if (item.CountsAsClass() && item.type != ItemType()) modifiers.SourceDamage *= damageMult; } @@ -7038,51 +7041,34 @@ namespace CalamityMod.NPCs spawnRate = (int)(spawnRate * 0.85); if (Main.SceneMetrics.WaterCandleCount > 0) + spawnRate = (int)(spawnRate * 0.8888); // On top of 0.75 = 0.6666x (1.33x -> 1.5x spawn rate) + if (player.enemySpawns) // Battle Potion { - spawnRate = (int)(spawnRate * 0.9); - maxSpawns = (int)(maxSpawns * 1.1f); - } - if (player.enemySpawns) - { - spawnRate = (int)(spawnRate * 0.8); - maxSpawns = (int)(maxSpawns * 1.2f); + spawnRate = (int)(spawnRate * 0.8); // On top of 0.5 = 0.4x (2x -> 2.5x spawn rate) + maxSpawns = (int)(maxSpawns * 1.25f); // On top of 2 (2x -> 2.5x max spawns) } if (player.Calamity().chaosCandle) { - spawnRate = (int)(spawnRate * 0.6); + spawnRate = (int)(spawnRate * 0.4); // 2.5x spawn rate maxSpawns = (int)(maxSpawns * 2.5f); } if (player.Calamity().zerg) { - spawnRate = (int)(spawnRate * 0.2); + spawnRate = (int)(spawnRate * 0.2); // 5x spawn rate maxSpawns = (int)(maxSpawns * 5f); } - // This is horribly unoptimized, I'm leaving it commented out. - Fab - /*if (NPC.AnyNPCs(NPCType())) - { - int otherWulfrumEnemies = NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()); - if (otherWulfrumEnemies < 4) - { - spawnRate = (int)(spawnRate * 0.8); - maxSpawns = (int)(maxSpawns * 1.2f); - } - }*/ - // Reductions if (Main.SceneMetrics.PeaceCandleCount > 0) - { - spawnRate = (int)(spawnRate * 1.1); - maxSpawns = (int)(maxSpawns * 0.9f); - } + spawnRate = (int)(spawnRate * 1.0989); // On top of 1.3 = 1.4286x (0.77x -> 0.7x spawn rate) if (player.Calamity().tranquilityCandle) { - spawnRate = (int)(spawnRate * 1.4); - maxSpawns = (int)(maxSpawns * 0.4f); + spawnRate = (int)(spawnRate * 1.6666); // 0.6x spawn rate + maxSpawns = (int)(maxSpawns * 0.6f); } if (player.Calamity().zen || (CalamityServerConfig.Instance.ForceTownSafety && player.townNPCs > 1f && Main.expertMode)) { - spawnRate = (int)(spawnRate * 2.5); + spawnRate = (int)(spawnRate * 3.3333); // 0.3x spawn rate maxSpawns = (int)(maxSpawns * 0.3f); } if (player.Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 44d474a8bb..159d4cd730 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -98,14 +98,22 @@ namespace CalamityMod.NPCs case NPCID.Werewolf: npcLoot.ChangeDropRate(ItemID.MoonCharm, 1, 20); break; + + // Possessed Armor + // Nazar @ 1% Normal, 2% Expert+ + case NPCID.PossessedArmor: + npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); + break; #endregion #region Sky / Space // Harpy // Sky Glaze @ 3.33% IF Eye of Cthulhu dead + // Giant Harpy Feather @ 1.25% (0.67% in Vanilla) // Essence of Sunlight @ 50% IF Hardmode and not statue spawned case NPCID.Harpy: postEoC.Add(ModContent.ItemType(), 30); + npcLoot.ChangeDropRate(ItemID.GiantHarpyFeather, 1, 80); hardmode.AddIf(() => !npc.SpawnedFromStatue, ModContent.ItemType(), 2); break; @@ -127,18 +135,24 @@ namespace CalamityMod.NPCs #region Underground // Giant Shelly + // Giant Shell @ 100% IF Hardmode + // OTHERWISE, // Giant Shell @ 14.29% Normal, 25% Expert+ case NPCID.GiantShelly: case NPCID.GiantShelly2: - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 4)); + hardmode.Add(ModContent.ItemType()); + hardmode.OnFailedConditions(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 4)); break; // Crawdad + // Craw Carapace @ 100% IF Hardmode + // OTHERWISE, // Craw Carapace @ 14.29% Normal, 25% Expert+ // Armor Polish @ 1% Normal, 2% Expert+ case NPCID.Crawdad: case NPCID.Crawdad2: - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 4)); + hardmode.Add(ModContent.ItemType()); + hardmode.OnFailedConditions(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 4)); npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.ArmorPolish, 100, 50)); break; @@ -170,6 +184,27 @@ namespace CalamityMod.NPCs npcLoot.Add(ModContent.ItemType()); break; + // Skeleton Archer + // Magic Quiver @ 5% (2.5% in Vanilla) + // Marrow @ 2.5% (0.5% in Vanilla) + case NPCID.SkeletonArcher: + npcLoot.ChangeDropRate(ItemID.MagicQuiver, 1, 20); + npcLoot.ChangeDropRate(ItemID.Marrow, 1, 40); + break; + + // Armored Skeleton + // Beam Sword @ 5% (0.67% in Vanilla) + case NPCID.ArmoredSkeleton: + npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 20); + break; + + // Black Recluse + // Poison Staff @ 5% (2.5% in Vanilla) + case NPCID.BlackRecluse: + case NPCID.BlackRecluseWall: + npcLoot.ChangeDropRate(ItemID.PoisonStaff, 1, 20); + break; + // Mimic // Drops all of its items Calamity Style @ 25% each // This requires erasing its vanilla behavior. @@ -367,18 +402,21 @@ namespace CalamityMod.NPCs // Life Jelly @ 10% Normal, 14.29% Expert+ case NPCID.PinkJellyfish: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 7)); + npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25); break; // Blue Jellyfish // Cleansing Jelly @ 10% Normal, 14.29% Expert+ case NPCID.BlueJellyfish: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 7)); + npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25); break; // Green Jellyfish // Vital Jelly @ 12.5% Normal, 20% Expert+ case NPCID.GreenJellyfish: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 8, 5)); + npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25); break; // Piranha, Arapaima, Blood Feeder @@ -403,7 +441,7 @@ namespace CalamityMod.NPCs // Jellyfish Necklace @ 1% case NPCID.BloodJelly: case NPCID.FungoFish: - npcLoot.Add(ItemID.JellyfishNecklace, 100); + npcLoot.Add(ItemID.JellyfishNecklace, 25); break; #endregion @@ -545,7 +583,7 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 15, 10)); break; - //The ectoplasm extra drops got moved to the list section; just like moss hornets + // The ectoplasm extra drops got moved to the list section; just like moss hornets // Hardmode Dungeon Melee Skeletons // Wisp in a Bottle @ 0.5% INSTEAD OF 0.25% @@ -596,10 +634,18 @@ namespace CalamityMod.NPCs #region Hell - // Hellbat. + // Hellbat // Flarebat Staff @ 4% + // Magma Stone @ 1.33% (0.67% in Vanilla) case NPCID.Hellbat: npcLoot.Add(ModContent.ItemType(), 25); + npcLoot.ChangeDropRate(ItemID.MagmaStone, 1, 75); + break; + + // Lava Bat + // Magma Stone @ 3.33% (2% in Vanilla) + case NPCID.Lavabat: + npcLoot.ChangeDropRate(ItemID.MagmaStone, 1, 30); break; // Fire Imp @@ -611,10 +657,12 @@ namespace CalamityMod.NPCs // Demon, Voodoo Demon // Bladecrest Oathsword @ 2%, 6.67% after defeating EoW/BoC + // Demon Scythe @ 5% (2.86% in Vanilla) case NPCID.Demon: case NPCID.VoodooDemon: npcLoot.AddIf((info) => !NPC.downedBoss2, ModContent.ItemType(), 50); npcLoot.AddIf((info) => NPC.downedBoss2, ModContent.ItemType(), 15); + npcLoot.ChangeDropRate(ItemID.DemonScythe, 1, 20); break; // Bone Serpent diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 8989fa9534..2058a665ac 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1024,8 +1024,6 @@ namespace CalamityMod.NPCs break; case NPCID.Wizard: - if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ItemType()) && !Main.LocalPlayer.ZoneHallow) - chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.MentionRoD"); if (Main.rand.NextBool(10) && Main.hardMode) chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.Hardmode"); break; diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 1c8cbd99a4..622541bb79 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index bb3e35e40d..a386dfd7fa 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/InfernalCongealment.cs b/NPCs/Crags/InfernalCongealment.cs index 99a577e956..e398dc8703 100644 --- a/NPCs/Crags/InfernalCongealment.cs +++ b/NPCs/Crags/InfernalCongealment.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/RenegadeWarlock.cs b/NPCs/Crags/RenegadeWarlock.cs index 770a2ab412..b2d3445b4a 100644 --- a/NPCs/Crags/RenegadeWarlock.cs +++ b/NPCs/Crags/RenegadeWarlock.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 9be31715aa..22af9262fa 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -281,7 +281,7 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 45bf652574..310531060d 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -254,7 +254,7 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index fedf150195..9e3be9a95a 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -306,12 +306,6 @@ namespace CalamityMod.NPCs.Crags postProv.Add(ModContent.ItemType(), 4); } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index e14a665bcb..0f477936d4 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1507,13 +1507,13 @@ namespace CalamityMod.NPCs.Cryogen { if (Main.zenithWorld) { - target.AddBuff(ModContent.BuffType(), 120, true); - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); } else { - target.AddBuff(BuffID.Frostburn, 240, true); - target.AddBuff(BuffID.Chilled, 120, true); + target.AddBuff(BuffID.Frostburn, 360); + target.AddBuff(BuffID.Chilled, 120); } } } diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index aff0c00efc..bb4ee5cc49 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -116,13 +116,13 @@ namespace CalamityMod.NPCs.Cryogen { if (Main.zenithWorld) { - target.AddBuff(ModContent.BuffType(), 120, true); - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); } else { - target.AddBuff(BuffID.Frostburn, 240, true); - target.AddBuff(BuffID.Chilled, 120, true); + target.AddBuff(BuffID.Frostburn, 360); + target.AddBuff(BuffID.Chilled, 120); } } } diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index e0164802fe..fad5059241 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -322,7 +322,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Bleeding, 60, true); + target.AddBuff(BuffID.Bleeding, 120); } public override Color? GetAlpha(Color drawColor) diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index d3448785a3..e82400e730 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -330,7 +330,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Bleeding, 60, true); + target.AddBuff(BuffID.Bleeding, 120); } public override Color? GetAlpha(Color drawColor) diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 3dd7b59380..fbb606fc63 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -607,7 +607,7 @@ namespace CalamityMod.NPCs.DesertScourge { if (hurtInfo.Damage > 0) { - target.AddBuff(BuffID.Bleeding, 180); + target.AddBuff(BuffID.Bleeding, 300); NPC.ai[3] = 1f; NPC.ForceNetUpdate(); } diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 08784a1e62..814c36893e 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -650,7 +650,7 @@ namespace CalamityMod.NPCs.DesertScourge { if (hurtInfo.Damage > 0) { - target.AddBuff(BuffID.Bleeding, 180); + target.AddBuff(BuffID.Bleeding, 300); NPC.ai[3] = 1f; NPC.ForceNetUpdate(); } diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 7c83738f4c..8b8bc97303 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Bleeding, 30, true); + target.AddBuff(BuffID.Bleeding, 60); } public override Color? GetAlpha(Color drawColor) diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index 00290efb8d..193643be96 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Bleeding, 30, true); + target.AddBuff(BuffID.Bleeding, 60); } public override Color? GetAlpha(Color drawColor) diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index c7d8ed7d33..8041253706 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 80, true); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 1a9b1bd130..6eb9fba049 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -451,7 +451,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index ce926f38ca..79e71a6b1d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -445,8 +445,8 @@ namespace CalamityMod.NPCs.DevourerofGods { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 160, true); - target.AddBuff(ModContent.BuffType(), 480, true); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 480); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 00adff6a0c..232c5b3899 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2799,8 +2799,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (hurtInfo.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 200, true); - target.AddBuff(ModContent.BuffType(), 600, true); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 600); if (target.Calamity().dogTextCooldown <= 0 && !BossRushEvent.BossRushActive) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 3c7fa5266d..d4eb16b82b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -33,6 +33,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public static readonly SoundStyle LaserSound = new("CalamityMod/Sounds/Custom/ExoMechs/THanosLaser"); + public static readonly SoundStyle GFBeam = new("CalamityMod/Sounds/Custom/ExoMechs/THanosGFBeam"); + + public static readonly SoundStyle ThanatosHitSoundOpen = new("CalamityMod/Sounds/NPCHit/ThanatosHitOpen", 2) { Volume = 0.5f }; public static readonly SoundStyle ThanatosHitSoundClosed = new("CalamityMod/Sounds/NPCHit/ThanatosHitClosed", 3) { Volume = 0.4f }; @@ -903,7 +906,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { //Commented out in case we decide its better for it to simply play from anywhere in range //if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance) - LaserSoundSlot = SoundEngine.PlaySound(LaserSound, NPC.Center); + LaserSoundSlot = SoundEngine.PlaySound((Main.zenithWorld ? GFBeam : LaserSound), NPC.Center); // Create a bunch of lightning bolts in the sky ExoMechsSky.CreateLightningBolt(12); diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index c0ed75b4cc..191cabdc62 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1332,7 +1332,7 @@ namespace CalamityMod.NPCs.HiveMind if (hurtInfo.Damage < 0) return; - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 360); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => NPC.scale == 1f; // Only draw HP bar while at full size diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 8c65b93520..adff77a47e 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -105,8 +105,8 @@ namespace CalamityMod.NPCs.NormalNPCs { if (hurtInfo.Damage > 0) { - target.AddBuff(BuffID.Frostburn, 90, true); - target.AddBuff(BuffID.Chilled, 60, true); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.Chilled, 60); } } diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 677e543ea6..d9aa5f45f2 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -68,8 +68,8 @@ namespace CalamityMod.NPCs.NormalNPCs { if (hurtInfo.Damage > 0) { - target.AddBuff(BuffID.Frostburn, 120, true); - target.AddBuff(BuffID.Chilled, 90, true); + target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.Chilled, 90); } } diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 1467b1f3b6..b82920a32c 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -101,8 +101,8 @@ namespace CalamityMod.NPCs.NormalNPCs { if (hurtInfo.Damage > 0) { - target.AddBuff(BuffID.Frostburn, 120, true); - target.AddBuff(BuffID.Chilled, 90, true); + target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.Chilled, 90); } } diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index fe9bf61205..7fde916b9d 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -316,15 +316,13 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - // waffles% stipulation: eidolists are accessible by beating cal clone, even without beating WoF - bool hardmodeOrCalClone = Main.hardMode || DownedBossSystem.downedCalamitasClone; - if (!hardmodeOrCalClone || !spawnInfo.Player.InAbyss()) + if (!spawnInfo.Player.InAbyss()) return 0f; // Keep this as a separate if check, because it's a loop and we don't want to be checking it constantly. if (NPC.AnyNPCs(NPC.type)) return 0f; - + if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) return Main.remixWorld ? 2.25f : 0.25f; diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 9d463af369..6788da55c2 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -312,7 +312,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 3bd82cae9d..dd5b9c3d62 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -293,8 +293,8 @@ namespace CalamityMod.NPCs.NormalNPCs { if (hurtInfo.Damage > 0) { - target.AddBuff(BuffID.Frostburn, 180, true); - target.AddBuff(BuffID.Chilled, 120, true); + target.AddBuff(BuffID.Frostburn, 240); + target.AddBuff(BuffID.Chilled, 120); } } diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 737a0269d0..1419f7e2b8 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -387,7 +387,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index 1feaea149e..d766fc1f04 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -196,7 +196,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Poisoned, 120); + target.AddBuff(BuffID.Poisoned, 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 595c902888..343fafa2b4 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 7a00d1fa3a..54d7a9714c 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index f4776d4331..d866ccbd01 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -261,7 +261,7 @@ namespace CalamityMod.NPCs.NormalNPCs target.AddBuff(ModContent.BuffType(), 90); } else - target.AddBuff(BuffID.OnFire, 150, true); + target.AddBuff(BuffID.OnFire, 180); } } diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 03979fc5f8..d2e311d506 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -1,6 +1,7 @@ using System; using System.IO; using CalamityMod.BiomeManagers; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; @@ -473,6 +474,7 @@ namespace CalamityMod.NPCs.OldDuke if (hurtInfo.Damage > 0) { target.AddBuff(ModContent.BuffType(), 480); + target.AddBuff(ModContent.BuffType(), 180); if (Main.zenithWorld) { target.AddBuff(BuffID.Rabies, Main.rand.Next(180, 601)); diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 6678323c28..04b29437b1 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -322,7 +322,10 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Ichor, 120); + } } } } diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index da460fae1f..0ef54560de 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 4e0c906fef..d829991d28 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -654,7 +654,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 57460d4cef..2638f557a3 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -570,13 +570,6 @@ namespace CalamityMod.NPCs.Perforator Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); } } - - // ???? - /*for (int i = 0; i < Main.maxNPCs; i++) - { - if (i != NPC.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPC.type || Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) - return; - }*/ } public override void BossLoot(ref string name, ref int potionType) @@ -598,7 +591,10 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240, true); + { + target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(BuffID.Ichor, 240); + } } } } diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index a1eed6c54b..2b77994911 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -583,7 +583,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 6d830f7449..54525678bc 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -647,7 +647,10 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180, true); + { + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Ichor, 300); + } } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index a16079a3c2..710b6bf4db 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 120, true); } } } diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 66712f3c70..1c83b3ec71 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -283,7 +283,10 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + { + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Ichor, 60); + } } } } diff --git a/NPCs/PlagueEnemies/Melter.cs b/NPCs/PlagueEnemies/Melter.cs index 4203d6ee5e..065874a933 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/PlagueEnemies/PestilentSlime.cs b/NPCs/PlagueEnemies/PestilentSlime.cs index 8e662822ae..72f79c03b4 100644 --- a/NPCs/PlagueEnemies/PestilentSlime.cs +++ b/NPCs/PlagueEnemies/PestilentSlime.cs @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index 54f956edec..c7ae9751ce 100644 --- a/NPCs/PlagueEnemies/PlagueCharger.cs +++ b/NPCs/PlagueEnemies/PlagueCharger.cs @@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index dad5fb445f..d3666be1d0 100644 --- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs +++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index db13bc4c31..0374f876c4 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -474,7 +474,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index 9e5acf2b08..55d9b3004b 100644 --- a/NPCs/PlagueEnemies/Plagueshell.cs +++ b/NPCs/PlagueEnemies/Plagueshell.cs @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 3, 4); diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index d2c2f4d31f..d8e5832bbd 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90, true); + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index a65955b46d..eb320135a4 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -262,11 +262,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (Main.zenithWorld) // it is the plague, you get very sick. { - target.AddBuff(ModContent.BuffType(), 240, true); - target.AddBuff(BuffID.Poisoned, 240, true); - target.AddBuff(BuffID.Venom, 240, true); + target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(BuffID.Poisoned, 240); + target.AddBuff(BuffID.Venom, 240); } - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index e95079f7ee..a12db2106d 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -152,11 +152,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (Main.zenithWorld) // it is the plague, you get very sick. { - target.AddBuff(ModContent.BuffType(), 300, true); - target.AddBuff(BuffID.Poisoned, 300, true); - target.AddBuff(BuffID.Venom, 300, true); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Poisoned, 300); + target.AddBuff(BuffID.Venom, 300); } - target.AddBuff(ModContent.BuffType(), 150, true); + target.AddBuff(ModContent.BuffType(), 240); } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 0216aef43a..8a18300de4 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1393,11 +1393,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (Main.zenithWorld) // it is the plague, you get very sick. { - target.AddBuff(ModContent.BuffType(), 480, true); - target.AddBuff(BuffID.Poisoned, 480, true); - target.AddBuff(BuffID.Venom, 480, true); + target.AddBuff(ModContent.BuffType(), 480); + target.AddBuff(BuffID.Poisoned, 480); + target.AddBuff(BuffID.Venom, 480); } - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 360); } } } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 086ac9f062..183ba8cdad 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -1519,7 +1519,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (NPC.Opacity == 1f && hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 1200, true); + target.AddBuff(ModContent.BuffType(), 1200); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 0a3d02a1fc..4afdca7d56 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -1273,7 +1273,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 200, true); + target.AddBuff(ModContent.BuffType(), 300); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index d15b591dfc..8c0774d5d3 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -947,7 +947,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 160, true); + target.AddBuff(ModContent.BuffType(), 240); } public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 1ea8449522..5a23446c69 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -568,12 +568,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians return minDist <= 80f; } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 34c3782b94..64ea8d4e8b 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -344,7 +344,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 80, true); + target.AddBuff(ModContent.BuffType(), 120); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 197260cfdb..1003555aee 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -1006,7 +1006,7 @@ namespace CalamityMod.NPCs.Ravager public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 480, true); + target.AddBuff(ModContent.BuffType(), 480); } public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 720ecc8c7e..84cda3e20c 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -314,11 +314,11 @@ namespace CalamityMod.NPCs.Ravager { if (DownedBossSystem.downedProvidence) { - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 240); } else { - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 01abdb3fb5..b8855ebe09 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -315,11 +315,11 @@ namespace CalamityMod.NPCs.Ravager { if (DownedBossSystem.downedProvidence) { - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 240); } else { - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 4170c15cf3..ff8adfd193 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Ravager if (hurtInfo.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 240); SoundEngine.PlaySound(SoundID.Item14, NPC.Center); NPC.ai[0] = 0f; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 5c2e453fac..eb3761f198 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -1055,7 +1055,7 @@ namespace CalamityMod.NPCs.Signus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 420, true); + target.AddBuff(ModContent.BuffType(), 420); } } } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index bb36b36aca..e677e317fd 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Weak, 90, true); + target.AddBuff(BuffID.Weak, 180); } } } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index 4e1e008508..ff4ec21caf 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Weak, 90, true); + target.AddBuff(BuffID.Weak, 180); } } } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index c4b73a5b34..b037980269 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Darkness, 90, true); + target.AddBuff(BuffID.Darkness, 180); } } } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 1322a3b560..10079952a5 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -177,7 +177,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Darkness, 90, true); + target.AddBuff(BuffID.Darkness, 180); } } } diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 2f5ffefcc7..672195c5f0 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -875,7 +875,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Darkness, 300, true); + target.AddBuff(BuffID.Darkness, 360); } } } diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index afc2c59e00..b93f13907b 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -618,7 +618,7 @@ namespace CalamityMod.NPCs.SlimeGod if (hitboxBotRight < minDist) minDist = hitboxBotRight; - return minDist <= 65f * NPC.scale; + return minDist <= 55f * NPC.scale; } public override Color? GetAlpha(Color drawColor) @@ -715,7 +715,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Weak, 300, true); + target.AddBuff(BuffID.Weak, 360); } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index a5f7e02c6d..dacc2f1f2a 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -842,9 +842,9 @@ namespace CalamityMod.NPCs.SlimeGod if (hurtInfo.Damage > 0) { int debufftype = Main.zenithWorld ? BuffID.VortexDebuff : BuffID.Slow; - target.AddBuff(debufftype, 180, true); - target.AddBuff(BuffID.Weak, 180, true); - target.AddBuff(BuffID.Darkness, 180, true); + target.AddBuff(debufftype, 180); + target.AddBuff(BuffID.Weak, 180); + target.AddBuff(BuffID.Darkness, 180); } } } diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 0de260db20..3a7fe26a17 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -861,7 +861,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Darkness, 240, true); + target.AddBuff(BuffID.Darkness, 240); } } } diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 727a4065b5..eea5d83c45 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -905,7 +905,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Weak, 240, true); + target.AddBuff(BuffID.Weak, 240); } } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index e3683fc811..0519194931 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -313,9 +313,9 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; + int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, buffDuration, true); + target.AddBuff(BuffID.Electrified, buffDuration); } public override bool CheckActive() diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index e291654baf..7dd6078c43 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -886,9 +886,9 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; + int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 480 : 240; if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, buffDuration, true); + target.AddBuff(BuffID.Electrified, buffDuration); } public override bool CheckActive() diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 0d33b1f0a0..4fb551873c 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -317,9 +317,9 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 60 : 30; + int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Electrified, buffDuration, true); + target.AddBuff(BuffID.Electrified, buffDuration); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index 6d911aa579..bdcea410e6 100644 --- a/NPCs/SulphurousSea/AquaticUrchin.cs +++ b/NPCs/SulphurousSea/AquaticUrchin.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 120); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 156617ae6c..640c48a995 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemID.JellyfishNecklace, 100); + npcLoot.Add(ItemID.JellyfishNecklace, 25); LeadingConditionRule postDS = npcLoot.DefineConditionalDropSet(DropHelper.PostDS()); postDS.Add(ModContent.ItemType(), 5); } diff --git a/NPCs/SunkenSea/Jellyghoul.cs b/NPCs/SunkenSea/Jellyghoul.cs index d86b9f83e4..52a24f4be8 100644 --- a/NPCs/SunkenSea/Jellyghoul.cs +++ b/NPCs/SunkenSea/Jellyghoul.cs @@ -1,12 +1,14 @@ using CalamityMod.BiomeManagers; +using CalamityMod.DataStructures; using CalamityMod.Items.Placeables; using CalamityMod.Particles; using CalamityMod.Projectiles.Enemy; -using CalamityMod.Tiles.SunkenSea; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using System; +using System.Collections.Generic; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -32,6 +34,13 @@ namespace CalamityMod.NPCs.SunkenSea public static SoundStyle JellyGhoulScream = SoundID.NPCDeath51 with { Pitch = -1, Volume = 0.2f, MaxInstances = 0 }; + public static Asset tentacleTexture; + + public override void Load() + { + tentacleTexture = ModContent.Request(Texture + "Tentacle"); + } + public override void SetStaticDefaults() { Main.npcFrameCount[Type] = 1; @@ -207,9 +216,6 @@ namespace CalamityMod.NPCs.SunkenSea public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - if (NPC.IsABestiaryIconDummy) - return true; - SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; @@ -221,13 +227,16 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 afterimageOffset = new Vector2((float)Math.Cos(Main.GlobalTimeWrappedHourly * afterimageRotationSpeed) + NPC.localAI[1], (float)Math.Sin(Main.GlobalTimeWrappedHourly * afterimageRotationSpeed) + NPC.localAI[1]) * afterimageDistance; // Spooky glowey aura effect - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - Texture2D bloom = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; + if (!NPC.IsABestiaryIconDummy) + { + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Texture2D bloom = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; - spriteBatch.Draw(bloom, NPC.Center - Main.screenPosition + afterimageOffset, null, FinalColor * 0.45f, 0f, bloom.Size() / 2f, 0.6f, SpriteEffects.None, 0); - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.Draw(bloom, NPC.Center - screenPos + afterimageOffset, null, FinalColor * 0.45f, 0f, bloom.Size() / 2f, 0.6f, SpriteEffects.None, 0); + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[Type] / 2)); @@ -239,6 +248,55 @@ namespace CalamityMod.NPCs.SunkenSea npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); + // Tentacles + Texture2D tentacle = tentacleTexture.Value; + for (int i = 0; i < 4; i++) + { + // Is the tentacle on the outside? + bool outerTentacle = i == 0 || i == 3; + // Is the tentacle one of the left ones? + int leftTentacle = i < 2 ? -1 : 1; + // Start position x offset + int xOffset = outerTentacle ? 4 : 2; + // How much the end position is rotated by + int endDeg = outerTentacle ? 20 : 5; + // Length of each tentacle + int tentacleLength = outerTentacle ? 60 : 50; + // A psuedo randomness value between tentacles and the NPC's index used to desync tentacles from each other + int randomness = i % 2 + NPC.whoAmI; + // Start position of the tentacle + Vector2 anchor = npcOffset + afterimageOffset + new Vector2(leftTentacle * xOffset, 10); + // End position of the tentacle + Vector2 end = npcOffset + afterimageOffset + Vector2.UnitY.RotatedBy(MathHelper.ToRadians(endDeg * -leftTentacle)).RotatedBy(MathHelper.ToRadians(MathF.Sin(Main.GlobalTimeWrappedHourly * 4) * 5 * -leftTentacle)) * tentacleLength; + + // Store the previous tentacle's location + Vector2 prevTentacle = npcOffset + afterimageOffset; + int segmentCount = 10; + Vector2 direction = anchor.DirectionTo(end).RotatedBy(MathHelper.PiOver2); + BezierCurve curve = new BezierCurve(anchor, anchor + (end - anchor) * 0.33f + direction * MathF.Sin(Main.GlobalTimeWrappedHourly * 4 + randomness) * 8, anchor + (end - anchor) * 0.66f + direction * MathF.Cos(Main.GlobalTimeWrappedHourly * 4 + randomness) * 16, end); + List points = curve.GetPoints(segmentCount); + for (int j = 0; j < segmentCount; j++) + { + // Which texture variant the tentacle uses is based on the horizontal position on its sheet + int texX = i == 0 ? 0 : i == (segmentCount - 1) ? 16 : 8; + // Which segment type. + // The first segment (0 is invisible) uses the first frame + // The final segment uses the last frame + // The rest alternate between frames 2 and 3 + int texY = j % 2 == 0 ? 16 : 8; + if (j == 1) + texY = 0; + else if (j == segmentCount - 1) + texY = 24; + + int segHeight = (j == segmentCount - 1) ? 8 : 6; + + if (j != 0) + spriteBatch.Draw(tentacle, points[j], new Rectangle(texX, texY, 6, segHeight), FinalColor * NPC.Opacity, points[j].DirectionTo(prevTentacle).ToRotation() + MathHelper.PiOver2, new Vector2(2), NPC.scale, spriteEffects, 0); + prevTentacle = points[j]; + } + } + // Draws transparent clones around itself to look woozy int cloneAmt = 4; for (int i = 0; i < cloneAmt; i++) diff --git a/NPCs/SunkenSea/Jellyghoul.png b/NPCs/SunkenSea/Jellyghoul.png index 26bfb3154d..4ca9f182b3 100644 Binary files a/NPCs/SunkenSea/Jellyghoul.png and b/NPCs/SunkenSea/Jellyghoul.png differ diff --git a/NPCs/SunkenSea/JellyghoulTentacle.png b/NPCs/SunkenSea/JellyghoulTentacle.png new file mode 100644 index 0000000000..573995d970 Binary files /dev/null and b/NPCs/SunkenSea/JellyghoulTentacle.png differ diff --git a/NPCs/SunkenSea/StormlionSentry.cs b/NPCs/SunkenSea/StormlionSentry.cs new file mode 100644 index 0000000000..8a47696aaa --- /dev/null +++ b/NPCs/SunkenSea/StormlionSentry.cs @@ -0,0 +1,341 @@ +using System; +using System.IO; +using CalamityMod.BiomeManagers; +using CalamityMod.Dusts; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Enemy; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.GameContent.Bestiary; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; + +namespace CalamityMod.NPCs.SunkenSea +{ + public class StormlionSentry : ModNPC + { + public ref float time => ref NPC.ai[0]; + public ref float attackTimer => ref NPC.ai[1]; + public ref float jitter => ref NPC.ai[2]; + public ref float jitterRate => ref NPC.localAI[0]; + public ref float headRot => ref NPC.localAI[1]; + public ref float attackFeedback => ref NPC.localAI[2]; + public bool canBeMoved => NPC.localAI[3] == 0; + public enum Mode + { + Idle, + Agressive, + Leaping, + Digging + } + public Mode AIState + { + get => (Mode)(int)NPC.ai[3]; + set => NPC.ai[3] = (int)value; + } + + public float fxFade = 1; + public float fxFadeInv => attackFeedback - 1; + public float targetRange = 830; + public int attackRate = 180; + public int digDir = 1; + public Vector2 headPosition; + public Vector2 attackPosition; + + public static Asset headTexture; + public static Asset mandibleTexture; + public static Asset bodyTexture; + + public override void Load() + { + headTexture = ModContent.Request(Texture + "Head"); + mandibleTexture = ModContent.Request(Texture + "Mandible"); + bodyTexture = ModContent.Request(Texture + "Body"); + } + + public override void SetStaticDefaults() + { + NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 20f }; + NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; + } + + public override void SetDefaults() + { + NPC.width = 50; + NPC.height = 108; + NPC.lifeMax = 60; + NPC.damage = 15; + NPC.defense = 3; + NPC.knockBackResist = 0f; + NPC.HitSound = Effects.StormlionEffects.Hit; + NPC.DeathSound = Effects.StormlionEffects.Killed; + NPC.noGravity = true; + NPC.noTileCollide = true; // Custom tile collision + + AIState = Mode.Idle; + attackFeedback = 1; + headRot = -MathHelper.PiOver2; + + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + //Banner = NPC.type; + //BannerItem = ModContent.ItemType(); + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(NPC.localAI[0]); + writer.Write(NPC.localAI[1]); + writer.Write(NPC.localAI[2]); + writer.Write(NPC.localAI[3]); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + NPC.localAI[0] = reader.ReadSingle(); + NPC.localAI[1] = reader.ReadSingle(); + NPC.localAI[2] = reader.ReadSingle(); + NPC.localAI[3] = reader.ReadSingle(); + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange( + [ + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.StormlionSentry") + ]); + } + + public override void AI() + { + NPC.TargetClosest(false); + Player target = Main.player[NPC.target]; + NPC.spriteDirection = NPC.direction; + + bool npcFullyInTiles = Collision.SolidCollision(NPC.Center - Vector2.UnitY * 13, 15, 15); + bool npcOnTiles = Collision.SolidCollision(NPC.Center + Vector2.UnitY * 10, 15, 15); + bool targetInRange = Utils.Distance(target.Center, NPC.Center) <= targetRange && Collision.CanHit(headPosition, 1, 1, target.Center, 1, 1); + + attackFeedback = MathHelper.Lerp(attackFeedback, 1, 0.025f); + fxFade = Utils.GetLerpValue(0, attackRate, attackTimer, true); + + if (!npcOnTiles) + { + if (NPC.velocity.Y < 0) + NPC.velocity.Y *= 0.97f; + if (NPC.velocity.Y < 20) + NPC.velocity.Y += 0.5f; + NPC.velocity.X *= 0.97f; + } + + if (!npcFullyInTiles && npcOnTiles && AIState != Mode.Digging) + { + NPC.localAI[3] = 5; + AIState = Mode.Digging; + } + if (AIState == Mode.Idle) + { + attackTimer = (int)MathHelper.Lerp(attackTimer, 0, 0.01f); + jitterRate = MathHelper.Lerp(jitterRate, 0.1f, 0.05f); + headRot = headRot.AngleLerp(-Vector2.UnitY.ToRotation(), 0.02f); + if (targetInRange && !canBeMoved) + AIState = Mode.Agressive; + + if (Main.rand.NextBool(15) && time % 60 == 0) + { + jitterRate = 4.7f; + SoundEngine.PlaySound((Main.rand.NextBool() ? Effects.StormlionEffects.Idle1 : Effects.StormlionEffects.Idle2) with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.2f, 0.1f) }, NPC.Center); + } + } + if (AIState == Mode.Agressive) + { + if (!targetInRange && attackTimer >= 0) + AIState = Mode.Idle; + + if (attackTimer >= 0) + { + jitterRate = MathHelper.Lerp(jitterRate, 1f + 3f * Utils.GetLerpValue(0, attackRate, attackTimer), 0.035f); + headRot = headRot.AngleLerp(NPC.Center.DirectionTo(target.Center).ToRotation(), 0.035f); + } + else + headRot = headRot.AngleLerp(NPC.Center.DirectionTo(target.Center).ToRotation(), 0.01f); + + if (attackTimer == attackRate) + { + SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, NPC.Center); + + Projectile.NewProjectile(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 12), ModContent.ProjectileType(), NPC.damage, 0f, Main.myPlayer); + for (int i = 0; i <= 12; i++) + { + float variance = Main.rand.NextFloat(-0.6f, 0.6f); + int dustStyle = Effects.StormlionEffects.EnergyDust; + Dust dust2 = Dust.NewDustPerfect(attackPosition, dustStyle); + dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance); + dust2.velocity = (headRot.ToRotationVector2() * 15).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)); + dust2.noGravity = true; + dust2.color = Effects.StormlionEffects.EnergyColor; + } + + attackFeedback = 2; + attackTimer = -60; + jitterRate = 0; + NPC.ForceNetUpdate(); + } + attackTimer++; + } + if (AIState == Mode.Digging) + { + if (time % 10 == 0) + { + NPC.velocity = Vector2.Zero; + headRot = MathHelper.ToRadians(4 * digDir) - MathHelper.PiOver2; + SoundEngine.PlaySound(SoundID.WormDig with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, NPC.Center); + NPC.Center += Vector2.UnitY * 2; + digDir *= -1; + } + if (npcFullyInTiles) + AIState = Mode.Idle; + } + + if (!canBeMoved) + NPC.velocity = Vector2.Zero; + + + bool dancing = false; // They will dance if a "music projectile" is on screen of if the player is using an instrument (except drums because that would be annoying to make work) + for (int x = 0; x < Main.maxProjectiles; x++) + { + if (Main.mouseLeft && (target.HeldItem.type == ItemID.Bell || target.HeldItem.type == ItemID.CarbonGuitar || target.HeldItem.type == ItemID.IvyGuitar || target.HeldItem.type == ItemID.Harp || target.HeldItem.type == ItemID.TheAxe)) + { + dancing = true; + } + Projectile projectile = Main.projectile[x]; + if (!dancing && projectile.active && (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ProjectileID.SparkleGuitar || projectile.type == ProjectileID.EighthNote || projectile.type == ProjectileID.QuarterNote || projectile.type == ProjectileID.TiedEighthNote)) + { + dancing = true; + } + } + + if (dancing) + { + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 14.37f / MathHelper.Pi); + if (Main.zenithWorld) + { + if (time % 2 == 0) + { + SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 0.2f, Pitch = 0.4f * sine, MaxInstances = 30 }, NPC.Center); + Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 6), ModContent.ProjectileType(), NPC.damage * target.statLifeMax2, 0f, Main.myPlayer); + proj.friendly = true; + proj.hostile = false; + } + fxFade = 1; + attackTimer = attackRate * 0.9f; + } + else + attackTimer = 0; + jitterRate = 1; + NPC.dontTakeDamage = true; + headRot = MathHelper.ToRadians(100 * sine) - MathHelper.PiOver2; + AIState = Mode.Idle; + } + else + NPC.dontTakeDamage = false; + + float orbSine = (float)Math.Sin(time * 0.575f / MathHelper.Pi) * Utils.GetLerpValue(attackRate * 1.1f, 0, attackTimer); + headPosition = NPC.Center - (Vector2.UnitY * 27).RotatedBy(NPC.rotation) + headRot.ToRotationVector2() * 12 + NPC.velocity; + attackPosition = headPosition + headRot.ToRotationVector2() * (25 + 8 * orbSine); + NPC.rotation = Utils.AngleLerp(0, headRot + MathHelper.PiOver2, 0.35f); + + + if (fxFade > 0) + { + Lighting.AddLight(attackPosition, Effects.StormlionEffects.EnergyColor.ToVector3() * 0.7f * fxFade); + } + + time++; + jitter += jitterRate; + } + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, Effects.StormlionEffects.FleshDust, hit.HitDirection, -1f, 0, Effects.StormlionEffects.FleshColor, Main.rand.NextFloat(0.7f, 1.1f)); + } + if (NPC.life <= 0) + { + for (int k = 0; k < 35; k++) + { + bool type = !Main.rand.NextBool(3); + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, type ? Effects.StormlionEffects.EnergyDust : Effects.StormlionEffects.FleshDust, hit.HitDirection, -1f, 0, type ? Effects.StormlionEffects.EnergyColor : Effects.StormlionEffects.FleshColor, Main.rand.NextFloat(0.7f, 1.1f)); + } + // Gores go here once they're done + /* + if (!Main.dedServ) + { + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("StormlionSentry").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("StormlionSentry2").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("StormlionSentry3").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("StormlionSentry4").Type, 1f); + } + */ + } + } + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + return false; + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Player.Calamity().ZoneTimelessShores && !spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + { + return SpawnCondition.Cavern.Chance * 0.5f; + } + return 0f; + } + public override void ModifyNPCLoot(NPCLoot npcLoot) + { + npcLoot.Add(ModContent.ItemType()); + } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + Texture2D tex = TextureAssets.Npc[Type].Value; + if (NPC.IsABestiaryIconDummy) + { + spriteBatch.Draw(tex, NPC.Center - screenPos, null, drawColor, NPC.rotation, tex.Size() / 2f, NPC.scale, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + return false; + } + if (time == 0) + return false; + + Texture2D body = bodyTexture.Value; + Texture2D head = headTexture.Value; + Texture2D mandible = mandibleTexture.Value; + Texture2D attack = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + spriteBatch.Draw(body, NPC.Center - screenPos, null, drawColor, NPC.rotation, body.Size() / 2f, NPC.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(head, headPosition - screenPos, null, drawColor, headRot + MathHelper.PiOver2, head.Size() / 2f, NPC.scale, SpriteEffects.None, 0f); + for (int i = -1; i <= 1; i += 2) + { + float sine = (float)Math.Sin(jitter * 0.575f / MathHelper.Pi) * Utils.GetLerpValue(4.8f, 0, jitterRate); + Vector2 madiblePos = headPosition + (Vector2.UnitX * 10 * i).RotatedBy(headRot + MathHelper.PiOver2); + Vector2 madibleOrigin = (new Vector2(i == 1 ? 0 : mandible.Width, mandible.Height)); + float mandibleRot = MathHelper.ToRadians(5 * i) + MathHelper.Lerp(MathHelper.ToRadians(20) * sine * i, MathHelper.ToRadians(50) * i * fxFadeInv, fxFadeInv); + spriteBatch.Draw(mandible, madiblePos - screenPos, null, drawColor, headRot + mandibleRot + MathHelper.PiOver2, madibleOrigin, NPC.scale, i == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + } + + if (attackTimer > 0) + { + float fade = (float)Math.Pow(fxFade, 2); + for (int i = 0; i < 3; i++) + spriteBatch.Draw(attack, attackPosition - screenPos, null, Color.Lerp(Effects.StormlionEffects.EnergyColor, Color.White, i * 0.3f) with { A = 0 } * fade, headRot, attack.Size() / 2f, (NPC.scale * 0.3f - (i * 0.08f)) * fade * Main.rand.NextFloat(0.8f, 1.1f), SpriteEffects.None, 0f); + } + return false; + } + } +} diff --git a/NPCs/SunkenSea/StormlionSentry.png b/NPCs/SunkenSea/StormlionSentry.png new file mode 100644 index 0000000000..8e5990842a Binary files /dev/null and b/NPCs/SunkenSea/StormlionSentry.png differ diff --git a/NPCs/SunkenSea/StormlionSentryBody.png b/NPCs/SunkenSea/StormlionSentryBody.png new file mode 100644 index 0000000000..0e8b945f4d Binary files /dev/null and b/NPCs/SunkenSea/StormlionSentryBody.png differ diff --git a/NPCs/SunkenSea/StormlionSentryHead.png b/NPCs/SunkenSea/StormlionSentryHead.png new file mode 100644 index 0000000000..eefe88b4e4 Binary files /dev/null and b/NPCs/SunkenSea/StormlionSentryHead.png differ diff --git a/NPCs/SunkenSea/StormlionSentryMandible.png b/NPCs/SunkenSea/StormlionSentryMandible.png new file mode 100644 index 0000000000..474cbbfaa0 Binary files /dev/null and b/NPCs/SunkenSea/StormlionSentryMandible.png differ diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index a44b972fce..4d6bd4d2b2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -469,23 +469,27 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealHoverVelocity, hoverAcceleration + (timeToCharge ? ((npc.ai[2] - phaseLimit) * 0.001f) : 0f)); npc.ai[2] += 1f; - float projectileGateValue = (lifeRatio < 0.5f && death) ? 40f : (death ? 60f : 80f); - if (npc.ai[2] % projectileGateValue == 0f && shootProjectile) + + if (death) { - Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * servantAndProjectileVelocity * 2f; - Vector2 projectileSpawnCenter = npc.Center + projectileVelocity; - if (Main.netMode != NetmodeID.MultiplayerClient) + float projectileGateValue = lifeRatio < 0.5f ? 40f : 60f; + if (npc.ai[2] % projectileGateValue == 0f && shootProjectile) { - int type = ProjectileID.BloodNautilusShot; - int damage = npc.GetProjectileDamage(type); - int numProj = death ? 4 : 3; - int spread = death ? 12 : 10; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * servantAndProjectileVelocity * 2f; + Vector2 projectileSpawnCenter = npc.Center + projectileVelocity; + if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = 600; + int type = ProjectileID.BloodNautilusShot; + int damage = npc.GetProjectileDamage(type); + int numProj = 3; + int spread = 10; + float rotation = MathHelper.ToRadians(spread); + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Main.projectile[proj].timeLeft = 600; + } } } } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 22cd5db061..93ae4067f9 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -3070,7 +3070,7 @@ namespace CalamityMod.NPCs.Yharon public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180); } #endregion diff --git a/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs new file mode 100644 index 0000000000..73c7b4c53b --- /dev/null +++ b/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs @@ -0,0 +1,497 @@ +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.Prefixes; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.BaseProjectiles +{ + + public class BaseSwordHoldoutPlayer : ModPlayer + { + /// + /// Used to detect what swing a weapon is doing. + /// + public int swingNum = 0; + + } + /// + /// Manages all the required settings for custom sword holdouts done using BaseSwordHoldoutProjectile + /// + public abstract class BaseSwordHoldoutItem : ModItem + { + public virtual int ProjectileType { get; set; } + public virtual bool SizeModifiers { get; set; } = true; + + public virtual bool RClickAutoswing { get; set; } = false; + + public override void SetStaticDefaults() + { + if (RClickAutoswing) ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + } + + public override bool MeleePrefix() + { + return SizeModifiers; + } + public override void SetDefaults() + { + Item.noMelee = true; + Item.noUseGraphic = true; + Item.shoot = ProjectileType; + Item.autoReuse = true; + Item.useTurn = false; + Item.useStyle = ItemUseStyleID.Shoot; + if (SizeModifiers) PrefixLegacy.ItemSets.SwordsHammersAxesPicks[Item.type] = true; + } + public override bool CanUseItem(Player player) + { + if (player.itemTime > 0) + { + return false; + } + for (int i = 0; i < 1000; i++) + { + var proj = Main.projectile[i]; + if (proj.type == ProjectileType && proj.owner == player.whoAmI && proj.active) + { + return false; + } + + } + return base.CanUseItem(player); + } + } + + [PierceResistException] + //Doze 24apr2025 - Not a child of BaseCustomUseStyleProjectile because this doesn't use any of it's functionality. Comes from my melee rework mod. + public abstract class BaseSwordHoldoutProjectile : ModProjectile + { + #region Overrideable Fields + /// + /// The width, in degrees, of the sword swing. + /// Defaults to 180 + /// + public virtual int swingWidth { get; set; } = 180; + /// + /// How many frames the sword swing should take. + /// Defaults to 20 + /// + public virtual int swingTime { get; set; } = 20; + /// + /// If the swing should alternate directions each use. + /// Defaults to true + /// + public virtual bool AlternateSwings { get; set; } = true; + /// + /// How far the held sword should be offset from the player + /// Defaults to 0 + /// + public virtual int OffsetDistance { get; set; } = 0; + /// + /// What item this projectile uses as a base. + /// + public virtual Item BaseItem { get; set; } + /// + /// Whether or not this projectile uses a base item at all. + /// Defaults to true. + /// + public virtual bool UsesBaseItem { get; set; } = true; + + /// + /// Length of after-image trail left by the projectile. + /// Defaults to 0 + /// + public virtual int AfterImageLength { get; set; } = 0; + + /// + /// Whether or not this should get melee speed bonuses + /// Defaults to TRUE + /// + public virtual bool useMeleeSpeed { get; set; } = true; + + /// + /// Whether or not this should get melee size bonuses (Titan Glove) + /// Defaults to TRUE + /// + public virtual bool useMeleeSize { get; set; } = true; + /// + /// Array of three colors used for the built-in trail drawing code. + /// Defaults to White, Black, Green. + /// + public virtual Color[] trailColors { get; set; } = [Color.White, Color.Black, Color.Green]; + + /// + /// Whether or not to draw a trail when swung. + /// + public virtual bool drawSwordTrail { get; set; } = false; + /// + /// How far the trail should be offset from the center of the projectile. Use to draw trail at sword tip + /// Defaults to 25 + /// + public virtual float trailOffset { get; set; } = 25; + /// + /// Length of the trail in frames + /// Defaults to 25 + /// + public virtual int trailLength { get; set; } = 25; + + /// + /// How long before the weapon should begin it's actual swing once used + /// + public virtual int StartupTime { get; set; } = 0; + /// + /// How long the weapon should "cool down" after swinging before ending the item use + /// + public virtual int CooldownTime { get; set; } = 0; + /// + /// Speed at which the projectile should rotate to match the mouse angle during StartupTime. + /// Set to 0 to disable. + /// Defaults to 0.5f + /// + public virtual float RotateInStartup { get; set; } = 0.5f; + + #endregion + + #region Fields + + /// + /// Angle of the swing. By default, gets set to mouse angle. Can be set in Spawn(IEntitySource) for fixed angles. + /// + public Vector2 angle { get; set; } = Vector2.Zero; + /// + /// Internal timer for the projectile's entire lifespan + /// + public int timer { get; set; } = 0; + + /// + /// Internal timer for the projectile's swing animation + /// + internal int swingTimer = 0; + + public static Asset TrailTexture; + + public float baseScale; + /// + /// Old weapon scales used to track for trail drawing + /// + public List oldScale = new List(); + List oldProjectileRot = new List { }; + List oldProjectilePos = new List { }; + + internal int ExistsTime = 20; + public bool inStartup => timer < StartupTime; + + public bool inCooldown => timer > CooldownStartFrame; + + public bool inSwing => !(inStartup || inCooldown); + + public int CooldownStartFrame => swingTime + StartupTime; + + public int CooldownTimer => timer - CooldownStartFrame; + + public float StartupCompletion => timer / (float)StartupTime; + public float SwingCompletion => swingTimer / (float)swingTime; + public float CooldownCompletion => CooldownTimer / (float)CooldownTime; + + #endregion + + #region Overridable Methods + /// + /// Happens after movement but before timer increases. Use as to not cancel the default AI behavior. + /// + public virtual void AdditionalAI() { } + /// + /// happens after OnSpawn. Use as not to cancel the default OnSpawn behavior. + /// + /// + public virtual void Spawn(IEntitySource source) { } + /// + /// happens after SetDefaults. Use as not to cancel default SetDefaults behavior. + /// + public virtual void Defaults() { } + /// + /// Returns the swing offset from the center angle in radians. Automatically will be inverted if AlternateSwings is enabled. + /// + /// + public virtual float SwingFunction() + { + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth / 2, swingWidth / 2, swingTimer / (float)swingTime)); + } + + /// + /// The function for the width of the trail + /// + /// + /// + public virtual float trailWidth(float completion) + { + return MathHelper.Lerp(30, 0, completion); + } + + /// + /// The function for the color of the trail + /// + /// + /// + public virtual Color trailColor(float completion) + { + return Color.Black; + } + #endregion + + #region Overrides + public override void SetStaticDefaults() + { + ProjectileDestroyExceptionsList.List.Add(Projectile.type); + } + /// + /// DO NOT OVERRIDE IN MOST SITUATIONS + /// use Defaults() instead. + /// That will set defaults after everything is set in the base projectile. + /// + public override void SetDefaults() + { + Projectile.timeLeft = swingTime * 2; + if (UsesBaseItem) + { + Projectile.width = BaseItem.width; + Projectile.height = BaseItem.height; + } + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.localNPCHitCooldown = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.extraUpdates = 0; + Projectile.aiStyle = -2; + Projectile.DamageType = ModLoader.GetMod("CalamityMod").Find("TrueMeleeDamageClass"); + Projectile.tileCollide = false; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; + Defaults(); + + + } + /// + /// DO NOT OVERRIDE IN MOST SITUATIONS + /// use Spawn(IEntitySource) instead + /// That will run spawn code in the proper timing. + /// + public override void OnSpawn(IEntitySource source) + { + var player = Main.player[Projectile.owner]; + angle = (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One); + Projectile.velocity = Vector2.Zero; + if (angle.X < 0) + { + player.direction = 1; + Projectile.spriteDirection = 1 * (int)player.gravDir; + } + else + { + player.direction = -1; + Projectile.spriteDirection = -1 * (int)player.gravDir; + } + swingTime = Main.player[Projectile.owner].HeldItem.useTime; + Spawn(source); + if (useMeleeSpeed) + { + var speed = Main.player[Projectile.owner].GetAttackSpeed(); + if (speed > 3f) + speed = 3f; + + if (speed != 0f) + speed = 1f / speed; + + swingTime = (int)(swingTime * speed); + if (swingTime < 1) + { + swingTime = 1; + } + StartupTime = (int)(StartupTime * speed); + CooldownTime = (int)(CooldownTime * speed); + } + if (useMeleeSize) + { + if (player.meleeScaleGlove) Projectile.scale *= 1.1f; + Projectile.scale *= player.HeldItem.scale; + } + baseScale = Projectile.scale; + ExistsTime = swingTime + StartupTime + CooldownTime; + Projectile.timeLeft = ExistsTime * 2; + } + + /// + /// DO NOT OVERRIDE IN MOST SITUATIONS + /// use AdditionalAI() instead + /// That will run AI code at the right time. + /// + public override void AI() + { + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + float adust = MathHelper.ToRadians(45 + 180); + if (timer < StartupTime || timer > StartupTime + swingTime) + { + angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInStartup); + if (angle.X < 0) + { + player.direction = 1; + Projectile.spriteDirection = 1 * (int)player.gravDir; + } + else + { + player.direction = -1; + Projectile.spriteDirection = -1 * (int)player.gravDir; + } + } + if (Projectile.spriteDirection == -1) + { + adust = MathHelper.ToRadians(-45); + } + var armCenter = player.Center - new Vector2(5 * player.direction, 2); + if (AfterImageLength > 0) + { + oldProjectileRot.Add(Projectile.rotation); + oldProjectilePos.Add(Projectile.Center); + if (oldProjectileRot.Count > AfterImageLength) + { + oldProjectileRot.RemoveAt(0); + oldProjectilePos.RemoveAt(0); + } + } + var angle2 = (AlternateSwings && (modplayer.swingNum % 2 == 1 ? false : true) ? SwingFunction() : -SwingFunction()); + Projectile.Center = armCenter - (angle * OffsetDistance * (1 + (Projectile.scale - 1) * 0.75f)).RotatedBy(Projectile.spriteDirection * angle2); + Projectile.rotation = angle.RotatedBy(Projectile.spriteDirection * angle2).ToRotation() + adust; + AdditionalAI(); + + player.itemTime = ExistsTime + 1 - timer; + if (timer > ExistsTime) + { + Projectile.Kill(); + player.itemTime = 0; + } + timer++; + if (timer >= StartupTime && timer < StartupTime + swingTime) + { + swingTimer++; + } + var armDir = armCenter - Projectile.Center; + armDir.Y *= player.gravDir; + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, armDir.ToRotation() + MathHelper.ToRadians(90)); + oldScale.Insert(0, Projectile.scale); + } + public override bool PreDraw(ref Color lightColor) + { + + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + if (AfterImageLength > 0) + { + Texture2D texture = ModContent.Request(Texture).Value; + for (int i = 0; i < oldProjectileRot.Count; i++) + { + var col = Projectile.Opacity * (i / (float)AfterImageLength) * 0.1f; + if (Projectile.spriteDirection == 1) + { + Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, 1, SpriteEffects.None, 0); + } + else + { + Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, 1, SpriteEffects.FlipHorizontally, 0); + } + } + } + if (drawSwordTrail && timer >= StartupTime && timer <= StartupTime + swingTime) + { + Main.spriteBatch.EnterShaderRegion(); + if (TrailTexture == null) + { + TrailTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/VoronoiShapes", (AssetRequestMode)2); + } + Vector2 trailOffset = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2() + Projectile.Size * 0.5f; + GameShaders.Misc["CalamityMod:ExobladeSlash"].SetShaderTexture(TrailTexture); + + GameShaders.Misc["CalamityMod:ExobladeSlash"].UseColor(trailColors[0]); + + GameShaders.Misc["CalamityMod:ExobladeSlash"].UseSecondaryColor(trailColors[1]); + + GameShaders.Misc["CalamityMod:ExobladeSlash"].Shader.Parameters["fireColor"].SetValue(trailColors[2].ToVector3()); + + GameShaders.Misc["CalamityMod:ExobladeSlash"].Shader.Parameters["flipped"].SetValue((AlternateSwings && modplayer.swingNum % 2 == 1) ^ Projectile.spriteDirection == -1 ? false : true); + GameShaders.Misc["CalamityMod:ExobladeSlash"].Apply(); + + var positionsToUse = Projectile.oldPos.Take((int)MathHelper.Min(trailLength,swingTimer)).ToArray(); + for (var i = 0; i < positionsToUse.Length; i++) + { + if (i >= timer) break; + positionsToUse[i] += (Projectile.oldRot[i] - MathHelper.PiOver4 * (Projectile.spriteDirection == -1 ? 3 : 1)).ToRotationVector2() * this.trailOffset * oldScale[i]; + } + PrimitiveRenderer.RenderTrail(positionsToUse, new(trailWidth, trailColor, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 25); + Main.spriteBatch.ExitShaderRegion(); + + Main.player[Projectile.owner].heldProj = Projectile.whoAmI; + } + Main.player[Projectile.owner].heldProj = Projectile.whoAmI; + return true; + } + public override void ModifyDamageHitbox(ref Rectangle hitbox) + { + var center = hitbox.Center.ToVector2(); + hitbox.Height = (int)(Projectile.height * Projectile.scale); + hitbox.Width = (int)(Projectile.width * Projectile.scale); + hitbox.Location = (center - new Vector2(hitbox.Width / 2, hitbox.Height / 2)).ToPoint(); + + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = ((Main.player[Projectile.owner].DirectionTo(target.Center)).X >= 0 ? 1 : -1); + } + + public override bool? CanDamage() + { + return inSwing; + } + #endregion + + #region Helper Methods + /// + /// Spawns projectiles from the sword swing, automatically spacing them out on the if an amount is set. + /// + /// + /// Velocity of the projectile. Automatically converted into a Vector2 in the direction of swing. + /// The modifier from the source projectile's damage for this projectile + /// The amount of projectiles for the sword to shoot. If set, it will space out those projectiles evenly. If unset, will force a shot. + /// + /// + public void shootCheck(int type = 0, float velocity = 1, float damagemod = 1, int amount = 0, int negate = 0, int ai0 = 0) + { + if (negate == 0) + { + negate = Projectile.spriteDirection; + } + if (amount == 0) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation + negate * MathHelper.ToRadians(45 - negate * 90)).ToRotationVector2() * velocity, type, (int)(Projectile.damage * damagemod), Projectile.knockBack, Projectile.owner, ai0); + return; + } + amount += 1; + if (timer % (swingTime / amount) == 0 && timer > 0 && timer < swingTime - swingTime / amount / 2) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation + negate * MathHelper.ToRadians(45 - negate * 90)).ToRotationVector2() * velocity, type, (int)(Projectile.damage * damagemod), Projectile.knockBack, Projectile.owner, ai0); + } + } + + #endregion + } + +} diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index f89f8ea341..569a7b3921 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -132,7 +132,6 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.Opacity != 1f) return; - target.AddBuff(BuffID.OnFire, 360); target.AddBuff(BuffID.CursedInferno, 180); } diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 7328a7f6e0..6b95f59bbb 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -184,7 +184,6 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(BuffID.OnFire, 360); target.AddBuff(BuffID.CursedInferno, 180); } diff --git a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs index fabc0a19b7..2c7d2d2db3 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs @@ -49,13 +49,5 @@ namespace CalamityMod.Projectiles.Boss public override void PostAI() => Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f); public override bool CanHitPlayer(Player target) => CalamityUtils.CircularHitboxCollision(Projectile.Center, CurrentRadius * Projectile.scale * 0.4f, target.Hitbox) && Projectile.timeLeft > 6; - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.OnFire, 480); - } } } diff --git a/Projectiles/Boss/AresGaussNukeProjectileSpark.cs b/Projectiles/Boss/AresGaussNukeProjectileSpark.cs index dc29973504..c3bd6ab250 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileSpark.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileSpark.cs @@ -77,14 +77,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.OnFire, 180); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/AresPlasmaBolt.cs b/Projectiles/Boss/AresPlasmaBolt.cs index adba705b56..dc9c8a14e0 100644 --- a/Projectiles/Boss/AresPlasmaBolt.cs +++ b/Projectiles/Boss/AresPlasmaBolt.cs @@ -75,7 +75,6 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.Opacity != 1f) return; - target.AddBuff(BuffID.OnFire, 180); target.AddBuff(BuffID.CursedInferno, 90); } diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index c214b13881..e1611af3ba 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -131,7 +131,6 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.Opacity != 1f) return; - target.AddBuff(BuffID.OnFire, 360); target.AddBuff(BuffID.CursedInferno, 180); } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 4d91d08a39..9cbf6a12c9 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -19,6 +19,7 @@ using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; @@ -282,6 +283,8 @@ namespace CalamityMod.Projectiles /// public float UpdatePriority = 0f; + public int BloodstoneOrbValue = 0; + #region On Spawn public override void OnSpawn(Projectile projectile, IEntitySource source) @@ -4222,6 +4225,10 @@ namespace CalamityMod.Projectiles #region On Hit NPC public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) { + if (BloodstoneOrbValue > 0) + { + Projectile.NewProjectile(projectile.GetSource_OnHit(target), projectile.Center, projectile.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((projectile.velocity.Length() * projectile.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), BloodstoneOrbValue, 0f, Main.player[projectile.owner].whoAmI); + } // Hyperius Overflow if (projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && target.Calamity().hyperiusMarked) { diff --git a/Projectiles/Enemy/StormlionSentryBullet.cs b/Projectiles/Enemy/StormlionSentryBullet.cs new file mode 100644 index 0000000000..5802fe3a03 --- /dev/null +++ b/Projectiles/Enemy/StormlionSentryBullet.cs @@ -0,0 +1,64 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Enemy +{ + public class StormlionSentryBullet : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Enemy"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + Projectile.width = 8; + Projectile.height = 8; + Projectile.hostile = true; + Projectile.timeLeft = 160; + Projectile.extraUpdates = 6; + Projectile.tileCollide = true; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Lighting.AddLight(Projectile.Center, Effects.StormlionEffects.EnergyColor.ToVector3() * 0.3f); + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + if (Main.rand.NextBool()) + { + int dustStyle = ModContent.DustType(); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, dustStyle); + dust2.scale = Main.rand.NextFloat(0.4f, 0.7f); + dust2.velocity = Projectile.velocity * Main.rand.NextFloat(0.6f, 1f); + dust2.noGravity = true; + dust2.color = Effects.StormlionEffects.EnergyColor; + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + if (info.Damage <= 0) + return; + + target.AddBuff(ModContent.BuffType(), 60); + } + public override void OnKill(int timeLeft) + { + + } + public override bool PreDraw(ref Color lightColor) + { + Asset orb = ModContent.Request("CalamityMod/Particles/BloomCircle"); + + for (int i = 0; i < 4; i++) + { + Vector2 scale = Projectile.scale * new Vector2(0.2f, 1.4f) * (0.05f + i * 0.02f) * 4; + Main.EntitySpriteDraw(orb.Value, Projectile.Center - Main.screenPosition, null, Effects.StormlionEffects.EnergyColor with { A = 0 }, Projectile.rotation, orb.Size() * 0.5f, scale, SpriteEffects.None); + } + return false; + } + } +} diff --git a/Projectiles/Healing/BloodstoneHealOrb.cs b/Projectiles/Healing/BloodstoneHealOrb.cs new file mode 100644 index 0000000000..6edd4ff6f5 --- /dev/null +++ b/Projectiles/Healing/BloodstoneHealOrb.cs @@ -0,0 +1,131 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Healing +{ + public class BloodstoneHealOrb : ModProjectile, ILocalizedModType //Modified copy from SanguineHealOrb + { + public new string LocalizationCategory => "Projectiles.Healing"; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public int target = -1; + public ref int heal => ref Projectile.damage; + + public int spawnCooldown = 60; //how many frames must pass before it can be picked up + + public override void SetDefaults() + { + Projectile.width = 8; + Projectile.height = 8; + Projectile.ignoreWater = true; + Projectile.alpha = 255; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.extraUpdates = 3; + Projectile.timeLeft = 60 * 5 * Projectile.MaxUpdates; + spawnCooldown *= Projectile.MaxUpdates; + } + + public override void AI() + { + float particleSize = 0.9f + 0.15f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 60f * MathHelper.TwoPi); + if (Projectile.timeLeft <= 60) //Shrinks to nothing when projectile is nearing death + { + particleSize *= Projectile.timeLeft / 60f; + } + particleSize *= 8f; + Particle beam3 = new CustomSpark(Projectile.Center + Projectile.Size / 2f, -Projectile.velocity * 0.1f, "CalamityMod/Particles/PearlParticleGlow", false, 10, 0.05f * particleSize, Color.DarkRed, new Vector2(0.5f, 1), false, false, 0, false, false, 0f); + GeneralParticleHandler.SpawnParticle(beam3); + + if (false && Main.rand.NextBool(8)) + { + Particle beam4 = new CustomSpark(Projectile.Center + Projectile.Size / 2f, Projectile.velocity * 0.1f, "CalamityMod/Particles/WaterFoam", false, 5, 0.01f * particleSize, Color.Red, new Vector2(1f, 1), true, false, Main.rand.NextFloat(-10, 10), false, false, 0f); + GeneralParticleHandler.SpawnParticle(beam4); + } + Projectile.scale = MathHelper.Lerp(1, 1, 0.65f); + float maxDistance = 200f; + if (spawnCooldown > 0) + { + PassiveBehavior(); + spawnCooldown--; + return; + } + if (target < 0) + { + PassiveBehavior(); + if (Projectile.FinalExtraUpdate()) for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + if (player.lifeMagnet) + maxDistance *= 1.5f; //Heartreach gives 50% more range + float targetDist = Vector2.Distance(player.Center, Projectile.Center); + if (targetDist < maxDistance) + { + maxDistance = targetDist; + target = playerIndex; + } + } + } + else HealHome(); + } + + public void PassiveBehavior() + { + Projectile.velocity *= 0.99f; + } + + public void HealHome() + { + Player player = Main.player[target]; + Vector2 playerVector = player.Center - Projectile.Center; + float playerDist = playerVector.Length(); + if (playerDist < 50f && Projectile.position.X < player.position.X + player.width && Projectile.position.X + Projectile.width > player.position.X && Projectile.position.Y < player.position.Y + player.height && Projectile.position.Y + Projectile.height > player.position.Y) + { + Heal(player, heal); + Projectile.Kill(); + } + + Projectile.velocity = (Projectile.velocity * 5 + (playerVector.SafeNormalize(Vector2.Zero) * 5)) / 6f; //Move towards player. Range is determined in the AI(); + } + + public static void Heal(Player player, int PotionTime) + { + var cplayer = player.Calamity(); + if (player.potionDelay > 0) + { + player.potionDelay -= PotionTime; + if (player.potionDelay < 0) + player.potionDelay = 0; + if (player.HasBuff(BuffID.PotionSickness)) + { + for (var i = 0; i < player.buffType.Length; i++) + { + if (player.buffType[i] == BuffID.PotionSickness) + { + player.buffTime[i] = player.potionDelay; + } + } + } + } + else + { + player.lifeRegenTime += 3*PotionTime; //if Potion Sickness is full, each orb speeds up natural regen + } + + Particle ring = new CustomPulse(player.Center, Vector2.Zero, new Color(255, 32, 32)*0.75f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, 0, 0.01f, 0.05f, 20); + GeneralParticleHandler.SpawnParticle(ring); + } + + public override bool PreDraw(ref Color lightColor) + { + return false; + } + } +} diff --git a/Projectiles/Magic/SHPL.cs b/Projectiles/Magic/SHPL.cs index fcc39b155d..374445d84b 100644 --- a/Projectiles/Magic/SHPL.cs +++ b/Projectiles/Magic/SHPL.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Projectiles.Magic { Projectile.width = 5; Projectile.height = 5; + Projectile.scale = 2.5f; Projectile.friendly = true; Projectile.extraUpdates = 3; Projectile.timeLeft = 600; diff --git a/Projectiles/Magic/SHPS.cs b/Projectiles/Magic/SHPS.cs index 4f75a2c856..4b75bb5e05 100644 --- a/Projectiles/Magic/SHPS.cs +++ b/Projectiles/Magic/SHPS.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Magic private const float HomingRange = 560f; private NPC Target; - private Player ToBuff; private Projectile ToSuckTowards; public float RandomAnglingStrength = 0f; @@ -74,7 +73,6 @@ namespace CalamityMod.Projectiles.Magic if (p.type == ModContent.ProjectileType() && p.Colliding(p.Hitbox, Projectile.Hitbox)) { AIState = 2f; - ToBuff = Main.player[p.owner]; ToSuckTowards = p; break; } @@ -105,7 +103,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity = (Projectile.velocity * 15f + Utils.DirectionTo(Projectile.Center, ToSuckTowards.ModProjectile().TipPosition) * 15f) / 16f; if (Vector2.Distance(Projectile.Center, ToSuckTowards.ModProjectile().TipPosition) < 40f) { - // ToBuff.Calamity().whateverBuffName++; + ToSuckTowards.ModProjectile().SoulColors.Add(Projectile.ai[0]); Projectile.Kill(); } break; diff --git a/Projectiles/Magic/SHPV.cs b/Projectiles/Magic/SHPV.cs index 3b4b5d88e7..38e9ccdf43 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -1,13 +1,15 @@ using System; using System.Collections.Generic; -using System.Threading; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; +using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using ReLogic.Utilities; using Terraria; +using Terraria.Audio; using Terraria.GameContent; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic @@ -16,13 +18,33 @@ namespace CalamityMod.Projectiles.Magic { public new string LocalizationCategory => "Projectiles.Magic"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + private static Asset Smoke = ModContent.Request("CalamityMod/Particles/MediumMist"); + private static Asset SoulSquare = ModContent.Request("CalamityMod/Particles/Square"); private Player Owner => Main.player[Projectile.owner]; - private const float Size = 480f; - private const float Spread = MathHelper.Pi / 7.2f; // 25 degrees on each side, 50 degrees total - private static Vector2 Offset => new Vector2(27f, -10f); - public Vector2 TipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * 62f + Vector2.UnitY * Offset.Y; + private SlotId VacuumSound; + private const int VacuumStartFrames = 78; + private const int VacuumLoopFrames = 132; + private bool PlayedEndSound = false; public ref float Timer => ref Projectile.ai[0]; + + // The maximum distance in pixels out from the tip of the gun in which souls can be sucked in. + private const float Size = 480f; + // The spread of the suction on each side. 25 degrees on each side, 50 degrees total. + private const float Spread = MathHelper.Pi / 7.2f; + // Maximum number of souls per visual ring drawn on the gun. Additional souls get moved into additional rings. + private const int MaxSoulsRing = 10; + // Manual offset used for drawing the gun. + private static Vector2 Offset => new Vector2(27f, -10f); + // The position of the tip of the gun. Used for most projectile logic. + public Vector2 TipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * 62f + Vector2.UnitY * Offset.Y; + // A list containing the ai[0] values of each soul that is sucked in, used for determining the color to draw the soul as. + public List SoulColors = []; + // Tracks whether or not the gun should be doing the laser attack. + private bool FiringLasers = false; + // Allows for current soul color to be "consumed" every other laser shot. + private bool ConsumeSoul = false; + public override void SetDefaults() { Projectile.width = Projectile.height = 70; @@ -33,33 +55,92 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - if (Owner.CantUseHoldout(false) || !Owner.Calamity().mouseRight) + // Stop using the holdout if you cannot + if (Owner.CantUseHoldout(false)) { Projectile.Kill(); return; } + // Start sound + if (Timer == 0f) + VacuumSound = SoundEngine.PlaySound(SHPC.VacuumStart, Owner.Center); + // Move the vacuum sound on top of the player constantly + if (SoundEngine.TryGetActiveSound(VacuumSound, out var ChargeSound) && ChargeSound.IsPlaying) + ChargeSound.Position = Owner.Center; Timer++; - // Debug code used for assessing the visual and functional area of the vacuum - /*BloomLineVFX l = new(Owner.Center, Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(Spread) * Size, 0.4f, Color.Gray, 2, true); - BloomLineVFX l2 = new(Owner.Center, Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(-Spread) * Size, 0.4f, Color.Gray, 2, true); - GeneralParticleHandler.SpawnParticle(l); - GeneralParticleHandler.SpawnParticle(l2);*/ - - // Spawn faded smoke particles idly - if (Timer % 2 == 0f) + // If you release right click, use the laser attack + if (!Owner.Calamity().mouseRight) + FiringLasers = true; + if (FiringLasers) { - Vector2 spawn = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedByRandom(Spread) * Size * Main.rand.NextFloat(0.4f, 1f); - MediumMistParticle smoky = new(spawn, Utils.DirectionTo(spawn, TipPosition) * 4.5f, Color.Gray, Color.DarkGray, 1.25f, 96f); - GeneralParticleHandler.SpawnParticle(smoky); + // Vacuum end sound + if (!PlayedEndSound) + { + if (SoundEngine.TryGetActiveSound(VacuumSound, out var Vacuum)) + Vacuum?.Stop(); + VacuumSound = SoundEngine.PlaySound(SHPC.VacuumEnd, Owner.Center); + PlayedEndSound = true; + } + + if (SoulColors.Count > 0) + { + if (Timer % 5 == 0f) + { + if (Owner.HeldItem.ModItem is SHPC shpc && shpc.storedSoulpower > 0) + { + shpc.storedSoulpower--; + SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, Owner.Center); + Vector2 laserPos = TipPosition + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-7f, 7f); + Vector2 laserVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 20f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserPos, laserVel, ModContent.ProjectileType(), Projectile.damage, 3f, Projectile.owner, SoulColors[0]); + + if (ConsumeSoul) + SoulColors.RemoveAt(0); + ConsumeSoul = !ConsumeSoul; + } + else + SoulColors.Clear(); + } + } + } + else + { + // Debug code used for assessing the visual and functional area of the vacuum + /*BloomLineVFX l = new(Owner.Center, Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(Spread) * Size, 0.4f, Color.Gray, 2, true); + BloomLineVFX l2 = new(Owner.Center, Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(-Spread) * Size, 0.4f, Color.Gray, 2, true); + GeneralParticleHandler.SpawnParticle(l); + GeneralParticleHandler.SpawnParticle(l2);*/ + + // Spawn faded smoke particles idly + if (Timer % 2 == 0f) + { + Vector2 spawn = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedByRandom(Spread) * Size * Main.rand.NextFloat(0.4f, 1f); + MediumMistParticle smoky = new(spawn, Utils.DirectionTo(spawn, TipPosition) * 4.5f, Color.Gray, Color.DarkGray, 1.25f, 96f); + GeneralParticleHandler.SpawnParticle(smoky); + } + + // Vacuum loop sound + if ((Timer - VacuumStartFrames) % VacuumLoopFrames == 0) + VacuumSound = SoundEngine.PlaySound(SHPC.VacuumLoop, Owner.Center); } + // Typical held projectile shit Owner.heldProj = Projectile.whoAmI; Owner.ChangeDir(Math.Sign((Owner.Calamity().mouseWorld - Owner.Center).X)); Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, (Owner.Center - Owner.Calamity().mouseWorld).ToRotation() * Owner.gravDir + MathHelper.PiOver2); Projectile.rotation = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).ToRotation(); Projectile.velocity = Vector2.Zero; Projectile.Center = Owner.Center; + // This is used to make the projectile naturally despawn with a delay after running out of souls or if you stop firing with no souls + if (!FiringLasers || SoulColors.Count > 0) + Projectile.timeLeft = 50; + } + + public override void OnKill(int timeLeft) + { + if (SoundEngine.TryGetActiveSound(VacuumSound, out var ChargeSound)) + ChargeSound?.Stop(); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -72,28 +153,53 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - Rectangle frame = tex.Frame(1, 3, 0, Main.rand.Next(3)); + // Draw spiraling smoke particles representing the suction radius Vector2 farthestPos = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * Size; float rotation = Utils.DirectionTo(TipPosition, farthestPos).ToRotation(); + if (!FiringLasers) + { + Texture2D tex = Smoke.Value; + Rectangle frame = tex.Frame(1, 3, 0, Main.rand.Next(3)); - Main.spriteBatch.SetBlendState(BlendState.Additive); - for (int i = 0; i < 6; i++) - { - for (int j = 0; j < 3; j++) + Main.spriteBatch.SetBlendState(BlendState.Additive); + for (int i = 0; i < 6; i++) { - float distRatio = 1f - (Main.GameUpdateCount + j * 10) % 30 / 30f; - Vector2 posOffset = new Vector2(MathF.Sin(MathHelper.TwoPi / 6f * i) * 25f * distRatio, MathF.Cos(Main.GameUpdateCount * MathHelper.Pi / 30f + MathHelper.TwoPi / 6f * i) * 160f * distRatio).RotatedBy(rotation); - float colorMult = 0.5f * Utils.GetLerpValue(1f, 0.8f, distRatio, true); - Main.EntitySpriteDraw(tex, Vector2.Lerp(TipPosition, farthestPos, distRatio) + posOffset - Main.screenPosition, frame, Color.Gray * colorMult, rotation + MathHelper.Pi, frame.Size() / 2f, 1.5f * distRatio, SpriteEffects.None); + // There are 3 separate streams offset from one another + for (int j = 0; j < 3; j++) + { + float distRatio = 1f - (Main.GameUpdateCount + j * 10) % 30 / 30f; + Vector2 posOffset = new Vector2(MathF.Sin(MathHelper.TwoPi / 6f * i) * 25f * distRatio, MathF.Cos(Main.GameUpdateCount * MathHelper.Pi / 30f + MathHelper.TwoPi / 6f * i) * 160f * distRatio).RotatedBy(rotation); + float colorMult = 0.5f * Utils.GetLerpValue(1f, 0.8f, distRatio, true); + Main.EntitySpriteDraw(tex, Vector2.Lerp(TipPosition, farthestPos, distRatio) + posOffset - Main.screenPosition, frame, Color.Gray * colorMult, rotation + MathHelper.Pi, frame.Size() / 2f, 1.5f * distRatio, SpriteEffects.None); + } } + Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); } - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); + // Manually draw the gun itself Texture2D shpc = TextureAssets.Item[ModContent.ItemType()].Value; Vector2 position = Owner.Center - Main.screenPosition + Vector2.UnitX.RotatedBy(rotation) * Offset.X + Vector2.UnitY * Offset.Y; SpriteEffects sp = Owner.Calamity().mouseWorld.X < Owner.Center.X ? SpriteEffects.FlipVertically : SpriteEffects.None; Main.EntitySpriteDraw(shpc, position, null, lightColor, rotation, shpc.Size() / 2f, 1f, sp); + + // Draw souls around the gun as a sort of indicator of how many you have sucked in + if (SoulColors.Count > 0) + { + Texture2D sq = SoulSquare.Value; + for (int i = 0; i < SoulColors.Count; i++) + { + int soulsInRing = SoulColors.Count > MaxSoulsRing ? (SoulColors.Count - i > SoulColors.Count % MaxSoulsRing ? MaxSoulsRing : SoulColors.Count % MaxSoulsRing) : SoulColors.Count; + // Souls past 10 get moved into additional rings + int ringsBack = i / MaxSoulsRing; + Vector2 soulPosition = Projectile.Center + Vector2.UnitX.RotatedBy(rotation) * (68f - (ringsBack * 9f)) + Vector2.UnitY * -12.5f; + Vector2 posOffset = new Vector2(MathF.Sin(Main.GameUpdateCount * MathHelper.Pi / 30f + MathHelper.TwoPi / soulsInRing * (i % MaxSoulsRing)) * 3f, MathF.Cos(Main.GameUpdateCount * MathHelper.Pi / 30f + MathHelper.TwoPi / soulsInRing * (i % MaxSoulsRing)) * 25f).RotatedBy(rotation); + + // Makes the souls disappear when they go "behind" the gun + bool shouldDraw = posOffset.RotatedBy(-rotation).X <= 2.7f; + if (shouldDraw) + Main.EntitySpriteDraw(sq, soulPosition + posOffset - Main.screenPosition, null, SHPB.FindColorForSoul((int)SoulColors[i]), 0f, sq.Size() / 2f, 1f, SpriteEffects.None); + } + } return false; } } diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 4926c62ddd..2f9ddfab3f 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -2,7 +2,11 @@ using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -13,10 +17,8 @@ namespace CalamityMod.Projectiles.Magic public class SanguineFlareProj : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - private int x; - private double speed = 10; - private float startSpeedY = 0f; - + public bool beingChanneled = true; + public float dmgMult = 1; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 4; @@ -25,48 +27,74 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = 30; + Projectile.height = 30; Projectile.friendly = true; Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.timeLeft = 600; Projectile.alpha = 255; Projectile.DamageType = DamageClass.Magic; + Projectile.extraUpdates = 19; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - Lighting.AddLight(Projectile.Center, 1f, 0f, 0f); - if (Projectile.localAI[0] == 0f) + var player = Main.player[Projectile.owner]; + if (beingChanneled && player.channel) { - Projectile.velocity.X = Projectile.velocity.X + (Main.player[Projectile.owner].velocity.X * 0.5f); - startSpeedY = Projectile.velocity.Y + (Main.player[Projectile.owner].velocity.Y * 0.5f); - Projectile.velocity.Y = startSpeedY; - } - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] >= 180f) + Projectile.velocity = Vector2.Zero; + Projectile.timeLeft = 300 * Projectile.MaxUpdates; + if (Projectile.FinalExtraUpdate()) + { + player.itemTime = 15; + player.SetItemAnimation(15); + var dir = player.Center.DirectionTo(player.ClampedMouseWorld()) * 64; + player.direction = dir.X >= 0 ? 1 : -1; + Projectile.direction = player.direction; + player.itemRotation = (dir * player.direction).ToRotation(); + Projectile.Center = player.Center + player.Center.DirectionTo(player.ClampedMouseWorld()) * 64; + dmgMult *= 1.009f; + if (dmgMult >= 5f) + { + dmgMult = 5f; + player.channel = false; + } + + } + + } else { - x++; - speed += 0.1; - Projectile.velocity.Y = startSpeedY + (float)(speed * Math.Sin(x / 4)); - } - Projectile.rotation += Projectile.velocity.Y * 0.02f; - Projectile.alpha -= 5; - if (Projectile.alpha < 30) - { - Projectile.alpha = 30; + if (beingChanneled) + { + Projectile.damage = (int)(Projectile.damage * dmgMult); + Projectile.velocity = player.MountedCenter.DirectionTo(player.ClampedMouseWorld())*4; + Projectile.extraUpdates = 19; + beingChanneled = false; + } + + float particleSize = (dmgMult * 5 + 5)/2f; + Particle beam3 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.1f, "CalamityMod/Particles/PearlParticleGlow", false, 10, 0.05f * particleSize, Color.DarkRed, new Vector2(0.5f, 1), false, false, 0, false, false, 0f); + GeneralParticleHandler.SpawnParticle(beam3); + + if (Main.rand.NextBool(8)) + { + Particle beam4 = new CustomSpark(Projectile.Center, Projectile.velocity * 0.1f, "CalamityMod/Particles/WaterFoam", false, 5, 0.01f * particleSize, Color.Red, new Vector2(1f, 1), true, false, Main.rand.NextFloat(-10, 10), false, false, 0f); + GeneralParticleHandler.SpawnParticle(beam4); + } } } - public override Color? GetAlpha(Color lightColor) + public override bool? CanDamage() { - return new Color(200, 60, 60, Projectile.alpha); + return !beingChanneled; } - public override void OnKill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + SoundStyle hitSound = new("CalamityMod/Sounds/NPCKilled/PerfLargeDeath"); + SoundEngine.PlaySound(hitSound with { Volume = 0.5f }, Projectile.Center); Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); Projectile.width = 10; @@ -95,23 +123,63 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 60); - - int heal = (int)Math.Round(hit.Damage * 0.025); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) + target.AddBuff(ModContent.BuffType(), 360); + if (beingChanneled || Projectile.penetrate == -1) return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + var player = Main.player[Projectile.owner]; + float orbCount = MathHelper.Lerp(0, 20, (dmgMult-1) / 4f); + for (var i = 0; i < orbCount; i++) + { + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, Projectile.velocity.RotatedByRandom(1) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, player.whoAmI); + } + if (dmgMult > 1) + { + Projectile.position = Projectile.Center; + Projectile.Size *= dmgMult * 1.5f; + Projectile.Center = Projectile.position; + Projectile.penetrate = -1; + Projectile.extraUpdates = 0; + Projectile.timeLeft = 2; + Projectile.velocity *= 0; + Projectile.damage /= 2; + Particle bloodsplosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed*0.75f, "CalamityMod/Particles/DetailedExplosion", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.16f*dmgMult/5f, 0.87f * dmgMult / 5f, (int)(40 * 0.38f), false); + GeneralParticleHandler.SpawnParticle(bloodsplosion); + Particle bloodsplosion2 = new CustomPulse(Projectile.Center, Vector2.Zero, new Color(255, 32, 32)*0.5f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.03f * dmgMult / 5f, 0.155f * dmgMult / 5f, 40); + GeneralParticleHandler.SpawnParticle(bloodsplosion2); + } } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + if (beingChanneled) + { + + Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value; + for (int i = 0; i < 1; i++) + { + //Photoviscerator drawcode, edited slightly + Color color = Color.DarkRed * (dmgMult/5f); + color.A = 0; + Vector2 drawPosition = Projectile.oldPos[i]+Projectile.Size /2f + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY) + new Vector2(-32.5f, -32.5f); //Last vector is to offset the circle so that it is displayed where the hitbox actually is, instead of a bit down and to the right. + Color outerColor = color; + Color innerColor = color * 0.5f; + float intensity = 0.9f + 0.15f * (float)Math.Cos(dmgMult * MathHelper.TwoPi); + intensity *= MathHelper.Lerp(0.15f, 1f, 1f - i / (float)Projectile.oldPos.Length); + if (Projectile.timeLeft <= 60) //Shrinks to nothing when projectile is nearing death + { + intensity *= Projectile.timeLeft / 60f; + } + // Become smaller the futher along the old positions we are. + Vector2 outerScale = new Vector2(1f) * Projectile.scale * intensity; + Vector2 innerScale = new Vector2(1f) * Projectile.scale * intensity * 0.7f; + outerColor *= intensity; + innerColor *= intensity; + Main.EntitySpriteDraw(lightTexture, drawPosition, null, outerColor, 0f, lightTexture.Size() * 0.5f, outerScale * 1.25f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(lightTexture, drawPosition, null, innerColor, 0f, lightTexture.Size() * 0.5f, innerScale * 1.25f, SpriteEffects.None, 0); + } + } return false; } } diff --git a/Projectiles/Magic/VisceraBeam.cs b/Projectiles/Magic/VisceraBeam.cs index b0194dba22..636c4f426f 100644 --- a/Projectiles/Magic/VisceraBeam.cs +++ b/Projectiles/Magic/VisceraBeam.cs @@ -10,6 +10,7 @@ using Terraria.Audio; using CalamityMod.Balancing; using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Projectiles.Healing; namespace CalamityMod.Projectiles.Magic { @@ -93,15 +94,13 @@ namespace CalamityMod.Projectiles.Magic dust.noGravity = true; } } + if (Projectile.ai[2] < 1){ + for (int i = 0; i < 2; i++) { + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedByRandom(0.5f) * Main.rand.NextFloat(3, 5), ModContent.ProjectileType(), 5, 0f, Projectile.owner); + } + Projectile.ai[2]++; + } - int heal = (int)Math.Round(hit.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); } public override void AI() diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index de43a94052..bb20ec193c 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -10,6 +10,9 @@ namespace CalamityMod.Projectiles.Melee public class GelWave : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; + + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/GeliticBladeWave"); + public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 10; @@ -34,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee { if (Projectile.localAI[0] == 0f) { - SoundEngine.PlaySound(SoundID.Item92, Projectile.position); + SoundEngine.PlaySound(UseSound with { Volume = 3f, PitchVariance = 0.25f }, Projectile.position); Projectile.localAI[0] += 1f; } Lighting.AddLight(Projectile.Center, Color.Blue.ToVector3()); diff --git a/Projectiles/Melee/SaharaSlicersBolt.cs b/Projectiles/Melee/SaharaSlicersBolt.cs index 3304c67806..6628ec23f1 100644 --- a/Projectiles/Melee/SaharaSlicersBolt.cs +++ b/Projectiles/Melee/SaharaSlicersBolt.cs @@ -1,8 +1,9 @@ -using System; -using CalamityMod.Particles; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -35,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee { Player Owner = Main.player[Projectile.owner]; float playerDist = Vector2.Distance(Owner.Center, Projectile.Center); + Projectile.ai[2]++; // Shot Mode if (Projectile.ai[0] == 1) @@ -102,7 +104,28 @@ namespace CalamityMod.Projectiles.Melee { if (Projectile.ai[0] == 1) CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return true; + Vector2 scale = new Vector2(Projectile.scale); + // Squishy fade in. This does not occur if the slicer is instantly thrown + if (Projectile.ai[0] == 0) + { + int endStretch = 4; + int endSquash = 8; + Vector2 stretch = new Vector2(0.8f, 1.6f); + if (Projectile.ai[2] < endStretch) + { + float completion = Utils.GetLerpValue(0, endStretch, Projectile.ai[2], true); + scale.X = MathHelper.Lerp(1.8f, stretch.X, completion); + scale.Y = MathHelper.Lerp(0.3f, stretch.Y, completion); + } + else + { + float completion = Utils.GetLerpValue(0, endSquash, Projectile.ai[2], true); + scale.X = MathHelper.Lerp(stretch.X, 1f, completion); + scale.Y = MathHelper.Lerp(stretch.Y, 1f, completion); + } + } + Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, TextureAssets.Projectile[Type].Size() / 2, scale, SpriteEffects.None); + return false; } public override bool? CanDamage() => Projectile.ai[0] == 1 ? true : false; } diff --git a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs new file mode 100644 index 0000000000..4a86c09dd1 --- /dev/null +++ b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Healing; +using Terraria.Audio; +using Terraria.IO; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; + +namespace CalamityMod.Projectiles.Melee +{ + public class MutilatorSwordProj : BaseSwordHoldoutProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override int swingWidth => 180; + public override string Texture => ModContent.GetModItem(BaseItem.type).Texture; + public override Item BaseItem => ModContent.GetModItem(ModContent.ItemType()).Item; + public override int AfterImageLength => 5; + public override int OffsetDistance => 60; + public override bool drawSwordTrail => true; + public override Color[] trailColors => [Color.Red, Color.DarkRed, Color.Gold]; + + public override float trailOffset => 20; + + public override float trailWidth(float completion) + { + return base.trailWidth(completion); + } + + public override int trailLength => 5; + + public override int StartupTime { get; set; } + public override int CooldownTime { get; set; } + + public bool hasGivenBlood = false; + + public override void Spawn(IEntitySource source) + { + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + StartupTime = 15; + CooldownTime = 5; + swingTime -= StartupTime + CooldownTime; + modplayer.swingNum = 0; + } + + public override void AdditionalAI() + { + if (inStartup) + { + Projectile.scale = baseScale * MathHelper.Lerp(0.5f, 1, 1 - MathF.Pow(1 - StartupCompletion, 2f)); + } else if (inCooldown) + { + Projectile.scale = baseScale * MathHelper.Lerp(1,0.5f,MathF.Pow(CooldownCompletion,2)); + } else + Projectile.scale = baseScale * Math.Min(MathHelper.SmoothStep(1, 2, SwingCompletion), MathHelper.SmoothStep(2, 1, SwingCompletion)); + } + + public override float SwingFunction() + { + if (inStartup) + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * 0.5f, -swingWidth * 0.75f, 1-MathF.Pow(1-StartupCompletion,2f))); + if (inCooldown) + return MathHelper.ToRadians(MathHelper.SmoothStep(swingWidth * 0.25f, swingWidth * 0.33f, CooldownCompletion)); + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth *0.75f, swingWidth *0.25f, SwingCompletion)); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 60); + var player = Main.player[Projectile.owner]; + var item = player.HeldItem; + if (item.type != ModContent.ItemType()) + { + Projectile.Kill(); + return; + } + var modItem = item.ModItem as TheMutilator; + if (!hasGivenBlood) + { + modItem.Charge++; + hasGivenBlood = true; + if (modItem.Charge > TheMutilator.MaximumCharge) + { + modItem.Charge = 0; + int orbAmount = 30; + if (orbAmount > 0) + { + float spreadAmount = MathHelper.ToRadians(360); + for (var i = 0; i < orbAmount; i++) + { + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), target.Center, -angle.RotatedByRandom(spreadAmount) * 3.5f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 22, 0f, player.whoAmI); + + } + Particle bloodsplosion2 = new CustomPulse(target.Center, Vector2.Zero, new Color(255, 32, 32) * 0.75f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.03f, 0.155f, 40); + GeneralParticleHandler.SpawnParticle(bloodsplosion2); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BloodPactCrit") { Volume = 0.5f }, player.Center); + } + } + modItem.DecayTimer = 180; + } + } + } +} diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index af3ed087d8..5a1869b20e 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -7,6 +7,7 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Projectiles.Healing; namespace CalamityMod.Projectiles.Ranged { @@ -195,19 +196,9 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.Hitbox.Intersects(player.Hitbox)) { - if (!Main.player[Projectile.owner].moonLeech) + if (improvedHeal) { - int bonusHeal = Main.rand.NextBool(3) ? 5 : 3; - int heal = improvedHeal ? bonusHeal : 2; - - if (Main.LocalPlayer.lifeSteal <= 0f) - { - Projectile.Kill(); - return; - } - - Main.LocalPlayer.lifeSteal -= heal; - player.HealPlayer(heal); + BloodstoneHealOrb.Heal(player, 8); } Projectile.Kill(); diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 5c271827d0..4ccc6336d3 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -18,6 +18,9 @@ namespace CalamityMod.Projectiles.Ranged { public new string LocalizationCategory => "Projectiles.Ranged"; + //Used by Arterial Assault + public bool DisableEffects = false; + public override string Texture => "CalamityMod/Items/Ammo/BloodfireArrow"; public override void SetStaticDefaults() @@ -47,14 +50,22 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.localAI[0] == 0) { - Projectile.damage = (int)(Projectile.damage * 1.3f); // damage boost - player.statLife -= 1; - if (player.statLife <= 0) + if (DisableEffects) { - PlayerDeathReason pdr = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BloodFireArrow" + Main.rand.Next(1, 2 + 1)).ToNetworkText(player.name)); - player.KillMe(pdr, 1000.0, 0, false); + + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 9; + } else + { + Projectile.damage = (int)(Projectile.damage * 1.3f); // damage boost + player.statLife -= 1; + if (player.statLife <= 0) + { + PlayerDeathReason pdr = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BloodFireArrow" + Main.rand.Next(1, 2 + 1)).ToNetworkText(player.name)); + player.KillMe(pdr, 1000.0, 0, false); + } + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 9; } - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 9; + } Player Owner = Main.player[Projectile.owner]; @@ -101,6 +112,8 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + if (DisableEffects) + return; Player player = Main.player[Projectile.owner]; player.lifeRegenTime += 2; diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs deleted file mode 100644 index d37c4265a0..0000000000 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ /dev/null @@ -1,77 +0,0 @@ -using CalamityMod.Balancing; -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class ClaretCannonProj : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 10; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.friendly = true; - Projectile.alpha = 255; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; - Projectile.aiStyle = ProjAIStyleID.Arrow; - AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); - SoundEngine.PlaySound(SoundID.Dig, Projectile.position); - return true; - } - - public override void OnKill(int timeLeft) - { - for (int k = 0; k < 2; k++) - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.oldVelocity.X * 0.15f, Projectile.oldVelocity.Y * 0.15f); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - - int heal = (int)Math.Round(hit.Damage * 0.02); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - } -} diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 4884fc3f27..090ef8dd38 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -6,6 +6,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; +using System.Reflection.Metadata; +using Terraria.Audio; namespace CalamityMod.Projectiles.Rogue { public class BloodsoakedCrashax : ModProjectile, ILocalizedModType @@ -109,7 +113,7 @@ namespace CalamityMod.Projectiles.Rogue int projID = ModContent.ProjectileType(); int bloodDamage = Projectile.damage; float bloodKB = 1f; - int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, projID, bloodDamage, bloodKB, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); + int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi)*4f, projID, bloodDamage, bloodKB, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].DamageType = RogueDamageClass.Instance; @@ -117,14 +121,16 @@ namespace CalamityMod.Projectiles.Rogue } } - int heal = (int)Math.Round(damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; + float orbAmount = Projectile.Calamity().stealthStrike ? 3 : Projectile.penetrate % 2; + if (orbAmount > 0) + { + float spreadAmount = MathHelper.ToRadians(360); + for (var i = 0; i < orbAmount; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, Projectile.owner); - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + } + } } public override bool PreDraw(ref Color lightColor) //afterimages diff --git a/Projectiles/Summon/BloodSpit.cs b/Projectiles/Summon/BloodSpit.cs index 1a0908f86e..89167493d4 100644 --- a/Projectiles/Summon/BloodSpit.cs +++ b/Projectiles/Summon/BloodSpit.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 6; Projectile.DamageType = DamageClass.Summon; + Projectile.Calamity().BloodstoneOrbValue = 20; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. } public override void AI() @@ -49,15 +50,6 @@ namespace CalamityMod.Projectiles.Summon blood.velocity = Main.rand.NextVector2Circular(1f, 2f); blood.noGravity = true; } - - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); } } } diff --git a/Projectiles/Typeless/AmuletEnergy.cs b/Projectiles/Typeless/AmuletEnergy.cs index f6fd3a19e5..9a4334d8a3 100644 --- a/Projectiles/Typeless/AmuletEnergy.cs +++ b/Projectiles/Typeless/AmuletEnergy.cs @@ -116,11 +116,11 @@ namespace CalamityMod.Projectiles.Typeless float offsetPower = Utils.GetLerpValue(1, 5, Owner.velocity.Length(), true); float sine = (float)Math.Sin((time * 0.1f) / MathHelper.Pi); float sine2 = (float)Math.Sin((time * 0.04f) / MathHelper.Pi); - Vector2 bonusMobility = (offsetPower > 0 ? ((Utils.DirectionTo(Projectile.Center, Owner.Center) * 50) * sine2).RotatedBy(0.8f * sine) * offsetPower : Vector2.Zero); - Vector2 goalPosition = Owner.MountedCenter + bonusMobility + ((MathHelper.TwoPi * energyNumber) / Math.Max(Owner.ownedProjectileCounts[ModContent.ProjectileType()], 1)).ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly * 0.4f) * 80; + Vector2 bonusMobility = (offsetPower > 0 ? ((Utils.DirectionTo(Projectile.Center, Owner.Center) * 90) * sine2).RotatedBy(0.8f * sine) * offsetPower : Vector2.Zero); + Vector2 goalPosition = Owner.MountedCenter + bonusMobility + ((MathHelper.TwoPi * energyNumber) / Math.Max(Owner.ownedProjectileCounts[ModContent.ProjectileType()], 1)).ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly * 0.4f) * 20; - bool outOfRange = Utils.Distance(Projectile.Center, goalPosition) > 100; - if (Projectile.velocity.Length() < 5 && outOfRange) + bool outOfRange = Utils.Distance(Projectile.Center, goalPosition) > 60; + if (Projectile.velocity.Length() < 6 && outOfRange) Projectile.velocity = Projectile.velocity * 0.995f + Utils.DirectionTo(Projectile.Center, goalPosition) * homingSpeed; else if (outOfRange) Projectile.velocity *= 0.985f; @@ -211,7 +211,7 @@ namespace CalamityMod.Projectiles.Typeless GeneralParticleHandler.SpawnParticle(fadeInfx); } - Projectile.scale = MathHelper.Lerp(Projectile.scale, spoke ? 1.4f : 1, 0.1f); + Projectile.scale = MathHelper.Lerp(Projectile.scale, spoke ? 0.9f : 0.5f, 0.1f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; time++; } @@ -228,7 +228,7 @@ namespace CalamityMod.Projectiles.Typeless { float variance = Main.rand.NextFloat(-0.5f, 0.5f); Vector2 vel = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * 4; - float scale = (Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance)) * 0.35f; + float scale = (Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance)) * 0.35f * Projectile.scale; Particle sparks = new CustomSpark(Projectile.Center + vel, vel, "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(13, 16 + 1), scale, bColor * 0.7f, new Vector2(1f, 1), true, false, 0, false, shrinkSpeed: 0.25f); GeneralParticleHandler.SpawnParticle(sparks); diff --git a/Projectiles/Typeless/ClaretCannonProj.cs b/Projectiles/Typeless/ClaretCannonProj.cs new file mode 100644 index 0000000000..9866a37afc --- /dev/null +++ b/Projectiles/Typeless/ClaretCannonProj.cs @@ -0,0 +1,81 @@ +using CalamityMod.Balancing; +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Typeless; +using CalamityMod.Projectiles.Healing; +using CalamityMod.Particles; + +namespace CalamityMod.Projectiles.Typeless +{ + public class ClaretCannonProj : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + + public override void SetDefaults() + { + Projectile.width = 14; + Projectile.height = 14; + Projectile.friendly = true; + Projectile.alpha = 0; + Projectile.penetrate = 1; + Projectile.timeLeft = 600; + Projectile.DamageType = AverageDamageClass.Instance; + Projectile.extraUpdates = 1; + Projectile.aiStyle = 0; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + SoundEngine.PlaySound(SoundID.Dig, Projectile.position); + return true; + } + + public override void OnKill(int timeLeft) + { + if (Projectile.penetrate != -1) + return; + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCKilled/PerfLargeDeath") { Volume = 0.5f }, Projectile.Center); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BloodPactCrit") { Volume = 0.5f }, Projectile.Center); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), ClaretCannon.ClaretCooldownMax); + target.AddBuff(BuffID.BetsysCurse, ClaretCannon.ClaretCooldownMax*2); + if (Projectile.penetrate == -1) + return; + var player = Main.player[Projectile.owner]; + float orbCount = 20; + for (var i = 0; i < orbCount; i++) + { + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedByRandom(1) * Main.rand.NextFloat(2.75f, 5.25f), ModContent.ProjectileType(), 20, 0f, player.whoAmI); + } + Projectile.position = Projectile.Center; + Projectile.Size = new Vector2(352); + Projectile.Center = Projectile.position; + Projectile.penetrate = -1; + Projectile.extraUpdates = 0; + Projectile.timeLeft = 2; + Projectile.velocity *= 0; + Projectile.damage /= 2; + float particleScale = 8f; + Particle bloodsplosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DarkRed, "CalamityMod/Particles/DetailedExplosion", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.16f*particleScale/5f, 0.87f * particleScale / 5f, (int)(40 * 0.38f), false); + GeneralParticleHandler.SpawnParticle(bloodsplosion); + Particle bloodsplosion2 = new CustomPulse(Projectile.Center, Vector2.Zero, new Color(255, 32, 32), "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.03f * particleScale / 5f, 0.155f * particleScale / 5f, 40); + GeneralParticleHandler.SpawnParticle(bloodsplosion2); + } + } +} diff --git a/Projectiles/Ranged/ClaretCannonProj.png b/Projectiles/Typeless/ClaretCannonProj.png similarity index 100% rename from Projectiles/Ranged/ClaretCannonProj.png rename to Projectiles/Typeless/ClaretCannonProj.png diff --git a/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs b/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs new file mode 100644 index 0000000000..902165ffad --- /dev/null +++ b/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs @@ -0,0 +1,631 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class DiamondOfTheDeepProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + public Color bColor = Color.White; // Shifting color, used for most effects + public Color color1 = Color.White; + public Color color2 = Color.White; + public bool canDamage = false; + public bool visuals => Owner.Calamity().dOfTheDeepVisual; // Enables/disables visuals and sounds based on accessory visibility + public ref float time => ref Projectile.ai[0]; + public ref float energyNumber => ref Projectile.ai[1]; // The number assigned to this energy, ranging from 1 to the max number of projectiles + public bool idle => Projectile.ai[2] == 0; // Floating around the player + public bool healing = false; // If the projectiles should heal the player. If false they will attack + public NPC targeted; // Chosen target to home into + public int hitCooldown = 0; // Only for VOID, time after hit that it turns around before another hit + public ref float projType => ref Projectile.localAI[2]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.NoLiquidDistortion[Type] = true; + } + public override void SetDefaults() + { + Projectile.width = Projectile.height = 30; + Projectile.ignoreWater = true; + Projectile.timeLeft = 600; + Projectile.tileCollide = false; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.extraUpdates = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + // Hello, if you're trying to use code from this thing + // DO NOT + // It's very messy and confusing, because it was coded in pieces over the course of months with various levels of skill + // If I ever make another thing like this it will most certainly be 3 seperate projectiles, or at least use AIState instead + public override void AI() + { + Vector2 velocity = Projectile.velocity; + int startTime = (projType == 0 ? 70 : projType == 1 ? 140 : 210) + 15; // Time after launch when it will begin attacking/healing + int endTime = 320; // Time after launch when it's movement code reaches it's cap on strength + + #region Color Shifting + if (time == 0 && idle) + { + switch (projType) // 0 = gravel/vines, 1 = hadal/hydrothermic, 2 = void/lumenyl + { + case 0: + { + color1 = Color.MediumSeaGreen; + color2 = Color.DarkSlateGray; + break; + } + case 1: + { + color1 = Color.DarkRed; + color2 = Color.OrangeRed; + break; + } + case 2: + { + color1 = Color.MediumBlue; + color2 = Color.DodgerBlue; + break; + } + } + } + + float rate = Main.GlobalTimeWrappedHourly * 5; + List eColors = new List() + { + color1, + color2 + }; + + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + bColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + #endregion + + if (idle || time < startTime) // If not attacking/healing keep it alive + Projectile.timeLeft++; + + if (Owner.dead || !Owner.Calamity().dOfTheDeep) + Projectile.Kill(); + + if (Utils.Distance(Owner.Center, Projectile.Center) > 1100) // If it's too far away either teleport to the player if idle (or kill it if needed) + { + if (idle) + Projectile.Center = Owner.Center; + else if (targeted == null && !healing) + Projectile.Kill(); + } + + // Emit some light + Lighting.AddLight(Projectile.Center, bColor.ToVector3() * 1.5f); + + #region Dust Trails + float velLerp = Utils.GetLerpValue(-1.5f, 3f, Projectile.velocity.Length(), true); + if (projType == 0 && visuals) + { + if (Main.rand.NextBool((int)(14 - 5 * velLerp))) + { + Dust c = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(6, 6) * Projectile.scale + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 15, ModContent.DustType()); + c.velocity = -Projectile.velocity * Main.rand.NextFloat(0.3f, 1f) * velLerp; + c.scale = Main.rand.NextFloat(1f, 1.3f) * velLerp; + c.noGravity = true; + c.color = Main.rand.NextBool() ? Color.Aquamarine : bColor; + c.noLightEmittence = true; + c.fadeIn = 1; + c.alpha = 100; + } + } + if (projType == 1 && visuals) + { + if (Main.rand.NextBool((int)(10 - 5 * velLerp))) + { + Dust c = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 15, ModContent.DustType()); + c.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.6f, 1.3f) * velLerp; + c.scale = Main.rand.NextFloat(1.2f, 1.5f) * velLerp; + c.noGravity = true; + c.color = bColor; + c.noLightEmittence = true; + c.noGravity = !Main.rand.NextBool(3); + } + } + if (projType == 2 && visuals) + { + if (Main.rand.NextBool((int)(3 - velLerp))) + { + Dust c = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(6, 6) * Projectile.scale + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 15, ModContent.DustType()); + c.velocity = -Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(1.4f, 3.5f) * velLerp; + c.scale = Main.rand.NextFloat(1.8f, 2.3f) * velLerp; + c.noGravity = true; + c.color = bColor; + c.noLightEmittence = true; + c.fadeIn = 2.3f; + } + } + #endregion + + if (idle) // Following Ai + { + if (time == 0 && visuals) // On spawn fx + { + for (int i = 0; i <= 10; i++) + { + float variance = Main.rand.NextFloat(-0.5f, 0.5f); + Vector2 vel = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 7).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * 2; + float scale = (Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance)) * 0.35f; + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), vel); + dust2.scale = scale * 3; + dust2.noGravity = true; + dust2.color = bColor; + dust2.noLightEmittence = true; + } + } + if (time > 80) // Track the player in a natural motion simular to swimming + { + float homingSpeed = Utils.Remap(Utils.Distance(Projectile.Center, Owner.Center), 200, 600, 0.07f, 0.16f) + 0.009f * energyNumber; + float offsetPower = Utils.GetLerpValue(1, 5, Owner.velocity.Length(), true); + float sine = (float)Math.Sin((time * 0.1f) / MathHelper.Pi); + float sine2 = (float)Math.Sin((time * 0.04f) / MathHelper.Pi); + Vector2 bonusMobility = (offsetPower > 0 ? ((Utils.DirectionTo(Projectile.Center, Owner.Center) * 90) * sine2).RotatedBy(0.8f * sine) * offsetPower : Vector2.Zero); + Vector2 goalPosition = Owner.MountedCenter + bonusMobility + ((MathHelper.TwoPi * energyNumber) / Math.Max(Owner.ownedProjectileCounts[ModContent.ProjectileType()], 1)).ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly * 0.4f) * 20; + + bool outOfRange = Utils.Distance(Projectile.Center, goalPosition) > 120; + if (Projectile.velocity.Length() < 6 && outOfRange) + Projectile.velocity = Projectile.velocity * 0.995f + Utils.DirectionTo(Projectile.Center, goalPosition) * homingSpeed; + else if (outOfRange) + Projectile.velocity *= 0.985f; + if (!outOfRange) + Projectile.velocity = Projectile.velocity.RotatedBy(0.0065f * (energyNumber % 2 == 0 ? -1 : 1)) * 1.004f; + + velocity = Projectile.velocity; + } + else + Projectile.velocity *= 0.99f; + } + else // Attack/Healing Ai + { + if (Projectile.ai[2] == 5) // Effects for the moment they stop being idle + { + time = 0; + healing = (Owner.statLife < Owner.statLifeMax2 * 0.5f); + Projectile.ai[2]++; + } + if (healing) + startTime = 100; + if (time <= startTime) // Get into position before the attack/heal + { + float timeLerp = Utils.GetLerpValue(0, startTime * 0.5f, time, true); + int distFromPlayer = (int)(160 + (healing ? 240 * Utils.GetLerpValue(0, startTime * 0.8f, time, true) : 0)); + int moveSpeed = (int)(90 - 85 * timeLerp); + if (projType == 0) + { + Vector2 destination = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(MathHelper.TwoPi / 3) * distFromPlayer; + Projectile.velocity = (destination - Projectile.Center) / moveSpeed; + velocity = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + } + if (projType == 1) + { + Vector2 destination = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * distFromPlayer; + Projectile.velocity = (destination - Projectile.Center) / moveSpeed; + velocity = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + } + if (projType == 2) + { + Vector2 destination = Owner.Center + Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld).RotatedBy(-(MathHelper.TwoPi / 3)) * distFromPlayer; + Projectile.velocity = (destination - Projectile.Center) / moveSpeed; + velocity = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + } + } + + if (healing) // Heal/Buff player (only occurs below 50% HP) + { + if (time > startTime) + { + float sine = (float)Math.Sin((time * 0.3f) / MathHelper.Pi); + Projectile.extraUpdates = 6; + + if (time > startTime) + { + float homingSpeed = Utils.Remap(time, startTime, endTime, 0.01f, 0.1f); + + Vector2 goalPosition = Owner.Center; + + if (Projectile.velocity.Length() < 5) + Projectile.velocity = Projectile.velocity.RotatedBy(0.02f * sine) * 0.99f + Utils.DirectionTo(Projectile.Center, goalPosition) * homingSpeed; + else + Projectile.velocity *= 0.985f; + + if (Utils.Distance(goalPosition, Projectile.Center) < 50) + { + if (projType == 0) // Heals you for 8 flat + { + Owner.HealPlayer(8); + } + if (projType == 1) // Gives you a temporary defense buff + { + Owner.Calamity().dOfTheDeepDefenseBuffTimer = Owner.Calamity().dOfTheDeepDefenseBuffMax; + } + if (projType == 2) // Heals you for 5% max hp + { + int healValue = (int)((float)(Owner.statLifeMax2) * 0.05f); + Owner.HealPlayer(healValue); + } + + Projectile.Kill(); + } + } + } + } + else // Attacking + { + if (time > startTime) + { + if (canDamage == false) // Effects for the moment they begin attacking + { + if (visuals) + { + SoundStyle fire = new("CalamityMod/Sounds/Custom/AstrumDeus/AstrumDeusGodRay"); + SoundEngine.PlaySound(fire with { Volume = 0.3f, Pitch = (Main.rand.NextFloat(-0.6f, -0.5f) + projType * 0.1f) }, Projectile.Center); + SoundStyle fire2 = new("CalamityMod/Sounds/Item/VoidDash"); + SoundEngine.PlaySound(fire2 with { Volume = 0.3f, Pitch = (Main.rand.NextFloat(0.2f, 0.4f) + projType * 0.1f) }, Projectile.Center); + } + + NPC tempTarget = Projectile.Center.ClosestNPCAt(1200); + Vector2 aimTo = (tempTarget == null ? Owner.Calamity().mouseWorld : tempTarget.Center); + if (projType == 0) + { + Projectile.velocity = Utils.DirectionTo(Projectile.Center, aimTo) * 2; + Projectile.extraUpdates = 3; + } + if (projType == 1) + { + Projectile.velocity = Utils.DirectionTo(Projectile.Center, aimTo) * 11; + Projectile.extraUpdates = 18; + + if (visuals) + { + for (float i = 1; i <= 1.4f; i += 0.4f) + { + Particle pulse = new CustomSpark(Projectile.Center, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 7 * i, "CalamityMod/Particles/BloomRing", false, 18, 0.5f / i, bColor, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(pulse); + } + } + } + if (projType == 2) + { + Projectile.velocity = Utils.DirectionTo(Projectile.Center, aimTo) * 7; + Projectile.extraUpdates = 7; + Projectile.localNPCHitCooldown = 5; + Projectile.timeLeft = 600; + + if (visuals) + { + Particle pulse = new CustomSpark(Projectile.Center, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5, "CalamityMod/Particles/BloomRing", false, 14, 0.35f, bColor, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(pulse); + } + } + + if (visuals) + { + for (int i = 0; i <= 12; i++) + { + float variance = Main.rand.NextFloat(-0.7f, 0.7f); + Vector2 vel = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 24).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)); + float scale = (Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance)) * 0.35f; + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), vel); + dust2.scale = scale * 4; + dust2.noGravity = true; + dust2.color = bColor; + dust2.noLightEmittence = true; + } + } + } + canDamage = true; + + float homingSpeed = Utils.Remap(time, startTime, endTime, 0.01f, 0.5f); + if (projType == 0) + { + targeted = Owner.Calamity().mouseWorld.ClosestNPCAt(2300); + CalamityUtils.HomeInOnSelectedNPC(Projectile, targeted, true, homingSpeed, 25, 0.99f, accelerate: true); + + if (targeted == null) + { + if (Projectile.velocity.Y > 5) + { + Projectile.velocity.Y += 0.8f * homingSpeed; + Projectile.velocity.X *= 0.997f; + } + } + else + Projectile.timeLeft++; + } + if (projType == 2) + { + if (hitCooldown > 0) + hitCooldown--; + float timeLerp = Utils.GetLerpValue(400, 800, Projectile.timeLeft, true); // While a target is active, lifetime goes up, which increases homing power + if (targeted == null && hitCooldown == 0) + { + CalamityUtils.HomeInOnSelectedNPC(Projectile, Owner.Calamity().mouseWorld.ClosestNPCAt(2300), true, 0.5f, 10, 0.99f, accelerate: true); + } + else if (hitCooldown == 0) + { + Projectile.timeLeft += 2; + CalamityUtils.HomeInOnSelectedNPC(Projectile, targeted, true, 0.6f * timeLerp, 10, 0.99f, accelerate: true); + } + else + { + if (hitCooldown < 100) + Projectile.velocity = Projectile.velocity.RotatedBy((Projectile.numHits % 2 == 0 ? 1 : -1) * 0.0363f) * 0.99f; + } + if (targeted != null && (targeted.life <= 0 || !targeted.CanBeChasedBy() || !targeted.active)) + targeted = null; + } + } + } + } + + // The main particle trail + float squash = Utils.GetLerpValue(1, 3, Projectile.velocity.Length(), true); + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (squash > 0.15f && visuals && targetDist < 1400) + { + float scale = 0.55f * Projectile.scale * (projType == 1 && canDamage ? 2 : 1); + int lifetime = (int)(18 * (projType == 1 && canDamage ? 2.5f : 1)); + Particle fadeInfx = new CustomSpark(Projectile.Center, Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, lifetime, scale, bColor * 0.4f * squash, new Vector2(1 - 0.15f * squash, 1f), true, true, shrinkSpeed: 0.3f * squash, glowOpacity: 0.5f, glowCenterScale: 0.45f); + GeneralParticleHandler.SpawnParticle(fadeInfx); + } + + Projectile.scale = MathHelper.Lerp(Projectile.scale, 0.7f, 0.1f); + Projectile.rotation = velocity.ToRotation() + MathHelper.PiOver2; + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (projType == 0) + { + if (visuals) + { + SoundStyle s = new("CalamityMod/Sounds/Custom/AstrumDeus/DeusMineExplode"); + SoundEngine.PlaySound(s with { Volume = 0.7f, Pitch = (Main.rand.NextFloat(0.3f, 0.4f)) }, Projectile.Center); + SoundStyle fire2 = new("CalamityMod/Sounds/Item/VoidDash"); + SoundEngine.PlaySound(fire2 with { Volume = 0.4f, Pitch = Main.rand.NextFloat(-0.2f, -0.3f) }, Projectile.Center); + + for (int i = 0; i < 15; i++) + { + Dust c = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType()); + c.velocity = (MathHelper.TwoPi * i / 15f).ToRotationVector2() * 16f * (i % 3 == 0 ? 0.8f : 1f); + c.scale = Main.rand.NextFloat(1.3f, 1.6f) * 0.9f * (i % 3 == 0 ? 2.2f : 1.8f); + c.noGravity = true; + c.color = bColor; + c.noLightEmittence = true; + c.fadeIn = 0.9f; + } + Particle blastRing = new CustomPulse(target.Center, Vector2.Zero, bColor * 0.7f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 1.8f, 13, true); + GeneralParticleHandler.SpawnParticle(blastRing); + } + + float blastSize = 170; + float minMultiplier = 0.35f; + int hitsToMinMult = 8; + int debuff = ModContent.BuffType(); + int debuffTime = 240; + target.AddBuff(debuff, debuffTime); + + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, -11, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); + blast.timeLeft = 14; + blast.DamageType = Projectile.DamageType; + blast.localAI[0] = target.whoAmI; + blast.localAI[1] = debuff; + blast.localAI[2] = debuffTime; + Projectile.Kill(); + } + else + { + // HADAL and VOID have knockback, GRAVEL has it's knockback on the explosion + Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; + float launchPower = 7f; + target.MoveNPC(launchVel, launchPower, false); + + if (visuals) + { + for (int i = 0; i <= Math.Max(2, 8 - Projectile.numHits); i++) + { + float variance = Main.rand.NextFloat(-0.3f, 0.3f); + Vector2 vel = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 24).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)); + float scale = (Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance)) * 0.35f; + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), vel); + dust2.scale = scale * 5; + dust2.noGravity = true; + dust2.color = bColor; + dust2.noLightEmittence = true; + dust2.fadeIn = 1.5f; + } + } + } + if (projType == 1) + { + if (visuals) + { + SoundStyle s = new("CalamityMod/Sounds/Custom/AuricMine", 3); + SoundEngine.PlaySound(s with { Volume = 0.5f, Pitch = (-0.3f + Projectile.numHits * 0.1f), MaxInstances = 6 }, Projectile.Center); + } + + target.AddBuff(BuffID.OnFire3, 300); // Should be replaced with "Steamscorched" or whatever the scoria debuff will be + float minMult = 0.25f; + int hitsToMinMult = 10; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult * 2.5f; // Deals extra damage + } + if (projType == 2) + { + modifiers.SourceDamage *= 0.33f; // Deals less damage but hits multiple times + if (visuals) + { + SoundStyle s = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3); + SoundEngine.PlaySound(s with { Volume = 0.6f, Pitch = (-0.3f + Projectile.numHits * 0.1f) }, Projectile.Center); + } + + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 7; + target.AddBuff(ModContent.BuffType(), 30); // Very stong debuff need very short time + targeted = target; + hitCooldown = 140; + Projectile.timeLeft = 600; + Projectile.extraUpdates += 3; // Get faster on each hit + if (Projectile.numHits >= 5) + Projectile.Kill(); + } + } + public override void OnKill(int timeLeft) + { + if (healing && visuals) + { + for (int i = 0; i <= 4; i++) + { + float variance = Main.rand.NextFloat(-0.5f, 0.5f); + Vector2 vel = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * 4; + float scale = (Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance)) * 0.35f; + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), vel); + dust2.scale = scale * 2; + dust2.noGravity = false; + dust2.color = bColor; + dust2.noLight = true; + dust2.noLightEmittence = true; + } + } + } + public override bool PreDraw(ref Color lightColor) + { + Asset orb = ModContent.Request("CalamityMod/Particles/BloomCircle"); + float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 10) / MathHelper.Pi); + Vector2 squash = new Vector2(Utils.Remap(Projectile.velocity.Length(), 1, 5, 1, 0.6f), Utils.Remap(Projectile.velocity.Length(), 1, 5, 1, 2f)); + + Asset block = ModContent.Request("CalamityMod/Items/Placeables/Abyss/AbyssGravel"); + switch (projType) // 0 = gravel/vines, 1 = hadal/hydrothermic, 2 = void/lumenyl + { + case 0: + { + block = ModContent.Request("CalamityMod/Items/Placeables/Abyss/AbyssGravel"); + break; + } + case 1: + { + block = ModContent.Request("CalamityMod/Items/Placeables/Abyss/PyreMantle"); + break; + } + case 2: + { + block = ModContent.Request("CalamityMod/Items/Placeables/Abyss/Voidstone"); + break; + } + } + + // The main "glowy orb" part of the projectile + for (int i = 0; i < 6; i++) + { + Color orbColor = Color.Lerp(bColor, color2, (i + 1) / 6) with { A = 0 } * 0.4f; + Vector2 scale = Projectile.scale * squash * (0.05f + i * 0.01f) * 4.3f; + Main.EntitySpriteDraw(orb.Value, Projectile.Center - Main.screenPosition, null, Color.Lerp(orbColor, Color.White with { A = 0 }, 1 - i * 0.5f) * (visuals ? 1 : 0.15f), Projectile.rotation, orb.Size() * 0.5f, scale, SpriteEffects.None); + } + + float velLerp = Utils.GetLerpValue(0.5f, 3f, Projectile.velocity.Length(), true); + if (projType == 0 && visuals) // GRAVEL circle + { + Asset ring = ModContent.Request("CalamityMod/Particles/BloomRing"); + int orbs = 9; + for (int i = 1; i < orbs + 1; i++) + { + float sine2 = (float)Math.Sin((time * (i % 3 == 0 ? 0.2f : i % 2 == 0 ? 0.4f : 1f) * 0.2f) / MathHelper.Pi); + + Vector2 placement = Projectile.Center + ((MathHelper.TwoPi * i / orbs) + 7 * sine).ToRotationVector2() * (18 + Math.Abs(sine * (i % 3 == 0 ? 19 : 11))) * velLerp; + Color orbColor = Color.White * (visuals ? 1 : 0.1f) * velLerp; + Vector2 scale = Vector2.One * Projectile.scale; + + for (int y = 0; y < 7; y++) + { + Vector2 drawOffset = (MathHelper.TwoPi * y / 7).ToRotationVector2() * 4.5f; + Main.EntitySpriteDraw(block.Value, placement - Main.screenPosition + drawOffset, null, bColor with { A = 0 } * 0.7f * velLerp, Projectile.rotation + 0.02f * MathHelper.Lerp(i, 1, 0.75f) + 0.4f, block.Size() * 0.5f, scale, i % 2 == 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + Main.EntitySpriteDraw(block.Value, placement - Main.screenPosition, null, orbColor, Projectile.rotation + 0.02f * MathHelper.Lerp(i, 1, 0.75f) + 0.4f, block.Size() * 0.5f, scale, i % 2 == 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + for (int i = 0; i < 3; i++) + Main.EntitySpriteDraw(ring.Value, Projectile.Center - Main.screenPosition, null, bColor with { A = 0 } * 0.9f * velLerp, Projectile.rotation, ring.Size() * 0.5f, 0.2f * velLerp * Projectile.scale + (0.15f * Math.Abs(sine)) + 0.02f * i, SpriteEffects.None); + } + if (projType == 1 && visuals) // HALAD spires + { + int orbs = 9; + for (int i = 0; i < orbs; i++) + { + bool outer = i > (2); + bool outest = i > (5); + float rotation = MathHelper.TwoPi * i / (3) + Main.GlobalTimeWrappedHourly * 6; + Vector2 placement = Projectile.Center + ((rotation).ToRotationVector2() * (outest ? 16 : outer ? 12 : 8) + (Projectile.velocity.SafeNormalize(Vector2.UnitX) * (outest ? -15f : outer ? 0f : 15))) * velLerp; + Color orbColor = Color.White * (visuals ? 1 : 0.1f) * velLerp; + Vector2 scale = new Vector2(0.35f + (outest ? 0.1f : outer ? 0.3f : 0.6f), 2.3f) * Projectile.scale * (outest ? 0.8f : outer ? 0.9f : 1) * 1.5f; + + for (int y = 0; y < 7; y++) + { + Vector2 drawOffset = (MathHelper.TwoPi * y / 7).ToRotationVector2() * 2.5f; + Main.EntitySpriteDraw(block.Value, placement - Main.screenPosition + drawOffset, null, bColor with { A = 0 } * velLerp, Utils.DirectionTo(placement, Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 65f).ToRotation() + MathHelper.PiOver2, block.Size() * 0.5f, scale, outer ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + Main.EntitySpriteDraw(block.Value, placement - Main.screenPosition, null, orbColor, Utils.DirectionTo(placement, Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 65f).ToRotation() + MathHelper.PiOver2, block.Size() * 0.5f, scale, outer ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + } + if (projType == 2 && visuals) // VOID shards + { + float scalingValue = Main.GlobalTimeWrappedHourly * (90 + Projectile.numHits * 55); + int orbs = 8; + for (int i = 1; i < orbs + 1; i++) + { + float sine3 = (float)Math.Sin((scalingValue * (i % 3 == 0 ? 0.2f : i % 2 == 0 ? 0.4f : 1f) * 0.07f) / MathHelper.Pi); + float sine2 = (float)Math.Sin((scalingValue * (i % 3 == 0 ? 0.2f : i % 2 == 0 ? 0.4f : 1f) * 0.2f) / MathHelper.Pi); + + Vector2 velocity = Projectile.Center + ((MathHelper.TwoPi * i / orbs) + scalingValue * 0.04f).ToRotationVector2() * (23f + 8 * sine3) * Math.Abs(sine2) * velLerp; + + Color orbColor = Color.White * (visuals ? 1 : 0.1f) * velLerp; + Vector2 scale = new Vector2(i % 2 == 0 ? 0.4f : 0.6f, i % 2 == 0 ? 1f : 1.3f) * Projectile.scale * 1.3f; + + for (int y = 0; y < 7; y++) + { + Vector2 drawOffset = (MathHelper.TwoPi * y / 7).ToRotationVector2() * 4.5f; + Main.EntitySpriteDraw(block.Value, velocity - Main.screenPosition + drawOffset, null, bColor with { A = 0 } * 0.7f * velLerp, Utils.DirectionTo(velocity, Projectile.Center).ToRotation() + MathHelper.PiOver2 * sine3, block.Size() * 0.5f, scale, i % 2 == 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + Main.EntitySpriteDraw(block.Value, velocity - Main.screenPosition, null, orbColor, Utils.DirectionTo(velocity, Projectile.Center).ToRotation() + MathHelper.PiOver2 * sine3, block.Size() * 0.5f, scale, i % 2 == 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + } + + return false; + } + public override bool? CanDamage() => canDamage ? null : false; + public override bool? CanHitNPC(NPC target) + { + if (!target.CanBeChasedBy()) + return false; + if (projType == 2) // VOID has multihit, so it needs extra checks. Can't have it inflicting post ML debuffs and piercing + { + if (hitCooldown > 0 || (targeted != null && target != targeted)) + return false; + else + return null; + } + else + return null; + } + } +} diff --git a/Sounds/Custom/ExoMechs/THanosGFBeam.ogg b/Sounds/Custom/ExoMechs/THanosGFBeam.ogg new file mode 100644 index 0000000000..6bd2111021 Binary files /dev/null and b/Sounds/Custom/ExoMechs/THanosGFBeam.ogg differ diff --git a/Sounds/Custom/StormlionAltIdle1.ogg b/Sounds/Custom/StormlionAltIdle1.ogg new file mode 100644 index 0000000000..6531ae0bf1 Binary files /dev/null and b/Sounds/Custom/StormlionAltIdle1.ogg differ diff --git a/Sounds/Custom/StormlionAltIdle2.ogg b/Sounds/Custom/StormlionAltIdle2.ogg new file mode 100644 index 0000000000..cbd3f0835a Binary files /dev/null and b/Sounds/Custom/StormlionAltIdle2.ogg differ diff --git a/Sounds/Custom/StormlionAltShoot.ogg b/Sounds/Custom/StormlionAltShoot.ogg new file mode 100644 index 0000000000..e70429c360 Binary files /dev/null and b/Sounds/Custom/StormlionAltShoot.ogg differ diff --git a/Sounds/Item/GeliticBladeWave.ogg b/Sounds/Item/GeliticBladeWave.ogg new file mode 100644 index 0000000000..a63365b97d Binary files /dev/null and b/Sounds/Item/GeliticBladeWave.ogg differ diff --git a/Sounds/Item/SHPCVacuumEnd.ogg b/Sounds/Item/SHPCVacuumEnd.ogg new file mode 100644 index 0000000000..025be3e9c2 Binary files /dev/null and b/Sounds/Item/SHPCVacuumEnd.ogg differ diff --git a/Sounds/Item/SHPCVacuumLoop.ogg b/Sounds/Item/SHPCVacuumLoop.ogg new file mode 100644 index 0000000000..bf81d0cbad Binary files /dev/null and b/Sounds/Item/SHPCVacuumLoop.ogg differ diff --git a/Sounds/Item/SHPCVacuumStart.ogg b/Sounds/Item/SHPCVacuumStart.ogg new file mode 100644 index 0000000000..79ef8a962f Binary files /dev/null and b/Sounds/Item/SHPCVacuumStart.ogg differ diff --git a/Sounds/NPCHit/StormlionAltHit.ogg b/Sounds/NPCHit/StormlionAltHit.ogg new file mode 100644 index 0000000000..3630c97c47 Binary files /dev/null and b/Sounds/NPCHit/StormlionAltHit.ogg differ diff --git a/Sounds/NPCKilled/StormlionAltDeath.ogg b/Sounds/NPCKilled/StormlionAltDeath.ogg new file mode 100644 index 0000000000..1f71c3a56e Binary files /dev/null and b/Sounds/NPCKilled/StormlionAltDeath.ogg differ diff --git a/Systems/Graphic/ModLavaStyle.cs b/Systems/Graphic/ModLavaStyle.cs index bc015799fb..713b6e0fea 100644 --- a/Systems/Graphic/ModLavaStyle.cs +++ b/Systems/Graphic/ModLavaStyle.cs @@ -4,14 +4,9 @@ using System.Reflection; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; -using Terraria.GameContent.Liquid; -using Terraria.GameContent; using Terraria.Graphics; -using Terraria.ModLoader; -using System.Linq; using Terraria.ID; -using Microsoft.Xna.Framework; -using CalamityMod.Items.Potions.Alcohol; +using Terraria.ModLoader; namespace CalamityMod.Systems { @@ -149,7 +144,7 @@ namespace CalamityMod.Systems { if (ResizeArrayMethodInfo != null) { - MonoModHooks.Add(ResizeArrayMethodInfo, ResizeArrays); + MonoModHooks.Add(ResizeArrayMethodInfo, Delegate.CreateDelegate(typeof(Action), typeof(LavaStylesLoader).GetMethod(nameof(ResizeArrays), BindingFlags.NonPublic | BindingFlags.Static))); } } diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 91ffcf390e..a798f03d95 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -722,7 +722,6 @@ namespace CalamityMod.Systems AddEarlyGameAccessoryRecipes(); AddHardmodeItemRecipes(); AddArmorRecipes(); - AddAnkhShieldRecipes(); } #endregion @@ -1600,6 +1599,7 @@ namespace CalamityMod.Systems // Fledgling Wings r = Recipe.Create(ItemID.CreativeWings); + r.AddIngredient(ModContent.ItemType(), 2); r.AddIngredient(ItemID.Cloud, 5); r.AddIngredient(ItemID.Feather, 10); r.AddTile(TileID.Anvils); @@ -1638,6 +1638,13 @@ namespace CalamityMod.Systems r.DisableDecraft(); #endregion + // Cobalt Shield + r = Recipe.Create(ItemID.CobaltShield); + r.AddRecipeGroup(AnyCobaltBar, 5); + r.AddTile(TileID.Anvils); + r.Register(); + r.DisableDecraft(); + // Flame Waker Boots r = Recipe.Create(ItemID.FlameWakerBoots); r.AddIngredient(ItemID.Silk, 8); @@ -1712,70 +1719,6 @@ namespace CalamityMod.Systems } #endregion - #region Ankh Shield Components - private static void AddAnkhShieldRecipes() - { - // Cobalt Shield - Recipe r = Recipe.Create(ItemID.CobaltShield); - r.AddRecipeGroup(AnyCobaltBar, 5); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // The Plan: - // Trifold Map (confusion) - r = Recipe.Create(ItemID.TrifoldMap); - r.AddIngredient(ItemID.Silk, 10); - r.AddIngredient(ItemID.SoulofLight, 10); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // Fast Clock (slow) - r = Recipe.Create(ItemID.FastClock); - r.AddIngredient(ItemID.Timer1Second); - r.AddIngredient(ItemID.PixieDust, 25); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // Countercurse Mantra: - // Nazar (curse) - r = Recipe.Create(ItemID.Nazar); - r.AddIngredient(ItemID.SoulofNight, 10); - r.AddIngredient(ItemID.Lens, 3); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // Megaphone (silence) - r = Recipe.Create(ItemID.Megaphone); - r.AddRecipeGroup(AnyCobaltBar, 5); - r.AddIngredient(ItemID.Wire, 10); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // Reflective Shades: - // Blindfold (darkness) - r = Recipe.Create(ItemID.Blindfold); - r.AddIngredient(ItemID.Silk, 10); - r.AddIngredient(ItemID.TatteredCloth); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // Pocket Mirror (petrification) - r = Recipe.Create(ItemID.PocketMirror); - r.AddIngredient(ItemID.Glass, 10); - r.AddRecipeGroup(AnyGoldBar, 8); - r.AddIngredient(ItemID.CrystalShard, 8); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - } - #endregion - #region Hardmode Items and Accessories private static void AddHardmodeItemRecipes() { @@ -1789,7 +1732,7 @@ namespace CalamityMod.Systems // Rod of Discord r = Recipe.Create(ItemID.RodofDiscord); r.AddIngredient(ItemID.SoulofLight, 30); - r.AddIngredient(ItemID.PixieDust, 50); + r.AddIngredient(ItemID.CrystalShard, 25); r.AddIngredient(ItemID.ChaosFish, 5); r.AddTile(TileID.MythrilAnvil); r.Register(); diff --git a/Systems/ResizeArrayHook.cs b/Systems/ResizeArrayHook.cs index e5ffa028d2..56505264d0 100644 --- a/Systems/ResizeArrayHook.cs +++ b/Systems/ResizeArrayHook.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; using Terraria.ModLoader; namespace CalamityMod.Systems @@ -18,7 +14,7 @@ namespace CalamityMod.Systems public override void Load() { var resizeArrayMethod = typeof(ModContent).GetMethod("ResizeArrays", BindingFlags.NonPublic | BindingFlags.Static); - MonoModHooks.Add(resizeArrayMethod, ResizeArrays); + MonoModHooks.Add(resizeArrayMethod, Delegate.CreateDelegate(typeof(Action), typeof(ResizeArrayHook).GetMethod(nameof(ResizeArrays), BindingFlags.NonPublic | BindingFlags.Static))); } private static void ResizeArrays(ResizeArrayDelegate orig, bool unloading) diff --git a/Systems/World/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs index 5887a5f374..8020b3d9e7 100644 --- a/Systems/World/WorldMiscUpdateSystem.cs +++ b/Systems/World/WorldMiscUpdateSystem.cs @@ -147,12 +147,20 @@ namespace CalamityMod.Systems public static void HandleTileGrowth() { + // 2MAY2025: Lucille: By default, the assumption that these values are within a natural min/max relationship with searchBottom being greater than searchTop is sensible. + // However, in subworlds where these lines may be placed arbitrarily (such as shoving the surface line near the bottom of the world), this no longer holds true, and results + // in the logic below causing a storm of minValue >= maxValue exceptions. + int searchTop = (int)Main.worldSurface - 1; + int searchBottom = Main.maxTilesY - 20; + if (searchBottom <= searchTop) + return; + int l = 0; float mult2 = (float)(1.5E-05f * WorldGen.GetWorldUpdateRate()); while (l < Main.maxTilesX * Main.maxTilesY * mult2) { int x = WorldGen.genRand.Next(10, Main.maxTilesX - 10); - int y = WorldGen.genRand.Next((int)Main.worldSurface - 1, Main.maxTilesY - 20); + int y = WorldGen.genRand.Next(searchTop, searchBottom); int y2 = y - 1; if (y2 < 10) diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index ef10be5563..3cd6970006 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -418,6 +418,7 @@ namespace CalamityMod.Systems bool isMahoganyChest = isContainer1 && Main.tile[chest.x, chest.y].TileFrameX == 8 * 36; bool isIvyChest = isContainer1 && Main.tile[chest.x, chest.y].TileFrameX == 10 * 36; bool isIceChest = isContainer1 && Main.tile[chest.x, chest.y].TileFrameX == 11 * 36; + bool isLihzahrdChest = isContainer1 && Main.tile[chest.x, chest.y].TileFrameX == 16 * 36; bool isMushroomChest = isContainer1 && Main.tile[chest.x, chest.y].TileFrameX == 32 * 36; bool isMarniteChest = isContainer1 && (Main.tile[chest.x, chest.y].TileFrameX == 50 * 36 || Main.tile[chest.x, chest.y].TileFrameX == 51 * 36); @@ -426,7 +427,7 @@ namespace CalamityMod.Systems bool isSandstoneChest = isContainer2 && Main.tile[chest.x, chest.y].TileFrameX == 10 * 36; // Replace Suspicious Looking Eyes in Chests with random useful early game potions. - if (isBrownChest || isGoldChest || isMahoganyChest || isIvyChest || isIceChest || isMushroomChest || isMarniteChest || isDeadManChest || isSandstoneChest) + if (isBrownChest || isGoldChest || isMahoganyChest || isIvyChest || isIceChest || isLihzahrdChest || isMushroomChest || isMarniteChest || isDeadManChest || isSandstoneChest) { for (int inventoryIndex = 0; inventoryIndex < 40; inventoryIndex++) { diff --git a/Tiles/Astral/AstralBeacon.cs b/Tiles/Astral/AstralBeacon.cs index 399fc784f8..39410d4401 100644 --- a/Tiles/Astral/AstralBeacon.cs +++ b/Tiles/Astral/AstralBeacon.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Tiles.Astral // Various data sets to protect this tile from unintentional death TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsTileReplaceIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 854b2e295e..b35b83a285 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -337,81 +337,5 @@ namespace CalamityMod.Tiles } } } - - // TODO: Make this a data set or smth? - // Plausible name: PreventsAnchorTileChanges /// Tile prevents its "anchors" from being hammered, killed, actuated, or edited in any way which may cause it to unintentionally break. - public static bool ShouldNotBreakDueToAboveTile(int x, int y) - { - int[] invincibleTiles = new int[] - { - TileType(), - TileType(), - TileType(), - TileType(), - TileType() - }; - - Tile checkTile = CalamityUtils.ParanoidTileRetrieval(x, y); - Tile aboveTile = CalamityUtils.ParanoidTileRetrieval(x, y - 1); - - // Prevent tiles below invincible tiles from being destroyed. This is like chests in vanilla. - return aboveTile.HasTile && checkTile.TileType != aboveTile.TileType && invincibleTiles.Contains(aboveTile.TileType); - } - - public override bool CanExplode(int i, int j, int type) - { - if (ShouldNotBreakDueToAboveTile(i, j)) - return false; - - return base.CanExplode(i, j, type); - } - - public override bool CanKillTile(int i, int j, int type, ref bool blockDamaged) - { - if (ShouldNotBreakDueToAboveTile(i, j)) - return false; - - return base.CanKillTile(i, j, type, ref blockDamaged); - } - - // "Private" my ass, fuck off - public static void GetTreeBottom(int i, int j, out int x, out int y) - { - x = i; - y = j; - Tile tileSafely = Framing.GetTileSafely(x, y); - if (tileSafely.TileType == TileID.PalmTree) - { - while (y < Main.maxTilesY - 50 && (!tileSafely.HasTile || tileSafely.TileType == TileID.PalmTree)) - { - y++; - tileSafely = Framing.GetTileSafely(x, y); - } - - return; - } - - int treeTileX = tileSafely.TileFrameX / 22; - int treeTileY = tileSafely.TileFrameY / 22; - if (treeTileX == 3 && treeTileY <= 2) - x++; - else if (treeTileX == 4 && treeTileY >= 3 && treeTileY <= 5) - x--; - else if (treeTileX == 1 && treeTileY >= 6 && treeTileY <= 8) - x--; - else if (treeTileX == 2 && treeTileY >= 6 && treeTileY <= 8) - x++; - else if (treeTileX == 2 && treeTileY >= 9) - x++; - else if (treeTileX == 3 && treeTileY >= 9) - x--; - - tileSafely = Framing.GetTileSafely(x, y); - while (y < Main.maxTilesY - 50 && (!tileSafely.HasTile || TileID.Sets.IsATreeTrunk[tileSafely.TileType] || tileSafely.TileType == TileID.MushroomTrees)) - { - y++; - tileSafely = Framing.GetTileSafely(x, y); - } - } } } diff --git a/Tiles/DraedonStructures/DraedonLabTurret.cs b/Tiles/DraedonStructures/DraedonLabTurret.cs index be174bc706..86c6f7890d 100644 --- a/Tiles/DraedonStructures/DraedonLabTurret.cs +++ b/Tiles/DraedonStructures/DraedonLabTurret.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Tiles.DraedonStructures // Various data sets to protect this tile from unintentional death TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsTileReplaceIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index 1a30d91ae3..994955c808 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Tiles.DraedonSummoner // Various data sets to protect this tile from unintentional death TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; - //TileID.Sets.PreventsTileReplaceIfOnTopOfIt[Type] = true; Since this is a furniture item this may be unnecessary? + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); diff --git a/Tiles/Furniture/CraftingStations/SCalAltar.cs b/Tiles/Furniture/CraftingStations/SCalAltar.cs index f473c94e94..aa81603cc5 100644 --- a/Tiles/Furniture/CraftingStations/SCalAltar.cs +++ b/Tiles/Furniture/CraftingStations/SCalAltar.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations // Various data sets to protect this tile from unintentional death TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; - //TileID.Sets.PreventsTileReplaceIfOnTopOfIt[Type] = true; Since this is a furniture item this may be unnecessary? + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); @@ -161,7 +161,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations // Various data sets to protect this tile from unintentional death TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; - //TileID.Sets.PreventsTileReplaceIfOnTopOfIt[Type] = true; Since this is a furniture item this may be unnecessary? + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); diff --git a/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs b/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs index 5707586091..de17471788 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodChandelierTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureAcidwood; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { public class AcidwoodChandelierTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,14 +46,24 @@ namespace CalamityMod.Tiles.FurnitureAcidwood } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(64, 128, 102, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodChandelierTileFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureAncient/AncientChandelier.cs b/Tiles/FurnitureAncient/AncientChandelier.cs index 85650a6e48..ae9b9659d3 100644 --- a/Tiles/FurnitureAncient/AncientChandelier.cs +++ b/Tiles/FurnitureAncient/AncientChandelier.cs @@ -1,7 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,8 +11,14 @@ namespace CalamityMod.Tiles.FurnitureAncient { public class AncientChandelier : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + public override bool CreateDust(int i, int j, ref int type) { Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.RedTorch, 0f, 0f, 1, new Color(255, 255, 255), 1f); @@ -23,16 +31,26 @@ namespace CalamityMod.Tiles.FurnitureAncient num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAncient/AncientChandelierFlame").Value, i, j); - } - public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 64, 64, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0f; + } + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; diff --git a/Tiles/FurnitureAshen/AshenChandelier.cs b/Tiles/FurnitureAshen/AshenChandelier.cs index 877855977d..65bb0575ff 100644 --- a/Tiles/FurnitureAshen/AshenChandelier.cs +++ b/Tiles/FurnitureAshen/AshenChandelier.cs @@ -1,7 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +13,10 @@ namespace CalamityMod.Tiles.FurnitureAshen { int animationFrame = 0; + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() { this.SetUpChandelier(ModContent.ItemType(), true); @@ -58,16 +64,26 @@ namespace CalamityMod.Tiles.FurnitureAshen } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 64, 64, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenChandelierFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight); - } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; diff --git a/Tiles/FurnitureAuric/AuricLandMineTile.cs b/Tiles/FurnitureAuric/AuricLandMineTile.cs index 927da514e5..8b425dd330 100644 --- a/Tiles/FurnitureAuric/AuricLandMineTile.cs +++ b/Tiles/FurnitureAuric/AuricLandMineTile.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Tiles.FurnitureAuric Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = false; @@ -25,6 +26,8 @@ namespace CalamityMod.Tiles.FurnitureAuric MinPick = 250; } + public override bool CanExplode(int i, int j) => false; + public override bool CreateDust(int i, int j, ref int type) { Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Electric); diff --git a/Tiles/FurnitureExo/ExoChandelierTile.cs b/Tiles/FurnitureExo/ExoChandelierTile.cs index 6292d83cc9..650d9b4a10 100644 --- a/Tiles/FurnitureExo/ExoChandelierTile.cs +++ b/Tiles/FurnitureExo/ExoChandelierTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureExo; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureExo { public class ExoChandelierTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -42,14 +48,24 @@ namespace CalamityMod.Tiles.FurnitureExo } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoChandelierTileFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureMonolith/MonolithChandelier.cs b/Tiles/FurnitureMonolith/MonolithChandelier.cs index 45753af8b7..9dd32646e2 100644 --- a/Tiles/FurnitureMonolith/MonolithChandelier.cs +++ b/Tiles/FurnitureMonolith/MonolithChandelier.cs @@ -1,13 +1,24 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureMonolith { public class MonolithChandelier : ModTile { + public Asset FlameTexture; + public Asset GlowTexture; + + public override void Load() + { + FlameTexture = ModContent.Request(Texture + "Flame"); + GlowTexture = ModContent.Request(Texture + "Glow"); + } + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -23,22 +34,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - if (Main.tile[i, j].IsTileActuallyInvisible()) - return; - - int xPos = Main.tile[i, j].TileFrameX; - int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChandelierGlow").Value; - Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - - Texture2D glowmaskBright = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChandelierFlame").Value; - Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } + public override void AdjustMultiTileVineParameters(int i, int j, ref float? overrideWindCycle, ref float windPushPowerX, ref float windPushPowerY, ref bool dontRotateTopTiles, ref float totalWindMultiplier, ref Texture2D glowTexture, ref Color glowColor) => glowTexture = GlowTexture.Value; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -56,6 +52,21 @@ namespace CalamityMod.Tiles.FurnitureMonolith } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 1; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0f; + tileFlameData.flameRangeMultY = 0f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs index 07e16cb3d6..0740abdab5 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureSacrilegious; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious { public class SacrilegiousChandelierTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -41,14 +47,24 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 26, 26, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTileFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureStatigel/StatigelChandelier.cs b/Tiles/FurnitureStatigel/StatigelChandelier.cs index affdc54698..c5587ea2f3 100644 --- a/Tiles/FurnitureStatigel/StatigelChandelier.cs +++ b/Tiles/FurnitureStatigel/StatigelChandelier.cs @@ -1,6 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +10,10 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public class StatigelChandelier : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -39,14 +45,24 @@ namespace CalamityMod.Tiles.FurnitureStatigel } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureStatigel/StatigelChandelierFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureStratus/StratusChandelier.cs b/Tiles/FurnitureStratus/StratusChandelier.cs index c8b6e76bca..ab86d2dde4 100644 --- a/Tiles/FurnitureStratus/StratusChandelier.cs +++ b/Tiles/FurnitureStratus/StratusChandelier.cs @@ -1,8 +1,10 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +12,10 @@ namespace CalamityMod.Tiles.FurnitureStratus { public class StratusChandelier : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -42,16 +48,26 @@ namespace CalamityMod.Tiles.FurnitureStratus } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(77, 102, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 3); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureStratus/StratusChandelierFlame").Value, i, j, 0); - } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; diff --git a/Tiles/FurnitureWulfrum/WulfrumChandelier.cs b/Tiles/FurnitureWulfrum/WulfrumChandelier.cs index 24089c07cd..a4b0ec1074 100644 --- a/Tiles/FurnitureWulfrum/WulfrumChandelier.cs +++ b/Tiles/FurnitureWulfrum/WulfrumChandelier.cs @@ -1,8 +1,10 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; using Terraria.Enums; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -12,12 +14,22 @@ namespace CalamityMod.Tiles.FurnitureWulfrum { public class WulfrumChandelier : ModTile { + public Asset FlameTexture; + public Asset GlowTexture; + + public override void Load() + { + FlameTexture = ModContent.Request(Texture + "Flame"); + GlowTexture = ModContent.Request(Texture + "Glow"); + } + public override void SetStaticDefaults() { Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; TileID.Sets.MultiTileSway[Type] = true; + TileID.Sets.IsAMechanism[Type] = true; TileObjectData.newTile.Width = 3; TileObjectData.newTile.Height = 2; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; @@ -48,6 +60,8 @@ namespace CalamityMod.Tiles.FurnitureWulfrum num = fail ? 1 : 3; } + public override void AdjustMultiTileVineParameters(int i, int j, ref float? overrideWindCycle, ref float windPushPowerX, ref float windPushPowerY, ref bool dontRotateTopTiles, ref float totalWindMultiplier, ref Texture2D glowTexture, ref Color glowColor) => glowTexture = GlowTexture.Value; + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (Main.tile[i, j].TileFrameX < 18) @@ -64,14 +78,24 @@ namespace CalamityMod.Tiles.FurnitureWulfrum } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 3, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumChandelierFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureWulfrum/WulfrumChandelierFlame.png b/Tiles/FurnitureWulfrum/WulfrumChandelierFlame.png index 867632c86c..60c5a0858b 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumChandelierFlame.png and b/Tiles/FurnitureWulfrum/WulfrumChandelierFlame.png differ diff --git a/Tiles/FurnitureWulfrum/WulfrumChandelierGlow.png b/Tiles/FurnitureWulfrum/WulfrumChandelierGlow.png new file mode 100644 index 0000000000..3eacd216f8 Binary files /dev/null and b/Tiles/FurnitureWulfrum/WulfrumChandelierGlow.png differ diff --git a/Tiles/GiantPlanteraBulb.cs b/Tiles/GiantPlanteraBulb.cs index dfb8727821..6b2779e934 100644 --- a/Tiles/GiantPlanteraBulb.cs +++ b/Tiles/GiantPlanteraBulb.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Tiles // Various data sets to protect this tile from premature death TileID.Sets.PreventsTileRemovalIfOnTopOfIt[Type] = true; + TileID.Sets.PreventsTileHammeringIfOnTopOfIt[Type] = true; TileID.Sets.PreventsTileReplaceIfOnTopOfIt[Type] = true; TileID.Sets.PreventsSandfall[Type] = true; - // CalamityGlobalTile.PreventsAnchorTileChanges.Add(Type); // Object data TileObjectData.newTile.Width = 5; diff --git a/Tiles/Rubblemaker/SunkenSea/BlueCoralTreeEcho.cs b/Tiles/Rubblemaker/SunkenSea/BlueCoralTreeEcho.cs new file mode 100644 index 0000000000..891219546d --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/BlueCoralTreeEcho.cs @@ -0,0 +1,18 @@ +using Terraria.ModLoader; +using Terraria.GameContent; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class BlueCoralTreeEcho : BlueCoralTree + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/BlueCoralTree"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs index b3da12ec94..624a137c0e 100644 --- a/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; @@ -16,12 +17,11 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.addTile(Type); - + DustType = DustID.SailfishBoots; AddMapEntry(new Color(36, 61, 111)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/Rubblemaker/SunkenSea/BrownCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/BrownCoralEcho.cs new file mode 100644 index 0000000000..4f5dbf3736 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/BrownCoralEcho.cs @@ -0,0 +1,29 @@ +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea.Ambient; +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria.GameContent; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class BrownCoral1Echo : BrownCoral1 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/BrownCoral1"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class BrownCoral2Echo : BrownCoral2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/BrownCoral2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/CoralPileGiantEcho.cs b/Tiles/Rubblemaker/SunkenSea/CoralPileGiantEcho.cs new file mode 100644 index 0000000000..cce0e3cc5e --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/CoralPileGiantEcho.cs @@ -0,0 +1,18 @@ +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using CalamityMod.Items.Placeables.SunkenSea; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class CoralPileGiantEcho : CoralPileGiant + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/CoralPileGiant"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/CoralPileLargeEcho.cs b/Tiles/Rubblemaker/SunkenSea/CoralPileLargeEcho.cs index 93a794a6bb..a21ad0581d 100644 --- a/Tiles/Rubblemaker/SunkenSea/CoralPileLargeEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/CoralPileLargeEcho.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.SunkenSea; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.Enums; @@ -30,8 +31,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea TileObjectData.addTile(Type); AddMapEntry(new Color(44, 129, 163)); DustType = DustID.Coralstone; - RegisterItemDrop(ItemID.CoralstoneBlock); - FlexibleTileWand.RubblePlacementLarge.AddVariations(ItemID.CoralstoneBlock, Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } diff --git a/Tiles/Rubblemaker/SunkenSea/DigitateCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/DigitateCoralEcho.cs new file mode 100644 index 0000000000..4f20979f50 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/DigitateCoralEcho.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class DigitateCoralEcho : DigitateCoral + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DigitateCoral"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class DigitateCoral2Echo : DigitateCoral2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DigitateCoral2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class DigitateCoral3Echo : DigitateCoral3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DigitateCoral3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs new file mode 100644 index 0000000000..c58f0510f5 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs @@ -0,0 +1,70 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class DriftwoodAmbient1Echo : DriftwoodAmbient1 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DriftwoodAmbient1"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + // TODO: Most of these currently don't work + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class DriftwoodAmbient2Echo : DriftwoodAmbient2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DriftwoodAmbient2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class DriftwoodAmbient3Echo : DriftwoodAmbient3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DriftwoodAmbient3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class DriftwoodAmbient4Echo : DriftwoodAmbient4 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DriftwoodAmbient4"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class DriftwoodAmbient5Echo : DriftwoodAmbient5 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DriftwoodAmbient5"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class DriftwoodAmbient6Echo : DriftwoodAmbient6 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/DriftwoodAmbient6"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs index 85dd31c031..8f08dada84 100644 --- a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea TileObjectData.addTile(Type); DustType = 253; AddMapEntry(new Color(54, 69, 72)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } @@ -32,7 +32,7 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea public override void NearbyEffects(int i, int j, bool closer) { if (!Main.dedServ) - Main.SceneMetrics.ActiveFountainColor = BasaltGullyWater.Type; + Main.SceneMetrics.ActiveFountainColor = SunkenSeaBurrowsWater.Type; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -42,9 +42,9 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 0.3f; - g = 0.75f; - b = 0.75f; + r = 225f / 255f; + g = 255f / 255f; + b = 255f / 255f; } } } diff --git a/Tiles/Rubblemaker/SunkenSea/FryCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/FryCoralEcho.cs new file mode 100644 index 0000000000..fd886c7efa --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/FryCoralEcho.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class FryCoralEcho : FryCoral + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/FryCoral"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + // TODO: Currently none of these work + //FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class FryCoral2Echo : FryCoral2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/FryCoral2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class FryCoral3Echo : FryCoral3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/FryCoral3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/GiantNavystoneEcho.cs b/Tiles/Rubblemaker/SunkenSea/GiantNavystoneEcho.cs new file mode 100644 index 0000000000..dd5e4ee867 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/GiantNavystoneEcho.cs @@ -0,0 +1,29 @@ +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea.Ambient; +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria.GameContent; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class GiantNavystone1Echo : GiantNavystone1 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/GiantNavystone1"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class GiantNavystone2Echo : GiantNavystone2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/GiantNavystone2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/MediumCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/MediumCoralEcho.cs index ce5b492050..42a7c79415 100644 --- a/Tiles/Rubblemaker/SunkenSea/MediumCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/MediumCoralEcho.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.SunkenSea; +using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; using Terraria.ID; @@ -16,13 +17,14 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea Main.tileLavaDeath[Type] = true; Main.tileWaterDeath[Type] = false; Main.tileNoAttach[Type] = true; + Main.tileLighted[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(Type); AddMapEntry(new Color(233, 132, 58)); DustType = DustID.Coralstone; - RegisterItemDrop(ItemID.CoralstoneBlock); - FlexibleTileWand.RubblePlacementMedium.AddVariations(ItemID.CoralstoneBlock, Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } @@ -30,10 +32,33 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea { num = fail ? 1 : 2; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 229f / 350f; + g = 137f / 350f; + b = 204f / 350f; + } } public class MediumCoral2Echo : MediumCoralEcho { public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/MediumCoral2"; + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 60f / 400f; + g = 110f / 400f; + b = 146f / 400f; + } + } + + public class MediumCoral3Echo : MediumCoralEcho + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/MediumCoral3"; + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 60f / 255f; + g = 110f / 255f; + b = 146f / 255f; + } } } diff --git a/Tiles/Rubblemaker/SunkenSea/NavystoneAmbientEcho.cs b/Tiles/Rubblemaker/SunkenSea/NavystoneAmbientEcho.cs new file mode 100644 index 0000000000..ce3a96b941 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/NavystoneAmbientEcho.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class NavystoneAmbientEcho : NavystoneAmbient + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/NavystoneAmbient"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + // TODO: Currently none of these work + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class NavystoneAmbient2Echo : NavystoneAmbient2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/NavystoneAmbient2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class NavystoneAmbient3Echo : NavystoneAmbient3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/NavystoneAmbient3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/NavystonePileEcho.cs b/Tiles/Rubblemaker/SunkenSea/NavystonePileEcho.cs new file mode 100644 index 0000000000..ca7ebf753c --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/NavystonePileEcho.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class NavystonePile1Echo : NavystonePile1 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/NavystonePile1"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class NavystonePile2Echo : NavystonePile2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/NavystonePile2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class NavystonePile3Echo : NavystonePile3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/NavystonePile3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs b/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs index 119a1db8b2..4818944475 100644 --- a/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.GameContent; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; @@ -13,19 +15,36 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/SeaAnemone"; public override void SetStaticDefaults() { + Main.tileLighted[Type] = true; AnimationFrameHeight = 36; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(Type); - DustType = 253; + DustType = DustID.TsunamiInABottle; AddMapEntry(new Color(54, 69, 72)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.7f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.01f; + brightness *= (float)MathF.Sin(-j / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + i); + brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); + brightness += 0.4f; + brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); + r = 85f / 255f; + b = 151f / 255f; + g = 196f / 255f; + r *= brightness; + g *= brightness; + b *= brightness; + } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; diff --git a/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs index 11c4770866..939d4d9b2d 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs @@ -19,10 +19,10 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea Main.tileNoAttach[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(Type); - DustType = 253; + DustType = DustID.SailfishBoots; AddMapEntry(new Color(36, 61, 111)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } diff --git a/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs index d9ab7f41dd..d3ef5e9f7f 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.SunkenSea; +using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; using Terraria.ID; @@ -27,9 +28,9 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea AddMapEntry(new Color(178, 28, 153)); DustType = DustID.Coralstone; HitSound = SoundID.Grass; - RegisterItemDrop(ItemID.CoralstoneBlock); - // this one is weird - //FlexibleTileWand.RubblePlacementSmall.AddVariations(ItemID.CoralstoneBlock, Type, 0, 1, 2, 3, 4, 5); + RegisterItemDrop(ModContent.ItemType()); + // TODO: Currently this one doesn't work + //FlexibleTileWand.RubblePlacementSmall.AddVariations(ModContent.ItemType(), Type, 0, 1, 2, 3, 4, 5); base.SetStaticDefaults(); } diff --git a/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs index 2924b84bd4..465872717f 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea TileObjectData.addTile(Type); DustType = 253; AddMapEntry(new Color(36, 61, 111)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementSmall.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementSmall.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } diff --git a/Tiles/Rubblemaker/SunkenSea/SmallWideCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallWideCoralEcho.cs index 468e302c00..845dd954ff 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallWideCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallWideCoralEcho.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea Main.tileLavaDeath[Type] = true; Main.tileWaterDeath[Type] = false; Main.tileNoAttach[Type] = true; + Main.tileLighted[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(Type); @@ -26,9 +27,21 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea base.SetStaticDefaults(); } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 161f / 500f; + g = 183f / 500f; + b = 73f / 500f; + } } public class SmallWideCoral2Echo : SmallWideCoralEcho { public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/SmallWideCoral2"; + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 229f / 700f; + g = 137f / 700f; + b = 204f / 700f; + } } } diff --git a/Tiles/Rubblemaker/SunkenSea/StalkCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/StalkCoralEcho.cs new file mode 100644 index 0000000000..25d370eb39 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/StalkCoralEcho.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class StalkCoralEcho : StalkCoral + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/StalkCoral"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class StalkCoral2Echo : StalkCoral2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/StalkCoral2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class StalkCoral3Echo : StalkCoral3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/StalkCoral3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + +} diff --git a/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs index b4875bdc62..28345f79b5 100644 --- a/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea Main.tileNoAttach[Type] = true; Main.tileSolidTop[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.newTile.StyleMultiplier = 2; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); @@ -31,8 +32,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea TileObjectData.addTile(Type); DustType = 253; AddMapEntry(new Color(54, 69, 72)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } @@ -49,4 +50,14 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea frameYOffset = yPos * subsheetHeight; } } + + public class TableCoralEcho2 : TableCoralEcho + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TableCoral2"; + } + + public class TableCoralEcho3 : TableCoralEcho + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TableCoral3"; + } } diff --git a/Tiles/Rubblemaker/SunkenSea/TallDigitateCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/TallDigitateCoralEcho.cs new file mode 100644 index 0000000000..0e8e57edef --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/TallDigitateCoralEcho.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class TallDigitateCoralEcho : TallDigitateCoral + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TallDigitateCoral"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class TallDigitateCoral2Echo : TallDigitateCoral2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TallDigitateCoral2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + // TODO: Currently the larger Digitate Corals do not work + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class TallDigitateCoral3Echo : TallDigitateCoral3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TallDigitateCoral3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class TallDigitateCoral4Echo : TallDigitateCoral4 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TallDigitateCoral4"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs index 36538fa9f1..b200bb3e3c 100644 --- a/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea TileObjectData.addTile(Type); DustType = 253; AddMapEntry(new Color(36, 61, 111)); - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); base.SetStaticDefaults(); } diff --git a/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs new file mode 100644 index 0000000000..da444b3432 --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class WallCoral1Echo : WallCoral1 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral1"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + // TODO: None of these work + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class WallCoral2Echo : WallCoral2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class WallCoral3Echo : WallCoral3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class WallCoral4Echo : WallCoral4 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral4"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/Rubblemaker/SunkenSea/WideScarletSeagrassEcho.cs b/Tiles/Rubblemaker/SunkenSea/WideScarletSeagrassEcho.cs new file mode 100644 index 0000000000..a4fb5ff53c --- /dev/null +++ b/Tiles/Rubblemaker/SunkenSea/WideScarletSeagrassEcho.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemaker.SunkenSea +{ + public class WideScarletSeagrassEcho : WideScarletSeagrass + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WideScarletSeagrass"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + // TODO: Currently none of these work + //FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + + public class WideScarletSeagrass2Echo : WideScarletSeagrass2 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WideScarletSeagrass2"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class WideScarletSeagrass3Echo : WideScarletSeagrass3 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WideScarletSeagrass3"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } + public class WideScarletSeagrass4Echo : WideScarletSeagrass4 + { + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WideScarletSeagrass4"; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + RegisterItemDrop(ModContent.ItemType(), Type, 0); + //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + } + } +} diff --git a/Tiles/SunkenSea/Ambient/BlueCoralTree.cs b/Tiles/SunkenSea/Ambient/BlueCoralTree.cs index eb6976e536..d372bdc268 100644 --- a/Tiles/SunkenSea/Ambient/BlueCoralTree.cs +++ b/Tiles/SunkenSea/Ambient/BlueCoralTree.cs @@ -30,11 +30,13 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 155; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 60f / 255f; - g = 110f / 255f; - b = 146f / 255f; + // DON'T DO DIVISION HERE, I DON'T CARE ABOUT HOW EASY IT IS TO READ, IT'S DOING DIVISION CALCS EVERY FRAME + r = 0.235f; + g = 0.431f; + b = 0.573f; } } } diff --git a/Tiles/SunkenSea/Ambient/BranchCoral.cs b/Tiles/SunkenSea/Ambient/BranchCoral.cs index 773d7d5f07..1e5a4e1e60 100644 --- a/Tiles/SunkenSea/Ambient/BranchCoral.cs +++ b/Tiles/SunkenSea/Ambient/BranchCoral.cs @@ -65,9 +65,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 232 / 500f; - g = 122 / 500f; - b = 122 / 500f; + r = 0.464f; + g = 0.244f; + b = 0.244f; } } } diff --git a/Tiles/SunkenSea/Ambient/BrownCoral.cs b/Tiles/SunkenSea/Ambient/BrownCoral.cs index 0e76768aa2..10ad45b85f 100644 --- a/Tiles/SunkenSea/Ambient/BrownCoral.cs +++ b/Tiles/SunkenSea/Ambient/BrownCoral.cs @@ -31,11 +31,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 155; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 244f / 450f; - g = 238f / 450f; - b = 162f / 450f; + r = 0.542f; + g = 0.529f; + b = 0.36f; } } @@ -60,11 +61,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 155; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 244f / 400f; - g = 238f / 400f; - b = 162f / 400f; + r = 0.61f; + g = 0.595f; + b = 0.405f; } } } diff --git a/Tiles/SunkenSea/Ambient/DepthVines.cs b/Tiles/SunkenSea/Ambient/DepthVines.cs index 7c5f36445d..01c06706dd 100644 --- a/Tiles/SunkenSea/Ambient/DepthVines.cs +++ b/Tiles/SunkenSea/Ambient/DepthVines.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - namespace CalamityMod.Tiles.SunkenSea.Ambient { public class DepthVines : ModTile @@ -26,9 +25,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { Tile tile = Framing.GetTileSafely(i, j + 1); if (tile.HasTile && tile.TileType == Type) - { WorldGen.KillTile(i, j + 1); - } } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) @@ -36,14 +33,10 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient Tile tileAbove = Framing.GetTileSafely(i, j - 1); int type = -1; if (tileAbove.HasTile && !tileAbove.BottomSlope) - { type = tileAbove.TileType; - } if (type == ModContent.TileType() || type == Type) - { return true; - } WorldGen.KillTile(i, j); return true; @@ -78,9 +71,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient tileBelow.HasTile = true; WorldGen.SquareTileFrame(i, j + 1, true); if (Main.dedServ) - { NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); - } } } } diff --git a/Tiles/SunkenSea/Ambient/DigitateCoral.cs b/Tiles/SunkenSea/Ambient/DigitateCoral.cs index bd9961dd72..b2255c8d13 100644 --- a/Tiles/SunkenSea/Ambient/DigitateCoral.cs +++ b/Tiles/SunkenSea/Ambient/DigitateCoral.cs @@ -23,15 +23,17 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient base.SetStaticDefaults(); } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 2; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } @@ -39,9 +41,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } @@ -49,9 +51,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } } diff --git a/Tiles/SunkenSea/Ambient/DriftwoodAmbient1.cs b/Tiles/SunkenSea/Ambient/DriftwoodAmbient1.cs index 9c278f7bc6..ad72942421 100644 --- a/Tiles/SunkenSea/Ambient/DriftwoodAmbient1.cs +++ b/Tiles/SunkenSea/Ambient/DriftwoodAmbient1.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient HitSound = SoundID.Dig; } } + public class DriftwoodAmbient3 : ModTile { public override void SetStaticDefaults() @@ -72,6 +73,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient HitSound = SoundID.Dig; } } + public class DriftwoodAmbient4 : ModTile { public override void SetStaticDefaults() @@ -93,6 +95,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient HitSound = SoundID.Dig; } } + public class DriftwoodAmbient5 : ModTile { public override void SetStaticDefaults() @@ -114,6 +117,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient HitSound = SoundID.Dig; } } + public class DriftwoodAmbient6 : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/SunkenSea/Ambient/FanCoral.cs b/Tiles/SunkenSea/Ambient/FanCoral.cs index ecf774185d..d30e52a39e 100644 --- a/Tiles/SunkenSea/Ambient/FanCoral.cs +++ b/Tiles/SunkenSea/Ambient/FanCoral.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 225f / 255f; - g = 255f / 255f; - b = 255f / 255f; + r = 0.882f; + g = 1f; + b = 1f; } } } diff --git a/Tiles/SunkenSea/Ambient/FryCoral.cs b/Tiles/SunkenSea/Ambient/FryCoral.cs index 9002d177a9..275a3ac956 100644 --- a/Tiles/SunkenSea/Ambient/FryCoral.cs +++ b/Tiles/SunkenSea/Ambient/FryCoral.cs @@ -29,11 +29,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.BlueMoss; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 235f / 400f; - g = 146f / 400f; - b = 146f / 400f; + r = 0.588f; + g = 0.365f; + b = 0.365f; } } @@ -58,11 +59,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.BlueMoss; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 235f / 400f; - g = 146f / 400f; - b = 146f / 400f; + r = 0.588f; + g = 0.365f; + b = 0.365f; } } public class FryCoral3 : ModTile @@ -86,11 +88,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.BlueMoss; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 235f / 400f; - g = 146f / 400f; - b = 146f / 400f; + r = 0.588f; + g = 0.365f; + b = 0.365f; } } } diff --git a/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs b/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs index 827579e20d..22fd3f6af7 100644 --- a/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs +++ b/Tiles/SunkenSea/Ambient/LongScarletSeagrass.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); brightness += 0.4f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); - r = 187f / 255f; - g = 43f / 255f; - b = 44f / 255f; + r = 0.733f; + g = 0.169f; + b = 0.173f; r *= brightness; g *= brightness; b *= brightness; diff --git a/Tiles/SunkenSea/Ambient/MediumCoral.cs b/Tiles/SunkenSea/Ambient/MediumCoral.cs index 5c27fcdb6f..3cd9962467 100644 --- a/Tiles/SunkenSea/Ambient/MediumCoral.cs +++ b/Tiles/SunkenSea/Ambient/MediumCoral.cs @@ -23,15 +23,17 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient base.SetStaticDefaults(); } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 2; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 229f / 350f; - g = 137f / 350f; - b = 204f / 350f; + r = 0.654f; + g = 0.391f; + b = 0.583f; } } @@ -39,9 +41,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 60f / 400f; - g = 110f / 400f; - b = 146f / 400f; + r = 0.15f; + g = 0.275f; + b = 0.365f; } } @@ -49,9 +51,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 60f / 255f; - g = 110f / 255f; - b = 146f / 255f; + r = 0.235f; + g = 0.431f; + b = 0.573f; } } } diff --git a/Tiles/SunkenSea/Ambient/NavystoneAmbient.cs b/Tiles/SunkenSea/Ambient/NavystoneAmbient.cs index 169776c86a..34beee3454 100644 --- a/Tiles/SunkenSea/Ambient/NavystoneAmbient.cs +++ b/Tiles/SunkenSea/Ambient/NavystoneAmbient.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient HitSound = SoundID.Dig; } } + public class NavystoneAmbient3 : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/SunkenSea/Ambient/NavystonePile.cs b/Tiles/SunkenSea/Ambient/NavystonePile.cs index 9f98dc98a6..73fa99d2ba 100644 --- a/Tiles/SunkenSea/Ambient/NavystonePile.cs +++ b/Tiles/SunkenSea/Ambient/NavystonePile.cs @@ -1,11 +1,8 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; -using Terraria.Enums; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Tiles.SunkenSea.Ambient { @@ -30,4 +27,4 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public class NavystonePile3 : NavystonePile1 { } -} \ No newline at end of file +} diff --git a/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs b/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs index eb442b6f1b..388636ce9e 100644 --- a/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs +++ b/Tiles/SunkenSea/Ambient/RefractiveHangingCoral.cs @@ -27,9 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { Tile tile = Framing.GetTileSafely(i, j + 1); if (tile.HasTile && tile.TileType == Type) - { WorldGen.KillTile(i, j + 1); - } } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) @@ -37,18 +35,15 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient Tile tileAbove = Framing.GetTileSafely(i, j - 1); int type = -1; if (tileAbove.HasTile && !tileAbove.BottomSlope) - { type = tileAbove.TileType; - } if (type == ModContent.TileType() || type == Type) - { return true; - } WorldGen.KillTile(i, j); return true; } + public override void NearbyEffects(int i, int j, bool closer) { // Light Cyan @@ -60,6 +55,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient dust.noLight = true; dust.fadeIn = 2.5813954f; } + //Lilac if (closer && Main.rand.NextBool(600)) { @@ -70,11 +66,11 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient dust.fadeIn = 2.5813954f; } } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { + // Quite possibly some of the laggiest calculations I've ever seen float brightness = 0.9f; - brightness += 0.6f; - brightness = MathHelper.Clamp(brightness, 0.5f, 0.9f); brightness *= (float)MathF.Sin(-j / 40f + Main.GameUpdateCount * 0.01f + i); Color lilac = new Color(236, 194, 252); Color mint = new Color(163, 252, 195); @@ -117,9 +113,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient tileBelow.HasTile = true; WorldGen.SquareTileFrame(i, j + 1, true); if (Main.dedServ) - { NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); - } } } } diff --git a/Tiles/SunkenSea/Ambient/SeaAnemone.cs b/Tiles/SunkenSea/Ambient/SeaAnemone.cs index 3986a6af4c..2f910c9339 100644 --- a/Tiles/SunkenSea/Ambient/SeaAnemone.cs +++ b/Tiles/SunkenSea/Ambient/SeaAnemone.cs @@ -37,13 +37,14 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); brightness += 0.4f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); - r = 85f / 255f; - b = 151f / 255f; - g = 196f / 255f; + r = 0.333f; + b = 0.592f; + g = 0.769f; r *= brightness; g *= brightness; b *= brightness; } + public override void AnimateTile(ref int frame, ref int frameCounter) { frameCounter++; diff --git a/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs b/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs index 5b39be26bd..85db49466c 100644 --- a/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs +++ b/Tiles/SunkenSea/Ambient/SmallBrainCoral.cs @@ -31,9 +31,8 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void NearbyEffects(int i, int j, bool closer) { if (Main.gamePaused) - { return; - } + if (closer) { if (Main.rand.NextBool(300)) diff --git a/Tiles/SunkenSea/Ambient/SmallCorals.cs b/Tiles/SunkenSea/Ambient/SmallCorals.cs index e430167287..59b04ec364 100644 --- a/Tiles/SunkenSea/Ambient/SmallCorals.cs +++ b/Tiles/SunkenSea/Ambient/SmallCorals.cs @@ -35,14 +35,10 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient int type = -1; if (tileBelow.HasTile) - { type = tileBelow.TileType; - } if (type == ModContent.TileType()) - { return true; - } WorldGen.KillTile(i, j); diff --git a/Tiles/SunkenSea/Ambient/SmallWideCoral.cs b/Tiles/SunkenSea/Ambient/SmallWideCoral.cs index 5d7641c3f6..5d5c913b17 100644 --- a/Tiles/SunkenSea/Ambient/SmallWideCoral.cs +++ b/Tiles/SunkenSea/Ambient/SmallWideCoral.cs @@ -25,18 +25,19 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 161f / 500f; - g = 183f / 500f; - b = 73f / 500f; + r = 0.322f; + g = 0.366f; + b = 0.146f; } } + public class SmallWideCoral2 : SmallWideCoral { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 229f / 700f; - g = 137f / 700f; - b = 204f / 700f; + r = 0.327f; + g = 0.196f; + b = 0.291f; } } } diff --git a/Tiles/SunkenSea/Ambient/StalkCoral.cs b/Tiles/SunkenSea/Ambient/StalkCoral.cs index 0ad633d405..6cd41c5f5f 100644 --- a/Tiles/SunkenSea/Ambient/StalkCoral.cs +++ b/Tiles/SunkenSea/Ambient/StalkCoral.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient AddMapEntry(new Color(156, 87, 57)); DustType = DustID.t_PearlWood; HitSound = SoundID.Dig; - } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; @@ -37,9 +37,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 192f / 450f; - g = 173f / 450f; - b = 166f / 450f; + r = 0.427f; + g = 0.384f; + b = 0.369f; } } @@ -64,6 +64,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.t_PearlWood; HitSound = SoundID.Dig; } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; @@ -71,11 +72,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 192f / 450f; - g = 173f / 450f; - b = 166f / 450f; + r = 0.427f; + g = 0.384f; + b = 0.369f; } } + public class StalkCoral3 : ModTile { public override void SetStaticDefaults() @@ -97,6 +99,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.t_PearlWood; HitSound = SoundID.Dig; } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; @@ -104,9 +107,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 192f / 450f; - g = 173f / 450f; - b = 166f / 450f; + r = 0.427f; + g = 0.384f; + b = 0.369f; } } diff --git a/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs b/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs index 9f1a283578..c32be69462 100644 --- a/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs +++ b/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs @@ -29,15 +29,17 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.BlueMoss; HitSound = SoundID.Dig; } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } @@ -62,17 +64,20 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 96; HitSound = SoundID.Dig; } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } + public class TallDigitateCoral3 : ModTile { public override void SetStaticDefaults() @@ -94,6 +99,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 96; HitSound = SoundID.Dig; } + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; @@ -101,11 +107,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } + public class TallDigitateCoral4 : ModTile { public override void SetStaticDefaults() @@ -127,11 +134,12 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 96; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 56f / 400f; - g = 164f / 400f; - b = 180f / 400f; + r = 0.14f; + g = 0.41f; + b = 0.45f; } } } diff --git a/Tiles/SunkenSea/Ambient/WallCoral.cs b/Tiles/SunkenSea/Ambient/WallCoral.cs index 634fe16177..346747394c 100644 --- a/Tiles/SunkenSea/Ambient/WallCoral.cs +++ b/Tiles/SunkenSea/Ambient/WallCoral.cs @@ -34,9 +34,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 189f / 450f; - g = 72f / 450f; - b = 72f / 450f; + r = 0.42f; + g = 0.16f; + b = 0.16f; } } @@ -44,9 +44,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 96f / 450f; - g = 157f / 450f; - b = 187f / 450f; + r = 0.213f; + g = 0.349f; + b = 0.416f; } } @@ -54,9 +54,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 68f / 450f; - g = 154f / 450f; - b = 128f / 450f; + r = 0.151f; + g = 0.342f; + b = 0.284f; } } @@ -64,9 +64,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 206f / 450f; - g = 88f / 450f; - b = 174f / 450f; + r = 0.458f; + g = 0.196f; + b = 0.387f; } } } diff --git a/Tiles/SunkenSea/Ambient/WideScarletSeagrass.cs b/Tiles/SunkenSea/Ambient/WideScarletSeagrass.cs index 587ed2f77e..8d7ab3f8b2 100644 --- a/Tiles/SunkenSea/Ambient/WideScarletSeagrass.cs +++ b/Tiles/SunkenSea/Ambient/WideScarletSeagrass.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.BlueMoss; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { float brightness = 0.7f; @@ -38,9 +39,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); brightness += 0.7f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); - r = 187f / 255f; - g = 43f / 255f; - b = 44f / 255f; + r = 0.733f; + g = 0.169f; + b = 0.173f; r *= brightness; g *= brightness; b *= brightness; @@ -68,6 +69,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 96; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { float brightness = 0.7f; @@ -76,14 +78,15 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); brightness += 0.7f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); - r = 187f / 255f; - g = 43f / 255f; - b = 44f / 255f; + r = 0.733f; + g = 0.169f; + b = 0.173f; r *= brightness; g *= brightness; b *= brightness; } } + public class WideScarletSeagrass3 : ModTile { public override void SetStaticDefaults() @@ -105,6 +108,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = 96; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { float brightness = 0.7f; @@ -113,14 +117,15 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); brightness += 0.7f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); - r = 187f / 255f; - g = 43f / 255f; - b = 44f / 255f; + r = 0.733f; + g = 0.169f; + b = 0.173f; r *= brightness; g *= brightness; b *= brightness; } } + public class WideScarletSeagrass4 : ModTile { public override void SetStaticDefaults() @@ -142,6 +147,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient DustType = DustID.BlueMoss; HitSound = SoundID.Dig; } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { float brightness = 0.7f; @@ -150,9 +156,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient brightness *= (float)MathF.Sin(-i / 8f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes + j); brightness += 0.7f; brightness = MathHelper.Clamp(brightness, 0.1f, 0.5f); - r = 187f / 255f; - g = 43f / 255f; - b = 44f / 255f; + r = 0.733f; + g = 0.169f; + b = 0.173f; r *= brightness; g *= brightness; b *= brightness; diff --git a/Tiles/SunkenSea/BlackPearlPile.cs b/Tiles/SunkenSea/BlackPearlPile.cs index 5bc5af6bb7..2f7bb19c6e 100644 --- a/Tiles/SunkenSea/BlackPearlPile.cs +++ b/Tiles/SunkenSea/BlackPearlPile.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Abyss; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +10,7 @@ namespace CalamityMod.Tiles.SunkenSea { public class BlackPearlPile : ModTile { + public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -21,7 +23,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileShine2[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; - HitSound = SoundID.Shatter; + HitSound = MineSound; DustType = DustID.Lead; AddMapEntry(new Color(29, 33, 38)); diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal.cs b/Tiles/SunkenSea/MediumSeaPrismCrystal.cs index bb01d56583..44c4396200 100644 --- a/Tiles/SunkenSea/MediumSeaPrismCrystal.cs +++ b/Tiles/SunkenSea/MediumSeaPrismCrystal.cs @@ -9,6 +9,7 @@ using Terraria.DataStructures; using Terraria.Enums; using Terraria.ObjectData; using CalamityMod.Items.Weapons.Melee; +using Terraria.GameContent; namespace CalamityMod.Tiles.SunkenSea { @@ -60,6 +61,8 @@ namespace CalamityMod.Tiles.SunkenSea TileObjectData.newAlternate.Origin = new Point16(0, 0); TileObjectData.addAlternate(24); TileObjectData.addTile(Type); + + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0); } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/SunkenSea/PinkPearlPile.cs b/Tiles/SunkenSea/PinkPearlPile.cs index 2e6b07a060..ac2f11245f 100644 --- a/Tiles/SunkenSea/PinkPearlPile.cs +++ b/Tiles/SunkenSea/PinkPearlPile.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Abyss; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +10,7 @@ namespace CalamityMod.Tiles.SunkenSea { public class PinkPearlPile : ModTile { + public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -19,7 +21,7 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.HasSlopeFrames[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; - HitSound = SoundID.Shatter; + HitSound = MineSound; DustType = DustID.Ice_Pink; AddMapEntry(new Color(204, 143, 174)); Main.tileShine[Type] = 3500; diff --git a/Tiles/SunkenSea/WhitePearlPile.cs b/Tiles/SunkenSea/WhitePearlPile.cs index 7ddecd594e..8a1df3286a 100644 --- a/Tiles/SunkenSea/WhitePearlPile.cs +++ b/Tiles/SunkenSea/WhitePearlPile.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Abyss; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +10,7 @@ namespace CalamityMod.Tiles.SunkenSea { public class WhitePearlPile : ModTile { + public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; public override void SetStaticDefaults() { Main.tileSolid[Type] = true; @@ -22,7 +24,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileShine[Type] = 3500; Main.tileShine2[Type] = true; - HitSound = SoundID.Shatter; + HitSound = MineSound; DustType = DustID.Slush; AddMapEntry(new Color(217, 209, 213)); diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index c5cb3cd6d2..031e357a34 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -935,6 +935,7 @@ namespace CalamityMod Main.tileLavaDeath[mt.Type] = !lavaImmune; Main.tileWaterDeath[mt.Type] = false; TileID.Sets.MultiTileSway[mt.Type] = true; + TileID.Sets.IsAMechanism[mt.Type] = true; TileObjectData.newTile.Width = 3; TileObjectData.newTile.Height = 3; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index f241eb3142..460f0f32d4 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -218,8 +218,6 @@ namespace CalamityMod light += 1; if (mp.reaverExplore) light += 2; - if (mp.lumenousAmulet && underwater) - light += 2; if (mp.shine) light += 2; if (mp.blazingCore)