diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 8a1bed0f1c..87c8f2f8d0 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -47,6 +47,17 @@ namespace CalamityMod.Buffs } } + public override void Update(int type, NPC npc, ref int buffIndex) + { + if (type == BuffID.Webbed) + { + if (npc.Calamity().webbed < npc.buffTime[buffIndex]) + npc.Calamity().webbed = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + } + public override void ModifyBuffTip(int type, ref string tip, ref int rare) { if (type == BuffID.NebulaUpDmg1) diff --git a/Buffs/StatBuffs/BloodflareBloodFrenzy.cs b/Buffs/StatBuffs/BloodflareBloodFrenzy.cs index 053a3378e4..8c9ad3837d 100644 --- a/Buffs/StatBuffs/BloodflareBloodFrenzy.cs +++ b/Buffs/StatBuffs/BloodflareBloodFrenzy.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Buffs.StatBuffs { DisplayName.SetDefault("Blood Frenzy"); Description.SetDefault("Contact damage is reduced and melee stats are greatly increased"); - Main.debuff[Type] = false; + Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; longerExpertDebuff = false; diff --git a/Buffs/StatBuffs/ElysianGuard.cs b/Buffs/StatBuffs/ElysianGuard.cs index 04334f8bfb..018030bcc3 100644 --- a/Buffs/StatBuffs/ElysianGuard.cs +++ b/Buffs/StatBuffs/ElysianGuard.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Buffs.StatBuffs { DisplayName.SetDefault("Elysian Guard"); Description.SetDefault("Movement speed reduced, other stats buffed"); - Main.debuff[Type] = false; + Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; diff --git a/Buffs/StatBuffs/PolarisBuff.cs b/Buffs/StatBuffs/PolarisBuff.cs index 048a93d7fd..4654acdc1b 100644 --- a/Buffs/StatBuffs/PolarisBuff.cs +++ b/Buffs/StatBuffs/PolarisBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs b/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs index fb78bb33a9..c0feaf6629 100644 --- a/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs b/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs index 491717c3f3..b6f97b4e67 100644 --- a/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs b/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs index 77abb58f91..65a3e88a9c 100644 --- a/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.StatBuffs Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } diff --git a/Buffs/StatBuffs/TarragonCloak.cs b/Buffs/StatBuffs/TarragonCloak.cs index 26400266e5..d6c7e218a2 100644 --- a/Buffs/StatBuffs/TarragonCloak.cs +++ b/Buffs/StatBuffs/TarragonCloak.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Buffs.StatBuffs { DisplayName.SetDefault("Tarragon Cloak"); Description.SetDefault("Contact damage is reduced"); - Main.debuff[Type] = false; + Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; longerExpertDebuff = false; diff --git a/Buffs/StatBuffs/TarragonImmunity.cs b/Buffs/StatBuffs/TarragonImmunity.cs index 079614f2cb..9645bd17cf 100644 --- a/Buffs/StatBuffs/TarragonImmunity.cs +++ b/Buffs/StatBuffs/TarragonImmunity.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Buffs.StatBuffs { DisplayName.SetDefault("Tarragon Immunity"); Description.SetDefault("You are immune"); - Main.debuff[Type] = false; + Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; longerExpertDebuff = false; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 657951571d..330294da96 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -62,6 +62,11 @@ using Terraria.ModLoader.IO; namespace CalamityMod.CalPlayer { + public enum GaelSwitchPhase + { + LoseRage = 0, + None = 1 + } public class CalamityPlayer : ModPlayer { #region Variables @@ -110,16 +115,17 @@ namespace CalamityMod.CalPlayer public int hInfernoBoost = 0; public int pissWaterBoost = 0; public int gaelRageCooldown = 0; - public int gaelBloodShotCooldown = 0; public int packetTimer = 0; public int bloodflareHeartTimer = 180; public int bloodflareManaTimer = 180; public int moneyStolenByBandit = 0; public int polarisBoostCounter = 0; public int reforges = 0; + public int gaelSwipes = 0; public float modStealth = 1f; public float aquaticBoost = 1f; public float shieldInvinc = 5f; + public GaelSwitchPhase gaelSwitchTimer = 0; // Sound public bool playRogueStealthSound = false; @@ -161,6 +167,7 @@ namespace CalamityMod.CalPlayer public float throwingDamage = 1f; public float throwingVelocity = 1f; public int throwingCrit = 4; + public bool throwingAmmoCost75 = false; public bool throwingAmmoCost66 = false; public bool throwingAmmoCost50 = false; @@ -369,6 +376,7 @@ namespace CalamityMod.CalPlayer public bool ursaSergeant = false; public bool thiefsDime = false; public bool dynamoStemCells = false; + public bool etherealExtorter = false; //public bool dukeScales = false; public bool sandWaifu = false; public bool sandBoobWaifu = false; @@ -395,6 +403,14 @@ namespace CalamityMod.CalPlayer public bool electricianGlove = false; public bool bloodyGlove = false; public bool filthyGlove = false; + public bool sandCloak = false; + public int sandCloakCooldown = 0; + public bool spectralVeil = false; + public int spectralVeilImmunity = 0; + public bool plaguedFuelPack = false; + public int plaguedFuelPackCooldown = 0; + public int plaguedFuelPackDash = 0; + public int plaguedFuelPackDirection = 0; // Armor Set public bool victideSet = false; @@ -591,6 +607,7 @@ namespace CalamityMod.CalPlayer public bool polarisBoostTwo = false; public bool polarisBoostThree = false; public bool bloodfinBoost = false; + public int bloodfinTimer = 30; // Minion public bool resButterfly = false; @@ -861,6 +878,7 @@ namespace CalamityMod.CalPlayer throwingDamage = 1f; throwingVelocity = 1f; throwingCrit = 4; + throwingAmmoCost75 = false; throwingAmmoCost66 = false; throwingAmmoCost50 = false; @@ -870,6 +888,7 @@ namespace CalamityMod.CalPlayer thirdSage = false; if (player.immuneTime == 0) thirdSageH = false; + perfmini = false; akato = false; leviPet = false; @@ -1067,6 +1086,7 @@ namespace CalamityMod.CalPlayer ursaSergeant = false; thiefsDime = false; dynamoStemCells = false; + etherealExtorter = false; //dukeScales = false; daedalusReflect = false; @@ -1140,6 +1160,9 @@ namespace CalamityMod.CalPlayer electricianGlove = false; bloodyGlove = false; filthyGlove = false; + sandCloak = false; + spectralVeil = false; + plaguedFuelPack = false; alcoholPoisoning = false; shadowflame = false; @@ -1328,7 +1351,8 @@ namespace CalamityMod.CalPlayer #region Debuffs //distanceFromBoss = -1; gaelRageCooldown = 0; - gaelBloodShotCooldown = 0; + gaelSwipes = 0; + gaelSwitchTimer = (GaelSwitchPhase)0; stress = 0; adrenaline = 0; adrenalineMaxTimer = 300; @@ -1384,6 +1408,11 @@ namespace CalamityMod.CalPlayer moonCrownCooldown = 0; featherCrownCooldown = 0; sulphurPoison = false; + sandCloakCooldown = 0; + spectralVeilImmunity = 0; + plaguedFuelPackCooldown = 0; + plaguedFuelPackDash = 0; + plaguedFuelPackDirection = 0; #endregion #region Rogue @@ -1394,6 +1423,7 @@ namespace CalamityMod.CalPlayer throwingDamage = 1f; throwingVelocity = 1f; throwingCrit = 4; + throwingAmmoCost75 = false; throwingAmmoCost66 = false; throwingAmmoCost50 = false; #endregion @@ -1487,6 +1517,7 @@ namespace CalamityMod.CalPlayer polarisBoostTwo = false; polarisBoostThree = false; bloodfinBoost = false; + bloodfinTimer = 0; revivify = false; healCounter = 300; #endregion @@ -1567,6 +1598,7 @@ namespace CalamityMod.CalPlayer elysianGuard = false; #endregion + if (CalamityWorld.bossRushActive) { if (!CalamityGlobalNPC.AnyLivingPlayers()) @@ -1704,17 +1736,16 @@ namespace CalamityMod.CalPlayer { CalamityPlayer modOther = other.Calamity(); - // efficiently short circuits to false if there are any discrepancies - // TODO -- order this list by how frequently players are in these various biomes - return ZoneSunkenSea == modOther.ZoneSunkenSea && - ZoneCalamity == modOther.ZoneCalamity && - ZoneAstral == modOther.ZoneAstral && - ZoneSulphur == modOther.ZoneSulphur && - ZoneAbyss == modOther.ZoneAbyss && - ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 && - ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 && + // least common biomes checked first so it short circuits as rapidly as possible + return ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4 && ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 && - ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4; + ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 && + ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 && + ZoneCalamity == modOther.ZoneCalamity && + ZoneSulphur == modOther.ZoneSulphur && + ZoneSunkenSea == modOther.ZoneSunkenSea && + ZoneAbyss == modOther.ZoneAbyss && + ZoneAstral == modOther.ZoneAstral; } public override void CopyCustomBiomesTo(Player other) @@ -1854,6 +1885,87 @@ namespace CalamityMod.CalPlayer } } } + if (CalamityMod.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == player.whoAmI && player.Calamity().rogueStealth >= player.Calamity().rogueStealthMax * 0.25f && + wearingRogueArmor && player.Calamity().rogueStealthMax > 0 && sandCloakCooldown == 0) + { + sandCloakCooldown = 900; + player.Calamity().rogueStealth -= player.Calamity().rogueStealthMax * 0.25f; + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 7, 8, player.whoAmI, 0, 0); + Main.PlaySound(2, player.position, 45); + } + if (CalamityMod.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == player.whoAmI && player.Calamity().rogueStealth >= player.Calamity().rogueStealthMax * 0.25f && + wearingRogueArmor && player.Calamity().rogueStealthMax > 0) + { + float teleportRange = 320f; + Vector2 teleportLocation; + teleportLocation.X = (float)Main.mouseX + Main.screenPosition.X; + if (player.gravDir == 1f) + { + teleportLocation.Y = (float)Main.mouseY + Main.screenPosition.Y - (float)player.height; + } + else + { + teleportLocation.Y = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY; + } + teleportLocation.X -= (float)(player.width / 2); + Vector2 playerToTeleport = teleportLocation - player.position; + if (playerToTeleport.Length() > teleportRange) + { + playerToTeleport.Normalize(); + playerToTeleport *= teleportRange; + teleportLocation = player.position + playerToTeleport; + } + if (teleportLocation.X > 50f && teleportLocation.X < (float)(Main.maxTilesX * 16 - 50) && teleportLocation.Y > 50f && teleportLocation.Y < (float)(Main.maxTilesY * 16 - 50)) + { + int x = (int)(teleportLocation.X / 16f); + int y = (int)(teleportLocation.Y / 16f); + if (!Collision.SolidCollision(teleportLocation, player.width, player.height)) + { + player.Calamity().rogueStealth -= player.Calamity().rogueStealthMax * 0.25f; + + player.Teleport(teleportLocation, 1, 0); + NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); + if (player.chaosState) + { + player.statLife -= player.statLifeMax2 / 7; + PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13); + if (player.statLife <= 0) + { + player.KillMe(damageSource, 1.0, 0, false); + } + } + player.AddBuff(BuffID.ChaosState, 360, true); + + int numDust = 40; + Vector2 step = playerToTeleport / numDust; + for (int i = 0; i < numDust; i++) + { + int dustIndex = Dust.NewDust(player.Center - (step * i), 1, 1, 21, step.X, step.Y); + Main.dust[dustIndex].noGravity = true; + Main.dust[dustIndex].noLight = true; + } + + player.immune = true; + player.immuneTime = 120; + spectralVeilImmunity = 120; + for (int k = 0; k < player.hurtCooldowns.Length; k++) + { + player.hurtCooldowns[k] = player.immuneTime; + } + } + } + + } + if (CalamityMod.PlaguePackHotKey.JustPressed && plaguedFuelPack && Main.myPlayer == player.whoAmI && player.Calamity().rogueStealth >= player.Calamity().rogueStealthMax * 0.25f && + wearingRogueArmor && player.Calamity().rogueStealthMax > 0 && plaguedFuelPackCooldown == 0 && !player.mount.Active) + { + plaguedFuelPackCooldown = 90; + plaguedFuelPackDash = 10; + plaguedFuelPackDirection = player.direction; + player.Calamity().rogueStealth -= player.Calamity().rogueStealthMax * 0.25f; + Main.PlaySound(2, player.position, 66); + Main.PlaySound(2, player.position, 34); + } if (CalamityMod.BossBarToggleHotKey.JustPressed) { if (drawBossHPBar) @@ -2030,44 +2142,33 @@ namespace CalamityMod.CalPlayer Dust.NewDust(player.Center + angle.ToRotationVector2() * 160f, 0, 0, 218, 0f, 0f, 100, default, 1f); } gaelRageCooldown = 60 * GaelsGreatsword.SkullsplosionCooldownSeconds; - int damage2 = 15; - if (CalamityWorld.downedYharon) - { - damage2 = GaelsGreatsword.PostYharonDamage; - } - else if (NPC.downedMoonlord) - { - damage2 = GaelsGreatsword.PostMoonLordDamage; - } - else if (Main.hardMode) - { - damage2 = GaelsGreatsword.HardmodeDamage; - } float rageRatio = (float)stress / stressMax; - int damage = (int)((stress == stressMax ? GaelsGreatsword.MaxRageBoost : rageRatio * GaelsGreatsword.RageBoostMultiplier) * damage2); + int damage = (int)(rageRatio * GaelsGreatsword.MaxRageBoost * GaelsGreatsword.BaseDamage); float skullCount = 5f; float skullSpeed = 5f; if (CalamityWorld.downedYharon) { skullCount = 20f; - skullSpeed = 16f; + skullSpeed = 12f; } else if (NPC.downedMoonlord) { skullCount = 13f; - skullSpeed = 13f; + skullSpeed = 10f; } else if (Main.hardMode) { skullCount = 9f; - skullSpeed = 8.75f; + skullSpeed = 6.8f; } for (float i = 0; i < skullCount; i += 1f) { float angle = MathHelper.TwoPi * i / skullCount; - Vector2 initialVelocity = angle.ToRotationVector2() * skullSpeed; - int projectileIndex = Projectile.NewProjectile(player.Center + initialVelocity * 3f, initialVelocity, ModContent.ProjectileType(), damage, 2f, player.whoAmI); + Vector2 initialVelocity = angle.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(12f)) * skullSpeed * new Vector2(0.82f, 1.5f) * + Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f); + int projectileIndex = Projectile.NewProjectile(player.Center + initialVelocity * 3f, initialVelocity, ModContent.ProjectileType(), damage, 2f, player.whoAmI); Main.projectile[projectileIndex].tileCollide = false; + Main.projectile[projectileIndex].localAI[1] = (Main.projectile[projectileIndex].velocity.Y < 0f).ToInt(); } stress = 0; } @@ -2945,6 +3046,16 @@ namespace CalamityMod.CalPlayer #endregion #region MiscEffects + if (player.HeldItem.type == ModContent.ItemType()) + { + gaelSwitchTimer = GaelSwitchPhase.LoseRage; + stress += (int)MathHelper.Min(5, 10000 - stress); + } + else if (player.HeldItem.type != ModContent.ItemType() && gaelSwitchTimer == GaelSwitchPhase.LoseRage) + { + stress = 0; + gaelSwitchTimer = GaelSwitchPhase.None; + } if (Config.ProficiencyEnabled) { GetExactLevelUp(); @@ -3213,6 +3324,10 @@ namespace CalamityMod.CalPlayer { player.maxFallSpeed *= 1.1f; } + if (etherealExtorter && player.ZoneSkyHeight) + { + player.maxFallSpeed *= 1.25f; + } } if (normalityRelocator) { @@ -3319,6 +3434,14 @@ namespace CalamityMod.CalPlayer featherCrownCooldown--; if (moonCrownCooldown > 0) moonCrownCooldown--; + if (sandCloakCooldown > 0) + sandCloakCooldown--; + if (spectralVeilImmunity > 0) + spectralVeilImmunity--; + if (plaguedFuelPackCooldown > 0) + plaguedFuelPackCooldown--; + if (plaguedFuelPackDash > 0) + plaguedFuelPackDash--; if (ataxiaDmg > 0f) ataxiaDmg -= 1.5f; if (ataxiaDmg < 0f) @@ -3335,8 +3458,6 @@ namespace CalamityMod.CalPlayer aBulwarkRareMeleeBoostTimer--; if (bossRushImmunityFrameCurseTimer > 0) bossRushImmunityFrameCurseTimer--; - if (gaelBloodShotCooldown > 0) - gaelBloodShotCooldown--; if (gaelRageCooldown > 0) gaelRageCooldown--; @@ -3867,6 +3988,110 @@ namespace CalamityMod.CalPlayer } } } + if (spectralVeil && spectralVeilImmunity > 0) + { + Rectangle sVeilRectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0) + { + NPC nPC = Main.npc[i]; + Rectangle rect = nPC.getRect(); + if (sVeilRectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + { + if (player.whoAmI == Main.myPlayer) + { + player.noKnockback = true; + rogueStealth = rogueStealthMax; + spectralVeilImmunity = 0; + + for (int k = 0; k < player.hurtCooldowns.Length; k++) + { + player.hurtCooldowns[k] = player.immuneTime; + } + + Vector2 sVeilDustDir = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)); + sVeilDustDir.Normalize(); + sVeilDustDir *= 0.5f; + for (int j = 0; j < 20; j++) + { + int sVeilDustIndex1 = Dust.NewDust(player.Center, 1, 1, 21, sVeilDustDir.X * j, sVeilDustDir.Y * j); + int sVeilDustIndex2 = Dust.NewDust(player.Center, 1, 1, 21, -sVeilDustDir.X * j, -sVeilDustDir.Y * j); + Main.dust[sVeilDustIndex1].noGravity = false; + Main.dust[sVeilDustIndex1].noLight = false; + Main.dust[sVeilDustIndex2].noGravity = false; + Main.dust[sVeilDustIndex2].noLight = false; + } + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + } + break; + } + } + } + for (int i = 0; i < 1000; i++) + { + if (Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0) + { + Projectile proj = Main.projectile[i]; + Rectangle rect = proj.getRect(); + if (sVeilRectangle.Intersects(rect)) + { + if (player.whoAmI == Main.myPlayer) + { + player.noKnockback = true; + rogueStealth = rogueStealthMax; + spectralVeilImmunity = 0; + + for (int k = 0; k < player.hurtCooldowns.Length; k++) + { + player.hurtCooldowns[k] = player.immuneTime; + } + + Vector2 sVeilDustDir = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)); + sVeilDustDir.Normalize(); + sVeilDustDir *= 0.5f; + for (int j = 0; j < 20; j++) + { + int sVeilDustIndex1 = Dust.NewDust(player.Center, 1, 1, 21, sVeilDustDir.X * j, sVeilDustDir.Y * j); + int sVeilDustIndex2 = Dust.NewDust(player.Center, 1, 1, 21, -sVeilDustDir.X * j, -sVeilDustDir.Y * j); + Main.dust[sVeilDustIndex1].noGravity = false; + Main.dust[sVeilDustIndex1].noLight = false; + Main.dust[sVeilDustIndex2].noGravity = false; + Main.dust[sVeilDustIndex2].noLight = false; + } + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + } + break; + } + } + } + } + if (plaguedFuelPack && plaguedFuelPackDash > 0) + { + if (plaguedFuelPackDash > 1) + player.velocity = new Vector2(plaguedFuelPackDirection, -1) * 25; + else + player.velocity = new Vector2(plaguedFuelPackDirection, -1) * 5; + + int numClouds = Main.rand.Next(2, 10); + for (int i = 0; i < numClouds; i++) + { + Vector2 cloudVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); + cloudVelocity.Normalize(); + cloudVelocity *= Main.rand.NextFloat(0f, 1f); + int projectile = Projectile.NewProjectile(player.Center, cloudVelocity, ModContent.ProjectileType(), 20, 0, player.whoAmI, 0, 0); + Main.projectile[projectile].timeLeft = Main.rand.Next(75, 125); + } + for (int i = 0; i < 3; i++) + { + int dust = Dust.NewDust(player.Center, 1, 1, 89, player.velocity.X * -0.1f, player.velocity.Y * -0.1f, 100, default, 3.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.2f; + Main.dust[dust].velocity.Y -= 0.15f; + } + } #endregion #region StandingStillEffects @@ -4354,6 +4579,84 @@ namespace CalamityMod.CalPlayer { player.Calamity().throwingCrit += 10; } + if (etherealExtorter) + { + bool ZoneForest = !ZoneAbyss && !ZoneSulphur && !ZoneAstral && !ZoneCalamity && !ZoneSunkenSea && !player.ZoneSnow && !player.ZoneCorrupt && !player.ZoneCrimson && !player.ZoneHoly && !player.ZoneDesert && !player.ZoneUndergroundDesert && !player.ZoneGlowshroom && !player.ZoneDungeon && !player.ZoneBeach && !player.ZoneMeteor; + if (player.ZoneUnderworldHeight && !ZoneCalamity && CalamityMod.fireWeaponList.Contains(player.inventory[player.selectedItem].type)) + { + player.endurance += 0.03f; + } + if ((player.ZoneDesert || player.ZoneUndergroundDesert) && CalamityMod.daggerList.Contains(player.inventory[player.selectedItem].type)) + { + player.scope = true; + } + if (ZoneSunkenSea) + { + player.gills = true; + player.ignoreWater = true; + } + if (player.ZoneSnow && CalamityMod.iceWeaponList.Contains(player.inventory[player.selectedItem].type)) + { + player.statDefense += 5; + } + if (ZoneAstral) + { + if (player.wingTimeMax > 0) + player.wingTimeMax = (int)((double)player.wingTimeMax * 1.05); + } + if (player.ZoneJungle && CalamityMod.natureWeaponList.Contains(player.inventory[player.selectedItem].type)) + { + player.AddBuff(165, 5, true); //Dryad's Blessing + } + if (ZoneAbyss) + { + player.blind = true; + player.headcovered = true; + player.blackout = true; + if (player.FindBuffIndex(BuffID.Shine) > -1) + { player.ClearBuff(BuffID.Shine); } + if (player.FindBuffIndex(BuffID.NightOwl) > -1) + { player.ClearBuff(BuffID.NightOwl); } + player.nightVision = false; + shine = false; + player.allDamage += 0.2f; + AllCritBoost(5); + player.statDefense += 8; + player.endurance += 0.05f; + } + if (player.ZoneRockLayerHeight && ZoneForest && CalamityMod.flaskBombList.Contains(player.inventory[player.selectedItem].type)) + { + player.blackBelt = true; + } + if (player.ZoneHoly) + { + player.maxMinions += 1; + player.manaCost *= 0.9f; + player.ammoCost75 = true; //25% chance to not use ranged ammo + throwingAmmoCost75 = true; //25% chance to not consume rogue consumables + } + if (player.ZoneBeach) + { + player.moveSpeed += 0.05f; + } + if (player.ZoneGlowshroom) + { + player.statDefense += 3; + } + if (player.ZoneMeteor) + { + gravityNormalizer = true; + player.slowFall = true; + } + if (Main.moonPhase == 0) //full moon + { + player.fishingSkill += 30; + } + if (Main.moonPhase == 6) //first quarter + { + player.discount = true; + } + } if (harpyRing) { if (player.wingTimeMax > 0) @@ -4958,7 +5261,7 @@ namespace CalamityMod.CalPlayer player.npcTypeNoAggro[ModContent.NPCType()] = true; player.npcTypeNoAggro[ModContent.NPCType()] = true; player.npcTypeNoAggro[ModContent.NPCType()] = true; - // TODO -- When Wulfrum Slimes start being definitely robots, remove this immunity. + // LATER -- When Wulfrum Slimes start being definitely robots, remove this immunity. player.npcTypeNoAggro[ModContent.NPCType()] = true; } @@ -5216,6 +5519,7 @@ namespace CalamityMod.CalPlayer (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + (blueCandle ? 0.05f : 0f) + + (etherealExtorter && player.ZoneBeach ? 0.05f : 0f) + ((deepDiver && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) ? 0.15f : 0f) + (rogueStealthMax > 0f ? (rogueStealth >= rogueStealthMax ? rogueStealth * 0.05f : rogueStealth * 0.025f) : 0f); @@ -5229,6 +5533,7 @@ namespace CalamityMod.CalPlayer (cTracers ? 0.1f : 0f) + (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + + (etherealExtorter && player.ZoneBeach ? 0.05f : 0f) + ((stressPills || laudanum || draedonsHeart) ? 0.05f : 0f) + ((deepDiver && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) ? 0.15f : 0f) + (rogueStealthMax > 0f ? (rogueStealth >= rogueStealthMax ? rogueStealth * 0.05f : rogueStealth * 0.025f) : 0f); @@ -5590,6 +5895,11 @@ namespace CalamityMod.CalPlayer item.Calamity().rogue && item.useTime > 3) return 1.1f; } + if (etherealExtorter) + { + if (Main.moonPhase == 1 && item.Calamity().rogue && item.useTime > 3) //Waning gibbous + return 1.1f; + } return 1f; } #endregion @@ -5615,18 +5925,7 @@ namespace CalamityMod.CalPlayer } if (item.type == ModContent.ItemType()) { - if (CalamityWorld.downedYharon) - { - add += GaelsGreatsword.PostYharonDamage / (float)GaelsGreatsword.BaseDamage - 1f; - } - else if (NPC.downedMoonlord) - { - add += GaelsGreatsword.PostMoonLordDamage / (float)GaelsGreatsword.BaseDamage - 1f; - } - else if (Main.hardMode) - { - add += GaelsGreatsword.HardmodeDamage / (float)GaelsGreatsword.BaseDamage - 1f; - } + add += GaelsGreatsword.BaseDamage / (float)GaelsGreatsword.BaseDamage - 1f; } if (flamethrowerBoost && item.ranged && (item.useAmmo == 23 || item.type == ModContent.ItemType())) { @@ -5644,6 +5943,10 @@ namespace CalamityMod.CalPlayer { add += 0.1f; } + if (etherealExtorter && player.ZoneDungeon && item.Calamity().rogue && !item.consumable) + { + add += 0.05f; + } if (theBee && player.statLife >= player.statLifeMax2) { @@ -5693,6 +5996,14 @@ namespace CalamityMod.CalPlayer if (moscowMule) { knockback *= 1.09f; + } + bool ZoneForest = !ZoneAbyss && !ZoneSulphur && !ZoneAstral && !ZoneCalamity && !ZoneSunkenSea && !player.ZoneSnow && !player.ZoneCorrupt && !player.ZoneCrimson && !player.ZoneHoly && !player.ZoneDesert && !player.ZoneUndergroundDesert && !player.ZoneGlowshroom && !player.ZoneDungeon && !player.ZoneBeach && !player.ZoneMeteor; + if (etherealExtorter) + { + if (player.ZoneOverworldHeight && ZoneForest) + { + knockback *= 1.15f; + } } } #endregion @@ -6230,6 +6541,26 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Midas, 120, false); } } + if (etherealExtorter) + { + if (ZoneSunkenSea) + { + target.AddBuff(ModContent.BuffType(), 60, false); + } + if (ZoneSulphur) + { + target.AddBuff(ModContent.BuffType(), 120, false); + target.AddBuff(ModContent.BuffType(), 300, false); + } + if (Main.moonPhase == 6) //first quarter + { + target.AddBuff(BuffID.Midas, 120, false); + } + if (ZoneCalamity && CalamityMod.fireWeaponList.Contains(player.inventory[player.selectedItem].type)) + { + target.AddBuff(ModContent.BuffType(), 240, false); + } + } } } #endregion @@ -6886,7 +7217,33 @@ namespace CalamityMod.CalPlayer } if ((filthyGlove || electricianGlove) && proj.Calamity().stealthStrike && proj.Calamity().rogue) { - damageMult += 0.01; + damageMult += 0.1; + } + if (etherealExtorter && proj.Calamity().rogue) + { + bool ZoneForest = !ZoneAbyss && !ZoneSulphur && !ZoneAstral && !ZoneCalamity && !ZoneSunkenSea && !player.ZoneSnow && !player.ZoneCorrupt && !player.ZoneCrimson && !player.ZoneHoly && !player.ZoneDesert && !player.ZoneUndergroundDesert && !player.ZoneGlowshroom && !player.ZoneDungeon && !player.ZoneBeach && !player.ZoneMeteor; + if (Main.moonPhase == 7 && crit) //Waxing Gibbous + { + damageMult += 0.05; + } + if (Main.moonPhase == 5) //Waxing Cresent + { + if (proj.penetrate == -1) + damageMult += 0.1; + else if (proj.penetrate >= 5) + damageMult += 0.08; + else if (proj.penetrate == 4) + damageMult += 0.06; + else if (proj.penetrate == 3) + damageMult += 0.03; + else if (proj.penetrate == 2) + damageMult += 0.02; + } + if (player.ZoneDirtLayerHeight && ZoneForest) + { + if (Main.rand.NextBool(20) && !crit) //5% chance to minicrit + damageMult += 0.5; + } } damage = (int)((double)damage * damageMult); @@ -6930,6 +7287,15 @@ namespace CalamityMod.CalPlayer int penetratedDefense = Math.Min(penetratableDefense, 10); damage += (int)(0.5f * penetratedDefense); } + if (proj.Calamity().rogue && etherealExtorter) + { + if (CalamityMod.boomerangProjList.Contains(proj.type) && player.ZoneCorrupt) + { + int penetratableDefense = Math.Max(target.defense - player.armorPenetration, 0); + int penetratedDefense = Math.Min(penetratableDefense, 6); + damage += (int)(0.5f * penetratedDefense); + } + } #endregion #region MultiplicativeReductions @@ -7265,33 +7631,6 @@ namespace CalamityMod.CalPlayer #region Modify Hit By NPC public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) { - if (player.HeldItem.type == ModContent.ItemType() - && npc.active && npc.CanBeChasedBy() && player.altFunctionUse == 2 && Main.rand.NextBool(2)) - { - int direction = -1; - if (npc.Center.X < player.Center.X) - { - direction = 1; - } - int damage2 = 15; - if (CalamityWorld.downedYharon) - { - damage2 = GaelsGreatsword.PostYharonDamage; - } - else if (NPC.downedMoonlord) - { - damage2 = GaelsGreatsword.PostMoonLordDamage; - } - else if (Main.hardMode) - { - damage2 = GaelsGreatsword.HardmodeDamage; - } - player.ApplyDamageToNPC(npc, damage2 * 5, 5, -direction, false); - player.immune = true; - player.immuneNoBlink = true; - player.immuneTime = 4; - damage = 0; - } int bossRushDamage = (Main.expertMode ? 500 : 300) + (CalamityWorld.bossRushStage * 2); if (CalamityWorld.bossRushActive) { @@ -7370,23 +7709,11 @@ namespace CalamityMod.CalPlayer int dustIndex = Dust.NewDust(proj.position, proj.width, proj.height, 31, 0f, 0f, 0, default(Color), 1f); Main.dust[dustIndex].velocity *= 0.3f; } - int damage2 = 15; - if (CalamityWorld.downedYharon) - { - damage2 = GaelsGreatsword.PostYharonDamage; - } - else if (NPC.downedMoonlord) - { - damage2 = GaelsGreatsword.PostMoonLordDamage; - } - else if (Main.hardMode) - { - damage2 = GaelsGreatsword.HardmodeDamage; - } + int damage2 = GaelsGreatsword.BaseDamage; proj.hostile = false; proj.friendly = true; proj.velocity *= -1f; - proj.damage = damage2 * 5; + proj.damage = damage2; proj.penetrate = 1; player.immune = true; player.immuneNoBlink = true; @@ -10798,7 +11125,7 @@ namespace CalamityMod.CalPlayer fullBright = true; } } - if (mushy) + if (mushy || (etherealExtorter && player.ZoneGlowshroom)) { if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) { @@ -11005,6 +11332,11 @@ namespace CalamityMod.CalPlayer stealthGenMoving += 0.2f; } + if (etherealExtorter && Main.moonPhase == 3) //Waning Crescent + { + stealthGenMoving += 0.1f; + } + bool standstill = Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active; // Stealth gen acceleration diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index e70066ba74..fe95cc9855 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -287,7 +287,15 @@ namespace CalamityMod.CalPlayer player.lifeRegen += 5; player.lifeRegenTime += 10; } - } + if (modPlayer.bloodfinTimer > 0) + { modPlayer.bloodfinTimer--; } + if (player.whoAmI == Main.myPlayer && modPlayer.bloodfinTimer <= 0) + { + modPlayer.bloodfinTimer = 30; + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.75)) + player.statLife += 1; + } + } if (modPlayer.celestialJewel || modPlayer.astralArcanum) { @@ -577,6 +585,9 @@ namespace CalamityMod.CalPlayer player.lifeRegen += 2; } + if (modPlayer.etherealExtorter || player.ZoneGlowshroom) + player.lifeRegen += 1; + if (!player.shinyStone) { int lifeRegenTimeMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 450 : 1800; diff --git a/CalamityMod.cs b/CalamityMod.cs index 0e0906565b..56edcb11a7 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -15,6 +15,7 @@ using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Localization; +using CalamityMod.NPCs; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; @@ -46,7 +47,10 @@ using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Enemy; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Typeless; using CalamityMod.Skies; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Furniture; @@ -84,7 +88,7 @@ namespace CalamityMod { public class CalamityMod : Mod { - // TODO -- I have been advised by Jopo that Mods should never contain static variables + // CONSIDER -- I have been advised by Jopo that Mods should never contain static variables // Hotkeys public static ModHotKey NormalityRelocatorHotKey; @@ -97,6 +101,9 @@ namespace CalamityMod public static ModHotKey BossBarToggleHotKey; public static ModHotKey BossBarToggleSmallTextHotKey; public static ModHotKey MomentumCapacitatorHotkey; + public static ModHotKey SandCloakHotkey; + public static ModHotKey SpectralVeilHotKey; + public static ModHotKey PlaguePackHotKey; // Boss Spawners public static int ghostKillCount = 0; @@ -162,6 +169,11 @@ namespace CalamityMod public static List daggerList; public static List flaskBombList; public static List spikyBallList; + public static List boomerangProjList; + public static List javelinProjList; + public static List daggerProjList; + public static List flaskBombProjList; + public static List spikyBallProjList; public static List noGravityList; public static List lavaFishList; public static List highTestFishList; @@ -192,6 +204,9 @@ namespace CalamityMod AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P"); AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O"); MomentumCapacitatorHotkey = RegisterHotKey("Momentom Capacitater Effect", "U"); + SandCloakHotkey = RegisterHotKey("Sand Cloak Effect", "C"); + SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z"); + PlaguePackHotKey = RegisterHotKey("Plagued Fuel Pack Dash", "Q"); BossBarToggleHotKey = RegisterHotKey("Boss Health Bar Toggle", "NumPad0"); BossBarToggleSmallTextHotKey = RegisterHotKey("Boss Health Bar Small Text Toggle", "NumPad1"); @@ -204,6 +219,8 @@ namespace CalamityMod BossHealthBarManager.Load(this); + TileFraming.Load(); + Config.Load(); SetupLists(); @@ -280,6 +297,9 @@ namespace CalamityMod AstralTeleportHotKey = null; AstralArcanumUIHotkey = null; MomentumCapacitatorHotkey = null; + SandCloakHotkey = null; + SpectralVeilHotKey = null; + PlaguePackHotKey = null; BossBarToggleHotKey = null; BossBarToggleSmallTextHotKey = null; @@ -333,6 +353,11 @@ namespace CalamityMod daggerList = null; flaskBombList = null; spikyBallList = null; + boomerangProjList = null; + javelinProjList = null; + daggerProjList = null; + flaskBombProjList = null; + spikyBallProjList = null; noGravityList = null; lavaFishList = null; highTestFishList = null; @@ -349,6 +374,8 @@ namespace CalamityMod BossHealthBarManager.Unload(); base.Unload(); + TileFraming.Unload(); + AstralArcanumUI.Unload(); base.Unload(); @@ -833,6 +860,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -878,6 +907,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), //Cryonic Bar set stuff, could potentially be removed ModContent.ItemType(), ModContent.ItemType(), @@ -995,6 +1025,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -1728,6 +1759,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1743,9 +1775,49 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + }; + + boomerangProjList = new List() + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() }; javelinList = new List() @@ -1765,11 +1837,34 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; + javelinProjList = new List() + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }; + daggerList = new List() { + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -1792,7 +1887,51 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + }; + + daggerProjList = new List() + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() }; flaskBombList = new List() @@ -1803,18 +1942,46 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; + flaskBombProjList = new List() + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }; + spikyBallList = new List() { + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() + }; + + spikyBallProjList = new List() + { + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() }; noGravityList = new List() @@ -2011,6 +2178,7 @@ namespace CalamityMod ModContent.TileType(), ModContent.TileType(), ModContent.TileType(), + ModContent.TileType(), ModContent.TileType(), ModContent.TileType(), ModContent.TileType(), @@ -3121,6 +3289,32 @@ namespace CalamityMod case CalamityModMessageType.DeathCountSync: Main.player[reader.ReadInt32()].Calamity().HandleDeathCount(reader); break; + case CalamityModMessageType.RevengeanceBoolSync: + bool revActive = reader.ReadBoolean(); + CalamityWorld.revenge = revActive; + break; + case CalamityModMessageType.DeathBoolSync: + bool revActive2 = reader.ReadBoolean(); + CalamityWorld.revenge = revActive2; + bool deathActive = reader.ReadBoolean(); + CalamityWorld.death = deathActive; + break; + case CalamityModMessageType.DefiledBoolSync: + bool defiledActive = reader.ReadBoolean(); + CalamityWorld.defiled = defiledActive; + break; + case CalamityModMessageType.IronHeartBoolSync: + bool ironHeartActive = reader.ReadBoolean(); + CalamityWorld.ironHeart = ironHeartActive; + break; + case CalamityModMessageType.ArmageddonBoolSync: + bool armaActive = reader.ReadBoolean(); + CalamityWorld.armageddon = armaActive; + break; + case CalamityModMessageType.NPCRegenerationSync: + byte npcIndex = reader.ReadByte(); + Main.npc[npcIndex].lifeRegen = reader.ReadInt32(); + break; default: Logger.Warn("Unknown Message type: " + msgType); break; @@ -3142,7 +3336,9 @@ namespace CalamityMod public static void UpdateServerBoolean() { if (Main.netMode == NetmodeID.Server) + { NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } #endregion } @@ -3174,7 +3370,14 @@ namespace CalamityMod DoGCountdownSync, BossSpawnCountdownSync, BossTypeSync, - DeathCountSync + DeathCountSync, + RevengeanceBoolSync, + DeathBoolSync, + DefiledBoolSync, + IronHeartBoolSync, + ArmageddonBoolSync, + DemonTrophyBoolSync, + NPCRegenerationSync //DistanceFromBossSync } } diff --git a/Items/Accessories/EtherealExtorter.cs b/Items/Accessories/EtherealExtorter.cs new file mode 100644 index 0000000000..0270046c6a --- /dev/null +++ b/Items/Accessories/EtherealExtorter.cs @@ -0,0 +1,39 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class EtherealExtorter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ethereal Extorter"); + Tooltip.SetDefault(@"Infuses souls into your weapons and body generating different boosts that vary with the environment +Rogue projectiles rarely explode into homing souls +10% rogue damage but reduced life regen"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 32; + item.accessory = true; + item.value = Item.buyPrice(0, 24, 0, 0); + item.rare = 8; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.etherealExtorter = true; + modPlayer.throwingDamage += 0.1f; + player.lifeRegen -= 1; //canceled out in mushroom biome btw + if (Main.moonPhase == 4) //new moon + { + modPlayer.rogueStealthMax += 0.1f; + } + } + } +} diff --git a/Items/Accessories/EtherealExtorter.png b/Items/Accessories/EtherealExtorter.png new file mode 100644 index 0000000000..c257c4e747 Binary files /dev/null and b/Items/Accessories/EtherealExtorter.png differ diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs new file mode 100644 index 0000000000..238b57cecf --- /dev/null +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -0,0 +1,35 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class PlaguedFuelPack : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plagued Fuel Pack"); + Tooltip.SetDefault("*5 increased rogue damage\n" + + "15% increased rogue projectile velocity\n" + + "Press [Hotkey] to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of plagued clouds\n" + + "This effect has a 3 second cooldown before it can be used again"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 36; + item.value = Item.buyPrice(0, 24, 0, 0); + item.rare = 8; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().throwingDamage += 0.08f; + player.Calamity().throwingVelocity += 0.15f; + player.Calamity().plaguedFuelPack = true; + } + } +} diff --git a/Items/Accessories/PlaguedFuelPack.png b/Items/Accessories/PlaguedFuelPack.png new file mode 100644 index 0000000000..41549f5fcf Binary files /dev/null and b/Items/Accessories/PlaguedFuelPack.png differ diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs new file mode 100644 index 0000000000..1cb283751d --- /dev/null +++ b/Items/Accessories/SandCloak.cs @@ -0,0 +1,34 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class SandCloak : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sand Cloak"); + Tooltip.SetDefault("+1 defense and 5% increased movement speed\n" + + "Press C to consume 25% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen\n" + + "This effect has a 30 second cooldown before it can be used again"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 44; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statDefense += 1; + player.moveSpeed += 0.05f; + player.Calamity().sandCloak = true; + } + } +} diff --git a/Items/Accessories/SandCloak.png b/Items/Accessories/SandCloak.png new file mode 100644 index 0000000000..311b82e2b2 Binary files /dev/null and b/Items/Accessories/SandCloak.png differ diff --git a/Items/Accessories/SilencingSheath.cs b/Items/Accessories/SilencingSheath.cs index 3bd73b4b6c..c751a8f490 100644 --- a/Items/Accessories/SilencingSheath.cs +++ b/Items/Accessories/SilencingSheath.cs @@ -35,15 +35,7 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.DemoniteBar, 8); recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddIngredient(ItemID.ShadowScale, 3); - recipe.AddTile(TileID.TinkerersWorkbench); - recipe.SetResult(this); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 8); - recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddIngredient(ItemID.TissueSample, 3); + recipe.AddRecipeGroup("Boss2Material", 3); recipe.AddTile(TileID.TinkerersWorkbench); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs new file mode 100644 index 0000000000..f06ad15c1a --- /dev/null +++ b/Items/Accessories/SpectralVeil.cs @@ -0,0 +1,32 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class SpectralVeil : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spectral Veil"); + Tooltip.SetDefault("The inside of the cloak is full of teeth...\n" + + "Press Z to consume 25% of your maximum stealth to perform a short range teleport and render you momentarily invulnerable\n" + + "If you dodge something while invulnerable, you instantly gain full stealth"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 38; + item.value = Item.buyPrice(1, 40, 0, 0); + item.Calamity().postMoonLordRarity = 13; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().spectralVeil = true; + } + } +} diff --git a/Items/Accessories/SpectralVeil.png b/Items/Accessories/SpectralVeil.png new file mode 100644 index 0000000000..a095d7a028 Binary files /dev/null and b/Items/Accessories/SpectralVeil.png differ diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index dc3e858619..44e1e470fd 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -61,6 +61,7 @@ namespace CalamityMod.Items.Accessories.Wings player.pickSpeed -= 0.05f; player.allDamage += 0.05f; player.wingTimeMax = 100; + player.noFallDmg = true; } } } diff --git a/Items/Ammo/AstralSolution.cs b/Items/Ammo/AstralSolution.cs index dfd6820718..22601bac44 100644 --- a/Items/Ammo/AstralSolution.cs +++ b/Items/Ammo/AstralSolution.cs @@ -16,7 +16,6 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { item.ammo = AmmoID.Solution; - // TODO -- what is even happening here item.shoot = ModContent.ProjectileType() - ProjectileID.PureSpray; item.width = 10; item.height = 12; diff --git a/Items/Ammo/FiniteUse/ExplosiveShells.cs b/Items/Ammo/FiniteUse/ExplosiveShells.cs index 7dbcb89086..46393b7ecd 100644 --- a/Items/Ammo/FiniteUse/ExplosiveShells.cs +++ b/Items/Ammo/FiniteUse/ExplosiveShells.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Ammo.FiniteUse item.rare = 8; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - item.ammo = ModContent.ItemType(); // TODO -- would item.type work here + item.ammo = ModContent.ItemType(); // CONSIDER -- Would item.type work here instead of a self reference? } } } diff --git a/Items/Ammo/FiniteUse/GrenadeRounds.cs b/Items/Ammo/FiniteUse/GrenadeRounds.cs index a7ba5dbf3d..f8921b4f9b 100644 --- a/Items/Ammo/FiniteUse/GrenadeRounds.cs +++ b/Items/Ammo/FiniteUse/GrenadeRounds.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Ammo.FiniteUse item.rare = 8; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - item.ammo = ModContent.ItemType(); // TODO -- would item.type work here + item.ammo = ModContent.ItemType(); // CONSIDER -- Would item.type work here instead of a self reference? } } } diff --git a/Items/Ammo/FiniteUse/MagnumRounds.cs b/Items/Ammo/FiniteUse/MagnumRounds.cs index 6cd9275875..95cb8a4c6e 100644 --- a/Items/Ammo/FiniteUse/MagnumRounds.cs +++ b/Items/Ammo/FiniteUse/MagnumRounds.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Ammo.FiniteUse item.rare = 8; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - item.ammo = ModContent.ItemType(); // TODO -- would item.type work here + item.ammo = ModContent.ItemType(); // CONSIDER -- Would item.type work here instead of a self reference? } } } diff --git a/Items/Armor/UmbraphileHood.cs b/Items/Armor/UmbraphileHood.cs index 53da9fde5e..86f6f5b55a 100644 --- a/Items/Armor/UmbraphileHood.cs +++ b/Items/Armor/UmbraphileHood.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor player.Calamity().throwingVelocity += 0.10f; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); @@ -63,6 +63,6 @@ namespace CalamityMod.Items.Armor recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 72e61dddcb..7d0d8d81a5 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -290,9 +290,14 @@ namespace CalamityMod.Items { if (item.ranged && !rogue && Main.rand.Next(0, 100) >= 80) { + double damageMult = 1.0; + damageMult = (double)(item.useTime) / 30.0; + + double newDamage = (double)damage * 2 * damageMult; + if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, ModContent.ProjectileType(), (int)((double)damage * 2), 2f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, ModContent.ProjectileType(), (int)newDamage, 2f, player.whoAmI, 0f, 0f); } } } @@ -450,6 +455,10 @@ namespace CalamityMod.Items { return false; } + if ((item.type == ItemID.ShinePotion || item.type == ItemID.NightOwlPotion) && (modPlayer.etherealExtorter && modPlayer.ZoneAbyss)) + { + return false; + } if ((item.type == ItemID.SuperAbsorbantSponge || item.type == ItemID.EmptyBucket) && modPlayer.ZoneAbyss) { return false; @@ -846,7 +855,7 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.IronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) + if (item.type == ItemID.AncientIronHelmet || item.type == ItemID.IronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) { foreach (TooltipLine line2 in tooltips) { @@ -886,7 +895,7 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.GoldHelmet || item.type == ItemID.GoldChainmail || item.type == ItemID.GoldGreaves) + if (item.type == ItemID.AncientGoldHelmet || item.type == ItemID.GoldHelmet || item.type == ItemID.GoldChainmail || item.type == ItemID.GoldGreaves) { foreach (TooltipLine line2 in tooltips) { @@ -1919,6 +1928,11 @@ Grants immunity to fire blocks, and temporary immunity to lava"; DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); break; + // Queen Bee + case ItemID.QueenBeeBossBag: + DropHelper.DropItem(player, ModContent.ItemType(), 50, 75); + break; + // Skeletron case ItemID.SkeletronBossBag: DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); @@ -1987,7 +2001,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; return "Copper"; if (head.type == ItemID.TinHelmet && body.type == ItemID.TinChainmail && legs.type == ItemID.TinGreaves) return "Tin"; - if (head.type == ItemID.IronHelmet && body.type == ItemID.IronChainmail && legs.type == ItemID.IronGreaves) + if ((head.type == ItemID.IronHelmet || head.type == ItemID.AncientIronHelmet) && body.type == ItemID.IronChainmail && legs.type == ItemID.IronGreaves) return "Iron"; if (head.type == ItemID.LeadHelmet && body.type == ItemID.LeadChainmail && legs.type == ItemID.LeadGreaves) return "Lead"; @@ -1995,7 +2009,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; return "Silver"; if (head.type == ItemID.TungstenHelmet && body.type == ItemID.TungstenChainmail && legs.type == ItemID.TungstenGreaves) return "Tungsten"; - if (head.type == ItemID.GoldHelmet && body.type == ItemID.GoldChainmail && legs.type == ItemID.GoldGreaves) + if ((head.type == ItemID.GoldHelmet || head.type == ItemID.AncientGoldHelmet) && body.type == ItemID.GoldChainmail && legs.type == ItemID.GoldGreaves) return "Gold"; if (head.type == ItemID.PlatinumHelmet && body.type == ItemID.PlatinumChainmail && legs.type == ItemID.PlatinumGreaves) return "Platinum"; @@ -2414,7 +2428,8 @@ Grants immunity to fire blocks, and temporary immunity to lava"; (modPlayer.soaring ? 0.1f : 0f) + (modPlayer.holyWrath ? 0.05f : 0f) + (modPlayer.profanedRage ? 0.05f : 0f) + - (modPlayer.draconicSurge ? 0.15f : 0f); + (modPlayer.draconicSurge ? 0.15f : 0f) + + (modPlayer.etherealExtorter && modPlayer.ZoneAstral ? 0.05f : 0f); if (flightSpeedMult > 1.2f) flightSpeedMult = 1.2f; diff --git a/Items/DifficultyItems/Armageddon.cs b/Items/DifficultyItems/Armageddon.cs index 8d265a0007..c42330f06d 100644 --- a/Items/DifficultyItems/Armageddon.cs +++ b/Items/DifficultyItems/Armageddon.cs @@ -72,6 +72,14 @@ namespace CalamityMod.Items.DifficultyItems } CalamityMod.UpdateServerBoolean(); + + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((uint)CalamityModMessageType.ArmageddonBoolSync); + netMessage.Write(CalamityWorld.armageddon); + netMessage.Send(); + } return true; } diff --git a/Items/DifficultyItems/Death.cs b/Items/DifficultyItems/Death.cs index 0e5a68eb3c..20322b64dd 100644 --- a/Items/DifficultyItems/Death.cs +++ b/Items/DifficultyItems/Death.cs @@ -86,6 +86,14 @@ namespace CalamityMod.Items.DifficultyItems } CalamityMod.UpdateServerBoolean(); + + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DeathBoolSync); + netMessage.Write(CalamityWorld.death); + netMessage.Send(); + } return true; } diff --git a/Items/DifficultyItems/DefiledRune.cs b/Items/DifficultyItems/DefiledRune.cs index c86876f8ec..8a633f5557 100644 --- a/Items/DifficultyItems/DefiledRune.cs +++ b/Items/DifficultyItems/DefiledRune.cs @@ -83,6 +83,16 @@ namespace CalamityMod.Items.DifficultyItems } CalamityMod.UpdateServerBoolean(); + + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.RevengeanceBoolSync); + netMessage.Write(CalamityWorld.revenge); + netMessage.Write((byte)CalamityModMessageType.DefiledBoolSync); + netMessage.Write(CalamityWorld.defiled); + netMessage.Send(); + } return true; } diff --git a/Items/DifficultyItems/IronHeart.cs b/Items/DifficultyItems/IronHeart.cs index fcc45eeafe..58236f96e4 100644 --- a/Items/DifficultyItems/IronHeart.cs +++ b/Items/DifficultyItems/IronHeart.cs @@ -83,6 +83,14 @@ namespace CalamityMod.Items.DifficultyItems } } CalamityMod.UpdateServerBoolean(); + + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.IronHeartBoolSync); + netMessage.Write(CalamityWorld.ironHeart); + netMessage.Send(); + } return true; } } diff --git a/Items/DifficultyItems/MLGRune.cs b/Items/DifficultyItems/MLGRune.cs index cdb8ef2931..3fbbabeb5f 100644 --- a/Items/DifficultyItems/MLGRune.cs +++ b/Items/DifficultyItems/MLGRune.cs @@ -31,6 +31,13 @@ namespace CalamityMod.Items.DifficultyItems { CalamityWorld.demonMode = true; CalamityMod.UpdateServerBoolean(); + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DemonTrophyBoolSync); + netMessage.Write(CalamityWorld.demonMode); + netMessage.Send(); + } return true; } } diff --git a/Items/DifficultyItems/Revenge.cs b/Items/DifficultyItems/Revenge.cs index a1ad1ae0f5..0b66eabc2f 100644 --- a/Items/DifficultyItems/Revenge.cs +++ b/Items/DifficultyItems/Revenge.cs @@ -128,6 +128,13 @@ namespace CalamityMod.Items.DifficultyItems } CalamityMod.UpdateServerBoolean(); + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.RevengeanceBoolSync); + netMessage.Write(CalamityWorld.revenge); + netMessage.Send(); + } } return true; } diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 0a44300c0a..b12c8fca28 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -11,8 +11,9 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodfin"); - Tooltip.SetDefault("Boosts life regen for 10 seconds\n" + - "Angiogenesis"); + Tooltip.SetDefault(@"Grants a buff that boosts life regen for 10 seconds +The life regen boost is stronger if below 75% health +Angiogenesis"); } public override void SetDefaults() @@ -31,8 +32,6 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches item.consumable = true; item.healLife = 240; item.potion = true; - item.buffType = ModContent.BuffType(); - item.buffTime = 600; } public override bool CanUseItem(Player player) diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index 44abd00e0f..135b557a6f 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches } // Equipment - DropHelper.DropItemFromSetCondition(player, Main.hardMode, 0.2f, + DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.25f, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches DropHelper.DropItemChance(player, ModContent.ItemType(), 10, 1, 3); if (Main.hardMode) { - DropHelper.DropItem(player, Main.rand.Next(100) >= 49 ? ItemID.GreaterHealingPotion: ItemID.GreaterManaPotion, 5, 10); + DropHelper.DropItem(player, Main.rand.Next(100) >= 49 ? ItemID.GreaterHealingPotion : ItemID.GreaterManaPotion, 5, 10); } else { diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs new file mode 100644 index 0000000000..3d126504ff --- /dev/null +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs @@ -0,0 +1,41 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Tiles.FurnitureCosmilite; +using CalamityMod.Tiles.Furniture.CraftingStations; + +namespace CalamityMod.Items.Placeables.FurnitureCosmilite +{ + public class CosmiliteBasin : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cosmilite Basin"); + } + + public override void SetDefaults() + { + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.IronBar, 5); + recipe.anyIronBar = true; + recipe.SetResult(this, 1); + recipe.AddTile(ModContent.TileType()); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.png b/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.png new file mode 100644 index 0000000000..a2631e6bee Binary files /dev/null and b/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.png differ diff --git a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs index b7a95bae99..ad183ce0d3 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs @@ -29,14 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddIngredient(ItemID.GoldBar); - recipe.SetResult(this); - recipe.AddTile(ModContent.TileType()); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddIngredient(ItemID.PlatinumBar); + recipe.AddRecipeGroup("AnyGoldBar"); recipe.SetResult(this); recipe.AddTile(ModContent.TileType()); recipe.AddRecipe(); diff --git a/Items/Placeables/FurnitureSilva/SilvaChest.cs b/Items/Placeables/FurnitureSilva/SilvaChest.cs index 5b3dd21f05..61ca4a0ef5 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChest.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChest.cs @@ -27,15 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.GoldBar); - recipe.anyIronBar = true; - recipe.SetResult(this); - recipe.AddTile(ModContent.TileType()); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ItemID.PlatinumBar); - recipe.anyIronBar = true; + recipe.AddRecipeGroup("AnyGoldBar"); recipe.SetResult(this); recipe.AddTile(ModContent.TileType()); recipe.AddRecipe(); diff --git a/Items/Placeables/FurnitureSilva/SilvaClock.cs b/Items/Placeables/FurnitureSilva/SilvaClock.cs index 7cf838e5e1..3999459299 100644 --- a/Items/Placeables/FurnitureSilva/SilvaClock.cs +++ b/Items/Placeables/FurnitureSilva/SilvaClock.cs @@ -27,15 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.GoldBar, 3); - recipe.anyIronBar = true; - recipe.AddIngredient(ItemID.Glass, 6); - recipe.SetResult(this); - recipe.AddTile(ModContent.TileType()); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.PlatinumBar, 3); + recipe.AddRecipeGroup("AnyGoldBar", 3); recipe.anyIronBar = true; recipe.AddIngredient(ItemID.Glass, 6); recipe.SetResult(this); diff --git a/Items/Potions/AstralJelly.cs b/Items/Potions/AstralJelly.cs index e4451a7c2d..a81d078260 100644 --- a/Items/Potions/AstralJelly.cs +++ b/Items/Potions/AstralJelly.cs @@ -26,15 +26,14 @@ namespace CalamityMod.Items.Potions item.UseSound = SoundID.Item3; item.consumable = true; item.value = Item.buyPrice(0, 4, 50, 0); - item.buffType = BuffID.WellFed; - item.buffTime = 108000; + item.buffType = BuffID.MagicPower; + item.buffTime = 21600; } public override void OnConsumeItem(Player player) { - player.AddBuff(BuffID.ManaRegeneration, 21600); player.AddBuff(BuffID.MagicPower, 21600); - player.AddBuff(BuffID.WellFed, 108000); + player.AddBuff(BuffID.ManaRegeneration, 21600); } } } diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index 64f1af914a..7328bdd785 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items return true; } - // TODO -- Make Super Dummies work in multiplayer by spawning correctly. + // DEFECT -- Make Super Dummies work in multiplayer by spawning correctly. public override bool UseItem(Player player) { if (player.altFunctionUse == 2) diff --git a/Items/TreasureBags/CrabulonBag.cs b/Items/TreasureBags/CrabulonBag.cs index d8600e6c10..cafa89a774 100644 --- a/Items/TreasureBags/CrabulonBag.cs +++ b/Items/TreasureBags/CrabulonBag.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); // Equipment DropHelper.DropItem(player, ModContent.ItemType()); diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index a93a35cb95..d3720de54d 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -39,10 +39,10 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().postMoonLordRarity = 13; } - public override Vector2? HoldoutOrigin() + /*public override Vector2? HoldoutOrigin() { return new Vector2(15, 15); - } + }*/ public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index cf5a5da513..3e263576e2 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -38,10 +38,10 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().postMoonLordRarity = 13; } - public override Vector2? HoldoutOrigin() + /*public override Vector2? HoldoutOrigin() { return new Vector2(15, 15); - } + }*/ public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index 60de40b5fb..6aec678d06 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic { public class HeliumFlash : ModItem { - public static int BaseDamage = 1900; + public static int BaseDamage = 1280; public static float Speed = 15f; public override void SetStaticDefaults() diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index c0fad19bde..a7ac01484b 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -39,10 +39,10 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().postMoonLordRarity = 14; } - public override Vector2? HoldoutOrigin() + /*public override Vector2? HoldoutOrigin() { return new Vector2(15, 15); - } + }*/ public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { diff --git a/Items/Weapons/Magic/Vesuvius.cs b/Items/Weapons/Magic/Vesuvius.cs index 3487a57200..f2b94fda2d 100644 --- a/Items/Weapons/Magic/Vesuvius.cs +++ b/Items/Weapons/Magic/Vesuvius.cs @@ -41,10 +41,10 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().postMoonLordRarity = 17; } - public override Vector2? HoldoutOrigin() + /*public override Vector2? HoldoutOrigin() { return new Vector2(30, 30); - } + }*/ public override bool AltFunctionUse(Player player) { diff --git a/Items/Weapons/Melee/ColdheartIcicle.cs b/Items/Weapons/Melee/ColdheartIcicle.cs index 56e76644bf..aa52321516 100644 --- a/Items/Weapons/Melee/ColdheartIcicle.cs +++ b/Items/Weapons/Melee/ColdheartIcicle.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee crit = false; } - // TODO -- Providence specifically is immune to Coldheart Icicle. There is probably a better way to do this + // LATER -- Providence specifically is immune to Coldheart Icicle. There is probably a better way to do this public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) { damage = 1; diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index baa49a9851..a36466a014 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -1,10 +1,13 @@ using CalamityMod.Projectiles.Melee; +using CalamityMod.World; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.GameInput; using Terraria.Graphics.Capture; using Terraria.ModLoader; +using Terraria.World.Generation; namespace CalamityMod.Items.Weapons.Melee { @@ -12,65 +15,37 @@ namespace CalamityMod.Items.Weapons.Melee { //Help, they're forcing me to slave away at Calamity until I die! - Dominic - public int SwingType; - //Weapon attribute constants - public static readonly int BaseDamage = 8; + public static readonly int BaseDamage = 11145; - public static readonly int HardmodeDamage = 24; + public static readonly float TrueMeleeBoost = 2.5f; - public static readonly int PostMoonLordDamage = 270; - - public static readonly int PostYharonDamage = 10000; - - public static readonly float TrueMeleeBoostPreHardmode = 1.75f; - - public static readonly float TrueMeleeBoostHardmode = 2.5f; + public static readonly float GiantSkullDamageMultiplier = 1.5f; //Weapon projectile attribute constants - public static readonly int BaseSearchDistance = 400; + public static readonly int SearchDistance = 1450; - public static readonly int HardmodeSearchDistance = 660; + public static readonly int ImmunityFrames = 2; - public static readonly int PostMoonLordSearchDistance = 940; - - public static readonly int PostYharonSearchDistance = 1450; - - public static readonly int BaseImmunityFrames = 11; - - public static readonly int HardmodeImmunityFrames = 7; - - public static readonly int PostMoonLordImmunityFrames = 4; - - public static readonly int PostYharonImmunityFrames = 2; - - public static readonly int SkullsplosionCooldownSeconds = 10; - - public static readonly int PreMoonlordPenetrate = 3; //Infinite after Moon lord is dead + public static readonly int SkullsplosionCooldownSeconds = 30; //Skull ring attribute constants - public static readonly float MaxRageBoost = 2.5f; - - public static readonly float RageBoostMultiplier = 1.5f; + public static readonly float MaxRageBoost = 1.5f; public override void SetStaticDefaults() { DisplayName.SetDefault("Gael's Greatsword"); - Tooltip.SetDefault("Raises the player's damage reduction by 10% when wielding this sword\n" + - "There are three random attacks that can occur when the blade is swung\n" + - "The first attack releases two blood-skulls that home in\n" + - "The second attack releases an enormous slow-moving skull\n" + - "This slow-moving skull becomes weaker with time and lasts for around 4 seconds seconds\n" + - "The second attack causes a true melee strike with increased damage\n" + - "If you're below 50% life, swings release blood droplets\n" + - "Pressing the Rage Key while holding this weapon resets Rage to 0 and releases a circle of\n" + - "Slow-moving blood skulls. If Rage is full, the skulls do way more damage. Otherwise, the skull's damage is\n" + - "related to the amount of rage sacrificed\n" + - "This effect has a " + SkullsplosionCooldownSeconds + " second cooldown.\n" + - "The user can right click with the sword to deflect projectiles and enemy attacks 50% of the time"); + Tooltip.SetDefault("First swing fires homing skulls\n" + + "Second swing fires a giant, powerful skull\n" + + "Third swing deals massive damage\n" + + "Constantly generates rage when in use\n" + + "[Swings leave behind exploding blood trails [Below 50% health]]\n" + + "[Right click to swipe the sword, reflecting projectiles at a 50% chance]\n" + + "[Activating Rage Mode releases an enormous barrage of skulls]\n" + + "'Give me that thing, your dark soul'"); } //NOTE: GetWeaponDamage is in the CalamityPlayer file public override void SetDefaults() @@ -114,134 +89,63 @@ namespace CalamityMod.Items.Weapons.Melee } public override void MeleeEffects(Player player, Rectangle hitbox) { - SwingType = Main.rand.Next(3); - - //Almost entirely Ultimus Cleaver code. Feel free to clean it up if you wish. - if (player.whoAmI == Main.myPlayer && - player.statLife < player.statLifeMax * 0.5 && - player.Calamity().gaelBloodShotCooldown == 0) + if (CalamityUtils.CountProjectiles(ModContent.ProjectileType()) < 3 && + player.statLife <= player.statLifeMax2 * 0.5f) { - float velocityY = 0f; - float velocityX = 0f; - float spawnAdditiveY = 0f; - float spawnAdditiveX = 0f; - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.8)) + Point origin = (player.Center + Main.rand.Next(-300, 301) * Vector2.UnitX).ToTileCoordinates(); + Point p; + if (WorldUtils.Find(origin, Searches.Chain(new Searches.Down(400), new GenCondition[] { - velocityY = -7f; + new Conditions.IsSolid() + }), out p)) + { + Projectile.NewProjectile(p.ToWorldCoordinates(8f, 0f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); } - if (player.direction == -1) + } + if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.5)) + { + player.Calamity().gaelSwipes++; + if (player.statLife <= player.statLifeMax2 * 0.5f) { - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9)) + for (int i = 0; i < 170; i++) { - spawnAdditiveX -= 8f; + float r = (float)Math.Sqrt(Main.rand.NextDouble()); + float t = Main.rand.NextFloat() * MathHelper.TwoPi; + Vector2 dustSpawn = t.ToRotationVector2() * r * item.Size; + if (dustSpawn.X > item.width / 2) + { + Dust.NewDustPerfect(player.MountedCenter + dustSpawn.RotatedBy(player.itemRotation) * player.direction, 218, Vector2.Zero).noGravity = true; + } + else + { + //Don't waste this version of "i" just because we failed. Decrease so that we can try again. + i--; + continue; + } + if (Main.rand.NextBool(100)) + { + Projectile.NewProjectile(player.MountedCenter + dustSpawn.RotatedBy(player.itemRotation) * player.direction, Vector2.Zero, ModContent.ProjectileType(), BaseDamage, 0f, player.whoAmI); + } } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7)) - { - spawnAdditiveX -= 6f; - } - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7)) - { - spawnAdditiveX = 26f; - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.6)) - { - velocityY = -6f; - velocityX = 2f; - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.4)) - { - velocityY = -4f; - velocityX = 4f; - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.3)) - { - spawnAdditiveX -= 4f; - spawnAdditiveY -= 20f; - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.2)) - { - velocityY = -2f; - velocityX = 6f; - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1)) - { - velocityX = 7f; - } - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1)) - { - spawnAdditiveY += 6f; - } - velocityY *= 1.35f; - velocityX *= 1.35f; - spawnAdditiveX *= (float)player.direction * Main.rand.NextFloat(0.9f, 1.1f); - spawnAdditiveY *= player.gravDir; - Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + spawnAdditiveX, (float)(hitbox.Y + hitbox.Height / 2) + spawnAdditiveY, - (float)player.direction * velocityX, velocityY * player.gravDir, ModContent.ProjectileType(), (int)((float)item.damage * 0.35f * player.meleeDamage), 0f, player.whoAmI, 0f, 0f); - - if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9)) - { - player.Calamity().gaelBloodShotCooldown = 30; } } } public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { //True melee boost - if (SwingType == 2) + if (player.Calamity().gaelSwipes % 3 == 2) { - damage = (int)((Main.hardMode ? TrueMeleeBoostHardmode : TrueMeleeBoostPreHardmode) * damage); + damage = (int)(TrueMeleeBoost * damage); } } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - //This is mostly from a function in Player.cs which handles the Brand of the Inferno alt click effect - //attackCD = The attack countdown. Can reflect attacks from projectiles and hostile npcs while > 0 - //shield_parry_cooldown = A simple count down variable for effects. if (player.altFunctionUse == 2) { - bool shieldRaised = false; - if (player.selectedItem != 58 && player.controlUseTile && !player.tileInteractionHappened && player.releaseUseItem && !player.controlUseItem && !player.mouseInterface && !CaptureManager.Instance.Active && !Main.HoveringOverAnNPC && !Main.SmartInteractShowingGenuine - && player.inventory[player.selectedItem].type == ModContent.ItemType() && !player.mount.Active && (player.itemAnimation == 0 || PlayerInput.Triggers.JustPressed.MouseRight)) - { - shieldRaised = true; - } - if (player.shield_parry_cooldown > 0) - { - player.shield_parry_cooldown--; - if (player.shield_parry_cooldown == 1) - { - Main.PlaySound(25, -1, -1, 1, 1f, 0f); - for (int i = 0; i < 10; i++) - { - int dustIndex = Dust.NewDust(player.Center + new Vector2((float)(player.direction * 6 + ((player.direction == -1) ? -10 : 0)), -14f), 10, 16, 45, 0f, 0f, 255, new Color(255, 100, 0, 127), (float)Main.rand.NextFloat(1f, 1.6f)); - Main.dust[dustIndex].noLight = true; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].velocity *= 0.5f; - } - } - } - if (shieldRaised != player.shieldRaised) - { - player.shieldRaised = shieldRaised; - if (player.shieldRaised) - { - player.itemAnimation = 0; - player.itemTime = 0; - player.reuseDelay = 0; - } - else - { - player.shield_parry_cooldown = 15; - if (player.attackCD < 30) - { - player.attackCD = 30; - } - } - } + //CalamityPlayer.cs line 7373. Thank me later. return false; } - switch (SwingType) + switch (player.Calamity().gaelSwipes % 3) { //Two small, quick skulls case 0: @@ -255,7 +159,20 @@ namespace CalamityMod.Items.Weapons.Melee break; //Giant, slow, fading skull case 1: - int projectileIndex = Projectile.NewProjectile(position, new Vector2(speedX,speedY) * 0.5f, type, damage * 2, knockBack, player.whoAmI, ai1:1f); + int largeSkullDmg = damage * 2; + if (CalamityWorld.downedYharon) + { + largeSkullDmg = (int)((float)damage * 1.5f); + } + else if (NPC.downedMoonlord) + { + largeSkullDmg = damage * 2; + } + else if (Main.hardMode) + { + largeSkullDmg = damage * 2; + } + int projectileIndex = Projectile.NewProjectile(position, new Vector2(speedX,speedY) * 0.5f, type, largeSkullDmg, knockBack, player.whoAmI, ai1:1f); Main.projectile[projectileIndex].scale = 1.75f; break; } diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index a8a85a387e..80a66f5cee 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Melee { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 14); - // TODO -- HiveBombExplosion doesn't exist. Is it supposed to? + // DEFECT -- HiveBombExplosion does not exist. // Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((float)item.damage * player.meleeDamage), knockback, Main.myPlayer); for (int num621 = 0; num621 < 30; num621++) diff --git a/Items/Weapons/Melee/TerraDiskMelee.cs b/Items/Weapons/Melee/TerraDiskMelee.cs new file mode 100644 index 0000000000..3c7dbd4612 --- /dev/null +++ b/Items/Weapons/Melee/TerraDiskMelee.cs @@ -0,0 +1,74 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class TerraDiskMelee : ModItem + { + public static int BaseDamage = 70; + public static float Speed = 12f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terra Disk"); + Tooltip.SetDefault(@"Throws a disk that has a chance to generate several disks if enemies are near it +A max of three disks can be active at a time"); + } + + public override void SetDefaults() + { + item.width = 46; + item.height = 46; + item.damage = BaseDamage; + item.knockBack = 4f; + item.useAnimation = 16; + item.useTime = 16; + item.autoReuse = true; + item.noMelee = true; + item.noUseGraphic = true; + + item.useStyle = 1; + item.UseSound = SoundID.Item1; + + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + + item.melee = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = Speed; + } + + public override bool CanUseItem(Player player) + { + if (player.ownedProjectileCounts[item.shoot] >= 3) + { + return false; + } + else + { + return true; + } + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceMelee = true; + return false; + } + + /*public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.SetResult(this); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(TileID.MythrilAnvil); + recipe.AddRecipe(); + }*/ + } +} diff --git a/Items/Weapons/Melee/TerraDiskMelee.png b/Items/Weapons/Melee/TerraDiskMelee.png new file mode 100644 index 0000000000..32b39a6f1e Binary files /dev/null and b/Items/Weapons/Melee/TerraDiskMelee.png differ diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 0d265139da..4c57fada4d 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 18; + item.damage = 9; item.ranged = true; item.width = 56; item.height = 28; @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-50, 51) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-50, 51) * 0.05f; - int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.75), knockBack, player.whoAmI, 0.0f, 0.0f); + int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.6), knockBack, player.whoAmI, 0.0f, 0.0f); Main.projectile[flare].penetrate = 1; Main.projectile[flare].timeLeft = 600; Main.projectile[flare].Calamity().forceRanged = true; diff --git a/Items/Weapons/Rogue/AshenStalactite.cs b/Items/Weapons/Rogue/AshenStalactite.cs new file mode 100644 index 0000000000..30cbc72856 --- /dev/null +++ b/Items/Weapons/Rogue/AshenStalactite.cs @@ -0,0 +1,54 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class AshenStalactite : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ashen Stalactite"); + Tooltip.SetDefault("Throws a fast, small stalactite that crumbles to dust after travelling a short distance\n" + + "Stealth strikes cause a larger, more damaging stalagmite to be thrown which travels slower and further before crumbling to damaging dust"); + } + + public override void SafeSetDefaults() + { + item.width = 36; + item.height = 34; + item.damage = 50; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 1f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.maxStack = 1; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 3; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 15f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) + { + int stealthType = ModContent.ProjectileType(); + float stealthSpeedMult = 0.6f; + float stealthDamageMult = 1.15f; + float stealthKnockbackMult = 2.5f; + int p = Projectile.NewProjectile(position.X, position.Y, speedX * stealthSpeedMult, speedY * stealthSpeedMult, stealthType, (int)(damage * stealthDamageMult), (int)(knockBack * stealthKnockbackMult), player.whoAmI, 0f, 1f); + Main.projectile[p].Calamity().stealthStrike = true; + return false; + } + return true; + } + } +} diff --git a/Items/Weapons/Rogue/AshenStalactite.png b/Items/Weapons/Rogue/AshenStalactite.png new file mode 100644 index 0000000000..aafd03c7af Binary files /dev/null and b/Items/Weapons/Rogue/AshenStalactite.png differ diff --git a/Items/Weapons/Rogue/BlazingStar.png b/Items/Weapons/Rogue/BlazingStar.png index 75c05587da..ac480e43b1 100644 Binary files a/Items/Weapons/Rogue/BlazingStar.png and b/Items/Weapons/Rogue/BlazingStar.png differ diff --git a/Items/Weapons/Rogue/BouncySpikyBall.cs b/Items/Weapons/Rogue/BouncySpikyBall.cs new file mode 100644 index 0000000000..ab8d132080 --- /dev/null +++ b/Items/Weapons/Rogue/BouncySpikyBall.cs @@ -0,0 +1,62 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class BouncySpikyBall : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bouncy Spiky Ball"); + Tooltip.SetDefault(@"Throws a very bouncy ball that richochets off walls and enemies +Receives a small boost in damage and velocity after bouncing off an enemy +Stealth strikes provide a bigger boost after richocheting"); + } + + public override void SafeSetDefaults() + { + item.width = 14; + item.damage = 10; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 1f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.consumable = true; + item.maxStack = 999; + item.height = 14; + item.value = Item.buyPrice(0, 0, 1, 0); + item.rare = 1; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 8f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpikyBall, 3); + recipe.AddIngredient(ItemID.PinkGel); + recipe.AddTile(TileID.WorkBenches); + recipe.SetResult(this, 3); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/BouncySpikyBall.png b/Items/Weapons/Rogue/BouncySpikyBall.png new file mode 100644 index 0000000000..d409a6b571 Binary files /dev/null and b/Items/Weapons/Rogue/BouncySpikyBall.png differ diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 36470ea2e8..8a162dd099 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/Weapons/Rogue/DeepWounder.cs b/Items/Weapons/Rogue/DeepWounder.cs new file mode 100644 index 0000000000..940802e836 --- /dev/null +++ b/Items/Weapons/Rogue/DeepWounder.cs @@ -0,0 +1,55 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class DeepWounder : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Deep Wounder"); + Tooltip.SetDefault("Throws an abyssal hatchet that inflicts Armor Crunch and Marked for Death to the enemies it hits\n" + + "Stealth strikes cause the hatchet to be thrown faster and trail water, inflicting Crush Depth in addition to the other debuffs"); + } + + public override void SafeSetDefaults() + { + item.width = 52; + item.damage = 125; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 23; + item.useStyle = 1; + item.useTime = 23; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 48; + item.maxStack = 1; + item.rare = 7; + item.value = Item.buyPrice(0, 60, 0, 0); + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 14f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) + { + float stealthSpeedMult = 1.5f; + Vector2 velocity = new Vector2(speedX, speedY); + velocity.Normalize(); + velocity *= item.shootSpeed * stealthSpeedMult; + + int p = Projectile.NewProjectile(position.X, position.Y, velocity.X, velocity.Y, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[p].Calamity().stealthStrike = true; + return false; + } + return true; + } + } +} diff --git a/Items/Weapons/Rogue/DeepWounder.png b/Items/Weapons/Rogue/DeepWounder.png new file mode 100644 index 0000000000..0212f6a971 Binary files /dev/null and b/Items/Weapons/Rogue/DeepWounder.png differ diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs new file mode 100644 index 0000000000..92340f2238 --- /dev/null +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -0,0 +1,100 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class DefectiveSphere : RogueWeapon + { + public static int BaseDamage = 80; + public static float Speed = 15f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Defective Sphere"); + Tooltip.SetDefault(@"Fires a variety deadly spheres with different effects +Stacks up to 5 +Stealth strikes launch all 4 sphere types at once"); + } + + public override void SafeSetDefaults() + { + item.width = 42; + item.height = 44; + item.damage = BaseDamage; + item.knockBack = 5f; + item.useAnimation = 13; + item.useTime = 13; + item.autoReuse = true; + item.noMelee = true; + item.noUseGraphic = true; + item.maxStack = 5; + + item.useStyle = 1; + item.UseSound = SoundID.Item15; //phaseblade sound effect + + item.value = Item.buyPrice(0, 16, 0, 0); + item.rare = 8; + + item.Calamity().rogue = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = Speed; + } + + public override bool CanUseItem(Player player) + { + int UseMax = item.stack; + + if (player.Calamity().StealthStrikeAvailable()) + { + return true; + } + else if ((player.ownedProjectileCounts[item.shoot] + player.ownedProjectileCounts[ModContent.ProjectileType()] + player.ownedProjectileCounts[ModContent.ProjectileType()] + player.ownedProjectileCounts[ModContent.ProjectileType()]) >= UseMax) + { + return false; + } + else + { + return true; + } + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int sphereType = type; + if (Main.rand.NextBool(4)) + sphereType = ModContent.ProjectileType(); + else if (Main.rand.NextBool(3)) + sphereType = ModContent.ProjectileType(); + else if (Main.rand.NextBool(2)) + sphereType = ModContent.ProjectileType(); + float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedX2 = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedY2 = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedX3 = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedY3 = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedX4 = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedY4 = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; + + if (player.Calamity().StealthStrikeAvailable()) + { + int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage / 2, knockBack, player.whoAmI, 0f, 0f); + int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, 0f); + int stealth3 = Projectile.NewProjectile(position.X, position.Y, SpeedX3, SpeedY3, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, 0f); + int stealth4 = Projectile.NewProjectile(position.X, position.Y, SpeedX4, SpeedY4, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth2].Calamity().stealthStrike = true; + Main.projectile[stealth3].Calamity().stealthStrike = true; + Main.projectile[stealth4].Calamity().stealthStrike = true; + } + else + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), sphereType, damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } + } +} diff --git a/Items/Weapons/Rogue/DefectiveSphere.png b/Items/Weapons/Rogue/DefectiveSphere.png new file mode 100644 index 0000000000..c4c2b56c25 Binary files /dev/null and b/Items/Weapons/Rogue/DefectiveSphere.png differ diff --git a/Items/Weapons/Rogue/DesecratedWater.cs b/Items/Weapons/Rogue/DesecratedWater.cs new file mode 100644 index 0000000000..d8bb2d81be --- /dev/null +++ b/Items/Weapons/Rogue/DesecratedWater.cs @@ -0,0 +1,62 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class DesecratedWater : RogueWeapon + { + public const int BaseDamage = 55; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desecrated Water"); + Tooltip.SetDefault(@"Throws an unholy flask of water that explodes into an explosion of bubbles on death +Stealth strikes spawn additional bubbles that inflict Ichor and Cursed Inferno"); + } + + public override void SafeSetDefaults() + { + item.damage = BaseDamage; + item.width = 22; + item.height = 24; + item.useAnimation = 29; + item.useTime = 29; + item.noMelee = true; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.knockBack = 4.5f; + item.rare = 6; + item.UseSound = SoundID.Item106; + item.autoReuse = true; + item.value = Item.buyPrice(gold: 48); //sell price of 9 gold 60 silver + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddRecipeGroup("AnyEvilWater", 100); + recipe.AddIngredient(ItemID.HallowedBar, 5); + recipe.AddRecipeGroup("CursedFlameIchor", 5); + recipe.AddIngredient(ItemID.SoulofLight, 7); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/DesecratedWater.png b/Items/Weapons/Rogue/DesecratedWater.png new file mode 100644 index 0000000000..e9fbc43d8c Binary files /dev/null and b/Items/Weapons/Rogue/DesecratedWater.png differ diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index a2bb54a43f..4201d9f041 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -20,12 +20,12 @@ Stealth strikes release more souls and leave behind souls as they travel"); public override void SafeSetDefaults() { item.width = 34; - item.damage = 90; + item.damage = 80; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; - item.useAnimation = 14; - item.useTime = 14; + item.useAnimation = 16; + item.useTime = 16; item.useStyle = 1; item.knockBack = 6f; item.UseSound = SoundID.Item1; @@ -53,10 +53,11 @@ Stealth strikes release more souls and leave behind souls as they travel"); public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.Ectoplasm); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ItemID.Silk, 3); + recipe.AddIngredient(ItemID.Ectoplasm, 5); recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 5); + recipe.SetResult(this, 100); recipe.AddRecipe(); } } diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs new file mode 100644 index 0000000000..0ad5b1006d --- /dev/null +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -0,0 +1,82 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class FrostcrushValari : RogueWeapon + { + public static float Speed = 15f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostcrush Valari"); + Tooltip.SetDefault(@"Fires a long ranged boomerang that explodes into icicles on hit +Stealth strikes throws three short ranged boomerangs along with a spread of icicles"); + } + + public override void SafeSetDefaults() + { + item.damage = 70; + item.knockBack = 12; + item.thrown = true; + item.crit = 16; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.useTime = 19; + item.useAnimation = 19; + item.width = 32; + item.height = 46; + item.useStyle = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shootSpeed = Speed; + item.shoot = ModContent.ProjectileType(); + item.noMelee = true; + item.noUseGraphic = true; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity(); + //If stealth is full, shoot a spread of 3 boomerangs with reduced range and 6 to 10 icicles + if (modPlayer.StealthStrikeAvailable()) + { + int spread = 10; + for (int i = 0; i < 3; i++) + { + Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[proj].Calamity().stealthStrike = true; + spread -= 10; + } + int spread2 = 3; + for (int i = 0; i < Main.rand.Next(6,11); i++) + { + Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2)); + Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), damage / 2, 0f, player.whoAmI, 0f, 0f); + spread2 -= Main.rand.Next(1,4); + } + return false; + } + return true; + } + + /*public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ModContent.ItemType(), 40); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + }*/ + } +} diff --git a/Items/Weapons/Rogue/FrostcrushValari.png b/Items/Weapons/Rogue/FrostcrushValari.png new file mode 100644 index 0000000000..1dd40a54e7 Binary files /dev/null and b/Items/Weapons/Rogue/FrostcrushValari.png differ diff --git a/Items/Weapons/Rogue/GildedDagger.cs b/Items/Weapons/Rogue/GildedDagger.cs index 57d5074e1f..69c387ffcb 100644 --- a/Items/Weapons/Rogue/GildedDagger.cs +++ b/Items/Weapons/Rogue/GildedDagger.cs @@ -18,12 +18,12 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 15; + item.damage = 14; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 15; + item.useAnimation = 18; item.useStyle = 1; - item.useTime = 15; + item.useTime = 18; item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/GleamingDagger.cs b/Items/Weapons/Rogue/GleamingDagger.cs index 4a413c7e92..7656d1344c 100644 --- a/Items/Weapons/Rogue/GleamingDagger.cs +++ b/Items/Weapons/Rogue/GleamingDagger.cs @@ -18,12 +18,12 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 15; + item.damage = 14; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 15; + item.useAnimation = 18; item.useStyle = 1; - item.useTime = 15; + item.useTime = 18; item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 532604548d..3b9acfeada 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class GodsParanoia : RogueWeapon { - private static int damage = 250; + private static int damage = 125; private static int knockBack = 5; public override void SetStaticDefaults() @@ -63,9 +63,9 @@ Right click to delete all existing spiky balls"); } else { - int UseMax = item.stack - 1; + int UseMax = item.stack; - if (player.ownedProjectileCounts[item.shoot] > UseMax) + if (player.ownedProjectileCounts[item.shoot] >= UseMax) { return false; } diff --git a/Items/Weapons/Rogue/HardenedHoneycomb.cs b/Items/Weapons/Rogue/HardenedHoneycomb.cs new file mode 100644 index 0000000000..bd004f53b3 --- /dev/null +++ b/Items/Weapons/Rogue/HardenedHoneycomb.cs @@ -0,0 +1,64 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class HardenedHoneycomb : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hardened Honeycomb"); + Tooltip.SetDefault(@"Fires a honeycomb that shatters into fragments +Grants the honey buff to players it touches +Stealth strikes can bounce off walls and enemies"); + } + + public override void SafeSetDefaults() + { + item.width = 30; + item.damage = 25; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 21; + item.useTime = 21; + item.useStyle = 1; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 32; + item.maxStack = 999; + item.value = 300; + item.rare = 3; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].penetrate = 3; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Hive); + recipe.AddIngredient(ItemID.CrispyHoneyBlock); + recipe.AddIngredient(ItemID.BeeWax); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 5); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/HardenedHoneycomb.png b/Items/Weapons/Rogue/HardenedHoneycomb.png new file mode 100644 index 0000000000..a29278afaa Binary files /dev/null and b/Items/Weapons/Rogue/HardenedHoneycomb.png differ diff --git a/Items/Weapons/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs index 6ad54e1225..051015b9d6 100644 --- a/Items/Weapons/Rogue/HellsSun.cs +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -64,9 +64,9 @@ namespace CalamityMod.Items.Weapons.Rogue } else { - int UseMax = item.stack - 1; + int UseMax = item.stack; - if (player.ownedProjectileCounts[item.shoot] > UseMax) + if (player.ownedProjectileCounts[item.shoot] >= UseMax) { return false; } diff --git a/Items/Weapons/Rogue/JawsOfOblivion.cs b/Items/Weapons/Rogue/JawsOfOblivion.cs new file mode 100644 index 0000000000..31762b9fcc --- /dev/null +++ b/Items/Weapons/Rogue/JawsOfOblivion.cs @@ -0,0 +1,80 @@ +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class JawsOfOblivion : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Jaws of Oblivion"); + Tooltip.SetDefault("Throws a tight spread of six venomous reaper fangs that stick in enemies\n" + + "Stealth strikes cause the teeth to emit a crushing shockwave on impact\n" + + "You're gonna need a bigger boat"); + } + + public override void SafeSetDefaults() + { + item.width = 42; + item.damage = 438; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 15; + item.useStyle = 1; + item.useTime = 15; + item.knockBack = 1f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 40; + item.maxStack = 1; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 25f; + item.Calamity().postMoonLordRarity = 13; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float spreadAngle = MathHelper.ToRadians(2.5f); + Vector2 direction = new Vector2(speedX, speedY); + Vector2 baseDirection = direction.RotatedBy(-spreadAngle * 2.5f); + + for (int i = 0; i < 6; i++) + { + Vector2 currentDirection = baseDirection.RotatedBy(spreadAngle * i); + currentDirection = currentDirection.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f))); + + if (player.Calamity().StealthStrikeAvailable()) + { + int p = Projectile.NewProjectile(position.X, position.Y, currentDirection.X, currentDirection.Y, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[p].Calamity().stealthStrike = true; + } + else + { + int p = Projectile.NewProjectile(position.X, position.Y, currentDirection.X, currentDirection.Y, type, (int)(damage * 1.5f), 10, player.whoAmI, 0f, 0f); + } + } + return false; + } + + /* + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + */ + } +} diff --git a/Items/Weapons/Rogue/JawsOfOblivion.png b/Items/Weapons/Rogue/JawsOfOblivion.png new file mode 100644 index 0000000000..31df3efa2a Binary files /dev/null and b/Items/Weapons/Rogue/JawsOfOblivion.png differ diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index 4c95f8da8a..fbb8eb6a17 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (int i = 0; i < 3; i++) { Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread)); - int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), item.damage, item.knockBack, player.whoAmI, 0f, 1f); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 1f); Main.projectile[proj].Calamity().stealthStrike = true; spread -= 10; } diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs new file mode 100644 index 0000000000..42d004a446 --- /dev/null +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -0,0 +1,85 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class LeviathanTeeth : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leviathan Teeth"); + Tooltip.SetDefault("Rapidly throws a variety of poisonous fangs that stick to enemies\n" + + "Stealth strikes cause 3 very fast teeth to be thrown, ignoring gravity and inflicting extreme knockback"); + } + + public override void SafeSetDefaults() + { + item.width = 36; + item.damage = 94; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 10; + item.useStyle = 1; + item.useTime = 10; + item.knockBack = 1f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 38; + item.maxStack = 1; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + bool stealthStrike = false; + int teethCount; + if (player.Calamity().StealthStrikeAvailable()) + { + teethCount = 3; + stealthStrike = true; + } + else + { + teethCount = Main.rand.Next(1, 4); + } + + float spreadAngle = MathHelper.ToRadians(10); + + for (int i = 0; i < teethCount; i++) + { + float toothType = Main.rand.Next(0, 3); + int projectileType = type; + switch (toothType) + { + case 1: + projectileType = ModContent.ProjectileType(); + break; + case 2: + projectileType = ModContent.ProjectileType(); + break; + } + + float offsetSpeedX = speedX + Main.rand.NextFloat(-4f, 4f); + float offsetSpeedY = speedY + Main.rand.NextFloat(-4f, 4f); + + if (stealthStrike) + { + int p = Projectile.NewProjectile(position.X, position.Y, offsetSpeedX * 1.5f, offsetSpeedY * 1.5f, projectileType, damage, 10f, player.whoAmI, 0f, 0f); + Main.projectile[p].Calamity().stealthStrike = true; + } + else + { + int p = Projectile.NewProjectile(position.X, position.Y, offsetSpeedX, offsetSpeedY, projectileType, damage, knockBack, player.whoAmI, 0f, 0f); + } + } + return false; + } + } +} diff --git a/Items/Weapons/Rogue/LeviathanTeeth.png b/Items/Weapons/Rogue/LeviathanTeeth.png new file mode 100644 index 0000000000..482780b6bf Binary files /dev/null and b/Items/Weapons/Rogue/LeviathanTeeth.png differ diff --git a/Items/Weapons/Rogue/MonkeyDarts.cs b/Items/Weapons/Rogue/MonkeyDarts.cs index 03175521d1..b6cfcb5c74 100644 --- a/Items/Weapons/Rogue/MonkeyDarts.cs +++ b/Items/Weapons/Rogue/MonkeyDarts.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item1; item.useTime = 20; item.useAnimation = 20; - item.value = Item.buyPrice(0, 0, 1, 0); + item.value = Item.buyPrice(0, 0, 4, 0); item.rare = 7; item.shootSpeed = 8f; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/NastyCholla.cs b/Items/Weapons/Rogue/NastyCholla.cs index 46aaae11bc..84b0b01ee7 100644 --- a/Items/Weapons/Rogue/NastyCholla.cs +++ b/Items/Weapons/Rogue/NastyCholla.cs @@ -47,7 +47,7 @@ Stealth strikes throw five at once"); for (int i = 0; i < 5; i++) { Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); - int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, item.damage, item.knockBack, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].Calamity().stealthStrike = true; spread -= Main.rand.Next(1,4); } @@ -56,13 +56,13 @@ Stealth strikes throw five at once"); return true; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Cactus, 2); recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 15); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index cbbc2c5a50..b1a48225a6 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -29,8 +29,8 @@ Stealth strikes summon ghost clones instead of lost souls"); item.noUseGraphic = true; item.value = Item.buyPrice(1, 40, 0, 0); - item.useTime = 15; - item.useAnimation = 15; + item.useTime = 25; + item.useAnimation = 25; item.UseSound = SoundID.Item1; item.rare = 10; item.Calamity().postMoonLordRarity = 13; @@ -52,7 +52,7 @@ Stealth strikes summon ghost clones instead of lost souls"); return true; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); @@ -62,6 +62,6 @@ Stealth strikes summon ghost clones instead of lost souls"); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs new file mode 100644 index 0000000000..7ce313eb20 --- /dev/null +++ b/Items/Weapons/Rogue/PhantomLance.cs @@ -0,0 +1,68 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class PhantomLance : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Lance"); + Tooltip.SetDefault(@"Fires a spectral javelin that rapidly releases lost souls +Fades away and slows down over time +Lost souls released later deal less damage +Stealth strikes don't slow down and souls always deal full damage"); + } + + public override void SafeSetDefaults() + { + item.damage = 75; + item.knockBack = 5f; + + item.width = 62; + item.height = 68; + item.useStyle = 1; + item.noMelee = true; + item.noUseGraphic = true; + + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 8; + item.useTime = 19; + item.useAnimation = 19; + item.maxStack = 999; + item.UseSound = SoundID.Item1; + item.consumable = true; + item.Calamity().rogue = true; + + item.autoReuse = true; + item.shootSpeed = 10f; + item.shoot = ModContent.ProjectileType(); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + + /*public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpectreBar, 2); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 100); + recipe.AddRecipe(); + }*/ + } +} diff --git a/Items/Weapons/Rogue/PhantomLance.png b/Items/Weapons/Rogue/PhantomLance.png new file mode 100644 index 0000000000..55db8c10ed Binary files /dev/null and b/Items/Weapons/Rogue/PhantomLance.png differ diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index f716346fc8..faa79880b6 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -18,7 +18,7 @@ Stealth strikes spawn smaller spears to fly along side it"); public override void SafeSetDefaults() { - item.damage = 1500; + item.damage = 410; item.knockBack = 8f; item.crit += 15; diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index 38511e189d..f4dc73825b 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -65,6 +65,11 @@ namespace CalamityMod.Items.Weapons.Rogue if (Main.rand.Next(1, 101) > 66) return false; } + if (player.Calamity().throwingAmmoCost75) + { + if (Main.rand.Next(1, 101) > 75) + return false; + } return true; } } diff --git a/Items/Weapons/Rogue/SandDollar.cs b/Items/Weapons/Rogue/SandDollar.cs index 91876e1ece..9bc9c7200e 100644 --- a/Items/Weapons/Rogue/SandDollar.cs +++ b/Items/Weapons/Rogue/SandDollar.cs @@ -37,13 +37,16 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool CanUseItem(Player player) { - int launched = 0; + int UseMax = item.stack - 1; - foreach (Projectile projectile in Main.projectile) - if (projectile.type == item.shoot && projectile.owner == item.owner && projectile.active) - launched++; - - return launched < item.stack; + if (player.ownedProjectileCounts[item.shoot] > UseMax) + { + return false; + } + else + { + return true; + } } } } diff --git a/Items/Weapons/Rogue/SkyStabber.cs b/Items/Weapons/Rogue/SkyStabber.cs index 972356a811..000305ce8a 100644 --- a/Items/Weapons/Rogue/SkyStabber.cs +++ b/Items/Weapons/Rogue/SkyStabber.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Items.Weapons.Rogue } else { - int UseMax = item.stack - 1; + int UseMax = item.stack; - if (player.ownedProjectileCounts[item.shoot] > UseMax) + if (player.ownedProjectileCounts[item.shoot] >= UseMax) { return false; } diff --git a/Items/Weapons/Rogue/StickySpikyBall.cs b/Items/Weapons/Rogue/StickySpikyBall.cs index 5915e0bf65..1b61bd93fd 100644 --- a/Items/Weapons/Rogue/StickySpikyBall.cs +++ b/Items/Weapons/Rogue/StickySpikyBall.cs @@ -19,7 +19,7 @@ Stealth strikes throw seven at once and last a lot longer"); public override void SafeSetDefaults() { item.width = 14; - item.damage = 20; + item.damage = 12; item.noMelee = true; item.noUseGraphic = true; item.maxStack = 999; @@ -45,9 +45,10 @@ Stealth strikes throw seven at once and last a lot longer"); for (int i = 0; i < 7; i++) { Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); - int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, item.damage, item.knockBack, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].Calamity().stealthStrike = true; Main.projectile[proj].timeLeft *= 4; + Main.projectile[proj].localNPCHitCooldown += 15; spread -= Main.rand.Next(1,4); } return false; @@ -55,7 +56,7 @@ Stealth strikes throw seven at once and last a lot longer"); return true; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SpikyBall, 3); @@ -63,6 +64,6 @@ Stealth strikes throw seven at once and last a lot longer"); recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 3); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs new file mode 100644 index 0000000000..d39d6dfd97 --- /dev/null +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -0,0 +1,74 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class TerraDisk : RogueWeapon + { + public static int BaseDamage = 70; + public static float Speed = 12f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terra Disk"); + Tooltip.SetDefault(@"Throws a disk that has a chance to generate several disks if enemies are near it +A max of three disks can be active at a time"); + } + + public override void SafeSetDefaults() + { + item.width = 46; + item.height = 46; + item.damage = BaseDamage; + item.knockBack = 4f; + item.useAnimation = 16; + item.useTime = 16; + item.autoReuse = true; + item.noMelee = true; + item.noUseGraphic = true; + + item.useStyle = 1; + item.UseSound = SoundID.Item1; + + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + + item.Calamity().rogue = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = Speed; + } + + public override bool CanUseItem(Player player) + { + if (player.ownedProjectileCounts[item.shoot] >= 3) + { + return false; + } + else + { + return true; + } + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + return false; + } + + /*public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.SetResult(this); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(TileID.MythrilAnvil); + recipe.AddRecipe(); + }*/ + } +} diff --git a/Items/Weapons/Rogue/TerraDisk.png b/Items/Weapons/Rogue/TerraDisk.png new file mode 100644 index 0000000000..32b39a6f1e Binary files /dev/null and b/Items/Weapons/Rogue/TerraDisk.png differ diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index d36ccd353f..9aa919a78f 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Rogue item.useStyle = 1; item.knockBack = 10; item.crit = 20; - item.value = Item.buyPrice(0, 0, 2, 0); - item.rare = 2; + item.value = Item.buyPrice(0, 0, 0, 50); + item.rare = 0; item.maxStack = 999; item.UseSound = SoundID.Item1; item.consumable = true; diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index 648507d2d6..e2ee1cd793 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -54,7 +54,7 @@ Stealth strikes leak tar as they fly"); recipe.AddIngredient(ItemID.MolotovCocktail, 50); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType()); - //recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/WebBall.cs b/Items/Weapons/Rogue/WebBall.cs new file mode 100644 index 0000000000..6afe6d92db --- /dev/null +++ b/Items/Weapons/Rogue/WebBall.cs @@ -0,0 +1,59 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class WebBall : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Web Ball"); + Tooltip.SetDefault(@"Throws a web-covered ball that covers enemies in cobwebs to slow them down +Stealth strikes slow enemies down longer"); + } + + public override void SafeSetDefaults() + { + item.width = 20; + item.damage = 12; + item.noMelee = true; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.useAnimation = 20; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.height = 18; + item.value = Item.buyPrice(0, 0, 0, 30); + item.rare = 0; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 4f; + item.Calamity().rogue = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, item.damage, item.knockBack, player.whoAmI, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Cobweb, 3); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/WebBall.png b/Items/Weapons/Rogue/WebBall.png new file mode 100644 index 0000000000..3640d6596e Binary files /dev/null and b/Items/Weapons/Rogue/WebBall.png differ diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 091cd094fc..a416b0cd43 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -445,7 +445,7 @@ namespace CalamityMod setBonus = setBonus.ToLower(); - // TODO -- no summon set bonuses are written well. all use two bools, neither of which actually controls the function + // LATER -- no summon set bonuses are written well. all use two bools, neither of which actually controls the function // Victide if (setBonus == "victide_summon" || setBonus == "victide summon") @@ -682,7 +682,7 @@ namespace CalamityMod if (setBonus == "victide_summon" || setBonus == "victide summon") { mp.victideSet = enabled; - mp.urchin = enabled; // TODO -- remove this when player.urchin actually controls victide summoner + mp.urchin = enabled; // LATER -- remove this when player.urchin actually controls victide summoner return true; } else if (setBonus == "victide" || setBonus.StartsWith("victide_") || setBonus.StartsWith("victide ")) @@ -695,7 +695,7 @@ namespace CalamityMod if (setBonus == "aerospec_summon" || setBonus == "aerospec summon") { mp.aeroSet = enabled; - mp.valkyrie = enabled; // TODO -- remove this when player.valkyrie actually controls aerospec summoner + mp.valkyrie = enabled; // LATER -- remove this when player.valkyrie actually controls aerospec summoner return true; } else if (setBonus == "aerospec" || setBonus.StartsWith("aerospec_") || setBonus.StartsWith("aerospec ")) @@ -708,7 +708,7 @@ namespace CalamityMod if (setBonus == "statigel_summon" || setBonus == "statigel summon") { mp.statigelSet = enabled; - mp.slimeGod = enabled; // TODO -- remove this when player.slimeGod actually controls statigel summoner + mp.slimeGod = enabled; // LATER -- remove this when player.slimeGod actually controls statigel summoner return true; } else if (setBonus == "statigel" || setBonus.StartsWith("statigel_") || setBonus.StartsWith("statigel ")) @@ -743,7 +743,7 @@ namespace CalamityMod return true; case "daedalus_summon": case "daedalus summon": - mp.daedalusCrystal = enabled; // TODO -- remove this when player.daedalusCrystal actually controls daedalus summoner + mp.daedalusCrystal = enabled; // LATER -- remove this when player.daedalusCrystal actually controls daedalus summoner return true; case "daedalus_rogue": case "daedalus rogue": @@ -770,7 +770,7 @@ namespace CalamityMod return true; case "reaver_summon": case "reaver summon": - mp.reaverOrb = enabled; // TODO -- remove this when player.reaverOrb actually controls reaver summoner + mp.reaverOrb = enabled; // LATER -- remove this when player.reaverOrb actually controls reaver summoner return true; case "reaver_rogue": case "reaver rogue": @@ -804,7 +804,7 @@ namespace CalamityMod case "ataxia_summon": case "ataxia summon": mp.ataxiaBlaze = enabled; - mp.chaosSpirit = enabled; // TODO -- remove this when player.chaosSpirit actually controls ataxia summoner + mp.chaosSpirit = enabled; // LATER -- remove this when player.chaosSpirit actually controls ataxia summoner return true; case "ataxia_rogue": case "ataxia rogue": @@ -853,7 +853,7 @@ namespace CalamityMod case "tarragon_summon": case "tarragon summon": mp.tarraSet = enabled; - mp.tarraSummon = enabled; // TODO -- remove this when player.tarraSummon actually controls life aura + mp.tarraSummon = enabled; // LATER -- remove this when player.tarraSummon actually controls life aura return true; case "tarragon_rogue": case "tarragon rogue": @@ -888,7 +888,7 @@ namespace CalamityMod case "bloodflare_summon": case "bloodflare summon": mp.bloodflareSet = enabled; - mp.bloodflareSummon = enabled; // TODO -- remove this when player.bloodflareSummon actually controls bloodflare orbs + mp.bloodflareSummon = enabled; // LATER -- remove this when player.bloodflareSummon actually controls bloodflare orbs return true; case "bloodflare_rogue": case "bloodflare rogue": @@ -935,7 +935,7 @@ namespace CalamityMod case "godslayer summon": case "god slayer summon": mp.godSlayer = enabled; - mp.godSlayerSummon = enabled; // TODO -- remove this when player.godSlayerSummon actually controls mechworm + mp.godSlayerSummon = enabled; // LATER -- remove this when player.godSlayerSummon actually controls mechworm return true; case "godslayer_rogue": case "godslayer rogue": @@ -971,7 +971,7 @@ namespace CalamityMod case "silva_summon": case "silva summon": mp.silvaSet = enabled; - mp.silvaSummon = enabled; // TODO -- remove this when player.silvaSummon actually controls silva crystl + mp.silvaSummon = enabled; // LATER -- remove this when player.silvaSummon actually controls silva crystal return true; case "silva_rogue": case "silva rogue": @@ -1075,7 +1075,7 @@ namespace CalamityMod if (setBonus == "demonshade") { mp.dsSetBonus = enabled; - mp.rDevil = enabled; // TODO -- remove this when player.rDevil controls demonshade summoned minion + mp.rDevil = enabled; // LATER -- remove this when player.rDevil controls demonshade summoned minion return true; } diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 8ab9c48f7f..064260e5f0 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.AcidRain npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; aiType = NPCID.GlowingSnail; - animationType = NPCID.GlowingSnail; + //animationType = NPCID.GlowingSnail; //banner = npc.type; //bannerItem = ModContent.ItemType(); } @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.AcidRain { if (npc.localAI[0] == 0f) { - npc.catchItem = (Main.rand.NextBool(20)) ? (short)ModContent.ItemType() : ItemID.None; + npc.catchItem = (Main.rand.NextBool(10)) ? (short)ModContent.ItemType() : ItemID.None; npc.localAI[0] = 1f; npc.velocity.Y = -3f; npc.netUpdate = true; @@ -63,6 +63,20 @@ namespace CalamityMod.NPCs.AcidRain } } + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + if (npc.frameCounter > 8) + { + npc.frameCounter = 0; + npc.frame.Y += frameHeight; + if (npc.frame.Y > frameHeight * 2) + { + npc.frame.Y = 0; + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.playerSafe || !spawnInfo.player.Calamity().ZoneSulphur || !Main.raining) diff --git a/NPCs/Astral/Hive.png b/NPCs/Astral/Hive.png index 081ee1131b..fcd1ef8827 100644 Binary files a/NPCs/Astral/Hive.png and b/NPCs/Astral/Hive.png differ diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 2127f12000..6599b57ea2 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -12,9 +12,6 @@ namespace CalamityMod.NPCs.AstrumAureus { public class AureusSpawn : ModNPC { - // TODO -- This value is never set, but is read and written by the network. Remove it? - private bool boostDR = false; - public override void SetStaticDefaults() { DisplayName.SetDefault("Aureus Spawn"); @@ -52,13 +49,11 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SendExtraAI(BinaryWriter writer) { - writer.Write(boostDR); writer.Write(npc.dontTakeDamage); } public override void ReceiveExtraAI(BinaryReader reader) { - boostDR = reader.ReadBoolean(); npc.dontTakeDamage = reader.ReadBoolean(); } diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index c4506ccb52..e28d0b3f1b 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -194,6 +194,11 @@ namespace CalamityMod.NPCs.Bumblebirb value45.Normalize(); value45 *= scaleFactor21; npc.velocity = (npc.velocity * (num1378 - 1f) + value45) / num1378; + npc.netSpam = 5; + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } return; } if (npc.ai[0] == 2f) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index c0a52a3553..4c753aed33 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -2773,7 +2773,12 @@ namespace CalamityMod.NPCs value52.Normalize(); value52 *= scaleFactor16; npc.velocity = (npc.velocity * (num1308 - 1f) + value52) / num1308; - return; + npc.netSpam = 5; + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + return; } // Fly towards target quickly diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index dd9c4d6099..6c7c638847 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -3050,6 +3050,12 @@ namespace CalamityMod.NPCs if (ModLoader.GetMod("FargowiltasSouls") != null) ModLoader.GetMod("FargowiltasSouls").Call("FargoSoulsAI", npc.whoAmI); + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + npc.netSpam = 5; + return false; } #endregion @@ -9222,9 +9228,6 @@ namespace CalamityMod.NPCs bool phase3 = lifeRatio < 0.4f || golemLifeRatio < 0.7f || CalamityWorld.death || CalamityWorld.bossRushActive; bool phase4 = lifeRatio < 0.1f || golemLifeRatio < 0.55f || CalamityWorld.death || CalamityWorld.bossRushActive; - // Target - npc.TargetClosest(true); - // Float through tiles or not bool flag44 = false; if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) || phase3) @@ -9252,6 +9255,10 @@ namespace CalamityMod.NPCs // Move to new location if (npc.ai[3] <= 0f) { + // Target + npc.TargetClosest(true); + npc.netSpam = 5; + npc.ai[3] = 300f; float maxDistance = 300f; @@ -9315,7 +9322,7 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[1] = -maxDistance; } - npc.netUpdate = true; + npc.netUpdate = true; } npc.ai[3] -= 1f + @@ -9470,6 +9477,7 @@ namespace CalamityMod.NPCs } } } + NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); if (ModLoader.GetMod("FargowiltasSouls") != null) ModLoader.GetMod("FargowiltasSouls").Call("FargoSoulsAI", npc.whoAmI); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index d127eae1f8..3a75681139 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs // private int ironHeartDamage = 0; // NewAI - private const int maxAIMod = 4; + internal const int maxAIMod = 4; public float[] newAI = new float[maxAIMod]; // Town NPC Patreon @@ -96,6 +96,7 @@ namespace CalamityMod.NPCs public int tSad = 0; public int eFreeze = 0; public int silvaStun = 0; + public int webbed = 0; public int yellowCandle = 0; public int pearlAura = 0; public int wCleave = 0; @@ -388,7 +389,7 @@ namespace CalamityMod.NPCs for (int j = 0; j < 1000; j++) { if (Main.projectile[j].active && - (Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType()) && + (Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType()) && Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) { projectileCount++; @@ -607,6 +608,7 @@ namespace CalamityMod.NPCs npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffID.Webbed] = true; } if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) @@ -2113,6 +2115,8 @@ namespace CalamityMod.NPCs eFreeze--; if (silvaStun > 0) silvaStun--; + if (webbed > 0) + webbed--; if (yellowCandle > 0) yellowCandle--; if (pearlAura > 0) @@ -2176,7 +2180,7 @@ namespace CalamityMod.NPCs { if (silvaStun > 0) npc.velocity = Vector2.Zero; - else if (timeSlow > 0) + else if (timeSlow > 0 || webbed > 0) npc.velocity *= 0.85f; } } @@ -2465,7 +2469,7 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.5); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) { damage = (int)(damage * 0.75); } @@ -2495,7 +2499,7 @@ namespace CalamityMod.NPCs if (Main.player[projectile.owner].Calamity().eGauntlet) { - if (projectile.melee && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) + if (projectile.melee && ShouldAffectNPC(npc) && !projectile.npcProj && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2506,7 +2510,7 @@ namespace CalamityMod.NPCs if (Main.player[projectile.owner].Calamity().eTalisman) { - if (projectile.magic && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) + if (projectile.magic && ShouldAffectNPC(npc) && !projectile.npcProj && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2517,7 +2521,7 @@ namespace CalamityMod.NPCs if (Main.player[projectile.owner].Calamity().nanotech) { - if (projectile.Calamity().rogue && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) + if (projectile.Calamity().rogue && ShouldAffectNPC(npc) && !projectile.npcProj && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2528,7 +2532,7 @@ namespace CalamityMod.NPCs if (Main.player[projectile.owner].Calamity().eQuiver) { - if (projectile.ranged && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) + if (projectile.ranged && ShouldAffectNPC(npc) && !projectile.npcProj && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2539,7 +2543,7 @@ namespace CalamityMod.NPCs if (Main.player[projectile.owner].Calamity().statisBeltOfCurses) { - if ((projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) + if ((projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) && ShouldAffectNPC(npc) && !projectile.npcProj && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2547,6 +2551,13 @@ namespace CalamityMod.NPCs } } } + if (projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() && + npc.type >= NPCID.SkeletronHead && + npc.type <= NPCID.SkeletronHand) + { + damage = (int)(damage * 0.85); + } } #endregion @@ -3137,6 +3148,21 @@ namespace CalamityMod.NPCs } } } + if (webbed > 0) + { + if (Main.rand.Next(5) < 4) + { + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 30, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.1f; + Main.dust[dust].velocity.Y += 0.25f; + if (Main.rand.NextBool(2)) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + } + } if (gState > 0 || eFreeze > 0) { @@ -3929,6 +3955,11 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPlaguebringer, Item.buyPrice(0, 50)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedBumble, Item.buyPrice(5)); } + + if (type == NPCID.SkeletonMerchant) + { + SetShopItem(ref shop, ref nextSlot, ItemID.Marrow, Main.hardMode, Item.buyPrice(0, 36)); + } } public override void SetupTravelShop(int[] shop, ref int nextSlot) @@ -4018,7 +4049,7 @@ namespace CalamityMod.NPCs Projectile projectile = Main.projectile[m]; if (projectile.active && projectile.bobber && projectile.owner == plr) { - // TODO -- Old Duke not added yet + // TODO -- Old Duke isn't added yet. int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, /* ModContent.NPCType() */ NPCID.DukeFishron); string typeName2 = Main.npc[num8].TypeName; if (Main.netMode == NetmodeID.SinglePlayer) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index d47f111113..8864574e0a 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -701,7 +701,7 @@ namespace CalamityMod.NPCs { ResetAdrenaline(npc); - // TODO -- this could be abused to have Draedon Mayhem effects active nigh indefinitely or in all sorts of weird conditions + // LATER -- keeping bosses alive lets draedon mayhem continue even after killing mechs // Reset Draedon Mayhem to false if no bosses are alive if (CalamityGlobalNPC.DraedonMayhem) { @@ -1142,7 +1142,7 @@ namespace CalamityMod.NPCs } } - if (NPC.downedPlantBoss && npc.type == NPCID.SandShark && !NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.downedPlantBoss && (npc.type == NPCID.SandShark || npc.type == NPCID.SandsharkHallow || npc.type == NPCID.SandsharkCorrupt || npc.type == NPCID.SandsharkCrimson || npc.type == ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType())) { CalamityMod.sharkKillCount++; if (CalamityMod.sharkKillCount == 4) @@ -1289,6 +1289,11 @@ namespace CalamityMod.NPCs DropHelper.DropItemChance(npc, ModContent.ItemType(), eyeballDropRate, 1, 1); break; + case NPCID.FireImp: + int stalactiteDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 100 : 150; + DropHelper.DropItemChance(npc, ModContent.ItemType(), stalactiteDropRate, 1, 1); + break; + case NPCID.PossessedArmor: int amuletDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 150 : 200; DropHelper.DropItemChance(npc, ModContent.ItemType(), amuletDropRate, 1, 1); @@ -1590,6 +1595,10 @@ namespace CalamityMod.NPCs DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 5, 1, 1); break; + case NPCID.QueenBee: + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 30, 50); + break; + case NPCID.DevourerHead: case NPCID.SeekerHead: DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 2 : 3); @@ -1629,7 +1638,7 @@ namespace CalamityMod.NPCs case NPCID.Reaper: case NPCID.Psycho: - DropHelper.DropItemCondition(npc, ModContent.ItemType(), (CalamityWorld.downedCalamitas || NPC.downedPlantBoss), Main.expertMode ? 0.1f : 0.05f, 1, 3); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), (CalamityWorld.downedCalamitas || NPC.downedPlantBoss), Main.expertMode ? 0.75f : 0.5f, 1, 4); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedBuffedMothron, Main.expertMode ? 0.06f : 0.04f, 1, 1); break; diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 6d55189e62..765de1a5d1 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -506,6 +506,7 @@ namespace CalamityMod.NPCs.Crabulon DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index 90ee4def13..1bd101d748 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Banners; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -58,5 +59,11 @@ namespace CalamityMod.NPCs.NormalNPCs } } } + + public override void NPCLoot() + { + int bandageDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 50 : 100; + DropHelper.DropItemCondition(npc, ItemID.AdhesiveBandage, Main.hardMode, bandageDropRate, 1, 1); + } } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 6adc5372f7..7b671b4850 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -226,7 +226,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath break; } } - npc.ai[0] = (float)num596; npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -349,7 +348,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (npc.netSpam > 10) npc.netSpam = 10; - } + } // Slow down after charge else @@ -860,6 +859,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.netSpam = 10; } } + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } } private void Movement(float xPos, float yPos, float yPos2) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index aae807cff6..a5b7875cc1 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -573,6 +573,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.netUpdate = true; } } + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 49bc3326d5..0c20b3b5a6 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -251,24 +251,23 @@ namespace CalamityMod.NPCs.TownNPCs { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; - /*shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + /*shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++;*/ } if (NPC.downedPlantBoss) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 4, 0); nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; - /*shop.item[nextSlot].SetDefaults(ModContent.ItemType()); - nextSlot++;*/ + shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + nextSlot++; } /*if (NPC.downedGolemBoss) { - shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(1, 0, 0, 0); nextSlot++; }*/ @@ -280,7 +279,7 @@ namespace CalamityMod.NPCs.TownNPCs } /*if (CalamityWorld.downedProvidence) { - shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(5, 0, 0, 0); nextSlot++; }*/ diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 4d6ef70757..0c6a01bd3a 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Projectiles private int counter2 = 0; public bool lineColor = false; //holy mother of god, Eater of Shoals was a pain in the ass + public bool extorterBoost = false; #region SetDefaults public override void SetDefaults(Projectile projectile) @@ -582,6 +583,20 @@ namespace CalamityMod.Projectiles else if (projectile.type == ProjectileID.SoulDrain) projectile.magic = true; + if (Main.player[projectile.owner].Calamity().etherealExtorter) + { + if (CalamityMod.spikyBallProjList.Contains(projectile.type) && extorterBoost == false && Main.moonPhase == 2) //third quarter + { + projectile.timeLeft += 300; + extorterBoost = true; + } + if (CalamityMod.javelinProjList.Contains(projectile.type) && extorterBoost == false && Main.player[projectile.owner].ZoneCrimson) + { + projectile.knockBack *= 2; + extorterBoost = true; + } + } + if (!projectile.npcProj && projectile.friendly && projectile.damage > 0) { if (Main.player[projectile.owner].Calamity().eQuiver && projectile.ranged && CalamityMod.rangedProjectileExceptionList.TrueForAll(x => projectile.type != x)) @@ -1394,7 +1409,6 @@ namespace CalamityMod.Projectiles } } - if (playerC.Calamity().moonCrown && stealthStrike && playerC.Calamity().moonCrownCooldown <= 0) { for (int i = 0; i < 20; i++) @@ -1716,6 +1730,28 @@ namespace CalamityMod.Projectiles } } } + + if (rogue) + { + if (Main.player[projectile.owner].Calamity().etherealExtorter && Main.rand.Next(0, 100) >= 95) + { + for (int num252 = 0; num252 < 3; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int newDamage = (int)((double)projectile.damage * 0.33); + int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileID.LostSoulFriendly, newDamage, 0f, projectile.owner, 0f, 0f); + Main.projectile[soul].Calamity().forceRogue = true; + Main.projectile[soul].timeLeft = 300; + Main.projectile[soul].tileCollide = false; + } + } + } } } #endregion diff --git a/Projectiles/Magic/VolatileStarcore.cs b/Projectiles/Magic/VolatileStarcore.cs index 6799a04788..2b806079d5 100644 --- a/Projectiles/Magic/VolatileStarcore.cs +++ b/Projectiles/Magic/VolatileStarcore.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -105,7 +104,7 @@ namespace CalamityMod.Projectiles.Magic // Spawn a Helium Flash on impact int type = ModContent.ProjectileType(); - int damage = HeliumFlash.BaseDamage; + int damage = projectile.damage; float kb = 9.5f; Projectile.NewProjectile(projectile.Center, Vector2.Zero, type, damage, kb, projectile.owner, 0f, 0f); } diff --git a/Projectiles/Melee/GaelExplosion.cs b/Projectiles/Melee/GaelExplosion.cs new file mode 100644 index 0000000000..631965c72e --- /dev/null +++ b/Projectiles/Melee/GaelExplosion.cs @@ -0,0 +1,97 @@ +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class GaelExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 45; + projectile.height = 45; + projectile.friendly = true; + projectile.ignoreWater = false; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 15; + projectile.melee = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = GaelsGreatsword.ImmunityFrames; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.75f / 255f); + if (projectile.localAI[0] == 0f) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + projectile.localAI[0] += 1f; + } + bool flag15 = false; + bool flag16 = false; + if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) + { + flag15 = true; + } + if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) + { + flag15 = true; + } + if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) + { + flag16 = true; + } + if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) + { + flag16 = true; + } + if (flag15 && flag16) + { + projectile.Kill(); + } + float num461 = 25f; + if (projectile.ai[0] > 180f) + { + num461 -= (projectile.ai[0] - 180f) / 2f; + } + if (num461 <= 0f) + { + num461 = 0f; + projectile.Kill(); + } + num461 *= 0.7f; + projectile.ai[0] += 4f; + int num462 = 0; + while ((float)num462 < num461) + { + float num463 = (float)Main.rand.Next(-30, 31); + float num464 = (float)Main.rand.Next(-30, 31); + float num465 = (float)Main.rand.Next(9, 27); + float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + num466 = num465 / num466; + num463 *= num466; + num464 *= num466; + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); + Main.dust[num467].noGravity = true; + Main.dust[num467].position.X = projectile.Center.X; + Main.dust[num467].position.Y = projectile.Center.Y; + Dust dust = Main.dust[num467]; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust = Main.dust[num467]; + dust.position.Y += (float)Main.rand.Next(-10, 11); + Main.dust[num467].velocity.X = num463; + Main.dust[num467].velocity.Y = num464; + num462++; + } + } + } +} diff --git a/Projectiles/Melee/GaelExplosion.png b/Projectiles/Melee/GaelExplosion.png new file mode 100644 index 0000000000..810820c0b4 Binary files /dev/null and b/Projectiles/Melee/GaelExplosion.png differ diff --git a/Projectiles/Melee/GaelSkull.cs b/Projectiles/Melee/GaelSkull.cs index 1f2f97675a..a00e03f1d2 100644 --- a/Projectiles/Melee/GaelSkull.cs +++ b/Projectiles/Melee/GaelSkull.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Skull"); + DisplayName.SetDefault("Ark of the Cosmos' Superior Cousin"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; ProjectileID.Sets.TrailingMode[projectile.type] = 0; Main.projFrames[projectile.type] = 5; @@ -29,50 +29,25 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = 600; projectile.light = 1f; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = GaelsGreatsword.BaseImmunityFrames; - - if (CalamityWorld.downedYharon) - { - projectile.localNPCHitCooldown = GaelsGreatsword.PostYharonImmunityFrames; - } - else if (NPC.downedMoonlord) - { - projectile.localNPCHitCooldown = GaelsGreatsword.PostMoonLordImmunityFrames; - } - else if (Main.hardMode) - { - projectile.localNPCHitCooldown = GaelsGreatsword.HardmodeImmunityFrames; - } + projectile.localNPCHitCooldown = GaelsGreatsword.ImmunityFrames; } public override void AI() { - float checkingDistance = GaelsGreatsword.BaseSearchDistance; - if (CalamityWorld.downedYharon) - { - checkingDistance = GaelsGreatsword.PostYharonSearchDistance; - } - else if (NPC.downedMoonlord) - { - checkingDistance = GaelsGreatsword.PostMoonLordSearchDistance; - } - else if (Main.hardMode) - { - checkingDistance = GaelsGreatsword.HardmodeSearchDistance; - } - //Targeting - - NPC target = projectile.Center.ClosestNPCAt(checkingDistance); - projectile.tileCollide = target != null; //Go through walls if we're hunting an NPC - if (target != null) + if (projectile.scale <= 1f) { - float velocityMagnitude = projectile.velocity.Length(); - Vector2 distanceNorm = projectile.DirectionTo(target.Center) * velocityMagnitude * (projectile.Distance(target.Center) < 220f ? 1.3f : 1f); - float inverseTurnSpeed = (projectile.Distance(target.Center) < 240f ? 4f : 13f); - projectile.velocity = (projectile.velocity * inverseTurnSpeed + distanceNorm) / (inverseTurnSpeed + 0.4f); - projectile.velocity.Normalize(); - projectile.velocity *= velocityMagnitude; + NPC target = projectile.Center.ClosestNPCAt(GaelsGreatsword.SearchDistance); + projectile.tileCollide = target != null; //Go through walls if we're hunting an NPC + if (target != null) + { + float velocityMagnitude = projectile.velocity.Length(); + Vector2 distanceNorm = projectile.DirectionTo(target.Center) * velocityMagnitude * (projectile.Distance(target.Center) < 220f ? 1.3f : 1f); + float inverseTurnSpeed = (projectile.Distance(target.Center) < 240f ? 4f : 13f); + projectile.velocity = (projectile.velocity * inverseTurnSpeed + distanceNorm) / (inverseTurnSpeed + 0.4f); + projectile.velocity.Normalize(); + projectile.velocity *= velocityMagnitude; + } } //Rotation @@ -93,12 +68,12 @@ namespace CalamityMod.Projectiles.Melee projectile.ai[0] += 1f; if (projectile.ai[0] % 20 == 0f) { - for (int l = 0; l < 24; l++) + for (int l = 0; l < 14; l++) { Vector2 spawnPositionAdditive = Vector2.UnitX * (float)-(float)projectile.width / 2f; - spawnPositionAdditive += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.TwoPi / 24f), default) * new Vector2(8f, 16f) * projectile.scale; + spawnPositionAdditive += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.TwoPi / 14f), default) * new Vector2(8f, 16f) * projectile.scale; spawnPositionAdditive = spawnPositionAdditive.RotatedBy((double)(projectile.rotation), default); - int dustIndex = Dust.NewDust(projectile.Center, 0, 0, 218, 0f, 0f, 0, default, 1.5f); + int dustIndex = Dust.NewDust(projectile.Center, 0, 0, 218, 0f, 0f, 0, new Color(188, 126, 154), 1.5f); Main.dust[dustIndex].noGravity = true; Main.dust[dustIndex].position = projectile.Center + spawnPositionAdditive; Main.dust[dustIndex].velocity = projectile.velocity * 0.1f; @@ -123,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.localAI[0] == 0f && !NPC.downedMoonlord) { - projectile.penetrate = GaelsGreatsword.PreMoonlordPenetrate; + projectile.penetrate = -1; projectile.localAI[0] = 1f; } else if (NPC.downedMoonlord) @@ -160,6 +135,8 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.maxPenetrate = -1; projectile.penetrate = -1; + if (projectile.scale == 1.75f && CalamityWorld.downedYharon) + projectile.damage /= 2; projectile.Damage(); Main.PlaySound((int)SoundType.NPCKilled, (int)projectile.Center.X, (int)projectile.Center.Y, 52, 0.4f); for (int i = 0; i < 3; i++) diff --git a/Projectiles/Melee/GaelSkull2.cs b/Projectiles/Melee/GaelSkull2.cs new file mode 100644 index 0000000000..35c69be239 --- /dev/null +++ b/Projectiles/Melee/GaelSkull2.cs @@ -0,0 +1,141 @@ +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class GaelSkull2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ark of the Cosmos' Superior Cousin"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 16; + projectile.friendly = true; + projectile.melee = true; + projectile.ignoreWater = true; + projectile.penetrate = 2; + projectile.timeLeft = 600; + projectile.light = 1f; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = GaelsGreatsword.ImmunityFrames; + } + + public override void AI() + { + //Rotation + + if (projectile.velocity.X < 0f) + { + projectile.spriteDirection = -1; + projectile.rotation = (-projectile.velocity).ToRotation(); + } + else + { + projectile.spriteDirection = 1; + projectile.rotation = projectile.velocity.ToRotation(); + } + + projectile.ai[0] += 1f; + if (projectile.localAI[1] == 1f && projectile.ai[0] < 35f) + { + projectile.velocity.Y += 0.5f; + return; + } + + //Targeting + + NPC target = projectile.Center.ClosestNPCAt(GaelsGreatsword.SearchDistance); + projectile.tileCollide = target != null; //Go through walls if we're hunting an NPC + if (target != null) + { + float velocityMagnitude = projectile.velocity.Length(); + Vector2 distanceNorm = projectile.DirectionTo(target.Center) * velocityMagnitude * (projectile.Distance(target.Center) < 220f ? 1.3f : 1f); + float inverseTurnSpeed = (projectile.Distance(target.Center) < 240f ? 4f : 13f); + projectile.velocity = (projectile.velocity * inverseTurnSpeed + distanceNorm) / (inverseTurnSpeed + 0.4f); + projectile.velocity.Normalize(); + projectile.velocity *= velocityMagnitude; + } + + //Dust circle + + if (projectile.ai[0] % 20 == 0f) + { + for (int l = 0; l < 14; l++) + { + Vector2 spawnPositionAdditive = Vector2.UnitX * (float)-(float)projectile.width / 2f; + spawnPositionAdditive += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.TwoPi / 14f), default) * new Vector2(8f, 16f) * projectile.scale; + spawnPositionAdditive = spawnPositionAdditive.RotatedBy((double)(projectile.rotation), default); + int dustIndex = Dust.NewDust(projectile.Center, 0, 0, 218, 0f, 0f, 0, new Color(188, 126, 154), 1.5f); + Main.dust[dustIndex].noGravity = true; + Main.dust[dustIndex].position = projectile.Center + spawnPositionAdditive; + Main.dust[dustIndex].velocity = projectile.velocity * 0.1f; + Main.dust[dustIndex].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[dustIndex].position) * 1.25f; + } + } + + //Frame logic + + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 0) + { + projectile.frame++; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + if (projectile.alpha > 0) + { + projectile.alpha -= 15; + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 240; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.Damage(); + Main.PlaySound((int)SoundType.NPCKilled, (int)projectile.Center.X, (int)projectile.Center.Y, 52, 0.4f); + for (int i = 0; i < 3; i++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 100, default, 1.5f); + } + for (int i = 0; i < 30; i++) + { + float angle = MathHelper.TwoPi * i / 30f; + int dustIndex = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 0, default, 2.5f); + Main.dust[dustIndex].noGravity = true; + Main.dust[dustIndex].velocity *= 3f; + dustIndex = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 100, default, 1.5f); + Main.dust[dustIndex].velocity *= 2f; + Main.dust[dustIndex].noGravity = true; + Dust.NewDust(projectile.Center + angle.ToRotationVector2() * 160f, 0, 0, 218, 0f, 0f, 100, default, 1.5f); + } + } + } +} diff --git a/Projectiles/Melee/GaelSkull2.png b/Projectiles/Melee/GaelSkull2.png new file mode 100644 index 0000000000..706be9b2d8 Binary files /dev/null and b/Projectiles/Melee/GaelSkull2.png differ diff --git a/Projectiles/Melee/GaelSpark.cs b/Projectiles/Melee/GaelSpark.cs deleted file mode 100644 index 8e6dc66b51..0000000000 --- a/Projectiles/Melee/GaelSpark.cs +++ /dev/null @@ -1,40 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class GaelSpark : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spark"); - } - - public override void SetDefaults() - { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; - projectile.melee = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 180; - projectile.alpha = 255; - } - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.velocity.X = 0f; - return false; - } - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.7f, 0f, 0f); - projectile.velocity.Y += 0.3f; - int dustIndex = Dust.NewDust(projectile.Center, 0, 0, DustID.Blood, 0f, 0f, 0, default, 1.4f); - Main.dust[dustIndex].noGravity = true; - } - } -} diff --git a/Projectiles/Melee/GaelSpark.png b/Projectiles/Melee/GaelSpark.png deleted file mode 100644 index 1740dec81a..0000000000 Binary files a/Projectiles/Melee/GaelSpark.png and /dev/null differ diff --git a/Projectiles/Melee/LightningThing.cs b/Projectiles/Melee/LightningThing.cs new file mode 100644 index 0000000000..41dbe60439 --- /dev/null +++ b/Projectiles/Melee/LightningThing.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.World; +namespace CalamityMod.Projectiles.Melee +{ + public class LightningThing : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lightning"); + } + + public override void SetDefaults() + { + projectile.width = 2; + projectile.height = 2; + projectile.friendly = true; + projectile.timeLeft = 90; + projectile.melee = true; + } + public override void Kill(int timeLeft) + { + int damage = GaelsGreatsword.BaseDamage; + for (int i = 0; i < 3; i++) + { + int idx = Projectile.NewProjectile(projectile.Center + new Vector2(Main.rand.NextFloat(-35f, 35f), -1600f), Vector2.UnitY * 12f, + ProjectileID.CultistBossLightningOrbArc, GaelsGreatsword.BaseDamage, 0f, projectile.owner, + MathHelper.PiOver2, Main.rand.Next(100)); + Main.projectile[idx].Calamity().forceMelee = true; + Main.projectile[idx].usesLocalNPCImmunity = true; + Main.projectile[idx].localNPCHitCooldown = GaelsGreatsword.ImmunityFrames; + } + } + } +} diff --git a/Projectiles/Melee/LightningThing.png b/Projectiles/Melee/LightningThing.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Melee/LightningThing.png differ diff --git a/Projectiles/Melee/SoulScythe.cs b/Projectiles/Melee/SoulScythe.cs index 183ff053ca..408fb40701 100644 --- a/Projectiles/Melee/SoulScythe.cs +++ b/Projectiles/Melee/SoulScythe.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(2, (int)target.position.X, (int)target.position.Y, 14); if (projectile.owner == Main.myPlayer) { - // TODO -- HiveBombExplosion does not exist. + // DEFECT -- HiveBombExplosion does not exist. // Projectile.NewProjectile(target.Center.X, target.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } projectile.position.X = projectile.position.X + (float)(projectile.width / 2); diff --git a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs index a310e205cf..3dbcb06ff6 100644 --- a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs +++ b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.hide = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; + projectile.localNPCHitCooldown = 8; } public override void AI() @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { projectile.localAI[0] = 1f; Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, - projectile.velocity.X * 2.4f, projectile.velocity.Y * 2.4f, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); + projectile.velocity.X * 2.4f, projectile.velocity.Y * 2.4f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); } } else diff --git a/Projectiles/Melee/TyphonsGreed.cs b/Projectiles/Melee/TyphonsGreedBubble.cs similarity index 99% rename from Projectiles/Melee/TyphonsGreed.cs rename to Projectiles/Melee/TyphonsGreedBubble.cs index 4ca1979fd7..773ab62d18 100644 --- a/Projectiles/Melee/TyphonsGreed.cs +++ b/Projectiles/Melee/TyphonsGreedBubble.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TyphonsGreed : ModProjectile + public class TyphonsGreedBubble : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/TyphonsGreed.png b/Projectiles/Melee/TyphonsGreedBubble.png similarity index 100% rename from Projectiles/Melee/TyphonsGreed.png rename to Projectiles/Melee/TyphonsGreedBubble.png diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index f36befd0ab..651ab03052 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.owner == Main.myPlayer) { float ai1 = Main.rand.NextFloat() + 0.5f; - Projectile.NewProjectile(vector20.X, vector20.Y, speedX, speedY, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner, 0.0f, ai1); + Projectile.NewProjectile(vector20.X, vector20.Y, speedX, speedY, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner, 0.0f, ai1); } } } diff --git a/Projectiles/Ranged/ChargedBlast3.cs b/Projectiles/Ranged/ChargedBlast3.cs index 1d3c8443ae..9eca4e211a 100644 --- a/Projectiles/Ranged/ChargedBlast3.cs +++ b/Projectiles/Ranged/ChargedBlast3.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { - // TODO -- HiveExplosion does not exist. + // DEFECT -- HiveExplosion does not exist. // int explode = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack, projectile.owner, 0f, 0f); // Main.projectile[explode].penetrate = 1; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - // TODO -- HiveExplosion does not exist. + // DEFECT -- HiveExplosion does not exist. // int explode = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack, projectile.owner, 0f, 0f); // Main.projectile[explode].penetrate = 1; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); @@ -177,7 +177,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 2; - // TODO -- HiveExplosion does not exist. + // DEFECT -- HiveExplosion does not exist. // int explode = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack, projectile.owner, 0f, 0f); // Main.projectile[explode].penetrate = 1; projectile.position.X = projectile.position.X + (float)(projectile.width / 2); diff --git a/Projectiles/Ranged/FrostsparkBulletProj.cs b/Projectiles/Ranged/FrostsparkBulletProj.cs index a1f30c2089..b7cbd4ae18 100644 --- a/Projectiles/Ranged/FrostsparkBulletProj.cs +++ b/Projectiles/Ranged/FrostsparkBulletProj.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); - // TODO -- BoltExplosion does not exist. + // DEFECT -- BoltExplosion does not exist. // Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); int num212 = Main.rand.Next(10, 20); for (int num213 = 0; num213 < num212; num213++) diff --git a/Projectiles/Ranged/SeasSearingBubble.cs b/Projectiles/Ranged/SeasSearingBubble.cs index a9e21d1a19..7a71e9c7c6 100644 --- a/Projectiles/Ranged/SeasSearingBubble.cs +++ b/Projectiles/Ranged/SeasSearingBubble.cs @@ -41,27 +41,35 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.alpha < 0) projectile.alpha = 0; } - for (int num105 = 0; num105 < 2; num105++) - { - float num99 = projectile.velocity.X / 3f * (float)num105; - float num100 = projectile.velocity.Y / 3f * (float)num105; - int num101 = 4; - int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 202, 0f, 0f, 100, default, 1.2f); - Main.dust[num102].noGravity = true; - Main.dust[num102].velocity *= 0.1f; - Main.dust[num102].velocity += projectile.velocity * 0.1f; - Dust expr_47FA_cp_0 = Main.dust[num102]; - expr_47FA_cp_0.position.X -= num99; - Dust expr_4815_cp_0 = Main.dust[num102]; - expr_4815_cp_0.position.Y -= num100; - } - if (Main.rand.NextBool(10)) - { - int num103 = 4; - int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 202, 0f, 0f, 100, default, 0.6f); - Main.dust[num104].velocity *= 0.25f; - Main.dust[num104].velocity += projectile.velocity * 0.5f; - } + if (projectile.timeLeft < 475) + { + for (int num105 = 0; num105 < 2; num105++) + { + float num99 = projectile.velocity.X / 3f * (float)num105; + float num100 = projectile.velocity.Y / 3f * (float)num105; + int num101 = 4; + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 202, 0f, 0f, 150, new Color(60, Main.DiscoG, 190), 1.2f); + Main.dust[num102].noGravity = true; + Main.dust[num102].velocity *= 0.1f; + Main.dust[num102].velocity += projectile.velocity * 0.1f; + Dust expr_47FA_cp_0 = Main.dust[num102]; + expr_47FA_cp_0.position.X -= num99; + Dust expr_4815_cp_0 = Main.dust[num102]; + expr_4815_cp_0.position.Y -= num100; + } + if (Main.rand.NextBool(10)) + { + int num103 = 4; + int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 202, 0f, 0f, 150, new Color(60, Main.DiscoG, 190), 0.6f); + Main.dust[num104].velocity *= 0.25f; + Main.dust[num104].velocity += projectile.velocity * 0.5f; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(60, Main.DiscoG, 190, projectile.alpha); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -75,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 96); for (int k = 0; k < 5; k++) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 202, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 202, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, new Color(60, Main.DiscoG, 190)); } } diff --git a/Projectiles/Ranged/SeasSearingSecondary.cs b/Projectiles/Ranged/SeasSearingSecondary.cs index 3f8c27d761..5c58ff72b3 100644 --- a/Projectiles/Ranged/SeasSearingSecondary.cs +++ b/Projectiles/Ranged/SeasSearingSecondary.cs @@ -41,10 +41,10 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 217, 0f, 0f, 100, default, projectile.scale); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 217, 0f, 0f, 100, new Color(60, Main.DiscoG, 190), projectile.scale); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - int num470 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 202, 0f, 0f, 100, default, projectile.scale); + int num470 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 202, 0f, 0f, 100, new Color(60, Main.DiscoG, 190), projectile.scale); Main.dust[num470].noGravity = true; Main.dust[num470].velocity *= 0f; } diff --git a/Projectiles/Ranged/SeasSearingSpout.cs b/Projectiles/Ranged/SeasSearingSpout.cs index 10db19cacb..e3df36dfb8 100644 --- a/Projectiles/Ranged/SeasSearingSpout.cs +++ b/Projectiles/Ranged/SeasSearingSpout.cs @@ -111,6 +111,11 @@ namespace CalamityMod.Projectiles.Ranged } } + public override Color? GetAlpha(Color lightColor) + { + return new Color(60, Main.DiscoG, 190, projectile.alpha); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture2D13 = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Ranged/VanquisherArrowMain.cs b/Projectiles/Ranged/VanquisherArrowMain.cs index cb5e0a69af..b90d3dae9e 100644 --- a/Projectiles/Ranged/VanquisherArrowMain.cs +++ b/Projectiles/Ranged/VanquisherArrowMain.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged } } - // TODO -- Vanquisher Arrow projectile glowmask doesn't work. + // DEFECT -- Vanquisher Arrow projectile glowmask doesn't work. /* public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Rogue/AshenStalactiteDebris.cs b/Projectiles/Rogue/AshenStalactiteDebris.cs new file mode 100644 index 0000000000..97dc29b133 --- /dev/null +++ b/Projectiles/Rogue/AshenStalactiteDebris.cs @@ -0,0 +1,59 @@ + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class AshenStalactiteDebris : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ashen Debris"); + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 50; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.rotation += 0.2f; + projectile.velocity.Y += 0.2f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 3; i++) + { + Dust.NewDust(projectile.Center, 1, 1, 1, projectile.velocity.X, projectile.velocity.Y); + } + } + } +} diff --git a/Projectiles/Rogue/AshenStalactiteDebris.png b/Projectiles/Rogue/AshenStalactiteDebris.png new file mode 100644 index 0000000000..c19bebc35f Binary files /dev/null and b/Projectiles/Rogue/AshenStalactiteDebris.png differ diff --git a/Projectiles/Rogue/AshenStalactiteProj.cs b/Projectiles/Rogue/AshenStalactiteProj.cs new file mode 100644 index 0000000000..93d3d8522d --- /dev/null +++ b/Projectiles/Rogue/AshenStalactiteProj.cs @@ -0,0 +1,61 @@ + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class AshenStalactiteProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ashen Stalactite"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 25; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + + projectile.velocity.Y += 0.1f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 10; i++) + { + Dust.NewDust(projectile.Center, 1, 1, 1, projectile.velocity.X, projectile.velocity.Y); + } + } + } +} diff --git a/Projectiles/Rogue/AshenStalactiteProj.png b/Projectiles/Rogue/AshenStalactiteProj.png new file mode 100644 index 0000000000..2bc70a87aa Binary files /dev/null and b/Projectiles/Rogue/AshenStalactiteProj.png differ diff --git a/Projectiles/Rogue/AshenStalagmiteProj.cs b/Projectiles/Rogue/AshenStalagmiteProj.cs new file mode 100644 index 0000000000..a4becec216 --- /dev/null +++ b/Projectiles/Rogue/AshenStalagmiteProj.cs @@ -0,0 +1,62 @@ + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class AshenStalagmiteProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ashen Stalagmite"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = 2; + projectile.timeLeft = 100; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + + projectile.velocity.Y += 0.075f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 6; i++) + { + int dustIndex = Dust.NewDust(projectile.Center, 1, 1, 1, projectile.velocity.X, projectile.velocity.Y); + Projectile.NewProjectile(projectile.Center, Main.dust[dustIndex].velocity, ModContent.ProjectileType(), projectile.damage / 2, 0, projectile.owner, 0, 0); + } + } + } +} diff --git a/Projectiles/Rogue/AshenStalagmiteProj.png b/Projectiles/Rogue/AshenStalagmiteProj.png new file mode 100644 index 0000000000..2f1751aaa4 Binary files /dev/null and b/Projectiles/Rogue/AshenStalagmiteProj.png differ diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 918a27479c..ae462c7733 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -77,14 +77,14 @@ namespace CalamityMod.Projectiles.Rogue { Vector2 shrapnelVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(30f)); Projectile.NewProjectile(projectile.Center, projectile.velocity + shrapnelVelocity, - ModContent.ProjectileType(), BlastBarrel.BaseDamage, 3f, projectile.owner); + ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner); } else { Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity, Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), - BlastBarrel.BaseDamage, 1f, projectile.owner); + projectile.damage, 1f, projectile.owner); Main.projectile[fireIndex].Calamity().forceRogue = true; Main.projectile[fireIndex].penetrate = -1; Main.projectile[fireIndex].usesLocalNPCImmunity = true; diff --git a/Projectiles/Rogue/BlazingStarProj.png b/Projectiles/Rogue/BlazingStarProj.png index 75c05587da..ac480e43b1 100644 Binary files a/Projectiles/Rogue/BlazingStarProj.png and b/Projectiles/Rogue/BlazingStarProj.png differ diff --git a/Projectiles/Rogue/BouncyBol.cs b/Projectiles/Rogue/BouncyBol.cs new file mode 100644 index 0000000000..c9e3476b2c --- /dev/null +++ b/Projectiles/Rogue/BouncyBol.cs @@ -0,0 +1,115 @@ +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class BouncyBol : ModProjectile + { + private bool hasHitEnemy = false; + private int targetNPC = -1; + private List previousNPCs = new List() { -1 }; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bouncy Ball"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.penetrate = 8; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + projectile.aiStyle = 14; + } + + public override void AI() + { + if (hasHitEnemy == true && projectile.timeLeft < 575) + { + projectile.velocity.X *= 1.005f; //you broke up, time to yeet yourself out + projectile.velocity.Y *= 1.005f; + if (projectile.velocity.X > 16f) + { + projectile.velocity.X = 16f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + float minDist = 999f; + int index = 0; + for (int i = 0; i < Main.npc.Length; i++) + { + bool hasHitNPC = false; + for (int j = 0; j < previousNPCs.Count; j++) + { + if (previousNPCs[j] == i) + { + hasHitNPC = true; + } + } + + NPC npc = Main.npc[i]; + if (npc == target) + { + previousNPCs.Add(i); + } + if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable && npc != target && !hasHitNPC) + { + float dist = (projectile.Center - npc.Center).Length(); + if (dist < minDist) + { + minDist = dist; + index = i; + } + } + } + + Vector2 velocityNew; + if (minDist < 999f) + { + if (projectile.Calamity().stealthStrike && hasHitEnemy == false) + { + projectile.damage = (int)(projectile.damage * 1.5f); + } + else + { + projectile.damage = (int)(projectile.damage * 1.1f); + } + hasHitEnemy = true; + targetNPC = index; + velocityNew = Main.npc[index].Center - projectile.Center; + velocityNew.Normalize(); + velocityNew *= 15f; + projectile.velocity = velocityNew; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X * 1.001f; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y * 1.001f; + } + return false; + } + } +} diff --git a/Projectiles/Rogue/BouncyBol.png b/Projectiles/Rogue/BouncyBol.png new file mode 100644 index 0000000000..d409a6b571 Binary files /dev/null and b/Projectiles/Rogue/BouncyBol.png differ diff --git a/Projectiles/Rogue/CelestialReaperProjectile.cs b/Projectiles/Rogue/CelestialReaperProjectile.cs index 2cfc9b10b5..1866d0657d 100644 --- a/Projectiles/Rogue/CelestialReaperProjectile.cs +++ b/Projectiles/Rogue/CelestialReaperProjectile.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue framesNeeded /= 6f - projectile.penetrate + 1f; //1 is to prevent division by zero. The more hits, the more afterimages if (projectile.timeLeft % (int)framesNeeded == 0f) { - Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType(), CelestialReaper.BaseDamage, 2f, projectile.owner); + Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner); } } } @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Rogue for (float i = 0f; i < 7f; i += 1f) { float angle = MathHelper.TwoPi * i / 7f; - Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType(), CelestialReaper.BaseDamage, 2f, projectile.owner); + Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner); } } } diff --git a/Projectiles/Rogue/ConsecratedWaterProjectile.cs b/Projectiles/Rogue/ConsecratedWaterProjectile.cs index b5b38e8234..3607442eed 100644 --- a/Projectiles/Rogue/ConsecratedWaterProjectile.cs +++ b/Projectiles/Rogue/ConsecratedWaterProjectile.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue Point result; if (WorldUtils.Find(projectile.Top.ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result)) { - Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), ConsecratedWater.BaseDamage, 2f, projectile.owner); + Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner); } } //stealth strike @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue Point result; if (WorldUtils.Find((projectile.Top + i * Main.rand.NextFloat(56f, 108f) * Vector2.UnitX).ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result)) { - Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), ConsecratedWater.BaseDamage, 2f, projectile.owner); + Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner); } } } diff --git a/Projectiles/Rogue/DeepWounderProjectile.cs b/Projectiles/Rogue/DeepWounderProjectile.cs new file mode 100644 index 0000000000..74f0f8e029 --- /dev/null +++ b/Projectiles/Rogue/DeepWounderProjectile.cs @@ -0,0 +1,85 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class DeepWounderProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Deep Wounder Projectile"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.rotation += 0.2f * projectile.direction; + + if (projectile.Calamity().stealthStrike) + { + int spriteWidth = 52; + int spriteHeight = 48; + Vector2 spriteCenter = projectile.Center - new Vector2(spriteWidth / 2, spriteHeight / 2); + + for (int i = 0; i < 30; i++) + { + int dust = Dust.NewDust(spriteCenter, spriteWidth, spriteHeight, 33, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 1f); + Main.dust[dust].noGravity = true; + } + + if (Main.rand.NextBool(5)) + { + Vector2 waterVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); + waterVelocity.Normalize(); + waterVelocity *= 3; + Projectile.NewProjectile(spriteCenter, waterVelocity, ModContent.ProjectileType(), 20, 1, projectile.owner, 0, 0); + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + if (projectile.Calamity().stealthStrike) + { + target.AddBuff(ModContent.BuffType(), 120); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + if (projectile.direction > 0) + { + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + } + else + { + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.FlipHorizontally, 0f); + } + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + } +} diff --git a/Projectiles/Rogue/DeepWounderProjectile.png b/Projectiles/Rogue/DeepWounderProjectile.png new file mode 100644 index 0000000000..0212f6a971 Binary files /dev/null and b/Projectiles/Rogue/DeepWounderProjectile.png differ diff --git a/Projectiles/Rogue/DeepWounderWater.cs b/Projectiles/Rogue/DeepWounderWater.cs new file mode 100644 index 0000000000..bd36f500e3 --- /dev/null +++ b/Projectiles/Rogue/DeepWounderWater.cs @@ -0,0 +1,57 @@ + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class DeepWounderWater : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Water Droplet"); + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 50; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 33, projectile.velocity.X, projectile.velocity.Y); + Main.dust[dust].noGravity = true; + } + + projectile.rotation += 0.2f; + + projectile.velocity.Y += 0.2f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + projectile.Kill(); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Rogue/DeepWounderWater.png b/Projectiles/Rogue/DeepWounderWater.png new file mode 100644 index 0000000000..86fe129183 Binary files /dev/null and b/Projectiles/Rogue/DeepWounderWater.png differ diff --git a/Projectiles/Rogue/DesecratedBubble.cs b/Projectiles/Rogue/DesecratedBubble.cs new file mode 100644 index 0000000000..4e8c86ecb1 --- /dev/null +++ b/Projectiles/Rogue/DesecratedBubble.cs @@ -0,0 +1,115 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class DesecratedBubble : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bubble"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = 1; + projectile.alpha = 255; + projectile.timeLeft = 120; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.scale += 0.002f; + if (projectile.alpha <= 0) + { + projectile.alpha = 0; + } + else if (projectile.alpha > 50) + { + projectile.alpha -= 20; + } + if (projectile.timeLeft <= 100) + { + projectile.ai[1] = 0f; + } + else + { + projectile.velocity *= 0.995f; + } + if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) + { + if (projectile.ai[1] == 0f) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 600f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 8f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + } + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 54); + int num190 = Main.rand.Next(5, 9); + for (int num191 = 0; num191 < num190; num191++) + { + int num192 = Dust.NewDust(projectile.Center, 0, 0, 179, 0f, 0f, 100, default, 1.4f); + Main.dust[num192].velocity *= 0.8f; + Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); + Main.dust[num192].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.ai[0] == 1f) + { + target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.CursedInferno, 180); + } + } + + // Cannot deal damage for the first several frames of existence. + public override bool CanDamage() + { + return projectile.timeLeft < 100; + } + } +} \ No newline at end of file diff --git a/Projectiles/Rogue/DesecratedBubble.png b/Projectiles/Rogue/DesecratedBubble.png new file mode 100644 index 0000000000..75961e8770 Binary files /dev/null and b/Projectiles/Rogue/DesecratedBubble.png differ diff --git a/Projectiles/Rogue/DesecratedWaterProj.cs b/Projectiles/Rogue/DesecratedWaterProj.cs new file mode 100644 index 0000000000..25e32ea4af --- /dev/null +++ b/Projectiles/Rogue/DesecratedWaterProj.cs @@ -0,0 +1,62 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class DesecratedWaterProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desecrated Water"); + } + + public override void SetDefaults() + { + projectile.width = 25; + projectile.height = 25; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.aiStyle = 2; + projectile.timeLeft = 300; + aiType = 48; + projectile.Calamity().rogue = true; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(13, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); + Vector2 vector2 = new Vector2(20f, 20f); + for (int index = 0; index < 10; ++index) + Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 191, 0.0f, 0.0f); + for (int index1 = 0; index1 < 20; ++index1) + { + int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 179, 0.0f, 0.0f, 100, new Color(), 2.5f); + Main.dust[index2].noGravity = true; + Dust dust1 = Main.dust[index2]; + dust1.velocity = dust1.velocity * 5f; + int index3 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 179, 0.0f, 0.0f, 100, new Color(), 1.5f); + Dust dust2 = Main.dust[index3]; + dust2.velocity = dust2.velocity * 3f; + } + int num220 = (projectile.Calamity().stealthStrike ? Main.rand.Next(10, 16) : Main.rand.Next(5, 11)); + if (projectile.owner == Main.myPlayer) + { + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), 1f, projectile.owner, (projectile.Calamity().stealthStrike ? 1f : 0f), 1f); + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Rogue/DesecratedWaterProj.png b/Projectiles/Rogue/DesecratedWaterProj.png new file mode 100644 index 0000000000..e9fbc43d8c Binary files /dev/null and b/Projectiles/Rogue/DesecratedWaterProj.png differ diff --git a/Projectiles/Rogue/EquanimityDarkShard.cs b/Projectiles/Rogue/EquanimityDarkShard.cs index 8e8ed18543..30842639d3 100644 --- a/Projectiles/Rogue/EquanimityDarkShard.cs +++ b/Projectiles/Rogue/EquanimityDarkShard.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.alpha = 0; projectile.penetrate = 1; projectile.tileCollide = true; - projectile.timeLeft = 150; + projectile.timeLeft = 120; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/EquanimityLightShard.cs b/Projectiles/Rogue/EquanimityLightShard.cs index 5b6bb62daf..cbccfad414 100644 --- a/Projectiles/Rogue/EquanimityLightShard.cs +++ b/Projectiles/Rogue/EquanimityLightShard.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.alpha = 0; projectile.penetrate = 3; projectile.tileCollide = true; - projectile.timeLeft = 150; + projectile.timeLeft = 120; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/EquanimityProj.cs b/Projectiles/Rogue/EquanimityProj.cs index 4c5ddd6b65..9f46ef762d 100644 --- a/Projectiles/Rogue/EquanimityProj.cs +++ b/Projectiles/Rogue/EquanimityProj.cs @@ -41,15 +41,15 @@ namespace CalamityMod.Projectiles.Rogue if (recall) { - if (Main.rand.Next(0, 7) == 0) + if (Main.rand.Next(0, 10) == 0) { Vector2 shardVelocity = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)); shardVelocity.Normalize(); shardVelocity *= 5f; - Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), 0f, projectile.owner); + Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.15f), 0f, projectile.owner); if (projectile.Calamity().stealthStrike) { - Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), 0f, projectile.owner); + Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.15f), 0f, projectile.owner); } } @@ -80,10 +80,10 @@ namespace CalamityMod.Projectiles.Rogue Vector2 shardVelocity = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)); shardVelocity.Normalize(); shardVelocity *= 5f; - Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25f), 0f, projectile.owner); + Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.1f), 0f, projectile.owner); if (projectile.Calamity().stealthStrike) { - Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25f), 0f, projectile.owner); + Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.1f), 0f, projectile.owner); } } } diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index b3896de0ed..a6e3aa9f10 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 3; i++) { - int idx = Projectile.NewProjectile(startPos, kunaiSp, ModContent.ProjectileType(), projectile.damage, 1f, projectile.owner, 0f, 0f); + int idx = Projectile.NewProjectile(startPos, kunaiSp, ModContent.ProjectileType(), projectile.damage/2, 1f, projectile.owner, 0f, 0f); Main.projectile[idx].rotation = angle; } } diff --git a/Projectiles/Rogue/Honeycomb.cs b/Projectiles/Rogue/Honeycomb.cs new file mode 100644 index 0000000000..bbb6ed729c --- /dev/null +++ b/Projectiles/Rogue/Honeycomb.cs @@ -0,0 +1,132 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Rogue; + +namespace CalamityMod.Projectiles.Rogue +{ + public class Honeycomb : ModProjectile + { + private const float radius = 15f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Honeycomb"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.aiStyle = 2; + projectile.timeLeft = 300; + aiType = 48; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + Player player = Main.player[Main.myPlayer]; + Vector2 posDiff = player.Center - projectile.Center; + if (posDiff.Length() <= radius) + { + player.AddBuff(BuffID.Honey, 300); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + int split = 0; + while (split < 3) + { + //Calculate the velocity of the projectile + float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f); + float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f; + //Prevents the projectile speed from being too low + if (shardspeedX < 2f && shardspeedX > -2f) + { + shardspeedX += -projectile.velocity.X; + } + if (shardspeedY > 2f && shardspeedY < 2f) + { + shardspeedY += -projectile.velocity.Y; + } + + //Spawn the projectile + Projectile.NewProjectile(projectile.position.X + shardspeedX, projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 2f, projectile.owner, Main.rand.Next(3), 0f); + split += 1; + } + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.velocity.X = -projectile.velocity.X; + projectile.velocity.Y = -projectile.velocity.Y; + int split = 0; + while (split < 3) + { + //Calculate the velocity of the projectile + float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f); + float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f; + //Prevents the projectile speed from being too low + if (shardspeedX < 2f && shardspeedX > -2f) + { + shardspeedX += -projectile.velocity.X; + } + if (shardspeedY > 2f && shardspeedY < 2f) + { + shardspeedY += -projectile.velocity.Y; + } + + //Spawn the projectile + Projectile.NewProjectile(projectile.position.X + shardspeedX, projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 2f, projectile.owner, Main.rand.Next(3), 0f); + split += 1; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1); + //Dust on impact + int dust_splash = 0; + while (dust_splash < 9) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 9, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.15f, 159, default, 1.5f); + dust_splash += 1; + } + if (Main.rand.NextBool(2)) + { + Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ModContent.ItemType()); + } + } + } +} diff --git a/Projectiles/Rogue/Honeycomb.png b/Projectiles/Rogue/Honeycomb.png new file mode 100644 index 0000000000..a29278afaa Binary files /dev/null and b/Projectiles/Rogue/Honeycomb.png differ diff --git a/Projectiles/Rogue/HoneycombFragment.cs b/Projectiles/Rogue/HoneycombFragment.cs new file mode 100644 index 0000000000..00f6d5121b --- /dev/null +++ b/Projectiles/Rogue/HoneycombFragment.cs @@ -0,0 +1,64 @@ +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace CalamityMod.Projectiles.Rogue +{ + public class HoneycombFragment : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Honeycomb Fragment"); + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 14; + projectile.height = 14; + projectile.Calamity().rogue = true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + //Changes the texture of the projectile + if (projectile.ai[0] == 1f) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HoneycombFragment2"); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 12, 14)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + if (projectile.ai[0] == 2f) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HoneycombFragment3"); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 16, 14)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + return true; + } + + public override void AI() + { + //Rotation and gravity + projectile.rotation += 0.6f * projectile.direction; + projectile.velocity.Y = projectile.velocity.Y + 0.27f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override void Kill(int timeLeft) + { + //Dust effect + int splash = 0; + while (splash < 4) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 9, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 159, default, 0.9f); + splash += 1; + } + } + } +} diff --git a/Projectiles/Rogue/HoneycombFragment.png b/Projectiles/Rogue/HoneycombFragment.png new file mode 100644 index 0000000000..993bd2ee3b Binary files /dev/null and b/Projectiles/Rogue/HoneycombFragment.png differ diff --git a/Projectiles/Rogue/HoneycombFragment2.png b/Projectiles/Rogue/HoneycombFragment2.png new file mode 100644 index 0000000000..032f46b4b9 Binary files /dev/null and b/Projectiles/Rogue/HoneycombFragment2.png differ diff --git a/Projectiles/Rogue/HoneycombFragment3.png b/Projectiles/Rogue/HoneycombFragment3.png new file mode 100644 index 0000000000..15350be722 Binary files /dev/null and b/Projectiles/Rogue/HoneycombFragment3.png differ diff --git a/Projectiles/Rogue/JawsProjectile.cs b/Projectiles/Rogue/JawsProjectile.cs new file mode 100644 index 0000000000..a695c112b8 --- /dev/null +++ b/Projectiles/Rogue/JawsProjectile.cs @@ -0,0 +1,232 @@ +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class JawsProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Reaper Tooth"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (projectile.Calamity().stealthStrike) + { + int dustToUse = Main.rand.Next(0, 4); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 33; + break; + case 1: + dustType = 101; + break; + case 2: + dustType = 111; + break; + case 3: + dustType = 180; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 15; + bool flag54 = false; + bool flag55 = false; + float[] var_2_2CB4E_cp_0 = projectile.localAI; + int var_2_2CB4E_cp_1 = 0; + float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; + var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 6; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 240); + if (projectile.Calamity().stealthStrike) + { + target.AddBuff(ModContent.BuffType(), 240); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 100, 10f, projectile.owner, 0, 0); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 3); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dustToUse = Main.rand.Next(0, 4); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 33; + break; + case 1: + dustType = 101; + break; + case 2: + dustType = 111; + break; + case 3: + dustType = 180; + break; + } + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, 0, 0, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/JawsProjectile.png b/Projectiles/Rogue/JawsProjectile.png new file mode 100644 index 0000000000..fe03c24c6a Binary files /dev/null and b/Projectiles/Rogue/JawsProjectile.png differ diff --git a/Projectiles/Rogue/JawsShockwave.cs b/Projectiles/Rogue/JawsShockwave.cs new file mode 100644 index 0000000000..be4a9209a5 --- /dev/null +++ b/Projectiles/Rogue/JawsShockwave.cs @@ -0,0 +1,86 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class JawsShockwave : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Reaper Tooth Shockwave"); + } + + public override void SetDefaults() + { + projectile.width = 320; + projectile.height = 320; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 10; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.timeLeft >= 5) + { + for (int i = 0; i < 50; i++) + { + int dustToUse = Main.rand.Next(0, 4); + int dustType = 0; + switch (dustToUse) + { + case 0: + dustType = 33; + break; + case 1: + dustType = 101; + break; + case 2: + dustType = 111; + break; + case 3: + dustType = 180; + break; + } + + Vector2 dustVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); + dustVelocity.Normalize(); + dustVelocity *= 16; + + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, dustVelocity.X, dustVelocity.Y, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); + float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight()); + float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft()); + float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight()); + + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; + + return minDist <= 160; + } + } +} diff --git a/Projectiles/Rogue/JawsShockwave.png b/Projectiles/Rogue/JawsShockwave.png new file mode 100644 index 0000000000..d86a683fca Binary files /dev/null and b/Projectiles/Rogue/JawsShockwave.png differ diff --git a/Projectiles/Rogue/KylieBoomerang.cs b/Projectiles/Rogue/KylieBoomerang.cs index 2a8113fed7..645a6ec9c7 100644 --- a/Projectiles/Rogue/KylieBoomerang.cs +++ b/Projectiles/Rogue/KylieBoomerang.cs @@ -126,6 +126,7 @@ namespace CalamityMod.Projectiles.Rogue //Start homing at player if you hit an enemy projectile.ai[0] = 1; } + public override bool OnTileCollide(Vector2 oldVelocity) { //Bounce off tiles and start homing on player if it hits a tile diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs new file mode 100644 index 0000000000..291ae41594 --- /dev/null +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -0,0 +1,196 @@ +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class LeviathanTooth : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leviathan Tooth"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (projectile.timeLeft < 575 && !projectile.Calamity().stealthStrike) + { + projectile.velocity.Y += 0.5f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + } + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 15; + bool flag54 = false; + bool flag55 = false; + float[] var_2_2CB4E_cp_0 = projectile.localAI; + int var_2_2CB4E_cp_1 = 0; + float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; + var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 6; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + if (projectile.Calamity().stealthStrike) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 3, tex); + } + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(projectile.Center, 1, 1, 33, 0, 0, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/LeviathanTooth.png b/Projectiles/Rogue/LeviathanTooth.png new file mode 100644 index 0000000000..349391a6fc Binary files /dev/null and b/Projectiles/Rogue/LeviathanTooth.png differ diff --git a/Projectiles/Rogue/LeviathanTooth2.cs b/Projectiles/Rogue/LeviathanTooth2.cs new file mode 100644 index 0000000000..f0c91daf55 --- /dev/null +++ b/Projectiles/Rogue/LeviathanTooth2.cs @@ -0,0 +1,196 @@ +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class LeviathanTooth2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leviathan Tooth"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (projectile.timeLeft < 575 && !projectile.Calamity().stealthStrike) + { + projectile.velocity.Y += 0.5f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + } + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 15; + bool flag54 = false; + bool flag55 = false; + float[] var_2_2CB4E_cp_0 = projectile.localAI; + int var_2_2CB4E_cp_1 = 0; + float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; + var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 6; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + if (projectile.Calamity().stealthStrike) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 3, tex); + } + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(projectile.Center, 1, 1, 33, 0, 0, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/LeviathanTooth2.png b/Projectiles/Rogue/LeviathanTooth2.png new file mode 100644 index 0000000000..9d885c4805 Binary files /dev/null and b/Projectiles/Rogue/LeviathanTooth2.png differ diff --git a/Projectiles/Rogue/LeviathanTooth3.cs b/Projectiles/Rogue/LeviathanTooth3.cs new file mode 100644 index 0000000000..8edb699761 --- /dev/null +++ b/Projectiles/Rogue/LeviathanTooth3.cs @@ -0,0 +1,196 @@ +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class LeviathanTooth3 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leviathan Tooth"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (projectile.timeLeft < 575 && !projectile.Calamity().stealthStrike) + { + projectile.velocity.Y += 0.5f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + } + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 15; + bool flag54 = false; + bool flag55 = false; + float[] var_2_2CB4E_cp_0 = projectile.localAI; + int var_2_2CB4E_cp_1 = 0; + float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; + var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 6; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + if (projectile.Calamity().stealthStrike) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 3, tex); + } + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + projectile.Kill(); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(projectile.Center, 1, 1, 33, 0, 0, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/LeviathanTooth3.png b/Projectiles/Rogue/LeviathanTooth3.png new file mode 100644 index 0000000000..3c083b2880 Binary files /dev/null and b/Projectiles/Rogue/LeviathanTooth3.png differ diff --git a/Projectiles/Rogue/NastyChollaNeedle.cs b/Projectiles/Rogue/NastyChollaNeedle.cs index 99fde9efff..9c9bef00b1 100644 --- a/Projectiles/Rogue/NastyChollaNeedle.cs +++ b/Projectiles/Rogue/NastyChollaNeedle.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 3; projectile.timeLeft = 180; projectile.aiStyle = 1; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 10; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -2; } public override void AI() diff --git a/Projectiles/Rogue/PhantasmalRuinProj.cs b/Projectiles/Rogue/PhantasmalRuinProj.cs index 8b21f6f27e..ceccfe47a1 100644 --- a/Projectiles/Rogue/PhantasmalRuinProj.cs +++ b/Projectiles/Rogue/PhantasmalRuinProj.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.Calamity().stealthStrike) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } else { @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue double deltaAngle = spread / 8f; double offsetAngle; int i; - if (projectile.owner == Main.myPlayer) //bringing super efficient and readable code to a CalamityMod near you + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 8) { for (i = 0; i < 8; i++) { @@ -79,8 +79,8 @@ namespace CalamityMod.Projectiles.Rogue float randomSpeed = (float)Main.rand.Next(1, 7); float randomSpeed2 = (float)Main.rand.Next(1, 7); offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int num23 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.2), 0f, projectile.owner, 1f, ai1); - int num24 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.2), 0f, projectile.owner, 1f, ai1); + int num23 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.05), 0f, projectile.owner, 1f, ai1); + int num24 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.05), 0f, projectile.owner, 1f, ai1); } } } diff --git a/Projectiles/Rogue/PhantasmalSoul.cs b/Projectiles/Rogue/PhantasmalSoul.cs index f757d8f55b..84ab21f81f 100644 --- a/Projectiles/Rogue/PhantasmalSoul.cs +++ b/Projectiles/Rogue/PhantasmalSoul.cs @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - projectile.damage /= 2; + projectile.damage /= 4; projectile.Damage(); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) diff --git a/Projectiles/Rogue/PhantomLanceProj.cs b/Projectiles/Rogue/PhantomLanceProj.cs new file mode 100644 index 0000000000..e265185848 --- /dev/null +++ b/Projectiles/Rogue/PhantomLanceProj.cs @@ -0,0 +1,91 @@ +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PhantomLanceProj : ModProjectile + { + private int projCount = 18; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Lance"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = 300; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void AI() + { + if (projectile.Calamity().stealthStrike != true) + { + if (projectile.timeLeft <= 255) + projectile.alpha += 1; + if (projectile.timeLeft >= 75) + { + projectile.velocity.X *= 0.995f; + projectile.velocity.Y *= 0.995f; + } + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default, 0.85f); + projCount--; + if (projCount <= 0) + { + if (projectile.owner == Main.myPlayer) + { + if (projectile.Calamity().stealthStrike) + { + int stealthSoulDamage = (int)(projectile.damage * 0.75f); + float stealthSoulKB = projectile.knockBack; + int stealthSoul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), stealthSoulDamage, stealthSoulKB, projectile.owner, 0f, 0f); + Main.projectile[stealthSoul].Calamity().forceRogue = true; + Main.projectile[stealthSoul].usesLocalNPCImmunity = true; + Main.projectile[stealthSoul].localNPCHitCooldown = -2; + } + else + { + float damageMult = projectile.timeLeft * 0.75f / 300f; + int soulDamage = (int)(projectile.damage * damageMult); + float soulKB = projectile.knockBack; + int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), soulDamage, soulKB, projectile.owner, 0f, 0f); + Main.projectile[soul].Calamity().forceRogue = true; + Main.projectile[soul].usesLocalNPCImmunity = true; + Main.projectile[soul].localNPCHitCooldown = -2; + } + } + projCount = 18; + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 10; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/Rogue/PhantomLanceProj.png b/Projectiles/Rogue/PhantomLanceProj.png new file mode 100644 index 0000000000..55db8c10ed Binary files /dev/null and b/Projectiles/Rogue/PhantomLanceProj.png differ diff --git a/Projectiles/Rogue/PlaguedFuelPackCloud.cs b/Projectiles/Rogue/PlaguedFuelPackCloud.cs new file mode 100644 index 0000000000..ffa477409d --- /dev/null +++ b/Projectiles/Rogue/PlaguedFuelPackCloud.cs @@ -0,0 +1,65 @@ +using CalamityMod.Buffs.DamageOverTime; +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PlaguedFuelPackCloud : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plagued Cloud"); + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 24; + projectile.friendly = true; + projectile.alpha = 0; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.ignoreWater = true; + projectile.timeLeft = 100; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.timeLeft < 50) + projectile.alpha += 5; + if (projectile.timeLeft < 75) + projectile.velocity *= 0.95f; + + if (Main.rand.NextBool(150)) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, projectile.velocity.X * 0.4f, projectile.velocity.Y * 0.4f, 100, default, 2f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.2f; + Main.dust[dust].velocity.Y -= 0.15f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + + public override void Kill(int timeLeft) + { + if (timeLeft != 0) + { + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, projectile.velocity.X * 0.4f, projectile.velocity.Y * 0.4f, 100, default, 3.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.2f; + Main.dust[dust].velocity.Y -= 0.15f; + } + } + } + } +} diff --git a/Projectiles/Rogue/PlaguedFuelPackCloud.png b/Projectiles/Rogue/PlaguedFuelPackCloud.png new file mode 100644 index 0000000000..1df6d88999 Binary files /dev/null and b/Projectiles/Rogue/PlaguedFuelPackCloud.png differ diff --git a/Projectiles/Rogue/ProfanedPartisanproj.cs b/Projectiles/Rogue/ProfanedPartisanproj.cs index c9ffbe416a..f0408a7134 100644 --- a/Projectiles/Rogue/ProfanedPartisanproj.cs +++ b/Projectiles/Rogue/ProfanedPartisanproj.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Rogue stealthStrikeTimer++; if (stealthStrikeTimer >= 18) { - Projectile.NewProjectile(spearposition, spearspeed, ModContent.ProjectileType(), projectile.damage/2, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(spearposition, spearspeed, ModContent.ProjectileType(), projectile.damage/10, projectile.knockBack, projectile.owner, 0f, 0f); stealthStrikeTimer = 0; } } @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue } Main.PlaySound(2, projectile.position, 45); Vector2 explode = new Vector2(0f, 0f); - Projectile.NewProjectile(projectile.Center, explode, ModContent.ProjectileType(), projectile.damage, projectile.knockBack * 1.3f, projectile.owner); + Projectile.NewProjectile(projectile.Center, explode, ModContent.ProjectileType(), projectile.damage/2, projectile.knockBack * 1.3f, projectile.owner); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/ProfanedPartisanspear.cs b/Projectiles/Rogue/ProfanedPartisanspear.cs index b5f8203745..3f36d0ee09 100644 --- a/Projectiles/Rogue/ProfanedPartisanspear.cs +++ b/Projectiles/Rogue/ProfanedPartisanspear.cs @@ -8,7 +8,6 @@ using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - //TODO -- This projectile literally does nothing so have fun public class ProfanedPartisanspear : ModProjectile { public int timer = 0; diff --git a/Projectiles/Rogue/ShroomerangProj.cs b/Projectiles/Rogue/ShroomerangProj.cs index 82f6ed444a..940f04969f 100644 --- a/Projectiles/Rogue/ShroomerangProj.cs +++ b/Projectiles/Rogue/ShroomerangProj.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike == true) { stealthCounter++; - if (stealthCounter == 8 && projectile.owner == Main.myPlayer) + if (stealthCounter == 15 && projectile.owner == Main.myPlayer) { Vector2 vector62 = Main.player[projectile.owner].Center - projectile.Center; stealthCounter = 0; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue vector63.Normalize(); vector63 *= (float)Main.rand.Next(45, 65) * 0.1f; vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.6), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.1), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f); } } } diff --git a/Projectiles/Rogue/SphereBladed.cs b/Projectiles/Rogue/SphereBladed.cs new file mode 100644 index 0000000000..32c85f80c0 --- /dev/null +++ b/Projectiles/Rogue/SphereBladed.cs @@ -0,0 +1,126 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class SphereBladed : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bladed Sphere"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.tileCollide = true; + projectile.penetrate = -1; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + projectile.timeLeft = 300; + projectile.tileCollide = false; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 1f, 0f, 0f); + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100); + } + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 8; + Main.PlaySound(SoundID.Item7, projectile.position); + } + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= 25f) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + else + { + float num42 = 16f; + float num43 = 3.2f; + Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X; + float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y; + float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45)); + if (num46 > 3000f) + { + projectile.Kill(); + } + num46 = num42 / num46; + num44 *= num46; + num45 *= num46; + if (projectile.velocity.X < num44) + { + projectile.velocity.X = projectile.velocity.X + num43; + if (projectile.velocity.X < 0f && num44 > 0f) + { + projectile.velocity.X = projectile.velocity.X + num43; + } + } + else if (projectile.velocity.X > num44) + { + projectile.velocity.X = projectile.velocity.X - num43; + if (projectile.velocity.X > 0f && num44 < 0f) + { + projectile.velocity.X = projectile.velocity.X - num43; + } + } + if (projectile.velocity.Y < num45) + { + projectile.velocity.Y = projectile.velocity.Y + num43; + if (projectile.velocity.Y < 0f && num45 > 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num43; + } + } + else if (projectile.velocity.Y > num45) + { + projectile.velocity.Y = projectile.velocity.Y - num43; + if (projectile.velocity.Y > 0f && num45 < 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num43; + } + } + if (Main.myPlayer == projectile.owner) + { + Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height); + if (rectangle.Intersects(value2)) + { + projectile.Kill(); + } + } + } + projectile.rotation += 0.5f; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/SphereBladed.png b/Projectiles/Rogue/SphereBladed.png new file mode 100644 index 0000000000..b90214da3a Binary files /dev/null and b/Projectiles/Rogue/SphereBladed.png differ diff --git a/Projectiles/Rogue/SphereBlue.cs b/Projectiles/Rogue/SphereBlue.cs new file mode 100644 index 0000000000..2b063098c7 --- /dev/null +++ b/Projectiles/Rogue/SphereBlue.cs @@ -0,0 +1,126 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using System; +namespace CalamityMod.Projectiles.Rogue +{ + public class SphereBlue : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Thruster Sphere"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + projectile.extraUpdates = 1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, 0f, 1f); + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100); + } + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 5f) + { + projectile.tileCollide = true; + } + projectile.rotation += projectile.velocity.X * 0.02f; + projectile.velocity.Y = projectile.velocity.Y + 0.085f; + projectile.velocity.X = projectile.velocity.X * 0.99f; + float pcx = projectile.Center.X; + float pcy = projectile.Center.Y; + float var1 = 800f; + bool flag = false; + for (int npcvar = 0; npcvar < 200; npcvar++) + { + if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1)) + { + float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2); + float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2); + float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3); + if (var4 < var1) + { + var1 = var4; + pcx = var2; + pcy = var3; + flag = true; + } + } + } + if (flag) + { + float homingstrenght = 16f; + Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float var6 = pcx - vector1.X; + float var7 = pcy - vector1.Y; + float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7); + var8 = homingstrenght / var8; + var6 *= var8; + var7 *= var8; + projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f; + } + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 192; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 37); + for (int num625 = 0; num625 < 3; num625++) + { + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int defectiveBruh = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(660, 662), 1f); + Main.gore[defectiveBruh].velocity *= scaleFactor10; + Main.gore[defectiveBruh].velocity += projectile.velocity; + } + for (int num194 = 0; num194 < 25; num194++) + { + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 226, + 229 + }); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 0f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/SphereBlue.png b/Projectiles/Rogue/SphereBlue.png new file mode 100644 index 0000000000..9718044895 Binary files /dev/null and b/Projectiles/Rogue/SphereBlue.png differ diff --git a/Projectiles/Rogue/SphereSpiked.cs b/Projectiles/Rogue/SphereSpiked.cs new file mode 100644 index 0000000000..f464c1fbec --- /dev/null +++ b/Projectiles/Rogue/SphereSpiked.cs @@ -0,0 +1,56 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +namespace CalamityMod.Projectiles.Rogue +{ + public class SphereSpiked : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spiked Sphere"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 300; + aiType = 52; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 1f, 0f, 0f); + if (projectile.timeLeft == 300) + projectile.damage *= (int)1.2f; + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34); + if (Main.rand.NextBool(10)) //idk if this even works + { + if (!crit) + crit = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/SphereSpiked.png b/Projectiles/Rogue/SphereSpiked.png new file mode 100644 index 0000000000..c4c2b56c25 Binary files /dev/null and b/Projectiles/Rogue/SphereSpiked.png differ diff --git a/Projectiles/Rogue/SphereYellow.cs b/Projectiles/Rogue/SphereYellow.cs new file mode 100644 index 0000000000..a28278f01a --- /dev/null +++ b/Projectiles/Rogue/SphereYellow.cs @@ -0,0 +1,62 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +namespace CalamityMod.Projectiles.Rogue +{ + public class SphereYellow : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yellow Thruster Sphere"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 300; + aiType = 52; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 1f, 1f, 0f); + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/SphereYellow.png b/Projectiles/Rogue/SphereYellow.png new file mode 100644 index 0000000000..b9f5952c35 Binary files /dev/null and b/Projectiles/Rogue/SphereYellow.png differ diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index 11c761cc5b..9978c34129 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.tileCollide = false; projectile.Calamity().rogue = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; + projectile.localNPCHitCooldown = 50; } public override void AI() diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs new file mode 100644 index 0000000000..93fdfef95e --- /dev/null +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -0,0 +1,172 @@ +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ValariBoomerang : ModProjectile + { + //This variable will be used for the stealth strike + public float ReboundTime = 0f; + public float timer = 0f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostcrush Valari"); + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 40; + projectile.height = 40; + projectile.penetrate = -1; + projectile.timeLeft = 360; + projectile.tileCollide = false; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 15; + projectile.coldDamage = true; + + projectile.Calamity().rogue = true; + } + + public override void AI() + { + //Dust trail + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + + //Constant rotation + projectile.rotation += 0.2f; + + timer++; + //Constant sound effects + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 15; + Main.PlaySound(SoundID.Item7, projectile.position); + } + //Slopes REEEEEEEEEEEE + if (timer == 3f) + projectile.tileCollide = true; + //Decide the range of the boomerang depending on stealth + if (projectile.Calamity().stealthStrike) + ReboundTime = 27f; + else + ReboundTime = 55f; + + // ai[0] stores whether the boomerang is returning. If 0, it isn't. If 1, it is. + if (projectile.ai[0] == 0f) + { + projectile.ai[1] += 1f; + if (projectile.ai[1] >= ReboundTime) + { + projectile.ai[0] = 1f; + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + else + { + projectile.tileCollide = false; + float returnSpeed = FrostcrushValari.Speed * 1.5f; + float acceleration = 3.2f; + Player owner = Main.player[projectile.owner]; + + // Delete the boomerang if it's excessively far away. + Vector2 playerCenter = owner.Center; + float xDist = playerCenter.X - projectile.Center.X; + float yDist = playerCenter.Y - projectile.Center.Y; + float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); + if (dist > 3000f) + projectile.Kill(); + + dist = returnSpeed / dist; + xDist *= dist; + yDist *= dist; + + // Home back in on the player. + if (projectile.velocity.X < xDist) + { + projectile.velocity.X = projectile.velocity.X + acceleration; + if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + } + else if (projectile.velocity.X > xDist) + { + projectile.velocity.X = projectile.velocity.X - acceleration; + if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + } + if (projectile.velocity.Y < yDist) + { + projectile.velocity.Y = projectile.velocity.Y + acceleration; + if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + } + else if (projectile.velocity.Y > yDist) + { + projectile.velocity.Y = projectile.velocity.Y - acceleration; + if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + } + + + // Delete the projectile if it touches its owner. + if (Main.myPlayer == projectile.owner) + if (projectile.Hitbox.Intersects(owner.Hitbox)) + projectile.Kill(); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + //Start homing at player if you hit an enemy + projectile.ai[0] = 1; + + int num251 = Main.rand.Next(2, 4); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + } + } + + target.AddBuff(BuffID.Frostburn, 240); + target.AddBuff(ModContent.BuffType(), 240); + if (Main.rand.NextBool(5)) + target.AddBuff(ModContent.BuffType(), 60); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + //Bounce off tiles and start homing on player if it hits a tile + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(0, projectile.position); + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.ai[0] = 1; + return false; + } + } +} diff --git a/Projectiles/Rogue/ValariBoomerang.png b/Projectiles/Rogue/ValariBoomerang.png new file mode 100644 index 0000000000..1dd40a54e7 Binary files /dev/null and b/Projectiles/Rogue/ValariBoomerang.png differ diff --git a/Projectiles/Rogue/Valaricicle.cs b/Projectiles/Rogue/Valaricicle.cs new file mode 100644 index 0000000000..6a5b790f3f --- /dev/null +++ b/Projectiles/Rogue/Valaricicle.cs @@ -0,0 +1,49 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.Rogue +{ + public class Valaricicle : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Valaricicle"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.Calamity().rogue = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + projectile.aiStyle = 1; + projectile.coldDamage = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.9995f; + projectile.velocity.Y = projectile.velocity.Y + 0.01f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 120); + } + } +} diff --git a/Projectiles/Rogue/Valaricicle.png b/Projectiles/Rogue/Valaricicle.png new file mode 100644 index 0000000000..d2db05e4da Binary files /dev/null and b/Projectiles/Rogue/Valaricicle.png differ diff --git a/Projectiles/Rogue/Valaricicle2.cs b/Projectiles/Rogue/Valaricicle2.cs new file mode 100644 index 0000000000..219365e519 --- /dev/null +++ b/Projectiles/Rogue/Valaricicle2.cs @@ -0,0 +1,49 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.Rogue +{ + public class Valaricicle2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Valaricicle"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.Calamity().rogue = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + projectile.aiStyle = 1; + projectile.coldDamage = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.9995f; + projectile.velocity.Y = projectile.velocity.Y + 0.01f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 120); + } + } +} diff --git a/Projectiles/Rogue/Valaricicle2.png b/Projectiles/Rogue/Valaricicle2.png new file mode 100644 index 0000000000..e88b3b8d3f Binary files /dev/null and b/Projectiles/Rogue/Valaricicle2.png differ diff --git a/Projectiles/Rogue/WebBallBol.cs b/Projectiles/Rogue/WebBallBol.cs new file mode 100644 index 0000000000..28106959aa --- /dev/null +++ b/Projectiles/Rogue/WebBallBol.cs @@ -0,0 +1,48 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class WebBallBol : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Web Ball"); + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + projectile.Calamity().rogue = true; + projectile.aiStyle = 14; + } + + public override void AI() + { + if (Main.rand.NextBool(12)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 30, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.Calamity().stealthStrike == true) + { + target.AddBuff(BuffID.Webbed, 180); + } + else + { + target.AddBuff(BuffID.Webbed, 30); + } + } + } +} + diff --git a/Projectiles/Rogue/WebBallBol.png b/Projectiles/Rogue/WebBallBol.png new file mode 100644 index 0000000000..3640d6596e Binary files /dev/null and b/Projectiles/Rogue/WebBallBol.png differ diff --git a/Projectiles/Summon/Hive.png b/Projectiles/Summon/Hive.png index 081ee1131b..fcd1ef8827 100644 Binary files a/Projectiles/Summon/Hive.png and b/Projectiles/Summon/Hive.png differ diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index 344b84a2aa..4de9f5960d 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -79,6 +79,23 @@ namespace CalamityMod.Projectiles.Summon float scaleFactor18; if (chase >= 0 && Main.projectile[chase].active) { + //Delete the player's mechworm if it's attaching to something weird + if (Main.projectile[chase].type != ModContent.ProjectileType() && + Main.projectile[chase].type != ModContent.ProjectileType() && + Main.projectile[chase].type != ModContent.ProjectileType()) + { + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner && + (Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType())) + { + Main.projectile[i].Kill(); + } + } + } value68 = Main.projectile[chase].Center; Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity; num1064 = Main.projectile[chase].rotation; @@ -105,14 +122,17 @@ namespace CalamityMod.Projectiles.Summon } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; + projectile.netSpam = 5; projectile.scale = scaleFactor18; projectile.width = projectile.height = (int)((float)num1051 * projectile.scale); projectile.Center = projectile.position; + projectile.netSpam = 5; if (vector134 != Vector2.Zero) { projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18; } projectile.spriteDirection = (vector134.X > 0f) ? 1 : -1; + projectile.netSpam = 5; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/MechwormBody2.cs b/Projectiles/Summon/MechwormBody2.cs index dba4f74489..ed9f836338 100644 --- a/Projectiles/Summon/MechwormBody2.cs +++ b/Projectiles/Summon/MechwormBody2.cs @@ -79,6 +79,23 @@ namespace CalamityMod.Projectiles.Summon float scaleFactor18; if (chase >= 0 && Main.projectile[chase].active) { + //Delete the player's mechworm if it's attaching to something weird + if (Main.projectile[chase].type != ModContent.ProjectileType() && + Main.projectile[chase].type != ModContent.ProjectileType() && + Main.projectile[chase].type != ModContent.ProjectileType()) + { + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner && + (Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType())) + { + Main.projectile[i].Kill(); + } + } + } value68 = Main.projectile[chase].Center; Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity; num1064 = Main.projectile[chase].rotation; @@ -104,9 +121,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; + projectile.netSpam = 5; projectile.scale = scaleFactor18; projectile.width = projectile.height = (int)((float)num1051 * projectile.scale); projectile.Center = projectile.position; + projectile.netSpam = 5; if (vector134 != Vector2.Zero) { projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18; diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index 41e8821143..1e22b54a7c 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -197,9 +197,11 @@ namespace CalamityMod.Projectiles.Summon } float num1061 = MathHelper.Clamp(projectile.localAI[0], 0f, 50f); projectile.position = projectile.Center; + projectile.netSpam = 5; projectile.scale = 1f + num1061 * 0.01f; projectile.width = projectile.height = (int)((float)num1051 * projectile.scale); projectile.Center = projectile.position; + projectile.netSpam = 5; if (projectile.alpha > 0) { projectile.alpha -= 42; @@ -208,6 +210,7 @@ namespace CalamityMod.Projectiles.Summon projectile.alpha = 0; } } + projectile.netSpam = 5; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs index 91b121c1a6..4c89873cac 100644 --- a/Projectiles/Summon/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -79,11 +79,27 @@ namespace CalamityMod.Projectiles.Summon float scaleFactor18; if (chase >= 0 && Main.projectile[chase].active) { + //Delete the player's mechworm if it's attaching to something weird + if (Main.projectile[chase].type != ModContent.ProjectileType() && + Main.projectile[chase].type != ModContent.ProjectileType()) + { + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner && + (Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType() || + Main.projectile[i].type == ModContent.ProjectileType())) + { + Main.projectile[i].Kill(); + } + } + } value68 = Main.projectile[chase].Center; Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity; num1064 = Main.projectile[chase].rotation; scaleFactor18 = MathHelper.Clamp(Main.projectile[chase].scale, 0f, 50f); - scaleFactor17 = 16f; + scaleFactor17 = 6f; Main.projectile[chase].localAI[0] = projectile.localAI[0] + 1f; } else @@ -105,14 +121,17 @@ namespace CalamityMod.Projectiles.Summon } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; + projectile.netSpam = 5; projectile.scale = scaleFactor18; projectile.width = projectile.height = (int)((float)num1051 * projectile.scale); projectile.Center = projectile.position; + projectile.netSpam = 5; if (vector134 != Vector2.Zero) { projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18; } projectile.spriteDirection = (vector134.X > 0f) ? 1 : -1; + projectile.netSpam = 5; return; } diff --git a/Projectiles/Typeless/GalaxySmasherHammer.cs b/Projectiles/Typeless/GalaxySmasherHammer.cs index 351efbe04b..469e88e2ba 100644 --- a/Projectiles/Typeless/GalaxySmasherHammer.cs +++ b/Projectiles/Typeless/GalaxySmasherHammer.cs @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Typeless // Three death lasers (aka "Nebula Shots") swarm the target. int laserID = ModContent.ProjectileType(); - int laserDamage = (int)(0.2f * GalaxySmasherMelee.BaseDamage); + int laserDamage = (int)(0.2f * projectile.damage); float laserKB = 2.5f; int numLasers = 3; for (int i = 0; i < numLasers; ++i) diff --git a/Projectiles/Typeless/NanoblackMain.cs b/Projectiles/Typeless/NanoblackMain.cs index 7c774402a5..f97cade254 100644 --- a/Projectiles/Typeless/NanoblackMain.cs +++ b/Projectiles/Typeless/NanoblackMain.cs @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Typeless private void SpawnEnergyBlade() { int bladeID = ModContent.ProjectileType(); - int bladeDamage = NanoblackReaperMelee.BaseDamage / 5; + int bladeDamage = projectile.damage / 5; float bladeKB = 3f; float spin = (projectile.direction <= 0) ? -1f : 1f; float d = 16f; diff --git a/Projectiles/Typeless/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs new file mode 100644 index 0000000000..53c9619b7c --- /dev/null +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -0,0 +1,130 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.NPCs; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Typeless +{ + public class SandCloakVeil : ModProjectile + { + private const float radius = 225f; + private const int duration = 900; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dust Veil"); + } + + public override void SetDefaults() + { + projectile.width = 450; + projectile.height = 450; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = duration; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + projectile.rotation += 0.01f; + + Player player = Main.player[Main.myPlayer]; + Vector2 posDiff = player.Center - projectile.Center; + if (posDiff.Length() <= radius) + { + player.statDefense += 6; + player.lifeRegen += 2; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + // Sprite Circle + Texture2D tex = Main.projectileTexture[projectile.type]; + float scaleStep = 0.03f; + float rotationOffset = 0.03f; + Color drawCol = projectile.GetAlpha(lightColor); + float drawTransparency = 0.1f; + + if (projectile.timeLeft > duration - 10) + { + drawTransparency = (duration - projectile.timeLeft) * 0.01f; + } + else if (projectile.timeLeft < 25) + { + drawTransparency = projectile.timeLeft * 0.004f; + } + + // Dust effects + Circle dustCircle = new Circle(projectile.Center, radius); + + for (int i = 0; i < 20; i++) + { + // Sprite + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, drawCol * drawTransparency, projectile.rotation + (rotationOffset * i * i), tex.Size() / 2f, projectile.scale - (i * scaleStep), SpriteEffects.None, 0f); + + // Dust + Vector2 dustPos = dustCircle.RandomPointInCircle(); + if ((dustPos - projectile.Center).Length() > 48) + { + int dustIndex = Dust.NewDust(dustPos, 1, 1, 32); + Main.dust[dustIndex].noGravity = true; + Main.dust[dustIndex].fadeIn = 1f; + Vector2 dustVelocity = projectile.Center - Main.dust[dustIndex].position; + float distToCenter = dustVelocity.Length(); + dustVelocity.Normalize(); + dustVelocity = dustVelocity.RotatedBy(MathHelper.ToRadians(-90f)); + dustVelocity *= distToCenter * 0.04f; + Main.dust[dustIndex].velocity = dustVelocity; + } + } + + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + // Knockback has to be done manually to ensure the enemies are repelled from the aura as opposed to thrown to one side of it + + if (CalamityGlobalNPC.ShouldAffectNPC(target)) + { + float knockbackMultiplier = knockback - target.knockBackResist; + if (knockbackMultiplier < 0) + { + knockbackMultiplier = 0; + } + Vector2 trueKnockback = target.Center - projectile.Center; + trueKnockback.Normalize(); + target.velocity = trueKnockback * knockbackMultiplier; + } + } + + // Circular hitbox code copied from HeliumFlashBlast + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); + float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight()); + float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft()); + float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight()); + + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; + + return minDist <= radius; + } + } +} diff --git a/Projectiles/Typeless/SandCloakVeil.png b/Projectiles/Typeless/SandCloakVeil.png new file mode 100644 index 0000000000..e1e0718885 Binary files /dev/null and b/Projectiles/Typeless/SandCloakVeil.png differ diff --git a/Projectiles/Typeless/StellarContemptHammer.cs b/Projectiles/Typeless/StellarContemptHammer.cs index 45a306c150..407ef89340 100644 --- a/Projectiles/Typeless/StellarContemptHammer.cs +++ b/Projectiles/Typeless/StellarContemptHammer.cs @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.netUpdate = true; int numFlares = 2; - int flareDamage = (int)(0.3f * StellarContemptMelee.BaseDamage); + int flareDamage = (int)(0.3f * projectile.damage); float flareKB = 4f; for (int i = 0; i < numFlares; ++i) { diff --git a/Projectiles/Typeless/TerraDiskProjectile.cs b/Projectiles/Typeless/TerraDiskProjectile.cs new file mode 100644 index 0000000000..0991fceea3 --- /dev/null +++ b/Projectiles/Typeless/TerraDiskProjectile.cs @@ -0,0 +1,114 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class TerraDiskProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terra Disk"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 46; + projectile.height = 46; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 180; + aiType = 52; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f); + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); + } + int[] array = new int[20]; + int num428 = 0; + float num429 = 300f; + bool flag14 = false; + for (int num430 = 0; num430 < 200; num430++) + { + if (Main.npc[num430].CanBeChasedBy(projectile, false)) + { + float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); + float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); + float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) + { + if (num428 < 20) + { + array[num428] = num430; + num428++; + } + flag14 = true; + } + } + } + if (flag14) + { + int num434 = Main.rand.Next(num428); + num434 = array[num434]; + float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); + float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 8f) + { + projectile.localAI[0] = 0f; + float num437 = 6f; + Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + value10 += projectile.velocity * 4f; + float num438 = num435 - value10.X; + float num439 = num436 - value10.Y; + float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + num440 = num437 / num440; + if (Main.rand.NextBool(5)) + { + if (projectile.owner == Main.myPlayer) + { + float spread = 60f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 6f; + double offsetAngle; + int i; + for (i = 0; i < 3; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; + int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + if (projectile.melee) + Main.projectile[proj2].Calamity().forceMelee = true; + else + Main.projectile[proj2].Calamity().forceRogue = true; + } + } + } + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Typeless/TerraDiskProjectile.png b/Projectiles/Typeless/TerraDiskProjectile.png new file mode 100644 index 0000000000..32b39a6f1e Binary files /dev/null and b/Projectiles/Typeless/TerraDiskProjectile.png differ diff --git a/Projectiles/Typeless/TerraDiskProjectile2.cs b/Projectiles/Typeless/TerraDiskProjectile2.cs new file mode 100644 index 0000000000..02357760e1 --- /dev/null +++ b/Projectiles/Typeless/TerraDiskProjectile2.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class TerraDiskProjectile2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Terra Disk"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 40; + projectile.alpha = 75; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 60; + aiType = 52; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f); + if (Main.rand.NextBool(5)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Typeless/TerraDiskProjectile2.png b/Projectiles/Typeless/TerraDiskProjectile2.png new file mode 100644 index 0000000000..47fd0d2130 Binary files /dev/null and b/Projectiles/Typeless/TerraDiskProjectile2.png differ diff --git a/Projectiles/Typeless/VanquisherArrowSplit.cs b/Projectiles/Typeless/VanquisherArrowSplit.cs index 475242cda5..e8ea00ba8c 100644 --- a/Projectiles/Typeless/VanquisherArrowSplit.cs +++ b/Projectiles/Typeless/VanquisherArrowSplit.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Typeless } } - // TODO -- Vanquisher Arrow duplicate projectile glow doesn't work. + // DEFECT -- Vanquisher Arrow duplicate projectile glow doesn't work. /* public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index 5116120202..1d9026137e 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileBlockLight[Type] = true; Main.tileMergeDirt[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); drop = ModContent.ItemType(); AddMapEntry(new Color(0, 0, 0)); @@ -37,7 +37,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, TileID.Dirt); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt); return false; } } diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index ef0935465a..3790232a14 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 2; drop = ModContent.ItemType(); @@ -88,7 +88,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Abyss/SulphurousSand.cs b/Tiles/Abyss/SulphurousSand.cs index 8f32820263..5a3da8edc7 100644 --- a/Tiles/Abyss/SulphurousSand.cs +++ b/Tiles/Abyss/SulphurousSand.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 32; drop = ModContent.ItemType(); @@ -189,7 +189,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Abyss/Tenebris.cs b/Tiles/Abyss/Tenebris.cs index aac7f768a4..d6a9075cee 100644 --- a/Tiles/Abyss/Tenebris.cs +++ b/Tiles/Abyss/Tenebris.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 44; drop = ModContent.ItemType(); @@ -91,7 +91,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index 2fb46a569c..04aee3d2d2 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Abyss Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); TileID.Sets.ChecksForMerge[Type] = true; soundType = 21; @@ -234,7 +234,7 @@ namespace CalamityMod.Tiles.Abyss public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } diff --git a/Tiles/AerialiteBrick.cs b/Tiles/AerialiteBrick.cs index e91c36d415..64e48a6a35 100644 --- a/Tiles/AerialiteBrick.cs +++ b/Tiles/AerialiteBrick.cs @@ -8,7 +8,6 @@ namespace CalamityMod.Tiles public override void SetDefaults() { Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; soundType = 21; minPick = 50; @@ -18,7 +17,7 @@ namespace CalamityMod.Tiles public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/Astral/AstralChestLocked.cs b/Tiles/Astral/AstralChestLocked.cs index e0d4acda49..7bf35851d0 100644 --- a/Tiles/Astral/AstralChestLocked.cs +++ b/Tiles/Astral/AstralChestLocked.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Tiles.Astral { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Astral Chest"); AddMapEntry(new Color(174, 129, 92), name, MapChestName); diff --git a/Tiles/Astral/AstralClay.cs b/Tiles/Astral/AstralClay.cs index ffa55478b2..f96309ea44 100644 --- a/Tiles/Astral/AstralClay.cs +++ b/Tiles/Astral/AstralClay.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/Astral/AstralDirt.cs b/Tiles/Astral/AstralDirt.cs index 879e9ea2f0..84eac815ac 100644 --- a/Tiles/Astral/AstralDirt.cs +++ b/Tiles/Astral/AstralDirt.cs @@ -14,13 +14,13 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); - TileMerge.MergeTile(Type, TileID.Grass); - TileMerge.MergeTile(Type, TileID.CorruptGrass); - TileMerge.MergeTile(Type, TileID.HallowedGrass); - TileMerge.MergeTile(Type, TileID.FleshGrass); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); + CalamityUtils.SetMerge(Type, TileID.Grass); + CalamityUtils.SetMerge(Type, TileID.CorruptGrass); + CalamityUtils.SetMerge(Type, TileID.HallowedGrass); + CalamityUtils.SetMerge(Type, TileID.FleshGrass); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, TileID.Dirt); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Dirt); return false; } diff --git a/Tiles/Astral/AstralGrass.cs b/Tiles/Astral/AstralGrass.cs index 3e541ccdb9..a5669e8cc4 100644 --- a/Tiles/Astral/AstralGrass.cs +++ b/Tiles/Astral/AstralGrass.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Tiles.Astral Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeTile(Type, ModContent.TileType()); - TileMerge.MergeTile(Type, TileID.Grass); - TileMerge.MergeTile(Type, TileID.CorruptGrass); - TileMerge.MergeTile(Type, TileID.HallowedGrass); - TileMerge.MergeTile(Type, TileID.FleshGrass); + CalamityUtils.SetMerge(Type, ModContent.TileType()); + CalamityUtils.SetMerge(Type, TileID.Grass); + CalamityUtils.SetMerge(Type, TileID.CorruptGrass); + CalamityUtils.SetMerge(Type, TileID.HallowedGrass); + CalamityUtils.SetMerge(Type, TileID.FleshGrass); dustType = ModContent.DustType(); drop = ModContent.ItemType(); diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/Astral/AstralMonolith.cs index f966681f87..d545c6d9ef 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/Astral/AstralMonolith.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeTile(Type, TileID.LeafBlock); - TileMerge.MergeTile(Type, TileID.LivingMahoganyLeaves); - TileMerge.MergeTile(Type, TileID.LivingWood); - TileMerge.MergeTile(Type, TileID.LivingMahogany); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.SetMerge(Type, TileID.LeafBlock); + CalamityUtils.SetMerge(Type, TileID.LivingMahoganyLeaves); + CalamityUtils.SetMerge(Type, TileID.LivingWood); + CalamityUtils.SetMerge(Type, TileID.LivingMahogany); drop = ModContent.ItemType(); AddMapEntry(new Color(45, 36, 63)); @@ -71,7 +71,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } diff --git a/Tiles/Astral/AstralSilt.cs b/Tiles/Astral/AstralSilt.cs index b319bda69b..2c8daae3a7 100644 --- a/Tiles/Astral/AstralSilt.cs +++ b/Tiles/Astral/AstralSilt.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.Astral Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/Astral/AstralStone.cs b/Tiles/Astral/AstralStone.cs index f97efae691..b37d924ccd 100644 --- a/Tiles/Astral/AstralStone.cs +++ b/Tiles/Astral/AstralStone.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.Astral Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); - TileMerge.MergeOreTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); + CalamityUtils.MergeWithOres(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralBrick.cs b/Tiles/AstralBrick.cs index b8787c954e..bb34563cd8 100644 --- a/Tiles/AstralBrick.cs +++ b/Tiles/AstralBrick.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) diff --git a/Tiles/AstralDesert/AstralFossil.cs b/Tiles/AstralDesert/AstralFossil.cs index 3d0f5626d0..4f27a702b4 100644 --- a/Tiles/AstralDesert/AstralFossil.cs +++ b/Tiles/AstralDesert/AstralFossil.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.AstralDesert public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } diff --git a/Tiles/AstralDesert/AstralSand.cs b/Tiles/AstralDesert/AstralSand.cs index 404ac1dc1c..0dfe3ca83c 100644 --- a/Tiles/AstralDesert/AstralSand.cs +++ b/Tiles/AstralDesert/AstralSand.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSand[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 108; drop = ModContent.ItemType(); @@ -51,8 +51,8 @@ namespace CalamityMod.Tiles.AstralDesert WorldGen.SquareTileFrame(i, j); return false; } - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType()); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralDesert/AstralSandstone.cs b/Tiles/AstralDesert/AstralSandstone.cs index f975a3e14c..f4b527988c 100644 --- a/Tiles/AstralDesert/AstralSandstone.cs +++ b/Tiles/AstralDesert/AstralSandstone.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = ModContent.DustType(); drop = ModContent.ItemType(); @@ -29,8 +29,8 @@ namespace CalamityMod.Tiles.AstralDesert public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralDesert/HardenedAstralSand.cs b/Tiles/AstralDesert/HardenedAstralSand.cs index 285fde36bc..adbb8d9dc5 100644 --- a/Tiles/AstralDesert/HardenedAstralSand.cs +++ b/Tiles/AstralDesert/HardenedAstralSand.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Tiles.AstralDesert Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 108; @@ -29,8 +29,8 @@ namespace CalamityMod.Tiles.AstralDesert public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/AstralSnow/AstralIce.cs b/Tiles/AstralSnow/AstralIce.cs index e1a335e13c..d840ba687e 100644 --- a/Tiles/AstralSnow/AstralIce.cs +++ b/Tiles/AstralSnow/AstralIce.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.AstralSnow Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSnowTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithSnow(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 173; drop = ModContent.ItemType(); @@ -48,7 +48,7 @@ namespace CalamityMod.Tiles.AstralSnow public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/AstralSnow/AstralSnow.cs b/Tiles/AstralSnow/AstralSnow.cs index ec950b5379..83c0920d73 100644 --- a/Tiles/AstralSnow/AstralSnow.cs +++ b/Tiles/AstralSnow/AstralSnow.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.AstralSnow Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSnowTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithSnow(Type); + CalamityUtils.MergeAstralTiles(Type); dustType = 173; drop = ModContent.ItemType(); @@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.AstralSnow public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 7ad42caefa..287c2cee96 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -1,4 +1,3 @@ - using CalamityMod.Items.Potions; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; @@ -26,55 +25,29 @@ namespace CalamityMod.Tiles TileID.HallowedPlants, TileID.HallowedPlants2, TileID.FleshWeeds, - (ushort)ModContent.GetInstance().TileType("AstralShortPlants"), - (ushort)ModContent.GetInstance().TileType("AstralTallPlants") + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), }; - public override void SetDefaults() + public override bool PreHitWire(int i, int j, int type) { - if (CalamityMod.chairList != null) - { - foreach (int i in CalamityMod.chairList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair, i); - } - } - if (CalamityMod.doorList != null) - { - foreach (int i in CalamityMod.doorList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor, i); - } - } - if (CalamityMod.lightList != null) - { - foreach (int i in CalamityMod.lightList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch, i); - } - } - if (CalamityMod.tableList != null) - { - foreach (int i in CalamityMod.tableList) - { - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable, i); - } - } + return !CalamityWorld.bossRushActive; } public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) { + // Custom plant framing for (int k = 0; k < PlantTypes.Length; k++) - { - if (PlantTypes[k] == type) + if (type == PlantTypes[k]) { - CustomTileFraming.CheckPlants(i, j); + TileFraming.PlantFrame(i, j); return false; } - } + + // Custom vine framing if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == ModContent.TileType()) { - CustomTileFraming.VineFrame(i, j); + TileFraming.VineFrame(i, j); return false; } return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); @@ -82,140 +55,84 @@ namespace CalamityMod.Tiles public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) { + // Guaranteed not null at this point Tile tile = Main.tile[i, j]; - if (type == TileID.Cactus) - { - //GRABBING VARIABLES FOR CERTAIN THINGS - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - if (Main.drawToScreen) - zero = Vector2.Zero; - //TESTING STUFF - int frameX = tile.frameX; - int frameY = tile.frameY; - bool astralCactus = false; - if (!Main.canDrawColorTile(i, j)) - { - int xTile = i; - if (frameX == 36) - { - xTile--; - } - if (frameX == 54) - { - xTile++; - } - if (frameX == 108) - { - if (frameY == 18) - { - xTile--; - } - else - { - xTile++; - } - } - int yTile = j; - bool flag = false; - if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) - { - flag = true; - } - while (!Main.tile[xTile, yTile].active() || !Main.tileSolid[(int)Main.tile[xTile, yTile].type] || !flag) - { - if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) - { - flag = true; - } - yTile++; - if (yTile > i + 20) - { - break; - } - } - //CACTUS CHECK - if (Main.tile[xTile, yTile].type == (ushort)ModContent.TileType()) - { - astralCactus = true; - } - } - //Draw Glow - if (astralCactus) - { - spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default, 1f, SpriteEffects.None, 0f); - } + // This function is only for Astral Cactus. If the tile isn't even cactus, forget about it. + if (type != TileID.Cactus) return; - } - } - public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) - { - // TODO -- holy shit THAT IS NOT HOW YOU NULL CHECK OH MY GOD THIS EXPLAINS EVERYTHING - if(Main.tile[i,j] is null) - return; - - if (Main.tile[i, j].type != ModContent.TileType() && Main.tile[i, j].type != ModContent.TileType() && Main.tileSolid[Main.tile[i, j].type]) + Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + zero = Vector2.Zero; + int frameX = tile.frameX; + int frameY = tile.frameY; + + // Search down the cactus to find out whether the block it is planted in is Astral Sand. + bool astralCactus = false; + if (!Main.canDrawColorTile(i, j)) { - if (Main.tile[i + 1, j] != null) + int xTile = i; + if (frameX == 36) // Cactus segment which splits left + xTile--; + if (frameX == 54) // Cactus segment which splits right + xTile++; + if (frameX == 108) // Cactus segment which splits both directions + xTile += (frameY == 18) ? -1 : 1; + + int yTile = j; + bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].type == TileID.Cactus && Main.tile[xTile, yTile].active(); + while (!Main.tile[xTile, yTile].active() || !Main.tileSolid[Main.tile[xTile, yTile].type] || !slidingDownCactus) { - if (Main.tile[i + 1, j].active()) + if (Main.tile[xTile, yTile].type == TileID.Cactus && Main.tile[xTile, yTile].active()) { - if (Main.tile[i + 1, j].type == ModContent.TileType() || (Main.tile[i + 1, j].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i + 1, j, false, false, false); - if (!Main.tile[i + 1, j].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i + 1, (float)j, 0f, 0, 0, 0); - } - } - } - } - if (Main.tile[i - 1, j] != null) - { - if (Main.tile[i - 1, j].active()) - { - if (Main.tile[i - 1, j].type == ModContent.TileType() || (Main.tile[i - 1, j].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i - 1, j, false, false, false); - if (!Main.tile[i - 1, j].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i - 1, (float)j, 0f, 0, 0, 0); - } - } - } - } - if (Main.tile[i, j + 1] != null) - { - if (Main.tile[i, j + 1].active()) - { - if (Main.tile[i, j + 1].type == ModContent.TileType() || (Main.tile[i, j + 1].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i, j + 1, false, false, false); - if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); - } - } - } - } - if (Main.tile[i, j - 1] != null) - { - if (Main.tile[i, j - 1].active()) - { - if (Main.tile[i, j - 1].type == ModContent.TileType() || (Main.tile[i, j - 1].type == ModContent.TileType() && CalamityWorld.downedDesertScourge)) - { - WorldGen.KillTile(i, j - 1, false, false, false); - if (!Main.tile[i, j - 1].active() && Main.netMode != NetmodeID.SinglePlayer) - { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j - 1, 0f, 0, 0, 0); - } - } + slidingDownCactus = true; } + yTile++; + // Cacti are assumed to be no more than 20 blocks tall. + if (yTile > i + 20) + break; } + astralCactus = Main.tile[xTile, yTile].type == (ushort)ModContent.TileType(); + } + + // If it is actually astral cactus, then draw its glowmask. + if (astralCactus) + { + spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default, 1f, SpriteEffects.None, 0f); } } + // This function exists only to shatter adjacent Lumenyl or Sea Prism crystals when a neighboring solid tile is destroyed. + public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) + { + Tile tile = Main.tile[i, j]; + if(tile is null) + return; + + // Helper function to shatter crystals attached to neighboring solid tiles. + void CheckShatterCrystal(int xPos, int yPos) + { + Tile t = Main.tile[xPos, yPos]; + if (t != null && t.active() && (t.type == ModContent.TileType() || (t.type == ModContent.TileType() && CalamityWorld.downedDesertScourge))) + { + WorldGen.KillTile(xPos, yPos, false, false, false); + if (!Main.tile[xPos, yPos].active() && Main.netMode != NetmodeID.SinglePlayer) + NetMessage.SendData(17, -1, -1, null, 0, (float)xPos, (float)yPos, 0f, 0, 0, 0); + } + } + + // CONSIDER -- Lumenyl Crystals and Sea Prism Crystals aren't solid. They shouldn't need to be checked here. + if (Main.tileSolid[tile.type] && tile.type != ModContent.TileType() && tile.type != ModContent.TileType()) + { + CheckShatterCrystal(i + 1, j); + CheckShatterCrystal(i - 1, j); + CheckShatterCrystal(i, j + 1); + CheckShatterCrystal(i, j - 1); + } + } + + // LATER -- clean up copied decompiled pot code here public override bool Drop(int i, int j, int type) { if (type == 28) @@ -584,10 +501,5 @@ namespace CalamityMod.Tiles } return true; } - - public override bool PreHitWire(int i, int j, int type) - { - return !CalamityWorld.bossRushActive; - } } } diff --git a/Tiles/Cinderplate.cs b/Tiles/Cinderplate.cs index 37c972e415..14720b25c4 100644 --- a/Tiles/Cinderplate.cs +++ b/Tiles/Cinderplate.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); soundType = 21; mineResist = 1f; diff --git a/Tiles/Crags/BrimstoneSlag.cs b/Tiles/Crags/BrimstoneSlag.cs index 5e5b79f80f..c285a3198d 100644 --- a/Tiles/Crags/BrimstoneSlag.cs +++ b/Tiles/Crags/BrimstoneSlag.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.Crags Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeHellTiles(Type); - TileMerge.MergeTile(Type, ModContent.TileType()); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithHell(Type); + CalamityUtils.SetMerge(Type, ModContent.TileType()); soundType = 21; mineResist = 3f; @@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.Crags public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/CryonicBrick.cs b/Tiles/CryonicBrick.cs index 886df7adb6..4d83c033e9 100644 --- a/Tiles/CryonicBrick.cs +++ b/Tiles/CryonicBrick.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Tiles Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); soundType = 21; minPick = 100; diff --git a/Tiles/FurnitureAbyss/AbyssBath.cs b/Tiles/FurnitureAbyss/AbyssBath.cs index 0a863314e3..be56829128 100644 --- a/Tiles/FurnitureAbyss/AbyssBath.cs +++ b/Tiles/FurnitureAbyss/AbyssBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssBed.cs b/Tiles/FurnitureAbyss/AbyssBed.cs index 457da51ae1..f280441e35 100644 --- a/Tiles/FurnitureAbyss/AbyssBed.cs +++ b/Tiles/FurnitureAbyss/AbyssBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssBookcase.cs b/Tiles/FurnitureAbyss/AbyssBookcase.cs index 7e8c5e2c66..36b5317fc1 100644 --- a/Tiles/FurnitureAbyss/AbyssBookcase.cs +++ b/Tiles/FurnitureAbyss/AbyssBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssCandelabra.cs b/Tiles/FurnitureAbyss/AbyssCandelabra.cs index b76fd6629e..675df6d43b 100644 --- a/Tiles/FurnitureAbyss/AbyssCandelabra.cs +++ b/Tiles/FurnitureAbyss/AbyssCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssChair.cs b/Tiles/FurnitureAbyss/AbyssChair.cs index 8d558714f0..8218df02d2 100644 --- a/Tiles/FurnitureAbyss/AbyssChair.cs +++ b/Tiles/FurnitureAbyss/AbyssChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssChandelier.cs b/Tiles/FurnitureAbyss/AbyssChandelier.cs index c313963421..61003db166 100644 --- a/Tiles/FurnitureAbyss/AbyssChandelier.cs +++ b/Tiles/FurnitureAbyss/AbyssChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssChest.cs b/Tiles/FurnitureAbyss/AbyssChest.cs index 750de05d95..41b136759f 100644 --- a/Tiles/FurnitureAbyss/AbyssChest.cs +++ b/Tiles/FurnitureAbyss/AbyssChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureAbyss/AbyssClock.cs b/Tiles/FurnitureAbyss/AbyssClock.cs index cdeb188bf2..b2a76142a0 100644 --- a/Tiles/FurnitureAbyss/AbyssClock.cs +++ b/Tiles/FurnitureAbyss/AbyssClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssDoorClosed.cs b/Tiles/FurnitureAbyss/AbyssDoorClosed.cs index 53de06ea52..f2db6f1480 100644 --- a/Tiles/FurnitureAbyss/AbyssDoorClosed.cs +++ b/Tiles/FurnitureAbyss/AbyssDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssDoorOpen.cs b/Tiles/FurnitureAbyss/AbyssDoorOpen.cs index 4e63968308..01a156250e 100644 --- a/Tiles/FurnitureAbyss/AbyssDoorOpen.cs +++ b/Tiles/FurnitureAbyss/AbyssDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssDresser.cs b/Tiles/FurnitureAbyss/AbyssDresser.cs index b7c453cb8a..aeb0916653 100644 --- a/Tiles/FurnitureAbyss/AbyssDresser.cs +++ b/Tiles/FurnitureAbyss/AbyssDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssLamp.cs b/Tiles/FurnitureAbyss/AbyssLamp.cs index 3b259106ab..9703458159 100644 --- a/Tiles/FurnitureAbyss/AbyssLamp.cs +++ b/Tiles/FurnitureAbyss/AbyssLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssLantern.cs b/Tiles/FurnitureAbyss/AbyssLantern.cs index c94f0705dd..5301f21226 100644 --- a/Tiles/FurnitureAbyss/AbyssLantern.cs +++ b/Tiles/FurnitureAbyss/AbyssLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssPiano.cs b/Tiles/FurnitureAbyss/AbyssPiano.cs index a7871162de..c99b695592 100644 --- a/Tiles/FurnitureAbyss/AbyssPiano.cs +++ b/Tiles/FurnitureAbyss/AbyssPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Synth"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssSink.cs b/Tiles/FurnitureAbyss/AbyssSink.cs index b9cb3193ce..f2efacc8e7 100644 --- a/Tiles/FurnitureAbyss/AbyssSink.cs +++ b/Tiles/FurnitureAbyss/AbyssSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssSofa.cs b/Tiles/FurnitureAbyss/AbyssSofa.cs index 2c345fb282..399f0ea036 100644 --- a/Tiles/FurnitureAbyss/AbyssSofa.cs +++ b/Tiles/FurnitureAbyss/AbyssSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssTable.cs b/Tiles/FurnitureAbyss/AbyssTable.cs index d34b586668..b7ab01d4b7 100644 --- a/Tiles/FurnitureAbyss/AbyssTable.cs +++ b/Tiles/FurnitureAbyss/AbyssTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/AbyssTorch.cs b/Tiles/FurnitureAbyss/AbyssTorch.cs index d5d6927b26..86e40febe1 100644 --- a/Tiles/FurnitureAbyss/AbyssTorch.cs +++ b/Tiles/FurnitureAbyss/AbyssTorch.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpTorch(Type, waterImmune: true); + this.SetUpTorch(waterImmune: true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Torch"); AddMapEntry(new Color(253, 221, 3), name); diff --git a/Tiles/FurnitureAbyss/AbyssWorkbench.cs b/Tiles/FurnitureAbyss/AbyssWorkbench.cs index dc016412ad..177c3822b3 100644 --- a/Tiles/FurnitureAbyss/AbyssWorkbench.cs +++ b/Tiles/FurnitureAbyss/AbyssWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Abyss Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs b/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs index 9fd6a511e4..4908935f52 100644 --- a/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs +++ b/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Tiles.FurnitureAbyss Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithAbyss(Type); soundType = 21; mineResist = 2f; diff --git a/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs b/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs index 2ffcbfcaf7..7c7794f71f 100644 --- a/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs +++ b/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); soundType = 21; AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureAncient/AncientBath.cs b/Tiles/FurnitureAncient/AncientBath.cs index bdcf7c9f93..8e4f3c3280 100644 --- a/Tiles/FurnitureAncient/AncientBath.cs +++ b/Tiles/FurnitureAncient/AncientBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type, true); + this.SetUpBathtub(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientBed.cs b/Tiles/FurnitureAncient/AncientBed.cs index 1fb3647845..0f9f772952 100644 --- a/Tiles/FurnitureAncient/AncientBed.cs +++ b/Tiles/FurnitureAncient/AncientBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type, true); + this.SetUpBed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientBookcase.cs b/Tiles/FurnitureAncient/AncientBookcase.cs index f68b028d1c..324ffdf711 100644 --- a/Tiles/FurnitureAncient/AncientBookcase.cs +++ b/Tiles/FurnitureAncient/AncientBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type, true); + this.SetUpBookcase(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientChair.cs b/Tiles/FurnitureAncient/AncientChair.cs index b81db7b848..15b2ff26c1 100644 --- a/Tiles/FurnitureAncient/AncientChair.cs +++ b/Tiles/FurnitureAncient/AncientChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type, true); + this.SetUpChair(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientChandelier.cs b/Tiles/FurnitureAncient/AncientChandelier.cs index 2d6fd59670..d2dbcc66e9 100644 --- a/Tiles/FurnitureAncient/AncientChandelier.cs +++ b/Tiles/FurnitureAncient/AncientChandelier.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type, true); + this.SetUpChandelier(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientDoorClosed.cs b/Tiles/FurnitureAncient/AncientDoorClosed.cs index 553cb8a9cb..5bcd57e104 100644 --- a/Tiles/FurnitureAncient/AncientDoorClosed.cs +++ b/Tiles/FurnitureAncient/AncientDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type, true); + this.SetUpDoorClosed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientDoorOpen.cs b/Tiles/FurnitureAncient/AncientDoorOpen.cs index 78e8efec85..4f5b56c82b 100644 --- a/Tiles/FurnitureAncient/AncientDoorOpen.cs +++ b/Tiles/FurnitureAncient/AncientDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type, true); + this.SetUpDoorOpen(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientDresser.cs b/Tiles/FurnitureAncient/AncientDresser.cs index 3fd8ea2f61..b8ff54f9ba 100644 --- a/Tiles/FurnitureAncient/AncientDresser.cs +++ b/Tiles/FurnitureAncient/AncientDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientLamp.cs b/Tiles/FurnitureAncient/AncientLamp.cs index 866e64dbad..5f1e49ba38 100644 --- a/Tiles/FurnitureAncient/AncientLamp.cs +++ b/Tiles/FurnitureAncient/AncientLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type, true); + this.SetUpLamp(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index 12615b5fac..9ded969cc5 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type, true); + this.SetUpLantern(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientMonolith.cs b/Tiles/FurnitureAncient/AncientMonolith.cs index 3e720de742..0cde559566 100644 --- a/Tiles/FurnitureAncient/AncientMonolith.cs +++ b/Tiles/FurnitureAncient/AncientMonolith.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type, true); + this.SetUpClock(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Monolith"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientSink.cs b/Tiles/FurnitureAncient/AncientSink.cs index d7ffb234aa..4d6ec5bd57 100644 --- a/Tiles/FurnitureAncient/AncientSink.cs +++ b/Tiles/FurnitureAncient/AncientSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type, true); + this.SetUpSink(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientSofa.cs b/Tiles/FurnitureAncient/AncientSofa.cs index 136d3baadc..83e0bec7bd 100644 --- a/Tiles/FurnitureAncient/AncientSofa.cs +++ b/Tiles/FurnitureAncient/AncientSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type, true); + this.SetUpSofa(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientTable.cs b/Tiles/FurnitureAncient/AncientTable.cs index 9359dadbbd..71b3cca707 100644 --- a/Tiles/FurnitureAncient/AncientTable.cs +++ b/Tiles/FurnitureAncient/AncientTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type, true); + this.SetUpTable(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAncient/AncientWorkbench.cs b/Tiles/FurnitureAncient/AncientWorkbench.cs index 964b5801bb..ca2d080942 100644 --- a/Tiles/FurnitureAncient/AncientWorkbench.cs +++ b/Tiles/FurnitureAncient/AncientWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type, true); + this.SetUpWorkBench(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ancient Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenBath.cs b/Tiles/FurnitureAshen/AshenBath.cs index 0ea9b41168..8e0d8f68c7 100644 --- a/Tiles/FurnitureAshen/AshenBath.cs +++ b/Tiles/FurnitureAshen/AshenBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type, true); + this.SetUpBathtub(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenBed.cs b/Tiles/FurnitureAshen/AshenBed.cs index ab3d7d7aa0..342c7c7605 100644 --- a/Tiles/FurnitureAshen/AshenBed.cs +++ b/Tiles/FurnitureAshen/AshenBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type, true); + this.SetUpBed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenBookcase.cs b/Tiles/FurnitureAshen/AshenBookcase.cs index 727ee925a1..81b3a10062 100644 --- a/Tiles/FurnitureAshen/AshenBookcase.cs +++ b/Tiles/FurnitureAshen/AshenBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type, true); + this.SetUpBookcase(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenCandelabra.cs b/Tiles/FurnitureAshen/AshenCandelabra.cs index 3d4e9f9748..2e31108a9d 100644 --- a/Tiles/FurnitureAshen/AshenCandelabra.cs +++ b/Tiles/FurnitureAshen/AshenCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type, true); + this.SetUpCandelabra(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenCandle.cs b/Tiles/FurnitureAshen/AshenCandle.cs index 1e64407e57..3f781a2325 100644 --- a/Tiles/FurnitureAshen/AshenCandle.cs +++ b/Tiles/FurnitureAshen/AshenCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type, true); + this.SetUpCandle(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenChair.cs b/Tiles/FurnitureAshen/AshenChair.cs index e0aa5d0ffd..cbc4769f9d 100644 --- a/Tiles/FurnitureAshen/AshenChair.cs +++ b/Tiles/FurnitureAshen/AshenChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type, true); + this.SetUpChair(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenChandelier.cs b/Tiles/FurnitureAshen/AshenChandelier.cs index 9ce827faad..fbfc652b28 100644 --- a/Tiles/FurnitureAshen/AshenChandelier.cs +++ b/Tiles/FurnitureAshen/AshenChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type, true); + this.SetUpChandelier(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenChest.cs b/Tiles/FurnitureAshen/AshenChest.cs index bdc7dbf68a..143eec1853 100644 --- a/Tiles/FurnitureAshen/AshenChest.cs +++ b/Tiles/FurnitureAshen/AshenChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureAshen/AshenDoorClosed.cs b/Tiles/FurnitureAshen/AshenDoorClosed.cs index 1b9e06b5c8..fc3b44f265 100644 --- a/Tiles/FurnitureAshen/AshenDoorClosed.cs +++ b/Tiles/FurnitureAshen/AshenDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type, true); + this.SetUpDoorClosed(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenDoorOpen.cs b/Tiles/FurnitureAshen/AshenDoorOpen.cs index 51e381eeba..8534f1fdaf 100644 --- a/Tiles/FurnitureAshen/AshenDoorOpen.cs +++ b/Tiles/FurnitureAshen/AshenDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type, true); + this.SetUpDoorOpen(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenDresser.cs b/Tiles/FurnitureAshen/AshenDresser.cs index 4a6b4176df..bad5eb2b8c 100644 --- a/Tiles/FurnitureAshen/AshenDresser.cs +++ b/Tiles/FurnitureAshen/AshenDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); Main.tileLavaDeath[Type] = false; ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Dresser"); diff --git a/Tiles/FurnitureAshen/AshenLamp.cs b/Tiles/FurnitureAshen/AshenLamp.cs index aa8e6e10f4..771c8907b5 100644 --- a/Tiles/FurnitureAshen/AshenLamp.cs +++ b/Tiles/FurnitureAshen/AshenLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type, true); + this.SetUpLamp(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index 1bc6a78e5a..467718a52d 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type, true); + this.SetUpLantern(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenMonolith.cs b/Tiles/FurnitureAshen/AshenMonolith.cs index 7854ab5eee..34405c0cba 100644 --- a/Tiles/FurnitureAshen/AshenMonolith.cs +++ b/Tiles/FurnitureAshen/AshenMonolith.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type, true); + this.SetUpClock(true); ModTranslation name = CreateMapEntryName(); AddMapEntry(new Color(191, 142, 111), name); name.SetDefault("Ashen Monolith"); diff --git a/Tiles/FurnitureAshen/AshenPlatform.cs b/Tiles/FurnitureAshen/AshenPlatform.cs index 1001fdfa9e..381c112814 100644 --- a/Tiles/FurnitureAshen/AshenPlatform.cs +++ b/Tiles/FurnitureAshen/AshenPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type, true); + this.SetUpPlatform(true); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureAshen/AshenSink.cs b/Tiles/FurnitureAshen/AshenSink.cs index e3509f56c2..b42bcb0d96 100644 --- a/Tiles/FurnitureAshen/AshenSink.cs +++ b/Tiles/FurnitureAshen/AshenSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type, true); + this.SetUpSink(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenSofa.cs b/Tiles/FurnitureAshen/AshenSofa.cs index 41bc7a88b1..773e4650ab 100644 --- a/Tiles/FurnitureAshen/AshenSofa.cs +++ b/Tiles/FurnitureAshen/AshenSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type, true); + this.SetUpSofa(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenTable.cs b/Tiles/FurnitureAshen/AshenTable.cs index bc31df79b0..da30fa01ca 100644 --- a/Tiles/FurnitureAshen/AshenTable.cs +++ b/Tiles/FurnitureAshen/AshenTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type, true); + this.SetUpTable(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/AshenWorkbench.cs b/Tiles/FurnitureAshen/AshenWorkbench.cs index 61e91ddfd5..9eb7faae1e 100644 --- a/Tiles/FurnitureAshen/AshenWorkbench.cs +++ b/Tiles/FurnitureAshen/AshenWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type, true); + this.SetUpWorkBench(true); ModTranslation name = CreateMapEntryName(); name.SetDefault("Ashen Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs index ddabcd10ac..f260f2e062 100644 --- a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs +++ b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeHellTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithHell(Type); soundType = 21; mineResist = 5f; diff --git a/Tiles/FurnitureBotanic/BotanicBathtub.cs b/Tiles/FurnitureBotanic/BotanicBathtub.cs index 719fa0b00d..8facebf005 100644 --- a/Tiles/FurnitureBotanic/BotanicBathtub.cs +++ b/Tiles/FurnitureBotanic/BotanicBathtub.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicBed.cs b/Tiles/FurnitureBotanic/BotanicBed.cs index 22bf8ecec3..e38443be80 100644 --- a/Tiles/FurnitureBotanic/BotanicBed.cs +++ b/Tiles/FurnitureBotanic/BotanicBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicBench.cs b/Tiles/FurnitureBotanic/BotanicBench.cs index 1d54c627b3..d00ff22607 100644 --- a/Tiles/FurnitureBotanic/BotanicBench.cs +++ b/Tiles/FurnitureBotanic/BotanicBench.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicBookcase.cs b/Tiles/FurnitureBotanic/BotanicBookcase.cs index 6ec27d61aa..0a30182edc 100644 --- a/Tiles/FurnitureBotanic/BotanicBookcase.cs +++ b/Tiles/FurnitureBotanic/BotanicBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicCandelabra.cs b/Tiles/FurnitureBotanic/BotanicCandelabra.cs index 28e8c3c759..f54e42c5be 100644 --- a/Tiles/FurnitureBotanic/BotanicCandelabra.cs +++ b/Tiles/FurnitureBotanic/BotanicCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicCandle.cs b/Tiles/FurnitureBotanic/BotanicCandle.cs index 2507f42ba1..a64c996414 100644 --- a/Tiles/FurnitureBotanic/BotanicCandle.cs +++ b/Tiles/FurnitureBotanic/BotanicCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicChair.cs b/Tiles/FurnitureBotanic/BotanicChair.cs index 634156d044..94472a0b41 100644 --- a/Tiles/FurnitureBotanic/BotanicChair.cs +++ b/Tiles/FurnitureBotanic/BotanicChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicChandelier.cs b/Tiles/FurnitureBotanic/BotanicChandelier.cs index 524c65cd75..9abd6913f6 100644 --- a/Tiles/FurnitureBotanic/BotanicChandelier.cs +++ b/Tiles/FurnitureBotanic/BotanicChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicChest.cs b/Tiles/FurnitureBotanic/BotanicChest.cs index 5dcac00d85..113e6aa815 100644 --- a/Tiles/FurnitureBotanic/BotanicChest.cs +++ b/Tiles/FurnitureBotanic/BotanicChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureBotanic/BotanicClock.cs b/Tiles/FurnitureBotanic/BotanicClock.cs index fdd33b75ca..58c0d26079 100644 --- a/Tiles/FurnitureBotanic/BotanicClock.cs +++ b/Tiles/FurnitureBotanic/BotanicClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicDoorClosed.cs b/Tiles/FurnitureBotanic/BotanicDoorClosed.cs index 42735d3b21..518ffc9949 100644 --- a/Tiles/FurnitureBotanic/BotanicDoorClosed.cs +++ b/Tiles/FurnitureBotanic/BotanicDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicDoorOpen.cs b/Tiles/FurnitureBotanic/BotanicDoorOpen.cs index 106602090e..c7c7dc2b07 100644 --- a/Tiles/FurnitureBotanic/BotanicDoorOpen.cs +++ b/Tiles/FurnitureBotanic/BotanicDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicDresser.cs b/Tiles/FurnitureBotanic/BotanicDresser.cs index c298deb61a..a68fb8cb97 100644 --- a/Tiles/FurnitureBotanic/BotanicDresser.cs +++ b/Tiles/FurnitureBotanic/BotanicDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicLamp.cs b/Tiles/FurnitureBotanic/BotanicLamp.cs index 2cf3a6e307..bf5bf2fe12 100644 --- a/Tiles/FurnitureBotanic/BotanicLamp.cs +++ b/Tiles/FurnitureBotanic/BotanicLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicLantern.cs b/Tiles/FurnitureBotanic/BotanicLantern.cs index 6d77e6d09e..5c4538eb6f 100644 --- a/Tiles/FurnitureBotanic/BotanicLantern.cs +++ b/Tiles/FurnitureBotanic/BotanicLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicPiano.cs b/Tiles/FurnitureBotanic/BotanicPiano.cs index 26c2950a08..37a2e3247f 100644 --- a/Tiles/FurnitureBotanic/BotanicPiano.cs +++ b/Tiles/FurnitureBotanic/BotanicPiano.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicPlatform.cs b/Tiles/FurnitureBotanic/BotanicPlatform.cs index 697752c81e..47718f5454 100644 --- a/Tiles/FurnitureBotanic/BotanicPlatform.cs +++ b/Tiles/FurnitureBotanic/BotanicPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureBotanic/BotanicSink.cs b/Tiles/FurnitureBotanic/BotanicSink.cs index 259dda3780..d6df4cf26e 100644 --- a/Tiles/FurnitureBotanic/BotanicSink.cs +++ b/Tiles/FurnitureBotanic/BotanicSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicTable.cs b/Tiles/FurnitureBotanic/BotanicTable.cs index caee57f315..616b83a2a2 100644 --- a/Tiles/FurnitureBotanic/BotanicTable.cs +++ b/Tiles/FurnitureBotanic/BotanicTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureBotanic/BotanicWorkBench.cs b/Tiles/FurnitureBotanic/BotanicWorkBench.cs index 10684207dd..3ede514034 100644 --- a/Tiles/FurnitureBotanic/BotanicWorkBench.cs +++ b/Tiles/FurnitureBotanic/BotanicWorkBench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Botanic Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs new file mode 100644 index 0000000000..5baad8c96c --- /dev/null +++ b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs @@ -0,0 +1,73 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using CalamityMod.Items.Placeables.FurnitureCosmilite; + +namespace CalamityMod.Tiles.FurnitureCosmilite +{ + class CosmiliteBasinTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Cosmilite Basin"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 54; + adjTiles = new int[] { TileID.Torches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 132, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 134, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + Tile tile = Main.tile[i, j]; + //227 79 79 + if (tile.frameX < 54) + { + r = 1f; + g = 0.6f; + b = 1f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + } +} \ No newline at end of file diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png new file mode 100644 index 0000000000..4abbed3430 Binary files /dev/null and b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.png differ diff --git a/Tiles/FurnitureCosmilite/CosmiliteBath.cs b/Tiles/FurnitureCosmilite/CosmiliteBath.cs index b5c2faa17f..fa165e2b4a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBath.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBed.cs b/Tiles/FurnitureCosmilite/CosmiliteBed.cs index e667c593ea..baefb13234 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs b/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs index bb531fa440..bc0efba24a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs index cd16588a4e..c391a8a0e4 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs b/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs index 6f724011df..f5b2055a39 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteCandle.cs b/Tiles/FurnitureCosmilite/CosmiliteCandle.cs index 596da90aca..e10eede421 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteCandle.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteChair.cs b/Tiles/FurnitureCosmilite/CosmiliteChair.cs index 3525770901..612ccc596f 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChair.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs b/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs index 79fbab4989..65bd59f6a6 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteChest.cs b/Tiles/FurnitureCosmilite/CosmiliteChest.cs index 13c4da657c..e7238b0804 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChest.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureCosmilite/CosmiliteClock.cs b/Tiles/FurnitureCosmilite/CosmiliteClock.cs index 4b4904974f..7f60027a3a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteClock.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs b/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs index 754be5a3b4..aed053387d 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs b/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs index 909a7d0556..b54e6169db 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteDresser.cs b/Tiles/FurnitureCosmilite/CosmiliteDresser.cs index ae210e904a..05d9706986 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDresser.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteLamp.cs b/Tiles/FurnitureCosmilite/CosmiliteLamp.cs index c46eabb5c6..8083d96456 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteLamp.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs index 72662b1985..d25d2084d7 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteLantern.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmilitePiano.cs b/Tiles/FurnitureCosmilite/CosmilitePiano.cs index ed138964f0..9bb5ce82c3 100644 --- a/Tiles/FurnitureCosmilite/CosmilitePiano.cs +++ b/Tiles/FurnitureCosmilite/CosmilitePiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmilitePlatform.cs b/Tiles/FurnitureCosmilite/CosmilitePlatform.cs index c14a15868e..aab34d9eae 100644 --- a/Tiles/FurnitureCosmilite/CosmilitePlatform.cs +++ b/Tiles/FurnitureCosmilite/CosmilitePlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureCosmilite/CosmiliteSink.cs b/Tiles/FurnitureCosmilite/CosmiliteSink.cs index 095bc653e6..08d03e6fb2 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteSink.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteSofa.cs b/Tiles/FurnitureCosmilite/CosmiliteSofa.cs index 62553d9c6e..9c63374c7e 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteSofa.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteTable.cs b/Tiles/FurnitureCosmilite/CosmiliteTable.cs index 879594aa7f..1cb9f60fb4 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteTable.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs b/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs index 34aeaf6084..ef6f95077a 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cosmilite Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs b/Tiles/FurnitureEutrophic/EutrophicBathtub.cs index 616d65ce26..15eaa2f81c 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBathtub.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.cs b/Tiles/FurnitureEutrophic/EutrophicBed.cs index ecd34cd7a3..185c48aecc 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.cs b/Tiles/FurnitureEutrophic/EutrophicBench.cs index baa77c9f77..d4bfdb7c09 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBench.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBench.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs b/Tiles/FurnitureEutrophic/EutrophicBookcase.cs index 5c17801ab4..60125099f5 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs b/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs index 8b4e111e9b..fd43dd889d 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.cs b/Tiles/FurnitureEutrophic/EutrophicCandle.cs index c7737489c9..f706935c97 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandle.cs +++ b/Tiles/FurnitureEutrophic/EutrophicCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicChair.cs b/Tiles/FurnitureEutrophic/EutrophicChair.cs index 16b6a80824..d69b74cca3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChair.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs b/Tiles/FurnitureEutrophic/EutrophicChandelier.cs index ed21766556..1c83213322 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.cs b/Tiles/FurnitureEutrophic/EutrophicChest.cs index afb7a22a70..4c9884c709 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChest.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.cs b/Tiles/FurnitureEutrophic/EutrophicClock.cs index dd452ac5a2..9481c58690 100644 --- a/Tiles/FurnitureEutrophic/EutrophicClock.cs +++ b/Tiles/FurnitureEutrophic/EutrophicClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs b/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs index ef47c15fc8..ab746a32ee 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs b/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs index 920cf96bcc..64fb41eda6 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.cs b/Tiles/FurnitureEutrophic/EutrophicDresser.cs index 624cc997b5..01830426b3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDresser.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicLamp.cs b/Tiles/FurnitureEutrophic/EutrophicLamp.cs index baff72b438..7864e7e496 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLamp.cs +++ b/Tiles/FurnitureEutrophic/EutrophicLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.cs b/Tiles/FurnitureEutrophic/EutrophicLantern.cs index d9921cdb18..215754fb24 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLantern.cs +++ b/Tiles/FurnitureEutrophic/EutrophicLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicPiano.cs b/Tiles/FurnitureEutrophic/EutrophicPiano.cs index 7aa21150d0..403c2d04d0 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPiano.cs +++ b/Tiles/FurnitureEutrophic/EutrophicPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs b/Tiles/FurnitureEutrophic/EutrophicPlatform.cs index 6b764effd8..79b1bb1596 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Tiles/FurnitureEutrophic/EutrophicPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureEutrophic/EutrophicSink.cs b/Tiles/FurnitureEutrophic/EutrophicSink.cs index 0d1c5fddc0..0a917459f3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicSink.cs +++ b/Tiles/FurnitureEutrophic/EutrophicSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicTable.cs b/Tiles/FurnitureEutrophic/EutrophicTable.cs index c92cfa5e21..d90da2eb71 100644 --- a/Tiles/FurnitureEutrophic/EutrophicTable.cs +++ b/Tiles/FurnitureEutrophic/EutrophicTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs b/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs index ccf99ebfe0..52103a9b74 100644 --- a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Eutrophic Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.cs b/Tiles/FurnitureEutrophic/SmoothNavystone.cs index 46526f27bd..b354a98f67 100644 --- a/Tiles/FurnitureEutrophic/SmoothNavystone.cs +++ b/Tiles/FurnitureEutrophic/SmoothNavystone.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; soundType = 21; diff --git a/Tiles/FurnitureOccult/OccultBathtub.cs b/Tiles/FurnitureOccult/OccultBathtub.cs index 4ac83af06b..4dd2d1e1fa 100644 --- a/Tiles/FurnitureOccult/OccultBathtub.cs +++ b/Tiles/FurnitureOccult/OccultBathtub.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultBed.cs b/Tiles/FurnitureOccult/OccultBed.cs index 326bd1377e..af6fbd8359 100644 --- a/Tiles/FurnitureOccult/OccultBed.cs +++ b/Tiles/FurnitureOccult/OccultBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultBookcase.cs b/Tiles/FurnitureOccult/OccultBookcase.cs index 40e135aea9..865723a772 100644 --- a/Tiles/FurnitureOccult/OccultBookcase.cs +++ b/Tiles/FurnitureOccult/OccultBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultCandelabra.cs b/Tiles/FurnitureOccult/OccultCandelabra.cs index bf5c37e535..c253c7c730 100644 --- a/Tiles/FurnitureOccult/OccultCandelabra.cs +++ b/Tiles/FurnitureOccult/OccultCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultCandle.cs b/Tiles/FurnitureOccult/OccultCandle.cs index b2097555ec..d93b4fb70c 100644 --- a/Tiles/FurnitureOccult/OccultCandle.cs +++ b/Tiles/FurnitureOccult/OccultCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultChair.cs b/Tiles/FurnitureOccult/OccultChair.cs index 1aedc4ac48..ac96949e67 100644 --- a/Tiles/FurnitureOccult/OccultChair.cs +++ b/Tiles/FurnitureOccult/OccultChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultChandelier.cs b/Tiles/FurnitureOccult/OccultChandelier.cs index 288fba6a40..0dc8072b9c 100644 --- a/Tiles/FurnitureOccult/OccultChandelier.cs +++ b/Tiles/FurnitureOccult/OccultChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultChest.cs b/Tiles/FurnitureOccult/OccultChest.cs index 875af69443..4caa15b748 100644 --- a/Tiles/FurnitureOccult/OccultChest.cs +++ b/Tiles/FurnitureOccult/OccultChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureOccult/OccultClock.cs b/Tiles/FurnitureOccult/OccultClock.cs index 155c19e9f6..a56246afa8 100644 --- a/Tiles/FurnitureOccult/OccultClock.cs +++ b/Tiles/FurnitureOccult/OccultClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultDoorClosed.cs b/Tiles/FurnitureOccult/OccultDoorClosed.cs index ff95568ba6..a9cbec9694 100644 --- a/Tiles/FurnitureOccult/OccultDoorClosed.cs +++ b/Tiles/FurnitureOccult/OccultDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultDoorOpen.cs b/Tiles/FurnitureOccult/OccultDoorOpen.cs index 4dd9bacfa3..1f0c91cbd3 100644 --- a/Tiles/FurnitureOccult/OccultDoorOpen.cs +++ b/Tiles/FurnitureOccult/OccultDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultDresser.cs b/Tiles/FurnitureOccult/OccultDresser.cs index 91c46aee4f..796c2e5597 100644 --- a/Tiles/FurnitureOccult/OccultDresser.cs +++ b/Tiles/FurnitureOccult/OccultDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultLamp.cs b/Tiles/FurnitureOccult/OccultLamp.cs index 649da26855..27bc92a8c7 100644 --- a/Tiles/FurnitureOccult/OccultLamp.cs +++ b/Tiles/FurnitureOccult/OccultLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultLantern.cs b/Tiles/FurnitureOccult/OccultLantern.cs index 532734b466..6f5ac699e5 100644 --- a/Tiles/FurnitureOccult/OccultLantern.cs +++ b/Tiles/FurnitureOccult/OccultLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultPiano.cs b/Tiles/FurnitureOccult/OccultPiano.cs index 71891ccda0..70beaf1e72 100644 --- a/Tiles/FurnitureOccult/OccultPiano.cs +++ b/Tiles/FurnitureOccult/OccultPiano.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultPlatform.cs b/Tiles/FurnitureOccult/OccultPlatform.cs index ba5752bd12..f765779440 100644 --- a/Tiles/FurnitureOccult/OccultPlatform.cs +++ b/Tiles/FurnitureOccult/OccultPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureOccult/OccultSink.cs b/Tiles/FurnitureOccult/OccultSink.cs index debf1a8cd1..bd76b59ebe 100644 --- a/Tiles/FurnitureOccult/OccultSink.cs +++ b/Tiles/FurnitureOccult/OccultSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultSofa.cs b/Tiles/FurnitureOccult/OccultSofa.cs index f99d5a7ac6..33cf7ced49 100644 --- a/Tiles/FurnitureOccult/OccultSofa.cs +++ b/Tiles/FurnitureOccult/OccultSofa.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultStone.cs b/Tiles/FurnitureOccult/OccultStone.cs index f004962a26..920adf1bd6 100644 --- a/Tiles/FurnitureOccult/OccultStone.cs +++ b/Tiles/FurnitureOccult/OccultStone.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Tiles.FurnitureOccult Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 21; mineResist = 10f; diff --git a/Tiles/FurnitureOccult/OccultTable.cs b/Tiles/FurnitureOccult/OccultTable.cs index 175b7870f1..cf00a26d5b 100644 --- a/Tiles/FurnitureOccult/OccultTable.cs +++ b/Tiles/FurnitureOccult/OccultTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureOccult/OccultWorkbench.cs b/Tiles/FurnitureOccult/OccultWorkbench.cs index dcaa8b5f76..bbe6141914 100644 --- a/Tiles/FurnitureOccult/OccultWorkbench.cs +++ b/Tiles/FurnitureOccult/OccultWorkbench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureOccult { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Otherworldly Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs index 72ecf2f5f8..377e26ef99 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs index 5d51d6725a..a5d139863c 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBathtub.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs index ebe4057dde..c5a3caaddf 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs index a111cb0b19..cdd3bce422 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs index a9e2cd7e09..415c4c5eb8 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs index d76f872ae4..fad963fbc4 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs index 7298cb1179..858b3573d8 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs index 6aca75bd8f..3cb997487f 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs index 5c7436753f..e5561e60ad 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs index ceb769d604..d963e78f62 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs index 6db6af02ee..42cccce9ea 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs index 5d113a4dcb..4f5605ba8a 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs index 6b33f9f630..f45aba7e55 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs index 3e29ecb079..63a827087b 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs index bf895ae112..1e5df8f95c 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlatePiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs index 8bdf31a690..d0382cc708 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlatePlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs index f2be54e0bb..4c08be7b27 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs index 27b2fd79bc..92d2aed8b4 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs index 053f4e5d47..5b8dfd2a37 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs index 5e05608cf7..8270c355f0 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Plagued Plate Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBath.cs b/Tiles/FurnitureProfaned/ProfanedBath.cs index d315dd238e..f9efa50b3e 100644 --- a/Tiles/FurnitureProfaned/ProfanedBath.cs +++ b/Tiles/FurnitureProfaned/ProfanedBath.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBed.cs b/Tiles/FurnitureProfaned/ProfanedBed.cs index 04949d85a1..921ba7fa2c 100644 --- a/Tiles/FurnitureProfaned/ProfanedBed.cs +++ b/Tiles/FurnitureProfaned/ProfanedBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBench.cs b/Tiles/FurnitureProfaned/ProfanedBench.cs index 146bf21aca..045ad834ba 100644 --- a/Tiles/FurnitureProfaned/ProfanedBench.cs +++ b/Tiles/FurnitureProfaned/ProfanedBench.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedBookcase.cs b/Tiles/FurnitureProfaned/ProfanedBookcase.cs index 66e2f3c73e..a5b6bca7d8 100644 --- a/Tiles/FurnitureProfaned/ProfanedBookcase.cs +++ b/Tiles/FurnitureProfaned/ProfanedBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedCandelabra.cs b/Tiles/FurnitureProfaned/ProfanedCandelabra.cs index 8b2d384034..2bdf665ab9 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandelabra.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedCandle.cs b/Tiles/FurnitureProfaned/ProfanedCandle.cs index cd8b815ef2..189d0dc099 100644 --- a/Tiles/FurnitureProfaned/ProfanedCandle.cs +++ b/Tiles/FurnitureProfaned/ProfanedCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedChair.cs b/Tiles/FurnitureProfaned/ProfanedChair.cs index 2c25f6f5fa..8aefc380f3 100644 --- a/Tiles/FurnitureProfaned/ProfanedChair.cs +++ b/Tiles/FurnitureProfaned/ProfanedChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedChandelier.cs b/Tiles/FurnitureProfaned/ProfanedChandelier.cs index 51cff1d059..4af1e58b3c 100644 --- a/Tiles/FurnitureProfaned/ProfanedChandelier.cs +++ b/Tiles/FurnitureProfaned/ProfanedChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Chandelier"); AddMapEntry(new Color(191, 142, 111), name); @@ -52,7 +52,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void HitWire(int i, int j) { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); } } } diff --git a/Tiles/FurnitureProfaned/ProfanedChest.cs b/Tiles/FurnitureProfaned/ProfanedChest.cs index 4f9ab2872b..79dce48340 100644 --- a/Tiles/FurnitureProfaned/ProfanedChest.cs +++ b/Tiles/FurnitureProfaned/ProfanedChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureProfaned/ProfanedClock.cs b/Tiles/FurnitureProfaned/ProfanedClock.cs index b59a16b648..26e2ab6612 100644 --- a/Tiles/FurnitureProfaned/ProfanedClock.cs +++ b/Tiles/FurnitureProfaned/ProfanedClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedCrystal.cs b/Tiles/FurnitureProfaned/ProfanedCrystal.cs index 655aa8650e..418edb3b5c 100644 --- a/Tiles/FurnitureProfaned/ProfanedCrystal.cs +++ b/Tiles/FurnitureProfaned/ProfanedCrystal.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileNoAttach[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 13; mineResist = 1f; @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs b/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs index dfc7558ab7..be0956c8e6 100644 --- a/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs +++ b/Tiles/FurnitureProfaned/ProfanedDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs b/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs index a4756e63e1..377154f463 100644 --- a/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs +++ b/Tiles/FurnitureProfaned/ProfanedDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedDresser.cs b/Tiles/FurnitureProfaned/ProfanedDresser.cs index 54d5e3fede..92fedcb671 100644 --- a/Tiles/FurnitureProfaned/ProfanedDresser.cs +++ b/Tiles/FurnitureProfaned/ProfanedDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedLamp.cs b/Tiles/FurnitureProfaned/ProfanedLamp.cs index 5ea676f6af..7b1bf3d349 100644 --- a/Tiles/FurnitureProfaned/ProfanedLamp.cs +++ b/Tiles/FurnitureProfaned/ProfanedLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index 948e03bccc..84047300d9 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedPlatform.cs b/Tiles/FurnitureProfaned/ProfanedPlatform.cs index b2ba6d6edd..28765ecb82 100644 --- a/Tiles/FurnitureProfaned/ProfanedPlatform.cs +++ b/Tiles/FurnitureProfaned/ProfanedPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureProfaned/ProfanedRock.cs b/Tiles/FurnitureProfaned/ProfanedRock.cs index 8f8b8f1b51..0b28736693 100644 --- a/Tiles/FurnitureProfaned/ProfanedRock.cs +++ b/Tiles/FurnitureProfaned/ProfanedRock.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 21; mineResist = 4f; diff --git a/Tiles/FurnitureProfaned/ProfanedSink.cs b/Tiles/FurnitureProfaned/ProfanedSink.cs index 3d80db87d8..3054bb26a1 100644 --- a/Tiles/FurnitureProfaned/ProfanedSink.cs +++ b/Tiles/FurnitureProfaned/ProfanedSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedSlab.cs b/Tiles/FurnitureProfaned/ProfanedSlab.cs index 8431951683..08b7de818c 100644 --- a/Tiles/FurnitureProfaned/ProfanedSlab.cs +++ b/Tiles/FurnitureProfaned/ProfanedSlab.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeTile(Type, ModContent.TileType()); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.SetMerge(Type, ModContent.TileType()); soundType = 21; mineResist = 4f; diff --git a/Tiles/FurnitureProfaned/ProfanedTable.cs b/Tiles/FurnitureProfaned/ProfanedTable.cs index 40c471287c..2585599ab9 100644 --- a/Tiles/FurnitureProfaned/ProfanedTable.cs +++ b/Tiles/FurnitureProfaned/ProfanedTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/ProfanedWorkbench.cs b/Tiles/FurnitureProfaned/ProfanedWorkbench.cs index 68ca679f5c..9036aa2f7a 100644 --- a/Tiles/FurnitureProfaned/ProfanedWorkbench.cs +++ b/Tiles/FurnitureProfaned/ProfanedWorkbench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Profaned Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs index 2a20cc9f67..455f53665c 100644 --- a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs +++ b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); soundType = 21; mineResist = 4f; diff --git a/Tiles/FurnitureSilva/SilvaBathtub.cs b/Tiles/FurnitureSilva/SilvaBathtub.cs index ed3d44ca38..c8639d8718 100644 --- a/Tiles/FurnitureSilva/SilvaBathtub.cs +++ b/Tiles/FurnitureSilva/SilvaBathtub.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaBed.cs b/Tiles/FurnitureSilva/SilvaBed.cs index 79b29383b2..06edbda356 100644 --- a/Tiles/FurnitureSilva/SilvaBed.cs +++ b/Tiles/FurnitureSilva/SilvaBed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaBench.cs b/Tiles/FurnitureSilva/SilvaBench.cs index ac06dfa210..d170c63c5d 100644 --- a/Tiles/FurnitureSilva/SilvaBench.cs +++ b/Tiles/FurnitureSilva/SilvaBench.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaBookcase.cs b/Tiles/FurnitureSilva/SilvaBookcase.cs index 2c85076608..ff6d4c069a 100644 --- a/Tiles/FurnitureSilva/SilvaBookcase.cs +++ b/Tiles/FurnitureSilva/SilvaBookcase.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaCandelabra.cs b/Tiles/FurnitureSilva/SilvaCandelabra.cs index 19a7b1ffad..884da7998e 100644 --- a/Tiles/FurnitureSilva/SilvaCandelabra.cs +++ b/Tiles/FurnitureSilva/SilvaCandelabra.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaCandle.cs b/Tiles/FurnitureSilva/SilvaCandle.cs index df9de0257e..17fbf60fbb 100644 --- a/Tiles/FurnitureSilva/SilvaCandle.cs +++ b/Tiles/FurnitureSilva/SilvaCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaChair.cs b/Tiles/FurnitureSilva/SilvaChair.cs index 00b295d5ee..079844f226 100644 --- a/Tiles/FurnitureSilva/SilvaChair.cs +++ b/Tiles/FurnitureSilva/SilvaChair.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaChandelier.cs b/Tiles/FurnitureSilva/SilvaChandelier.cs index 6b2f2c4e0a..b1cff31a2a 100644 --- a/Tiles/FurnitureSilva/SilvaChandelier.cs +++ b/Tiles/FurnitureSilva/SilvaChandelier.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaChest.cs b/Tiles/FurnitureSilva/SilvaChest.cs index fa70e41a25..e9154be443 100644 --- a/Tiles/FurnitureSilva/SilvaChest.cs +++ b/Tiles/FurnitureSilva/SilvaChest.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureSilva/SilvaClock.cs b/Tiles/FurnitureSilva/SilvaClock.cs index c3504da8e8..aebfb1db2b 100644 --- a/Tiles/FurnitureSilva/SilvaClock.cs +++ b/Tiles/FurnitureSilva/SilvaClock.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaCrystal.cs b/Tiles/FurnitureSilva/SilvaCrystal.cs index 2d052997c3..88cdd34d8b 100644 --- a/Tiles/FurnitureSilva/SilvaCrystal.cs +++ b/Tiles/FurnitureSilva/SilvaCrystal.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.FurnitureSilva public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } } } diff --git a/Tiles/FurnitureSilva/SilvaDoorClosed.cs b/Tiles/FurnitureSilva/SilvaDoorClosed.cs index 62dcc333d4..8ef1bcc480 100644 --- a/Tiles/FurnitureSilva/SilvaDoorClosed.cs +++ b/Tiles/FurnitureSilva/SilvaDoorClosed.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaDoorOpen.cs b/Tiles/FurnitureSilva/SilvaDoorOpen.cs index 14f54a1a9f..12ac6f22a3 100644 --- a/Tiles/FurnitureSilva/SilvaDoorOpen.cs +++ b/Tiles/FurnitureSilva/SilvaDoorOpen.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaDresser.cs b/Tiles/FurnitureSilva/SilvaDresser.cs index c50e001974..66ec338e01 100644 --- a/Tiles/FurnitureSilva/SilvaDresser.cs +++ b/Tiles/FurnitureSilva/SilvaDresser.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaLamp.cs b/Tiles/FurnitureSilva/SilvaLamp.cs index 6d710c53e9..462a8bf893 100644 --- a/Tiles/FurnitureSilva/SilvaLamp.cs +++ b/Tiles/FurnitureSilva/SilvaLamp.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaLantern.cs b/Tiles/FurnitureSilva/SilvaLantern.cs index f77dc68fbd..5e4ff6352a 100644 --- a/Tiles/FurnitureSilva/SilvaLantern.cs +++ b/Tiles/FurnitureSilva/SilvaLantern.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaPiano.cs b/Tiles/FurnitureSilva/SilvaPiano.cs index 7733ba2065..e32301a56f 100644 --- a/Tiles/FurnitureSilva/SilvaPiano.cs +++ b/Tiles/FurnitureSilva/SilvaPiano.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaPlatform.cs b/Tiles/FurnitureSilva/SilvaPlatform.cs index 4ea9a542ac..a77404b170 100644 --- a/Tiles/FurnitureSilva/SilvaPlatform.cs +++ b/Tiles/FurnitureSilva/SilvaPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureSilva/SilvaSink.cs b/Tiles/FurnitureSilva/SilvaSink.cs index 58ab4e6bec..3fc78bf4f3 100644 --- a/Tiles/FurnitureSilva/SilvaSink.cs +++ b/Tiles/FurnitureSilva/SilvaSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaTable.cs b/Tiles/FurnitureSilva/SilvaTable.cs index bea06bcaf5..30e9112489 100644 --- a/Tiles/FurnitureSilva/SilvaTable.cs +++ b/Tiles/FurnitureSilva/SilvaTable.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureSilva/SilvaWorkBench.cs b/Tiles/FurnitureSilva/SilvaWorkBench.cs index 636c53343c..ef8cf6f926 100644 --- a/Tiles/FurnitureSilva/SilvaWorkBench.cs +++ b/Tiles/FurnitureSilva/SilvaWorkBench.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Silva Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelBath.cs b/Tiles/FurnitureStatigel/StatigelBath.cs index 3c0fd349cb..7bac37c391 100644 --- a/Tiles/FurnitureStatigel/StatigelBath.cs +++ b/Tiles/FurnitureStatigel/StatigelBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelBed.cs b/Tiles/FurnitureStatigel/StatigelBed.cs index 902b21513e..c40946d7e3 100644 --- a/Tiles/FurnitureStatigel/StatigelBed.cs +++ b/Tiles/FurnitureStatigel/StatigelBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelBlock.cs b/Tiles/FurnitureStatigel/StatigelBlock.cs index 6acd70e87c..32290a99c0 100644 --- a/Tiles/FurnitureStatigel/StatigelBlock.cs +++ b/Tiles/FurnitureStatigel/StatigelBlock.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Tiles.FurnitureStatigel Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeSmoothTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeSmoothTiles(Type); drop = ModContent.ItemType(); AddMapEntry(new Color(215, 74, 121)); diff --git a/Tiles/FurnitureStatigel/StatigelBookcase.cs b/Tiles/FurnitureStatigel/StatigelBookcase.cs index f0dc433f44..170fc227f9 100644 --- a/Tiles/FurnitureStatigel/StatigelBookcase.cs +++ b/Tiles/FurnitureStatigel/StatigelBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelCandelabra.cs b/Tiles/FurnitureStatigel/StatigelCandelabra.cs index fe663096df..8fd0bbf336 100644 --- a/Tiles/FurnitureStatigel/StatigelCandelabra.cs +++ b/Tiles/FurnitureStatigel/StatigelCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelCandle.cs b/Tiles/FurnitureStatigel/StatigelCandle.cs index 43319b297b..957a19dc20 100644 --- a/Tiles/FurnitureStatigel/StatigelCandle.cs +++ b/Tiles/FurnitureStatigel/StatigelCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelChair.cs b/Tiles/FurnitureStatigel/StatigelChair.cs index 5b65a98ea7..269cab3648 100644 --- a/Tiles/FurnitureStatigel/StatigelChair.cs +++ b/Tiles/FurnitureStatigel/StatigelChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelChandelier.cs b/Tiles/FurnitureStatigel/StatigelChandelier.cs index c18b875a80..4d1f79d255 100644 --- a/Tiles/FurnitureStatigel/StatigelChandelier.cs +++ b/Tiles/FurnitureStatigel/StatigelChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelChest.cs b/Tiles/FurnitureStatigel/StatigelChest.cs index 7024b01340..c292d54d0e 100644 --- a/Tiles/FurnitureStatigel/StatigelChest.cs +++ b/Tiles/FurnitureStatigel/StatigelChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureStatigel/StatigelClock.cs b/Tiles/FurnitureStatigel/StatigelClock.cs index 40a3f3a0ec..72b2ec00ad 100644 --- a/Tiles/FurnitureStatigel/StatigelClock.cs +++ b/Tiles/FurnitureStatigel/StatigelClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelDoorClosed.cs b/Tiles/FurnitureStatigel/StatigelDoorClosed.cs index 2460f2abf0..859b50802b 100644 --- a/Tiles/FurnitureStatigel/StatigelDoorClosed.cs +++ b/Tiles/FurnitureStatigel/StatigelDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelDoorOpen.cs b/Tiles/FurnitureStatigel/StatigelDoorOpen.cs index bc5702e4f2..b0f3eee7c3 100644 --- a/Tiles/FurnitureStatigel/StatigelDoorOpen.cs +++ b/Tiles/FurnitureStatigel/StatigelDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelDresser.cs b/Tiles/FurnitureStatigel/StatigelDresser.cs index 03977d85e6..17ca56c32f 100644 --- a/Tiles/FurnitureStatigel/StatigelDresser.cs +++ b/Tiles/FurnitureStatigel/StatigelDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelLamp.cs b/Tiles/FurnitureStatigel/StatigelLamp.cs index 98e5c5b7b9..cca064e12e 100644 --- a/Tiles/FurnitureStatigel/StatigelLamp.cs +++ b/Tiles/FurnitureStatigel/StatigelLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelLantern.cs b/Tiles/FurnitureStatigel/StatigelLantern.cs index 7b53de4f06..a5bf8ae9d4 100644 --- a/Tiles/FurnitureStatigel/StatigelLantern.cs +++ b/Tiles/FurnitureStatigel/StatigelLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelPiano.cs b/Tiles/FurnitureStatigel/StatigelPiano.cs index 6ab966cf35..8d734ea1a4 100644 --- a/Tiles/FurnitureStatigel/StatigelPiano.cs +++ b/Tiles/FurnitureStatigel/StatigelPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelPlatform.cs b/Tiles/FurnitureStatigel/StatigelPlatform.cs index 87f608e9fe..ba56da70f4 100644 --- a/Tiles/FurnitureStatigel/StatigelPlatform.cs +++ b/Tiles/FurnitureStatigel/StatigelPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureStatigel/StatigelSink.cs b/Tiles/FurnitureStatigel/StatigelSink.cs index 7b85edc72e..49f15187a0 100644 --- a/Tiles/FurnitureStatigel/StatigelSink.cs +++ b/Tiles/FurnitureStatigel/StatigelSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelSofa.cs b/Tiles/FurnitureStatigel/StatigelSofa.cs index 6a0021c61e..be50113854 100644 --- a/Tiles/FurnitureStatigel/StatigelSofa.cs +++ b/Tiles/FurnitureStatigel/StatigelSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelTable.cs b/Tiles/FurnitureStatigel/StatigelTable.cs index 03167ecd58..702d167ea0 100644 --- a/Tiles/FurnitureStatigel/StatigelTable.cs +++ b/Tiles/FurnitureStatigel/StatigelTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStatigel/StatigelWorkbench.cs b/Tiles/FurnitureStatigel/StatigelWorkbench.cs index 354956fbec..f34431bfcc 100644 --- a/Tiles/FurnitureStatigel/StatigelWorkbench.cs +++ b/Tiles/FurnitureStatigel/StatigelWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Statigel Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBathtub.cs b/Tiles/FurnitureStratus/StratusBathtub.cs index 9d7ad9edfb..7446911f45 100644 --- a/Tiles/FurnitureStratus/StratusBathtub.cs +++ b/Tiles/FurnitureStratus/StratusBathtub.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBed.cs b/Tiles/FurnitureStratus/StratusBed.cs index 5844300124..b347463b93 100644 --- a/Tiles/FurnitureStratus/StratusBed.cs +++ b/Tiles/FurnitureStratus/StratusBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBookcase.cs b/Tiles/FurnitureStratus/StratusBookcase.cs index 50a417b6e4..9f570b1afb 100644 --- a/Tiles/FurnitureStratus/StratusBookcase.cs +++ b/Tiles/FurnitureStratus/StratusBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusBricks.cs b/Tiles/FurnitureStratus/StratusBricks.cs index dc452dbc1b..47a8523680 100644 --- a/Tiles/FurnitureStratus/StratusBricks.cs +++ b/Tiles/FurnitureStratus/StratusBricks.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.FurnitureStratus Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); soundType = 21; mineResist = 5f; @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.FurnitureStratus public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BetterGemsparkFraming(i, j, resetFrame); + return TileFraming.BetterGemsparkFraming(i, j, resetFrame); } public override void PostDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Tiles/FurnitureStratus/StratusCandelabra.cs b/Tiles/FurnitureStratus/StratusCandelabra.cs index 3e63ff033f..9e5a5753cc 100644 --- a/Tiles/FurnitureStratus/StratusCandelabra.cs +++ b/Tiles/FurnitureStratus/StratusCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusCandle.cs b/Tiles/FurnitureStratus/StratusCandle.cs index 6c6220a8f7..91385474ef 100644 --- a/Tiles/FurnitureStratus/StratusCandle.cs +++ b/Tiles/FurnitureStratus/StratusCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusChair.cs b/Tiles/FurnitureStratus/StratusChair.cs index 924c8f386d..9f48a73dd4 100644 --- a/Tiles/FurnitureStratus/StratusChair.cs +++ b/Tiles/FurnitureStratus/StratusChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusChandelier.cs b/Tiles/FurnitureStratus/StratusChandelier.cs index 886d3efd4f..af549c2547 100644 --- a/Tiles/FurnitureStratus/StratusChandelier.cs +++ b/Tiles/FurnitureStratus/StratusChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusChest.cs b/Tiles/FurnitureStratus/StratusChest.cs index 231f123dff..3b54090a54 100644 --- a/Tiles/FurnitureStratus/StratusChest.cs +++ b/Tiles/FurnitureStratus/StratusChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureStratus/StratusClock.cs b/Tiles/FurnitureStratus/StratusClock.cs index 5148467460..689558c938 100644 --- a/Tiles/FurnitureStratus/StratusClock.cs +++ b/Tiles/FurnitureStratus/StratusClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Clock"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusDoorClosed.cs b/Tiles/FurnitureStratus/StratusDoorClosed.cs index 97d2ad9b18..c5e0b4cafa 100644 --- a/Tiles/FurnitureStratus/StratusDoorClosed.cs +++ b/Tiles/FurnitureStratus/StratusDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusDoorOpen.cs b/Tiles/FurnitureStratus/StratusDoorOpen.cs index 7fe6efe512..294d81ec5f 100644 --- a/Tiles/FurnitureStratus/StratusDoorOpen.cs +++ b/Tiles/FurnitureStratus/StratusDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusDresser.cs b/Tiles/FurnitureStratus/StratusDresser.cs index b238615424..b9bf0a81c4 100644 --- a/Tiles/FurnitureStratus/StratusDresser.cs +++ b/Tiles/FurnitureStratus/StratusDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusLamp.cs b/Tiles/FurnitureStratus/StratusLamp.cs index 73e669cb57..d21fc33675 100644 --- a/Tiles/FurnitureStratus/StratusLamp.cs +++ b/Tiles/FurnitureStratus/StratusLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusLantern.cs b/Tiles/FurnitureStratus/StratusLantern.cs index 94f7a9a9c0..f0ef9600e7 100644 --- a/Tiles/FurnitureStratus/StratusLantern.cs +++ b/Tiles/FurnitureStratus/StratusLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusPiano.cs b/Tiles/FurnitureStratus/StratusPiano.cs index 3e21bdf0f8..ab0f513bdf 100644 --- a/Tiles/FurnitureStratus/StratusPiano.cs +++ b/Tiles/FurnitureStratus/StratusPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusPlatform.cs b/Tiles/FurnitureStratus/StratusPlatform.cs index 36107ba539..cb879e2dd3 100644 --- a/Tiles/FurnitureStratus/StratusPlatform.cs +++ b/Tiles/FurnitureStratus/StratusPlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureStratus/StratusSink.cs b/Tiles/FurnitureStratus/StratusSink.cs index c05bc39334..c30a22097e 100644 --- a/Tiles/FurnitureStratus/StratusSink.cs +++ b/Tiles/FurnitureStratus/StratusSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusSofa.cs b/Tiles/FurnitureStratus/StratusSofa.cs index d31c124258..831506237d 100644 --- a/Tiles/FurnitureStratus/StratusSofa.cs +++ b/Tiles/FurnitureStratus/StratusSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusTable.cs b/Tiles/FurnitureStratus/StratusTable.cs index 00e099eb14..0d4dcda6fe 100644 --- a/Tiles/FurnitureStratus/StratusTable.cs +++ b/Tiles/FurnitureStratus/StratusTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureStratus/StratusWorkbench.cs b/Tiles/FurnitureStratus/StratusWorkbench.cs index bb0ac08fe4..5d02910fd9 100644 --- a/Tiles/FurnitureStratus/StratusWorkbench.cs +++ b/Tiles/FurnitureStratus/StratusWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Stratus Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/SmoothVoidstone.cs b/Tiles/FurnitureVoid/SmoothVoidstone.cs index 0575eeaa53..3c141139fd 100644 --- a/Tiles/FurnitureVoid/SmoothVoidstone.cs +++ b/Tiles/FurnitureVoid/SmoothVoidstone.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Tiles.FurnitureVoid Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSmoothTiles(Type); - TileMerge.MergeDecorativeTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeSmoothTiles(Type); + CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithAbyss(Type); soundType = 21; mineResist = 7f; diff --git a/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs b/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs index 2c88fb8d2b..efafa9544f 100644 --- a/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs +++ b/Tiles/FurnitureVoid/SmoothVoidstonePlatform.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpPlatform(Type); + this.SetUpPlatform(); AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureVoid/VoidBath.cs b/Tiles/FurnitureVoid/VoidBath.cs index 2a9f3f2189..38f82bf05c 100644 --- a/Tiles/FurnitureVoid/VoidBath.cs +++ b/Tiles/FurnitureVoid/VoidBath.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpBathtub(Type); + this.SetUpBathtub(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Bathtub"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidBed.cs b/Tiles/FurnitureVoid/VoidBed.cs index d895eab73a..3797a72a4c 100644 --- a/Tiles/FurnitureVoid/VoidBed.cs +++ b/Tiles/FurnitureVoid/VoidBed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpBed(Type); + this.SetUpBed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Bed"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidBookcase.cs b/Tiles/FurnitureVoid/VoidBookcase.cs index d464e42d7c..9e298e03c1 100644 --- a/Tiles/FurnitureVoid/VoidBookcase.cs +++ b/Tiles/FurnitureVoid/VoidBookcase.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpBookcase(Type); + this.SetUpBookcase(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Bookcase"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidCandelabra.cs b/Tiles/FurnitureVoid/VoidCandelabra.cs index 356e25194f..1909e4bc37 100644 --- a/Tiles/FurnitureVoid/VoidCandelabra.cs +++ b/Tiles/FurnitureVoid/VoidCandelabra.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpCandelabra(Type); + this.SetUpCandelabra(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Candelabra"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidCandle.cs b/Tiles/FurnitureVoid/VoidCandle.cs index 40a55f5500..0cf50ad857 100644 --- a/Tiles/FurnitureVoid/VoidCandle.cs +++ b/Tiles/FurnitureVoid/VoidCandle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpCandle(Type); + this.SetUpCandle(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Candle"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidChair.cs b/Tiles/FurnitureVoid/VoidChair.cs index 3049e71902..d7870d874e 100644 --- a/Tiles/FurnitureVoid/VoidChair.cs +++ b/Tiles/FurnitureVoid/VoidChair.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpChair(Type); + this.SetUpChair(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Chair"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidChandelier.cs b/Tiles/FurnitureVoid/VoidChandelier.cs index 31254b803f..1f15ef52db 100644 --- a/Tiles/FurnitureVoid/VoidChandelier.cs +++ b/Tiles/FurnitureVoid/VoidChandelier.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpChandelier(Type); + this.SetUpChandelier(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Chandelier"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidChest.cs b/Tiles/FurnitureVoid/VoidChest.cs index c67cfd032f..c83db58333 100644 --- a/Tiles/FurnitureVoid/VoidChest.cs +++ b/Tiles/FurnitureVoid/VoidChest.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpChest(Type); + this.SetUpChest(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Chest"); AddMapEntry(new Color(191, 142, 111), name, MapChestName); diff --git a/Tiles/FurnitureVoid/VoidClock.cs b/Tiles/FurnitureVoid/VoidClock.cs index 3530221f4c..506003f84a 100644 --- a/Tiles/FurnitureVoid/VoidClock.cs +++ b/Tiles/FurnitureVoid/VoidClock.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpClock(Type); + this.SetUpClock(); animationFrameHeight = 90; ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Obelisk"); diff --git a/Tiles/FurnitureVoid/VoidDoorClosed.cs b/Tiles/FurnitureVoid/VoidDoorClosed.cs index 703a377a2c..ecf7ac19ff 100644 --- a/Tiles/FurnitureVoid/VoidDoorClosed.cs +++ b/Tiles/FurnitureVoid/VoidDoorClosed.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpDoorClosed(Type); + this.SetUpDoorClosed(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidDoorOpen.cs b/Tiles/FurnitureVoid/VoidDoorOpen.cs index 60823e31a1..6e2be97437 100644 --- a/Tiles/FurnitureVoid/VoidDoorOpen.cs +++ b/Tiles/FurnitureVoid/VoidDoorOpen.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpDoorOpen(Type); + this.SetUpDoorOpen(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Door"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidDresser.cs b/Tiles/FurnitureVoid/VoidDresser.cs index f9e24d6052..828e33e204 100644 --- a/Tiles/FurnitureVoid/VoidDresser.cs +++ b/Tiles/FurnitureVoid/VoidDresser.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpDresser(Type); + this.SetUpDresser(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Dresser"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidLamp.cs b/Tiles/FurnitureVoid/VoidLamp.cs index 1e827bac0f..d7059ad8d5 100644 --- a/Tiles/FurnitureVoid/VoidLamp.cs +++ b/Tiles/FurnitureVoid/VoidLamp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpLamp(Type); + this.SetUpLamp(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Lamp"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidLantern.cs b/Tiles/FurnitureVoid/VoidLantern.cs index b949f1a530..296a12c03b 100644 --- a/Tiles/FurnitureVoid/VoidLantern.cs +++ b/Tiles/FurnitureVoid/VoidLantern.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpLantern(Type); + this.SetUpLantern(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Lantern"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidPiano.cs b/Tiles/FurnitureVoid/VoidPiano.cs index edfbd29499..6015d92fbf 100644 --- a/Tiles/FurnitureVoid/VoidPiano.cs +++ b/Tiles/FurnitureVoid/VoidPiano.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpPiano(Type); + this.SetUpPiano(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Piano"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidSink.cs b/Tiles/FurnitureVoid/VoidSink.cs index 4a4e5d8c0e..a61c59bd8a 100644 --- a/Tiles/FurnitureVoid/VoidSink.cs +++ b/Tiles/FurnitureVoid/VoidSink.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpSink(Type); + this.SetUpSink(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Sink"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidSofa.cs b/Tiles/FurnitureVoid/VoidSofa.cs index ea70f2b09f..50b4738c62 100644 --- a/Tiles/FurnitureVoid/VoidSofa.cs +++ b/Tiles/FurnitureVoid/VoidSofa.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpSofa(Type); + this.SetUpSofa(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Sofa"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidTable.cs b/Tiles/FurnitureVoid/VoidTable.cs index f91a102207..9a08c2ff57 100644 --- a/Tiles/FurnitureVoid/VoidTable.cs +++ b/Tiles/FurnitureVoid/VoidTable.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpTable(Type); + this.SetUpTable(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Table"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/FurnitureVoid/VoidWorkbench.cs b/Tiles/FurnitureVoid/VoidWorkbench.cs index c59d33a662..348ca1c050 100644 --- a/Tiles/FurnitureVoid/VoidWorkbench.cs +++ b/Tiles/FurnitureVoid/VoidWorkbench.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { public override void SetDefaults() { - CalamityUtils.SetUpWorkBench(Type); + this.SetUpWorkBench(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Work Bench"); AddMapEntry(new Color(191, 142, 111), name); diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index 91ffbb7ee2..283a487eb5 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.Ores Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Aerialite Ore"); diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 9f6cfaab50..c6543466b9 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Tiles.Ores Main.tileSpelunker[Type] = true; Main.tileShine2[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAstralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeAstralTiles(Type); minPick = 200; dustType = 173; @@ -79,7 +79,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Ores/AuricOre.cs b/Tiles/Ores/AuricOre.cs index 0dc0a33cbf..f740c52870 100644 --- a/Tiles/Ores/AuricOre.cs +++ b/Tiles/Ores/AuricOre.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Tiles.Ores Main.tileSpelunker[Type] = true; Main.tileValue[Type] = 1000; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); dustType = 55; drop = ModContent.ItemType(); diff --git a/Tiles/Ores/ChaoticOre.cs b/Tiles/Ores/ChaoticOre.cs index 9693c0c16b..08f5fdb648 100644 --- a/Tiles/Ores/ChaoticOre.cs +++ b/Tiles/Ores/ChaoticOre.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 850; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeAbyssTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); dustType = 105; drop = ModContent.ItemType(); @@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Ores/CharredOre.cs b/Tiles/Ores/CharredOre.cs index da9a242079..2e9116f21d 100644 --- a/Tiles/Ores/CharredOre.cs +++ b/Tiles/Ores/CharredOre.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Tiles.Ores Main.tileLighted[Type] = true; Main.tileValue[Type] = 720; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeHellTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithHell(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); @@ -56,7 +56,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/Ores/CryonicOre.cs b/Tiles/Ores/CryonicOre.cs index d43b288caa..8ffa13280f 100644 --- a/Tiles/Ores/CryonicOre.cs +++ b/Tiles/Ores/CryonicOre.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 675; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeSnowTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithSnow(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, TileID.SnowBlock); + TileFraming.CustomMergeFrame(i, j, Type, TileID.SnowBlock); return false; } diff --git a/Tiles/Ores/ExodiumOre.cs b/Tiles/Ores/ExodiumOre.cs index 671c85b6cb..9c08ce117c 100644 --- a/Tiles/Ores/ExodiumOre.cs +++ b/Tiles/Ores/ExodiumOre.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Tiles.Ores Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); ModTranslation name = CreateMapEntryName(); name.SetDefault("Exodium Ore"); diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index 23e4df5d3e..37974a382c 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 710; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/Ores/UelibloomOre.cs b/Tiles/Ores/UelibloomOre.cs index a197522a00..251ec9bf2d 100644 --- a/Tiles/Ores/UelibloomOre.cs +++ b/Tiles/Ores/UelibloomOre.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileValue[Type] = 950; - TileMerge.MergeGeneralTiles(Type); + CalamityUtils.MergeWithGeneral(Type); drop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, TileID.Mud, false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Mud, false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/PerennialBrick.cs b/Tiles/PerennialBrick.cs index 4a9efd6879..c9e10b5008 100644 --- a/Tiles/PerennialBrick.cs +++ b/Tiles/PerennialBrick.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Tiles Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); drop = ModContent.ItemType(); soundType = 21; diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 5799b54228..1484ea1ec7 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; dustType = 108; @@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, TileID.Sandstone, false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, TileID.Sandstone); + // CustomTileFraming.CustomMergeFrame(i, j, Type, TileID.Sandstone, false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, TileID.Sandstone); return false; } } diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 295edd9f00..9fd08dd66c 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; dustType = 96; @@ -102,8 +102,8 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - // CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); - CustomTileFraming.FrameTileForCustomMergeFrom(i, j, Type, ModContent.TileType()); + // CustomTileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); return false; } } diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 88337420d1..3e7157d9a1 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDesertTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; dustType = 33; @@ -103,7 +103,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - CustomTileFraming.FrameTileForCustomMerge(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); return false; } } diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index 8d1fbb6ccd..8143c2eb61 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Tiles Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - TileMerge.MergeGeneralTiles(Type); - TileMerge.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeDecorativeTiles(Type); soundType = 21; minPick = 200; @@ -46,7 +46,7 @@ namespace CalamityMod.Tiles public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return CustomTileFraming.BrimstoneFraming(i, j, resetFrame); + return TileFraming.BrimstoneFraming(i, j, resetFrame); } public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 64aefeb672..471dab5f2e 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -555,6 +555,15 @@ namespace CalamityMod r.AddTile(TileID.Anvils); r.SetResult(ItemID.Radar); r.AddRecipe(); + + // Metal Detector + r = GetNewRecipe(); + r.AddIngredient(ItemID.Wire, 10); + r.AddIngredient(ItemID.HallowedBar, 5); + r.AddIngredient(ItemID.SpelunkerGlowstick, 5); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.MetalDetector); + r.AddRecipe(); } #endregion @@ -786,10 +795,18 @@ namespace CalamityMod }); RecipeGroup.RegisterGroup("CursedFlameIchor", group); + group = new RecipeGroup(() => "Any Evil Water", new int[] + { + ItemID.UnholyWater, + ItemID.BloodWater + }); + RecipeGroup.RegisterGroup("AnyEvilWater", group); + group = new RecipeGroup(() => "Any Silt", new int[] { ItemID.SiltBlock, - ItemID.SlushBlock + ItemID.SlushBlock, + ModContent.ItemType() }); RecipeGroup.RegisterGroup("SiltGroup", group); diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index f0e56e7991..ac73be1d06 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -2,6 +2,20 @@ using CalamityMod.Items; using CalamityMod.NPCs; using CalamityMod.Projectiles; +using CalamityMod.Tiles; +using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.AstralDesert; +using CalamityMod.Tiles.AstralSnow; +using CalamityMod.Tiles.Crags; +using CalamityMod.Tiles.FurnitureAbyss; +using CalamityMod.Tiles.FurnitureAshen; +using CalamityMod.Tiles.FurnitureEutrophic; +using CalamityMod.Tiles.FurnitureOccult; +using CalamityMod.Tiles.FurnitureProfaned; +using CalamityMod.Tiles.FurnitureVoid; +using CalamityMod.Tiles.Ores; +using CalamityMod.Tiles.SunkenSea; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -9,6 +23,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Text; using Terraria; using Terraria.DataStructures; using Terraria.Enums; @@ -312,6 +327,31 @@ namespace CalamityMod #endregion #region Tile Utilities + public static void SafeSquareTileFrame(int x, int y, bool resetFrame = true) + { + if (Main.tile[x, y] is null) + return; + + for (int xIter = x - 1; xIter <= x + 1; ++xIter) + { + if (xIter < 0 || xIter >= Main.maxTilesX) + continue; + for (int yIter = y - 1; yIter <= y + 1; yIter++) + { + if (yIter < 0 || yIter >= Main.maxTilesY) + continue; + if (xIter == x && yIter == y) + { + WorldGen.TileFrame(x, y, resetFrame, false); + } + else + { + WorldGen.TileFrame(xIter, yIter, false, false); + } + } + } + } + public static void LightHitWire(int type, int i, int j, int tileX, int tileY) { int x = i - Main.tile[i, j].frameX / 18 % tileX; @@ -349,6 +389,231 @@ namespace CalamityMod } } + #region Tile Merge Utilities + /// + /// Sets the mergeability state of two tiles. By default, enables tile merging. + /// + /// The first tile type which should merge (or not). + /// The second tile type which should merge (or not). + /// The mergeability state of the tiles. Defaults to true if omitted. + public static void SetMerge(int type1, int type2, bool merge = true) + { + if (type1 != type2) + { + Main.tileMerge[type1][type2] = merge; + Main.tileMerge[type2][type1] = merge; + } + } + + /// + /// Makes the first tile type argument merge with all the other tile type arguments. Also accepts arrays. + /// + /// The tile whose merging properties will be set. + /// Every tile that should be merged with. + public static void MergeWithSet(int myType, params int[] otherTypes) + { + for (int i = 0; i < otherTypes.Length; ++i) + SetMerge(myType, otherTypes[i]); + } + + /// + /// Makes the specified tile merge with the most common types of tiles found in world generation.

+ /// Notably excludes Ice. + ///
+ /// The tile whose merging properties will be set. + public static void MergeWithGeneral(int type) => MergeWithSet(type, new int[] { + // Soils + TileID.Dirt, + TileID.Mud, + TileID.ClayBlock, + // Stones + TileID.Stone, + TileID.Ebonstone, + TileID.Crimstone, + TileID.Pearlstone, + // Sands + TileID.Sand, + TileID.Ebonsand, + TileID.Crimsand, + TileID.Pearlsand, + // Snows + TileID.SnowBlock, + // Calamity Tiles + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all ores, vanilla and Calamity. Particularly useful for stone blocks. + /// + /// The tile whose merging properties will be set. + public static void MergeWithOres(int type) => MergeWithSet(type, new int[] { + // Vanilla Ores + TileID.Copper, + TileID.Tin, + TileID.Iron, + TileID.Lead, + TileID.Silver, + TileID.Tungsten, + TileID.Gold, + TileID.Demonite, + TileID.Crimtane, + TileID.Cobalt, + TileID.Palladium, + TileID.Mythril, + TileID.Platinum, + TileID.Orichalcum, + TileID.Adamantite, + TileID.Titanium, + TileID.LunarOre, + // Calamity Ores + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all types of desert tiles, including the Calamity Sunken Sea. + /// + /// The tile whose merging properties will be set. + public static void MergeWithDesert(int type) => MergeWithSet(type, new int[] { + // Sands + TileID.Sand, + TileID.Ebonsand, + TileID.Crimsand, + TileID.Pearlsand, + // Hardened Sands + TileID.HardenedSand, + TileID.CorruptHardenedSand, + TileID.CrimsonHardenedSand, + TileID.HallowHardenedSand, + // Sandstones + TileID.Sandstone, + TileID.CorruptSandstone, + TileID.CrimsonSandstone, + TileID.HallowSandstone, + // Miscellaneous Desert Tiles + TileID.FossilOre, + TileID.DesertFossil, + // Astral Desert + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + // Sunken Sea + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all types of snow and ice tiles. + /// + /// The tile whose merging properties will be set. + public static void MergeWithSnow(int type) => MergeWithSet(type, new int[] { + // Snows + TileID.SnowBlock, + // Ices + TileID.IceBlock, + TileID.CorruptIce, + TileID.FleshIce, + TileID.HallowedIce, + // Astral Snow + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all tiles which generate in hell. Does not include Charred Ore. + /// + /// The tile whose merging properties will be set. + public static void MergeWithHell(int type) => MergeWithSet(type, new int[] { + TileID.Ash, + TileID.Hellstone, + TileID.ObsidianBrick, + TileID.HellstoneBrick, + ModContent.TileType(), + }); + + /// + /// Makes the specified tile merge with all tiles which generate in the Abyss or the Sulphurous Sea. Includes Chaotic Ore. + /// + /// The tile whose merging properties will be set. + public static void MergeWithAbyss(int type) => MergeWithSet(type, new int[] { + // Sulphurous Sea + ModContent.TileType(), + // Abyss + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + }); + + /// + /// Makes the tile merge with all the tile types that generate within various types of astral tiles + /// + /// + public static void MergeAstralTiles(int type) + { + //Astral + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + //Astral Desert + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + //Astral Snow + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + } + + /// + /// Makes the tile merge with all the decorative 'smooth' tiles + /// + /// + public static void MergeSmoothTiles(int type) + { + //Vanilla + SetMerge(type, TileID.MarbleBlock); + SetMerge(type, TileID.GraniteBlock); + //Calam + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + } + + /// + /// Makes the tile merge with other mergable decorative tiles + /// + /// + public static void MergeDecorativeTiles(int type) + { + //Vanilla decor + Main.tileBrick[type] = true; + //Calam + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + SetMerge(type, ModContent.TileType()); + } + #endregion + + #region Furniture Interaction public static bool BedRightClick(int i, int j) { Player player = Main.LocalPlayer; @@ -860,14 +1125,20 @@ namespace CalamityMod player.showItemIcon2 = 0; } } + #endregion #region Furniture SetDefaults - public static void SetUpBathtub(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a bathtub. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpBathtub(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.Width = 4; TileObjectData.newTile.Height = 2; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; @@ -882,15 +1153,23 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All bathtubs count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpBed(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a bed. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpBed(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - TileID.Sets.HasOutlines[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.Width = 4; TileObjectData.newTile.Height = 2; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; @@ -905,51 +1184,83 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All beds count as chairs. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } - public static void SetUpBookcase(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a bookcase. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpBookcase(this ModTile mt, bool lavaImmune = false) { - Main.tileSolidTop[type] = true; - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileSolidTop[mt.Type] = true; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All bookcases count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpCandelabra(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a candelabra. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpCandelabra(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = true; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = true; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All candelabras count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpCandle(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a candle. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpCandle(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); TileObjectData.newTile.CoordinateHeights = new int[] { 20 }; TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All candles count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpChair(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a chair. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpChair(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; @@ -960,16 +1271,24 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // As you could probably guess, all chairs count as chairs. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } - public static void SetUpChandelier(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a chandelier. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpChandelier(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.Width = 3; TileObjectData.newTile.Height = 3; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; @@ -979,19 +1298,26 @@ namespace CalamityMod TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, 1, 1); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All chandeliers count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpChest(int type) + /// + /// Extension which initializes a ModTile to be a chest. + /// + /// The ModTile which is being initialized. + internal static void SetUpChest(this ModTile mt) { - Main.tileSpelunker[type] = true; - Main.tileContainer[type] = true; - Main.tileShine2[type] = true; - Main.tileShine[type] = 1200; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileValue[type] = 500; - TileID.Sets.HasOutlines[type] = true; + Main.tileSpelunker[mt.Type] = true; + Main.tileContainer[mt.Type] = true; + Main.tileShine2[mt.Type] = true; + Main.tileShine[mt.Type] = 1200; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileValue[mt.Type] = 500; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; @@ -1001,15 +1327,20 @@ namespace CalamityMod TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); } - public static void SetUpClock(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a clock. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpClock(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - TileID.Sets.HasOutlines[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; TileObjectData.newTile.CoordinateHeights = new int[] @@ -1023,20 +1354,25 @@ namespace CalamityMod TileObjectData.newTile.Origin = new Point16(0, 4); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); } - public static void SetUpDoorClosed(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a closed door. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpDoorClosed(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileBlockLight[type] = true; - Main.tileSolid[type] = true; - Main.tileNoAttach[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - TileID.Sets.NotReallySolid[type] = true; - TileID.Sets.DrawsWalls[type] = true; - TileID.Sets.HasOutlines[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileBlockLight[mt.Type] = true; + Main.tileSolid[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + TileID.Sets.NotReallySolid[mt.Type] = true; + TileID.Sets.DrawsWalls[mt.Type] = true; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -1054,16 +1390,24 @@ namespace CalamityMod TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Origin = new Point16(0, 2); TileObjectData.addAlternate(0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // As you could probably guess, all closed doors count as doors. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); } - public static void SetUpDoorOpen(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be an open door. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpDoorOpen(this ModTile mt, bool lavaImmune = false) { - Main.tileFrameImportant[type] = true; - Main.tileSolid[type] = false; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - Main.tileNoSunLight[type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileSolid[mt.Type] = false; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + Main.tileNoSunLight[mt.Type] = true; TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -1103,21 +1447,28 @@ namespace CalamityMod TileObjectData.newAlternate.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 1); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; TileObjectData.addAlternate(1); - TileObjectData.addTile(type); - TileID.Sets.HousingWalls[type] = true; - TileID.Sets.HasOutlines[type] = true; + TileObjectData.addTile(mt.Type); + TileID.Sets.HousingWalls[mt.Type] = true; + TileID.Sets.HasOutlines[mt.Type] = true; + + // As you could probably guess, all open doors count as doors. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); } - public static void SetUpDresser(int type) + /// + /// Extension which initializes a ModTile to be a dresser. + /// + /// The ModTile which is being initialized. + internal static void SetUpDresser(this ModTile mt) { - Main.tileSolidTop[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileContainer[type] = true; - Main.tileWaterDeath[type] = false; - Main.tileLavaDeath[type] = false; - TileID.Sets.HasOutlines[type] = true; + Main.tileSolidTop[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileContainer[mt.Type] = true; + Main.tileWaterDeath[mt.Type] = false; + Main.tileLavaDeath[mt.Type] = false; + TileID.Sets.HasOutlines[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; @@ -1127,102 +1478,170 @@ namespace CalamityMod TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All dressers count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpLamp(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a floor lamp. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpLamp(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style1xX); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All floor lamps count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpLantern(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a hanging lantern. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpLantern(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All hanging lanterns count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpPiano(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a piano. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpPiano(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All pianos count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpSink(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a platform. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpPlatform(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileSolidTop[mt.Type] = true; + Main.tileSolid[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + TileID.Sets.Platforms[mt.Type] = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 27; + TileObjectData.newTile.StyleWrapLimit = 27; + TileObjectData.newTile.UsesCustomCanPlace = false; + TileObjectData.newTile.LavaDeath = !lavaImmune; + TileObjectData.addTile(mt.Type); + + // All platforms count as doors (so that you may have top-or-bottom entry/exit rooms) + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); + } + + /// + /// Extension which initializes a ModTile to be a sink. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpSink(this ModTile mt, bool lavaImmune = false) + { + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); } - public static void SetUpSofa(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a sofa. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpSofa(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All sofas count as chairs. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); } - public static void SetUpTable(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a table. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpTable(this ModTile mt, bool lavaImmune = false) { - Main.tileSolidTop[type] = true; - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; + Main.tileSolidTop[mt.Type] = true; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // As you could probably guess, all tables count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } - public static void SetUpWorkBench(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a torch. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpTorch(this ModTile mt, bool lavaImmune = false, bool waterImmune = false) { - Main.tileSolidTop[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - Main.tileWaterDeath[type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[] { 18 }; - TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); - } - - public static void SetUpTorch(int type, bool lavaImmune = false, bool waterImmune = false) - { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileSolid[type] = false; - Main.tileNoAttach[type] = true; - Main.tileNoFail[type] = true; - Main.tileWaterDeath[type] = !waterImmune; - Main.tileLavaDeath[type] = !lavaImmune; + Main.tileLighted[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileSolid[mt.Type] = false; + Main.tileNoAttach[mt.Type] = true; + Main.tileNoFail[mt.Type] = true; + Main.tileWaterDeath[mt.Type] = !waterImmune; + Main.tileLavaDeath[mt.Type] = !lavaImmune; TileObjectData.newTile.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newTile.WaterDeath = !waterImmune; TileObjectData.newTile.LavaDeath = !lavaImmune; @@ -1241,31 +1660,34 @@ namespace CalamityMod TileObjectData.newAlternate.WaterDeath = false; TileObjectData.newAlternate.AnchorWall = true; TileObjectData.addAlternate(0); - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All torches count as light sources. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } - public static void SetUpPlatform(int type, bool lavaImmune = false) + /// + /// Extension which initializes a ModTile to be a work bench. + /// + /// The ModTile which is being initialized. + /// Whether this tile is supposed to be immune to lava. Defaults to false. + internal static void SetUpWorkBench(this ModTile mt, bool lavaImmune = false) { - Main.tileLighted[type] = true; - Main.tileFrameImportant[type] = true; - Main.tileSolidTop[type] = true; - Main.tileSolid[type] = true; - Main.tileNoAttach[type] = true; - Main.tileTable[type] = true; - Main.tileLavaDeath[type] = !lavaImmune; - TileID.Sets.Platforms[type] = true; - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleMultiplier = 27; - TileObjectData.newTile.StyleWrapLimit = 27; - TileObjectData.newTile.UsesCustomCanPlace = false; + Main.tileSolidTop[mt.Type] = true; + Main.tileFrameImportant[mt.Type] = true; + Main.tileNoAttach[mt.Type] = true; + Main.tileTable[mt.Type] = true; + Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileWaterDeath[mt.Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); + TileObjectData.newTile.CoordinateHeights = new int[] { 18 }; TileObjectData.newTile.LavaDeath = !lavaImmune; - TileObjectData.addTile(type); + TileObjectData.addTile(mt.Type); + + // All work benches count as tables. + mt.AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); } #endregion - #endregion #region Drawing Utilities @@ -1433,6 +1855,33 @@ namespace CalamityMod #endregion #region Miscellaneous Utilities + public static T[] ShuffleArray(T[] array, Random rand = null) + { + if (rand is null) + rand = new Random(); + + for (int i = array.Length; i > 0; --i) + { + int j = rand.Next(i); + T tempElement = array[j]; + array[j] = array[i - 1]; + array[i - 1] = tempElement; + } + return array; + } + + public static string CombineStrings(params object[] args) + { + StringBuilder result = new StringBuilder(1024); + for(int i = 0; i < args.Length; ++i) + { + object o = args[i]; + result.Append(o.ToString()); + result.Append(' '); + } + return result.ToString(); + } + public static void StartSandstorm() { typeof(Terraria.GameContent.Events.Sandstorm).GetMethod("StartSandstorm", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null); diff --git a/Utilities/CustomTileFraming.cs b/Utilities/TileFraming.cs similarity index 72% rename from Utilities/CustomTileFraming.cs rename to Utilities/TileFraming.cs index cd4e6164d7..a36f95ea47 100644 --- a/Utilities/CustomTileFraming.cs +++ b/Utilities/TileFraming.cs @@ -1,5 +1,4 @@ -using CalamityMod.Tiles; -using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; @@ -14,22 +13,40 @@ using Terraria.ModLoader; namespace CalamityMod { - public static class CustomTileFraming + public static class TileFraming { private static int[][] PlantCheckAgainst; private static Dictionary VineToGrass; + + // CONSIDER -- This is a triangle array, but does it need to be? Main.tileMerge is a triangle array as well public static bool[][] tileMergeTypes; - static CustomTileFraming() + #region Similarity Enum + private enum Similarity { - Setup(); + Same, + MergeLink, + None } - private static void Setup() + private static Similarity GetSimilarity(Tile check, int myType, int mergeType) { - int size = CalamityGlobalTile.PlantTypes.Length; - PlantCheckAgainst = new int[TileLoader.TileCount][]; + if (check is null || !check.active()) + return Similarity.None; + if (check.type == myType || Main.tileMerge[myType][check.type]) + return Similarity.Same; + else if (check.type == mergeType) + return Similarity.MergeLink; + + return Similarity.None; + } + #endregion + + #region Load/Unload + internal static void Load() + { + PlantCheckAgainst = new int[TileLoader.TileCount][]; PlantCheckAgainst[TileID.Plants] = new int[3] { TileID.Grass, TileID.PlanterBox, TileID.ClayPot }; PlantCheckAgainst[TileID.CorruptPlants] = new int[1] { TileID.CorruptGrass }; PlantCheckAgainst[TileID.JunglePlants] = new int[1] { TileID.JungleGrass }; @@ -42,18 +59,17 @@ namespace CalamityMod PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; - VineToGrass = new Dictionary(); - VineToGrass[TileID.Vines] = TileID.Grass; - VineToGrass[TileID.CrimsonVines] = TileID.FleshGrass; - VineToGrass[TileID.HallowedVines] = TileID.HallowedGrass; - VineToGrass[(ushort)ModContent.TileType()] = (ushort)ModContent.TileType(); + VineToGrass = new Dictionary + { + [TileID.Vines] = TileID.Grass, + [TileID.CrimsonVines] = TileID.FleshGrass, + [TileID.HallowedVines] = TileID.HallowedGrass, + [(ushort)ModContent.TileType()] = (ushort)ModContent.TileType() + }; tileMergeTypes = new bool[TileLoader.TileCount][]; - for (int i = 0; i < tileMergeTypes.Length; i++) - { + for (int i = 0; i < tileMergeTypes.Length; ++i) tileMergeTypes[i] = new bool[TileLoader.TileCount]; - } - tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; @@ -77,261 +93,149 @@ namespace CalamityMod tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; tileMergeTypes[ModContent.TileType()][ModContent.TileType()] = true; - } - private static bool PlantNeedsUpdate(int plantType, int checkType) + internal static void Unload() { - if (PlantCheckAgainst[plantType] == null) + PlantCheckAgainst = null; + VineToGrass.Clear(); + VineToGrass = null; + tileMergeTypes = null; + } + #endregion + + #region Framing Helpers + private static bool GetMerge(Tile myTile, Tile mergeTile) + { + if (myTile is null || mergeTile is null) return false; - int size = PlantCheckAgainst[plantType].Length; - for (int i = 0; i < size; i++) - { - if (PlantCheckAgainst[plantType][i] == checkType) - { - return false; - } - } - return true; + return mergeTile.active() && (mergeTile.type == myTile.type || Main.tileMerge[myTile.type][mergeTile.type]); } - public static void CheckPlants(int x, int y) + private static void SetFrameAt(int x, int y, int frameX, int frameY) { - int checkType = -1; - int plantType = Main.tile[x, y].type; - - if (y + 1 >= Main.maxTilesY) - checkType = plantType; - Tile tile = Main.tile[x, y]; - Tile below = Main.tile[x, y + 1]; - if (y + 1 < Main.maxTilesY && below != null && below.nactive() && !below.halfBrick() && below.slope() == 0) - checkType = below.type; + if (tile != null) + { + tile.frameX = (short)frameX; + tile.frameY = (short)frameY; + } + } + #endregion - if (checkType == -1) + #region Specific Framing Code + internal static void PlantFrame(int x, int y) + { + Tile tile = Main.tile[x, y]; + if (tile is null) return; - //Check if this plant needs an update - if (PlantNeedsUpdate(plantType, checkType)) - { - if ((plantType == TileID.Plants || plantType == TileID.Plants2) && checkType != TileID.Grass && tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - if (plantType == TileID.JunglePlants2 && checkType != TileID.JungleGrass && tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } + int checkType = -1; + int plantType = tile.type; - if (checkType == TileID.CorruptGrass) - { - plantType = TileID.CorruptPlants; - if (tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - } - else if (checkType == TileID.Grass) - { - if (plantType == TileID.HallowedPlants2) - { - plantType = TileID.Plants2; - } - else - { - plantType = TileID.Plants; - } - } - else if (checkType == TileID.HallowedGrass) - { - if (plantType == TileID.Plants2) - { - plantType = TileID.HallowedPlants2; - } - else - { - plantType = TileID.HallowedPlants; - } - } - else if (checkType == TileID.FleshGrass) - { - plantType = TileID.FleshWeeds; - } - else if (checkType == TileID.MushroomGrass) - { - plantType = TileID.MushroomPlants; - while (Main.tile[x, y].frameX > 72) - { - Main.tile[x, y].frameX -= 72; - } - } - else if (checkType == ModContent.GetInstance().TileType("AstralGrass")) //ASTRAL - { - if (plantType == TileID.Plants || plantType == TileID.CorruptPlants || - plantType == TileID.FleshWeeds || plantType == TileID.HallowedPlants || - plantType == TileID.MushroomPlants || plantType == TileID.JunglePlants) - { - plantType = ModContent.GetInstance().TileType("AstralShortPlants"); - } - else - { - plantType = ModContent.GetInstance().TileType("AstralTallPlants"); - } - } - if (plantType != Main.tile[x, y].type) - { - Main.tile[x, y].type = (ushort)plantType; - return; - } - WorldGen.KillTile(x, y, false, false, false); - } - } - - public static void VineFrame(int x, int y) - { - Tile tile = Main.tile[x, y]; - int myType = tile.type; - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - if (tile4 != null && tile4.active()) - { - if (Main.tileStone[(int)tile4.type]) - { - } - else - { - int num55 = (int)tile4.type; - } - if (tile4.slope() == 1 || tile4.slope() == 3) - { - } - } - if (tile5 != null && tile5.active()) - { - if (Main.tileStone[(int)tile5.type]) - { - } - else - { - int num56 = (int)tile5.type; - } - if (tile5.slope() == 2 || tile5.slope() == 4) - { - } - } - - int num53; - if (tile2 != null && tile2.active()) - { - if (Main.tileStone[(int)tile2.type]) - { - } - else - { - num53 = (int)tile2.type; - } - if (tile2.slope() == 3 || tile2.slope() == 4) - { - } - } - if (tile3 != null && tile3.active()) - { - if (Main.tileStone[(int)tile3.type]) - { - } - else - { - int num58 = (int)tile3.type; - } - if (tile3.slope() == 1 || tile3.slope() == 2) - { - } - } - if (tile8 != null && tile8.active()) - { - if (Main.tileStone[(int)tile8.type]) - { - } - else - { - int num52 = (int)tile8.type; - } - } - if (tile9 != null && tile9.active()) - { - if (Main.tileStone[(int)tile9.type]) - { - } - else - { - int num54 = (int)tile9.type; - } - } - if (tile6 != null && tile6.active()) - { - if (Main.tileStone[(int)tile6.type]) - { - } - else - { - int num57 = (int)tile6.type; - } - } - if (tile7 != null && tile7.active()) - { - if (Main.tileStone[(int)tile7.type]) - { - } - else - { - int num59 = (int)tile7.type; - } - } - if (tile.slope() == 2) - { - } - if (tile.slope() == 1) - { - } - if (tile.slope() == 4) - { - } - if (tile.slope() == 3) - { - } - - if (tile2 != null) - { - if (!tile2.active()) - { - num53 = -1; - } - else if (tile2.bottomSlope()) - { - num53 = -1; - } - else - { - num53 = (int)tile2.type; - } - } + // If the tile below is off the bottom of the map, then assume it's the same tile type. + if (y + 1 >= Main.maxTilesY) + checkType = plantType; else { - num53 = myType; + Tile below = Main.tile[x, y + 1]; + if (below != null && below.nactive() && !below.halfBrick() && below.slope() == 0) + checkType = below.type; } - ushort[] vines = VineToGrass.Keys.ToArray(); - - for (int i = 0; i < vines.Length; i++) + // Sub function to determine whether the plant needs an update + bool PlantNeedsUpdate(int plant, int check) { - ushort myGrassType = VineToGrass[(ushort)vines[i]]; - if (myType != vines[i] && (num53 == myGrassType || num53 == vines[i])) + if (PlantCheckAgainst[plant] is null) + return false; + + for (int i = 0; i < PlantCheckAgainst[plant].Length; ++i) + if (PlantCheckAgainst[plant][i] == check) + return false; + + return true; + } + + // If no valid below tile type could be determined, then don't do anything. + // Additionally, don't do anything if the plant doesn't need a framing update. + if (checkType == -1 || !PlantNeedsUpdate(plantType, checkType)) + return; + + if ((plantType == TileID.Plants || plantType == TileID.Plants2) && checkType != TileID.Grass && tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + if (plantType == TileID.JunglePlants2 && checkType != TileID.JungleGrass && tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + + if (checkType == TileID.CorruptGrass) + { + plantType = TileID.CorruptPlants; + if (tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + } + else if (checkType == TileID.Grass) + { + plantType = plantType == TileID.HallowedPlants2 ? TileID.Plants2 : TileID.Plants; + } + else if (checkType == TileID.HallowedGrass) + { + plantType = plantType == TileID.Plants2 ? TileID.HallowedPlants2 : TileID.HallowedPlants; + } + else if (checkType == TileID.FleshGrass) + { + plantType = TileID.FleshWeeds; + } + else if (checkType == TileID.MushroomGrass) + { + plantType = TileID.MushroomPlants; + while (Main.tile[x, y].frameX > 72) + { + Main.tile[x, y].frameX -= 72; + } + } + + // Astral grass and plant behavior + else if (checkType == ModContent.GetInstance().TileType("AstralGrass")) + { + bool isShortPlant = plantType == TileID.Plants || + plantType == TileID.CorruptPlants || + plantType == TileID.FleshWeeds || + plantType == TileID.HallowedPlants || + plantType == TileID.MushroomPlants || + plantType == TileID.JunglePlants; + plantType = ModContent.GetInstance().TileType(isShortPlant ? "AstralShortPlants" : "AstralTallPlants"); + } + + // If the tile type is not the same as the plant type, then set it equal. Otherwise, destroy it. + if (Main.tile[x, y].type != plantType) + Main.tile[x, y].type = (ushort)plantType; + else + WorldGen.KillTile(x, y, false, false, false); + } + + internal static void VineFrame(int x, int y) + { + Tile tile = Main.tile[x, y]; + if (tile is null) + return; + + int myType = tile.type; + + // Get the type of the tile above this vine. If that tile doesn't exist, just assume it's another vine. + Tile north = y <= 0 ? null : Main.tile[x, y - 1]; + int northType = north is null ? myType : (!north.active() || north.bottomSlope()) ? -1 : north.type; + + // Make this vine match the tile above it if that's another vine or a grass tile. + ushort[] vines = VineToGrass.Keys.ToArray(); + for (int i = 0; i < vines.Length; ++i) + { + ushort correspondingGrass = VineToGrass[vines[i]]; + if (myType != vines[i] && (northType == correspondingGrass || northType == vines[i])) { Main.tile[x, y].type = vines[i]; WorldGen.SquareTileFrame(x, y, true); @@ -339,57 +243,52 @@ namespace CalamityMod } } - if (num53 != myType) + // If the tile above is an identical vine, nothing else needs to be done. + if (northType == myType) + return; + + // If the tile above isn't sloped correctly or otherwise isn't a valid anchor for this vine, check whether the vine must die. + bool tileMustDie = northType == -1; + if(northType != -1) { - bool flag17 = false; - if (num53 == -1) + // Vanilla vines can hang from vanilla grass and vanilla leaf blocks. + if (myType == TileID.Vines && northType != TileID.Grass && northType != TileID.LeafBlock) + tileMustDie = true; + else for (int i = 0; i < vines.Length; ++i) { - flag17 = true; - } - else - { - for (int i = 0; i < vines.Length; i++) + // Not matching grass? Die. + if (myType == vines[i] && northType != VineToGrass[vines[i]]) { - if (myType != TileID.Vines) - { - if (myType == vines[i] && num53 != VineToGrass[vines[i]]) - { - flag17 = true; - } - } - else if (num53 != TileID.Grass && num53 != TileID.LeafBlock) - { - flag17 = true; - } + tileMustDie = true; + break; } } - if (flag17) - { - WorldGen.KillTile(x, y, false, false, false); - } } - return; + + if (tileMustDie) + WorldGen.KillTile(x, y, false, false, false); } - public static bool BetterGemsparkFraming(int x, int y, bool resetFrame) + internal static bool BetterGemsparkFraming(int x, int y, bool resetFrame) { Tile tile = Main.tile[x, y]; + if (tile is null) + return false; if (tile.slope() > 0 && TileID.Sets.HasSlopeFrames[tile.type]) { return true; } - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - - int myType = tile.type; + // these all get null checked in the GetMerge function + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; + Tile southwest = Main.tile[x - 1, y + 1]; + Tile southeast = Main.tile[x + 1, y + 1]; + Tile northwest = Main.tile[x - 1, y - 1]; + Tile northeast = Main.tile[x + 1, y - 1]; bool left = false; bool right = false; @@ -400,23 +299,24 @@ namespace CalamityMod bool downLeft = false; bool downRight = false; - if (GetMerge(tile, tile2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 2)) + if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) up = true; - if (GetMerge(tile, tile3) && (tile3.slope() == 0 || tile3.slope() == 3 || tile3.slope() == 4)) + if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) down = true; - if (GetMerge(tile, tile4) && (tile4.slope() == 0 || tile4.slope() == 2 || tile4.slope() == 4)) + if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) left = true; - if (GetMerge(tile, tile5) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 3)) + if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) right = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile4) && GetMerge(tile, tile8) && (tile8.slope() == 0 || tile8.slope() == 2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 3 || tile4.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) upLeft = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile5) && GetMerge(tile, tile9) && (tile9.slope() == 0 || tile9.slope() == 1) && (tile2.slope() == 0 || tile2.slope() == 2 || tile2.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 3 || tile5.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) upRight = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile4) && GetMerge(tile, tile6) && !tile6.halfBrick() && (tile6.slope() == 0 || tile6.slope() == 4) && (tile3.slope() == 0 || tile3.slope() == 1 || tile3.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 1 || tile4.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) downLeft = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile5) && GetMerge(tile, tile7) && !tile7.halfBrick() && (tile7.slope() == 0 || tile7.slope() == 3) && (tile3.slope() == 0 || tile3.slope() == 2 || tile3.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) downRight = true; + // Reset the tile's random frame style if the frame is being reset. int randomFrame; if (resetFrame) { @@ -647,25 +547,26 @@ namespace CalamityMod return true; } - public static bool BrimstoneFraming(int x, int y, bool resetFrame) + internal static bool BrimstoneFraming(int x, int y, bool resetFrame) { Tile tile = Main.tile[x, y]; + if (tile is null) + return false; if (tile.slope() > 0 && TileID.Sets.HasSlopeFrames[tile.type]) { return true; } - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - - int myType = tile.type; + // these all get null checked in the GetMerge function + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; + Tile southwest = Main.tile[x - 1, y + 1]; + Tile southeast = Main.tile[x + 1, y + 1]; + Tile northwest = Main.tile[x - 1, y - 1]; + Tile northeast = Main.tile[x + 1, y - 1]; bool left = false; bool right = false; @@ -676,23 +577,24 @@ namespace CalamityMod bool downLeft = false; bool downRight = false; - if (GetMerge(tile, tile2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 2)) + if (GetMerge(tile, north) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 2)) up = true; - if (GetMerge(tile, tile3) && (tile3.slope() == 0 || tile3.slope() == 3 || tile3.slope() == 4)) + if (GetMerge(tile, south) && (south.slope() == 0 || south.slope() == 3 || south.slope() == 4)) down = true; - if (GetMerge(tile, tile4) && (tile4.slope() == 0 || tile4.slope() == 2 || tile4.slope() == 4)) + if (GetMerge(tile, west) && (west.slope() == 0 || west.slope() == 2 || west.slope() == 4)) left = true; - if (GetMerge(tile, tile5) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 3)) + if (GetMerge(tile, east) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 3)) right = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile4) && GetMerge(tile, tile8) && (tile8.slope() == 0 || tile8.slope() == 2) && (tile2.slope() == 0 || tile2.slope() == 1 || tile2.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 3 || tile4.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, west) && GetMerge(tile, northwest) && (northwest.slope() == 0 || northwest.slope() == 2) && (north.slope() == 0 || north.slope() == 1 || north.slope() == 3) && (west.slope() == 0 || west.slope() == 3 || west.slope() == 4)) upLeft = true; - if (GetMerge(tile, tile2) && GetMerge(tile, tile5) && GetMerge(tile, tile9) && (tile9.slope() == 0 || tile9.slope() == 1) && (tile2.slope() == 0 || tile2.slope() == 2 || tile2.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 3 || tile5.slope() == 4)) + if (GetMerge(tile, north) && GetMerge(tile, east) && GetMerge(tile, northeast) && (northeast.slope() == 0 || northeast.slope() == 1) && (north.slope() == 0 || north.slope() == 2 || north.slope() == 4) && (east.slope() == 0 || east.slope() == 3 || east.slope() == 4)) upRight = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile4) && GetMerge(tile, tile6) && !tile6.halfBrick() && (tile6.slope() == 0 || tile6.slope() == 4) && (tile3.slope() == 0 || tile3.slope() == 1 || tile3.slope() == 3) && (tile4.slope() == 0 || tile4.slope() == 1 || tile4.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, west) && GetMerge(tile, southwest) && !southwest.halfBrick() && (southwest.slope() == 0 || southwest.slope() == 4) && (south.slope() == 0 || south.slope() == 1 || south.slope() == 3) && (west.slope() == 0 || west.slope() == 1 || west.slope() == 2)) downLeft = true; - if (GetMerge(tile, tile3) && GetMerge(tile, tile5) && GetMerge(tile, tile7) && !tile7.halfBrick() && (tile7.slope() == 0 || tile7.slope() == 3) && (tile3.slope() == 0 || tile3.slope() == 2 || tile3.slope() == 4) && (tile5.slope() == 0 || tile5.slope() == 1 || tile5.slope() == 2)) + if (GetMerge(tile, south) && GetMerge(tile, east) && GetMerge(tile, southeast) && !southeast.halfBrick() && (southeast.slope() == 0 || southeast.slope() == 3) && (south.slope() == 0 || south.slope() == 2 || south.slope() == 4) && (east.slope() == 0 || east.slope() == 1 || east.slope() == 2)) downRight = true; + // Reset the tile's random frame style if the frame is being reset. int randomFrame; if (resetFrame) { @@ -922,21 +824,23 @@ namespace CalamityMod return true; } + #endregion - enum Similarity + #region Generic Custom Framing Code + internal static void CustomMergeFrameExplicit(int x, int y, int myType, int mergeType, out bool mergedUp, + out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false, + bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) { - Same, - MergeLink, - None - } - public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) - { - bool tmp; - FrameTileForCustomMerge(x, y, myType, mergeType, out tmp, out tmp, out tmp, out tmp, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame); - } + if (Main.tile[x, y] is null) + { + mergedUp = mergedLeft = mergedRight = mergedDown = false; + return; + } - public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, out bool mergedUp, out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) - { + // Disable vanilla trying to merge these tiles automtaically. + Main.tileMerge[myType][mergeType] = false; + + // these all get null checked in the GetSimilarity and GetMerge functions Tile tileLeft = Main.tile[x - 1, y]; Tile tileRight = Main.tile[x + 1, y]; Tile tileUp = Main.tile[x, y - 1]; @@ -946,28 +850,19 @@ namespace CalamityMod Tile tileBottomLeft = Main.tile[x - 1, y + 1]; Tile tileBottomRight = Main.tile[x + 1, y + 1]; - Main.tileMerge[myType][mergeType] = false; + // Cardinal directions + Similarity leftSim = forceSameLeft ? Similarity.Same : GetSimilarity(tileLeft, myType, mergeType); + Similarity rightSim = forceSameRight ? Similarity.Same : GetSimilarity(tileRight, myType, mergeType); + Similarity upSim = forceSameUp ? Similarity.Same : GetSimilarity(tileUp, myType, mergeType); + Similarity downSim = forceSameDown ? Similarity.Same : GetSimilarity(tileDown, myType, mergeType); - //CARDINAL - Similarity leftSim = GetSimilarity(tileLeft, myType, mergeType); - if (forceSameLeft) - leftSim = Similarity.Same; - Similarity rightSim = GetSimilarity(tileRight, myType, mergeType); - if (forceSameRight) - rightSim = Similarity.Same; - Similarity upSim = GetSimilarity(tileUp, myType, mergeType); - if (forceSameUp) - upSim = Similarity.Same; - Similarity downSim = GetSimilarity(tileDown, myType, mergeType); - if (forceSameDown) - downSim = Similarity.Same; - - //DIAGONAL + // Diagonal directions Similarity topLeftSim = GetSimilarity(tileTopLeft, myType, mergeType); Similarity topRightSim = GetSimilarity(tileTopRight, myType, mergeType); Similarity bottomLeftSim = GetSimilarity(tileBottomLeft, myType, mergeType); Similarity bottomRightSim = GetSimilarity(tileBottomRight, myType, mergeType); + // Reset the tile's random frame style if the frame is being reset. int randomFrame; if (resetFrame) { @@ -979,14 +874,10 @@ namespace CalamityMod randomFrame = Main.tile[x, y].frameNumber(); } - /* DEBUGGING - if (Player.tileTargetX == x && Player.tileTargetY == y) - { - Main.NewText(StringWriter(leftSim, rightSim, upSim, downSim, topLeftSim, topRightSim, bottomLeftSim, bottomRightSim, forceSameDown, forceSameUp, forceSameLeft, forceSameRight)); - }*/ - + // Initialize all merged variables to false. mergedDown = mergedLeft = mergedRight = mergedUp = false; + #region Custom Merge Conditional Tree if (leftSim == Similarity.None) { if (upSim == Similarity.Same) @@ -1481,111 +1372,69 @@ namespace CalamityMod } SetFrameAt(x, y, 216, 18 * randomFrame); return; + #endregion } - public static void FrameTileForCustomMergeFrom(int x, int y, int myType, int mergeType) + internal static void CustomMergeFrame(int x, int y, int myType, int mergeType, bool forceSameDown = false, + bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) + => CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame); + + internal static void CustomMergeFrame(int x, int y, int myType, int mergeType) { + Tile tile = Main.tile[x, y]; + if (tile is null) + return; + bool forceSameUp = false; bool forceSameDown = false; bool forceSameLeft = false; bool forceSameRight = false; - Tile up = Main.tile[x, y - 1]; - Tile down = Main.tile[x, y + 1]; - Tile left = Main.tile[x - 1, y]; - Tile right = Main.tile[x + 1, y]; + Tile north = Main.tile[x, y - 1]; + Tile south = Main.tile[x, y + 1]; + Tile west = Main.tile[x - 1, y]; + Tile east = Main.tile[x + 1, y]; - bool tmp; - - if (up.active() && tileMergeTypes[myType][up.type]) + if (north != null && north.active() && tileMergeTypes[myType][north.type]) { - TileMerge.MergeTile(myType, up.type, false); + // Register this tile as not automatically merging with the tile above it. + CalamityUtils.SetMerge(myType, north.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedDown; - FrameTileForCustomMerge(x, y - 1, up.type, myType, out tmp, out tmp, out tmp, out mergedDown, false, false, false, false, false); - if (mergedDown) - { - forceSameUp = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x, y - 1, north.type, myType, out _, out _, out _, out forceSameUp, false, false, false, false, false); } - if (left.active() && tileMergeTypes[myType][left.type]) + if (west != null && west.active() && tileMergeTypes[myType][west.type]) { - TileMerge.MergeTile(myType, left.type, false); + // Register this tile as not automatically merging with the tile to the left of it. + CalamityUtils.SetMerge(myType, west.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedRight; - FrameTileForCustomMerge(x - 1, y, left.type, myType, out tmp, out tmp, out mergedRight, out tmp, false, false, false, false, false); - if (mergedRight) - { - forceSameLeft = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x - 1, y, west.type, myType, out _, out _, out forceSameLeft, out _, false, false, false, false, false); } - if (right.active() && tileMergeTypes[myType][right.type]) + if (east != null && east.active() && tileMergeTypes[myType][east.type]) { - TileMerge.MergeTile(myType, right.type, false); + // Register this tile as not automatically merging with the tile to the right of it. + CalamityUtils.SetMerge(myType, east.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedLeft; - FrameTileForCustomMerge(x + 1, y, right.type, myType, out tmp, out mergedLeft, out tmp, out tmp, false, false, false, false, false); - if (mergedLeft) - { - forceSameRight = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x + 1, y, east.type, myType, out _, out forceSameRight , out _, out _, false, false, false, false, false); } - if (down.active() && tileMergeTypes[myType][down.type]) + if (south != null && south.active() && tileMergeTypes[myType][south.type]) { - TileMerge.MergeTile(myType, down.type, false); + // Register this tile as not automatically merging with the tile below it. + CalamityUtils.SetMerge(myType, south.type, false); TileID.Sets.ChecksForMerge[myType] = true; - bool mergedUp; - FrameTileForCustomMerge(x, y + 1, down.type, myType, out mergedUp, out tmp, out tmp, out tmp, false, false, false, false, false); - if (mergedUp) - { - forceSameDown = true; - } + // Properly frame the tile given this constraint. + CustomMergeFrameExplicit(x, y + 1, south.type, myType, out forceSameDown, out _, out _, out _, false, false, false, false, false); } - FrameTileForCustomMerge(x, y, myType, mergeType, forceSameDown, forceSameUp, forceSameLeft, forceSameRight); - } - - private static void SetFrameAt(int x, int y, int frameX, int frameY) - { - Main.tile[x, y].frameX = (short)frameX; - Main.tile[x, y].frameY = (short)frameY; - } - - private static Similarity GetSimilarity(Tile check, int myType, int mergeType) - { - if (check is null || !check.active()) - return Similarity.None; - - if (check.type == myType || Main.tileMerge[myType][check.type]) - return Similarity.Same; - else if (check.type == mergeType) - return Similarity.MergeLink; - - return Similarity.None; - } - - private static bool GetMerge(Tile myTile, Tile mergeTile) - { - if (!mergeTile.active()) - return false; - return (mergeTile.type == myTile.type || Main.tileMerge[myTile.type][mergeTile.type]); - } - private static string StringWriter(params object[] strings) - { - string s = ""; - for (int i = 0; i < strings.Length; i++) - { - s += strings[i].ToString(); - if (i != strings.Length - 1) - { - s += ", "; - } - } - return s; + // With all constraints determined, properly frame the tile a final time. + CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, true); } + #endregion } } diff --git a/Utilities/TileMerge.cs b/Utilities/TileMerge.cs deleted file mode 100644 index 632c157a14..0000000000 --- a/Utilities/TileMerge.cs +++ /dev/null @@ -1,241 +0,0 @@ -using CalamityMod.Tiles; -using CalamityMod.Tiles.Abyss; -using CalamityMod.Tiles.Astral; -using CalamityMod.Tiles.AstralDesert; -using CalamityMod.Tiles.AstralSnow; -using CalamityMod.Tiles.Crags; -using CalamityMod.Tiles.FurnitureAbyss; -using CalamityMod.Tiles.FurnitureAshen; -using CalamityMod.Tiles.FurnitureEutrophic; -using CalamityMod.Tiles.FurnitureOccult; -using CalamityMod.Tiles.FurnitureProfaned; -using CalamityMod.Tiles.FurnitureVoid; -using CalamityMod.Tiles.Ores; -using CalamityMod.Tiles.SunkenSea; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod -{ - public static class TileMerge - { - public static void MergeTile(int type, int mergeType, bool merge = true) - { - if (type != mergeType) - { - Main.tileMerge[type][mergeType] = merge; - Main.tileMerge[mergeType][type] = merge; - } - } - - /// - /// Makes the tile merge with the most common types of naturally generated tiles - /// - /// - public static void MergeGeneralTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Soils - MergeTile(type, TileID.ClayBlock); - MergeTile(type, TileID.Dirt); - MergeTile(type, TileID.Mud); - //Sands - MergeTile(type, TileID.Sand); - MergeTile(type, TileID.Ebonsand); - MergeTile(type, TileID.Crimsand); - MergeTile(type, TileID.Pearlsand); - //Snows - MergeTile(type, TileID.SnowBlock); - //Stones - MergeTile(type, TileID.Stone); - MergeTile(type, TileID.Ebonstone); - MergeTile(type, TileID.Crimstone); - MergeTile(type, TileID.Pearlstone); - //Calam general tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - public static void MergeOreTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Vanilla Ores - MergeTile(type, TileID.Copper); - MergeTile(type, TileID.Tin); - MergeTile(type, TileID.Iron); - MergeTile(type, TileID.Lead); - MergeTile(type, TileID.Silver); - MergeTile(type, TileID.Tungsten); - MergeTile(type, TileID.Gold); - MergeTile(type, TileID.Demonite); - MergeTile(type, TileID.Crimtane); - MergeTile(type, TileID.Cobalt); - MergeTile(type, TileID.Palladium); - MergeTile(type, TileID.Mythril); - MergeTile(type, TileID.Platinum); - MergeTile(type, TileID.Orichalcum); - MergeTile(type, TileID.Adamantite); - MergeTile(type, TileID.Titanium); - MergeTile(type, TileID.LunarOre); - //Calam Ores - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of desert, sunken sea and related tiles - /// - /// - public static void MergeDesertTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Sands - MergeTile(type, TileID.Sand); - MergeTile(type, TileID.Ebonsand); - MergeTile(type, TileID.Crimsand); - MergeTile(type, TileID.Pearlsand); - //Hardened Sands - MergeTile(type, TileID.HardenedSand); - MergeTile(type, TileID.CorruptHardenedSand); - MergeTile(type, TileID.CrimsonHardenedSand); - MergeTile(type, TileID.HallowHardenedSand); - //Sandstones - MergeTile(type, TileID.Sandstone); - MergeTile(type, TileID.CorruptSandstone); - MergeTile(type, TileID.CrimsonSandstone); - MergeTile(type, TileID.HallowSandstone); - //Misc relevant desert tiles - MergeTile(type, TileID.FossilOre); - MergeTile(type, TileID.DesertFossil); - //Calam desert tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - //Sunken Sea tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of snow or snow biome related tiles - /// - /// - public static void MergeSnowTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Snow - MergeTile(type, TileID.SnowBlock); - //Ices - MergeTile(type, TileID.IceBlock); - MergeTile(type, TileID.CorruptIce); - MergeTile(type, TileID.FleshIce); - MergeTile(type, TileID.HallowedIce); - //Calam snow tiles - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of hell or hell biome related tiles - /// - /// - public static void MergeHellTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Terrain - MergeTile(type, TileID.Ash); - MergeTile(type, TileID.Hellstone); - //Houses - MergeTile(type, TileID.ObsidianBrick); - MergeTile(type, TileID.HellstoneBrick); - //Crag tiles - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of abyss or abyss biome related tiles - /// - /// - public static void MergeAbyssTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Sulphurous Sea - MergeTile(type, ModContent.TileType()); - //Abyss - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the tile types that generate within various types of astral tiles - /// - /// - public static void MergeAstralTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Astral - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - //Astral Desert - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - //Astral Snow - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with all the decorative 'smooth' tiles - /// - /// - public static void MergeSmoothTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Vanilla - MergeTile(type, TileID.MarbleBlock); - MergeTile(type, TileID.GraniteBlock); - //Calam - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - - /// - /// Makes the tile merge with other mergable decorative tiles - /// - /// - public static void MergeDecorativeTiles(int type) - { - Mod mod = ModContent.GetInstance(); - //Vanilla decor - Main.tileBrick[type] = true; - //Calam - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - MergeTile(type, ModContent.TileType()); - } - } -} diff --git a/World/Abyss.cs b/World/Abyss.cs index 1b1510a95f..6a63a7044e 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -390,7 +390,7 @@ namespace CalamityMod.World islandLocationY += islandLocationOffset; } - CalamityWorld.AbyssItemArray = WorldGenerationMethods.ShuffleArray(CalamityWorld.AbyssItemArray); + CalamityWorld.AbyssItemArray = CalamityUtils.ShuffleArray(CalamityWorld.AbyssItemArray); for (int abyssHouse = 0; abyssHouse < CalamityWorld.numAbyssIslands; abyssHouse++) //11 15 19 { if (abyssHouse != 20) @@ -415,7 +415,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(13, 16); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && @@ -425,7 +425,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(25, 28); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } } @@ -447,7 +447,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(13, 16); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && @@ -457,7 +457,7 @@ namespace CalamityMod.World { int style = WorldGen.genRand.Next(25, 28); WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - WorldGenerationMethods.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 6f5a23a294..256d5becd8 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1225,7 +1225,7 @@ namespace CalamityMod.World } } - // TODO -- remove random lorde spawn code + // DO NOT REMOVE -- this code is being kept for April Fools 2020 /*if (Main.rand.NextBool(100000000)) { string key = "Mods.CalamityMod.AprilFools"; diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 6abc32d137..e3dd921a67 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -1179,46 +1179,6 @@ namespace CalamityMod.World } #endregion - #region SafeTileFrame - public static void SafeSquareTileFrame(int i, int j, bool resetFrame = true) - { - if (Main.tile[i, j] != null) - { - for (int x = i - 1; x <= i + 1; x++) - { - for (int y = j - 1; y <= j + 1; y++) - { - if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY) - continue; - if (x == i && y == j) - { - WorldGen.TileFrame(i, j, resetFrame, false); - } - else - { - WorldGen.TileFrame(x, y, false, false); - } - } - } - } - } - #endregion - - #region ShuffleArray - public static int[] ShuffleArray(int[] array) - { - Random random = new Random(); - for (int index = array.Length; index > 0; index--) - { - int j = random.Next(index); - int k = array[j]; - array[j] = array[index - 1]; - array[index - 1] = k; - } - return array; - } - #endregion - #region OreSpawn public static void SpawnOre(int type, double frequency, float depth, float depthLimit) { @@ -1241,22 +1201,22 @@ namespace CalamityMod.World WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(12, 18), WorldGen.genRand.Next(12, 18), (ushort)type); } else if (type == ModContent.TileType()) - { + { //mud if (Main.tile[tilesX, tilesY].type == 59) { WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); } } else if (type == ModContent.TileType()) - { + { //dirt, stone if (Main.tile[tilesX, tilesY].type == 0 || Main.tile[tilesX, tilesY].type == 1) { WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); } } else if (type == ModContent.TileType()) - { - if (Main.tile[tilesX, tilesY].type == 147 || Main.tile[tilesX, tilesY].type == 161 || Main.tile[tilesX, tilesY].type == 163 || Main.tile[tilesX, tilesY].type == 164 || Main.tile[tilesX, tilesY].type == 200) + { //snow, ice, purple ice, pink ice, red ice, astral snow, astral ice + if (Main.tile[tilesX, tilesY].type == 147 || Main.tile[tilesX, tilesY].type == 161 || Main.tile[tilesX, tilesY].type == 163 || Main.tile[tilesX, tilesY].type == 164 || Main.tile[tilesX, tilesY].type == 200 || Main.tile[tilesX, tilesY].type == ModContent.TileType() || Main.tile[tilesX, tilesY].type == ModContent.TileType()) { WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); } @@ -1763,6 +1723,7 @@ namespace CalamityMod.World Main.tile[x, y].type = (ushort)ModContent.TileType(); break; case TileID.Silt: + case TileID.Slush: Main.tile[x, y].type = (ushort)ModContent.TileType(); break; case TileID.DesertFossil: @@ -3258,7 +3219,7 @@ namespace CalamityMod.World } Main.tile[k, l].active(true); Main.tile[k, l].type = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); - SafeSquareTileFrame(k, l, true); + CalamityUtils.SafeSquareTileFrame(k, l, true); } } } @@ -3310,7 +3271,7 @@ namespace CalamityMod.World { Main.tile[n, num17].active(true); Main.tile[n, num17].type = (ushort)num16; - SafeSquareTileFrame(n, num17, true); + CalamityUtils.SafeSquareTileFrame(n, num17, true); } } } @@ -3342,7 +3303,7 @@ namespace CalamityMod.World { Main.tile[n, num17].active(true); Main.tile[n, num17].type = (ushort)num16; - SafeSquareTileFrame(n, num17, true); + CalamityUtils.SafeSquareTileFrame(n, num17, true); } } } @@ -3414,7 +3375,7 @@ namespace CalamityMod.World if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) { Main.tile[num27, num28].type = (ushort)num26; - SafeSquareTileFrame(num27, num28, true); + CalamityUtils.SafeSquareTileFrame(num27, num28, true); } } } @@ -3463,21 +3424,21 @@ namespace CalamityMod.World Main.tile[num37, num35].active(false); Main.tile[num37, num35].liquid = 255; Main.tile[num37, num35].lava(false); - SafeSquareTileFrame(num34, num35, true); + CalamityUtils.SafeSquareTileFrame(num34, num35, true); } if (Main.tile[num37, num35 + 1].type == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) { Main.tile[num37, num35 + 1].active(false); Main.tile[num37, num35 + 1].liquid = 255; Main.tile[num37, num35 + 1].lava(false); - SafeSquareTileFrame(num34, num35 + 1, true); + CalamityUtils.SafeSquareTileFrame(num34, num35 + 1, true); } if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType())) { Main.tile[num37, num35 + 2].active(false); Main.tile[num37, num35 + 2].liquid = 255; Main.tile[num37, num35 + 2].lava(false); - SafeSquareTileFrame(num34, num35 + 2, true); + CalamityUtils.SafeSquareTileFrame(num34, num35 + 2, true); } } } @@ -3486,7 +3447,7 @@ namespace CalamityMod.World Main.tile[num34, num35].liquid = 255; } Main.tile[num34, num35].lava(false); - SafeSquareTileFrame(num34, num35, true); + CalamityUtils.SafeSquareTileFrame(num34, num35, true); } } }