Armor set system streamlining and cobalt set rework
This commit is contained in:
1 parent
ca5cee7bc0
commit
489fca00fd
25 files changed
+3808
-3239
No files matched your search
@@ -18,6 +18,7 @@ using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Mounts.Minecarts;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.TreasureBags;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
@@ -104,7 +105,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int waterLeechTarget = -1;
|
||||
public float KameiTrailXScale = 0.1f;
|
||||
public int KameiBladeUseDelay = 0;
|
||||
public Vector2[] KameiOldPositions = new Vector2[4];
|
||||
public Vector2[] OldPositions = new Vector2[4];
|
||||
public double trueMeleeDamage = 0D;
|
||||
public double contactDamageReduction = 0D;
|
||||
public double projectileDamageReduction = 0D;
|
||||
@@ -800,6 +801,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool chaosSpirit = false;
|
||||
public bool redDevil = false;
|
||||
public bool GemTechSet = false;
|
||||
public bool CobaltSet = false;
|
||||
private GemTechArmorState gemTechState;
|
||||
public GemTechArmorState GemTechState
|
||||
{
|
||||
@@ -1601,6 +1603,8 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
GemTechSet = false;
|
||||
|
||||
CobaltSet = false;
|
||||
|
||||
omegaBlueChestplate = false;
|
||||
omegaBlueSet = false;
|
||||
omegaBlueHentai = false;
|
||||
@@ -2443,6 +2447,7 @@ namespace CalamityMod.CalPlayer
|
||||
silvaCountdown = silvaReviveDuration;
|
||||
auricSet = false;
|
||||
GemTechSet = false;
|
||||
CobaltSet = false;
|
||||
omegaBlueChestplate = false;
|
||||
omegaBlueSet = false;
|
||||
omegaBlueCooldown = 0;
|
||||
@@ -4076,7 +4081,8 @@ namespace CalamityMod.CalPlayer
|
||||
((frostFlare && player.statLife < (int)(player.statLifeMax2 * 0.25)) ? 0.15f : 0f) +
|
||||
(dragonScales ? 0.1f : 0f) +
|
||||
(kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) +
|
||||
(silvaSet ? 0.05f : 0f) +
|
||||
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
|
||||
(silvaSet ? 0.05f : 0f) +
|
||||
(blueCandle ? 0.05f : 0f) +
|
||||
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
|
||||
((deepDiver && player.IsUnderwater()) ? 0.15f : 0f) +
|
||||
@@ -4090,7 +4096,8 @@ namespace CalamityMod.CalPlayer
|
||||
((frostFlare && player.statLife < (int)(player.statLifeMax2 * 0.25)) ? 0.15f : 0f) +
|
||||
(dragonScales ? 0.1f : 0f) +
|
||||
(kamiBoost ? KamiBuff.RunSpeedBoost : 0f) +
|
||||
(silvaSet ? 0.05f : 0f) +
|
||||
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
|
||||
(silvaSet ? 0.05f : 0f) +
|
||||
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
|
||||
((deepDiver && player.IsUnderwater()) ? 0.15f : 0f) +
|
||||
(rogueStealthMax > 0f ? (rogueStealth >= rogueStealthMax ? rogueStealth * 0.05f : rogueStealth * 0.025f) : 0f);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -20,6 +20,7 @@ using CalamityMod.Items.Fishing.FishingRods;
|
||||
using CalamityMod.Items.Mounts.Minecarts;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
@@ -2514,6 +2515,10 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Cobalt armor set effects.
|
||||
if (CobaltSet)
|
||||
CobaltArmorSetChange.ApplyMovementSpeedBonuses(player);
|
||||
|
||||
if (astralInjection)
|
||||
{
|
||||
if (player.statMana < player.statManaMax2)
|
||||
|
||||
+16
-13
@@ -10,6 +10,7 @@ using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Items.Armor;
|
||||
using CalamityMod.Items.Dyes.HairDye;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Localization;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Abyss;
|
||||
@@ -218,6 +219,7 @@ namespace CalamityMod
|
||||
BossHealthBarManager.Load(this);
|
||||
DraedonStructures.Load();
|
||||
EnchantmentManager.LoadAllEnchantments();
|
||||
VanillaArmorChangeManager.Load();
|
||||
SetupVanillaDR();
|
||||
SetupBossKillTimes();
|
||||
SetupBossVelocityScalingValues();
|
||||
@@ -262,7 +264,7 @@ namespace CalamityMod
|
||||
AddEquipTexture(new FeatherCrownHair(), null, EquipType.Head, "FeatherCrownHead", "CalamityMod/Items/Accessories/FeatherCrown_Face");
|
||||
AddEquipTexture(new MoonstoneCrownHair(), null, EquipType.Head, "MoonstoneCrownHead", "CalamityMod/Items/Accessories/MoonstoneCrown_Face");
|
||||
|
||||
AddEquipTexture(null, EquipType.Legs, "CirrusDress_Legs", "CalamityMod/Items/Armor/CirrusDress_Legs");
|
||||
AddEquipTexture(null, EquipType.Legs, "CirrusDress_Legs", "CalamityMod/Items/Armor/CirrusDress_Legs");
|
||||
|
||||
AstralCactusTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactus");
|
||||
AstralCactusGlowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow");
|
||||
@@ -378,6 +380,7 @@ namespace CalamityMod
|
||||
|
||||
Attunement.Unload();
|
||||
EnchantmentManager.UnloadAllEnchantments();
|
||||
VanillaArmorChangeManager.Unload();
|
||||
CalamityLists.UnloadLists();
|
||||
NPCStats.Unload();
|
||||
CalamityGlobalItem.UnloadTweaks();
|
||||
@@ -745,9 +748,9 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<AquaticScourgeBodyAlt>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<AquaticScourgeTail>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<BrimstoneElemental>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<CalamitasRun>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<CalamitasRun2>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<CalamitasRun3>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<CalamitasRun>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<CalamitasRun2>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<CalamitasRun3>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<Leviathan>(), bitingEnemeyVelocityScale },
|
||||
{ ModContent.NPCType<Siren>(), velocityScaleMin },
|
||||
{ ModContent.NPCType<AstrumAureus>(), velocityScaleMin },
|
||||
@@ -881,22 +884,22 @@ namespace CalamityMod
|
||||
music = GetMusicFromMusicMod("SulphurousSea") ?? MusicID.Desert;
|
||||
}
|
||||
}
|
||||
if (CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50) // 8 seconds before DoG returns
|
||||
{
|
||||
music = GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss;
|
||||
priority = MusicPriority.BossMedium;
|
||||
}
|
||||
if (CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50) // 8 seconds before DoG returns
|
||||
{
|
||||
music = GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss;
|
||||
priority = MusicPriority.BossMedium;
|
||||
}
|
||||
|
||||
// This section handles boss rush music. However, at the time of PR-ing the boss rush visuals branch not all
|
||||
// of the boss rush themes have been completed. As such, the custom music is intentionally omitted for the time being.
|
||||
/*
|
||||
// This section handles boss rush music. However, at the time of PR-ing the boss rush visuals branch not all
|
||||
// of the boss rush themes have been completed. As such, the custom music is intentionally omitted for the time being.
|
||||
/*
|
||||
if (BossRushEvent.BossRushActive && BossRushEvent.StartTimer >= BossRushEvent.StartEffectTotalTime)
|
||||
{
|
||||
music = BossRushEvent.MusicToPlay;
|
||||
priority = MusicPriority.BossHigh;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
+1408
-1539
File diff suppressed because it is too large.
Load diff
+980
-1016
File diff suppressed because it is too large.
Load diff
@@ -99,8 +99,13 @@ namespace CalamityMod.Items
|
||||
{ ItemID.ChristmasTreeSword, Do(AutoReuse, UseTurn, DamageExact(155)) },
|
||||
{ ItemID.ClingerStaff, Do(DamageRatio(1.33f)) },
|
||||
{ ItemID.ClockworkAssaultRifle, pointBlank },
|
||||
{ ItemID.CobaltBreastplate, Do(DefenseDelta(+3)) },
|
||||
{ ItemID.CobaltChainsaw, Do(TrueMelee, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) },
|
||||
{ ItemID.CobaltDrill, Do(TrueMelee, PickPower(130), UseTimeExact(5)) },
|
||||
{ ItemID.CobaltHat, Do(DefenseDelta(+2)) },
|
||||
{ ItemID.CobaltHelmet, Do(DefenseDelta(+5)) },
|
||||
{ ItemID.CobaltLeggings, Do(DefenseDelta(+3)) },
|
||||
{ ItemID.CobaltMask, Do(DefenseDelta(+3)) },
|
||||
{ ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(90)) },
|
||||
{ ItemID.CobaltPickaxe, Do(PickPower(130), UseTimeExact(9)) },
|
||||
{ ItemID.CobaltRepeater, Do(PointBlank, DamageRatio(1.1f)) },
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class CobaltArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.CobaltHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.CobaltBreastplate;
|
||||
|
||||
public override int? LegPieceID => ItemID.CobaltLeggings;
|
||||
|
||||
public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.CobaltHat, ItemID.CobaltMask };
|
||||
|
||||
public override string ArmorSetName => "Cobalt";
|
||||
|
||||
public const int SpeedBoostSetBonusPercentage = 15;
|
||||
public const int MaxManaBoost = 20;
|
||||
public const int MovementSpeedBoostPercentageMax = 15;
|
||||
public const int MovementSpeedBoostMphThreshold = 60;
|
||||
|
||||
public override void ApplyHeadPieceEffect(Player player)
|
||||
{
|
||||
if (player.armor[0].type == ItemID.CobaltHat)
|
||||
player.statManaMax2 += MaxManaBoost;
|
||||
}
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += $"\n{SpeedBoostSetBonusPercentage}% increased max speed and acceleration\n" +
|
||||
$"You gain a damage and critical strike chance boost relative to your current movement speed, up to {SpeedBoostSetBonusPercentage}%";
|
||||
}
|
||||
|
||||
public static float CalculateMovementSpeedInterpolant(Player player)
|
||||
{
|
||||
float milesPerHour = player.velocity.Length() * 225f / 44f;
|
||||
float movementSpeedInterpolant = Utils.InverseLerp(0f, MovementSpeedBoostMphThreshold, milesPerHour, true);
|
||||
return (float)Math.Pow(movementSpeedInterpolant, 5D / 3D);
|
||||
}
|
||||
|
||||
public static void ApplyMovementSpeedBonuses(Player player)
|
||||
{
|
||||
float movementSpeedInterpolant = CalculateMovementSpeedInterpolant(player);
|
||||
player.allDamage += MovementSpeedBoostPercentageMax * movementSpeedInterpolant * 0.01f;
|
||||
player.Calamity().AllCritBoost((int)(MovementSpeedBoostPercentageMax * movementSpeedInterpolant));
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.Calamity().CobaltSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class CopperArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.CopperHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.CopperChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.CopperGreaves;
|
||||
|
||||
public override string ArmorSetName => "Copper";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 15;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class EskimoArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.EskimoHood;
|
||||
|
||||
public override int? BodyPieceID => ItemID.EskimoCoat;
|
||||
|
||||
public override int? LegPieceID => ItemID.EskimoPants;
|
||||
|
||||
// The normal and Pink Eskimo set can be mixed and matched.
|
||||
public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.PinkEskimoHood };
|
||||
|
||||
public override int[] AlternativeBodyPieceIDs => new int[] { ItemID.PinkEskimoCoat };
|
||||
|
||||
public override int[] AlternativeLegPieceIDs => new int[] { ItemID.PinkEskimoPants };
|
||||
|
||||
public override bool NeedsToCreateSetBonusTextManually => true;
|
||||
|
||||
public override string ArmorSetName => "Eskimo";
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
string coldImmunity = CalamityWorld.death ? "\nProvides cold protection in Death Mode" : string.Empty;
|
||||
setBonusText = "All ice-themed damage over time debuffs receive a 50% damage bonus\n" +
|
||||
"Cold enemies will deal reduced contact damage to the player\n" +
|
||||
"Provides immunity to the Frostburn and Glacial State debuffs" + coldImmunity;
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.Calamity().eskimoSet = true;
|
||||
player.buffImmune[BuffID.Frostburn] = true;
|
||||
player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class GladiatorArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.GladiatorHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.GladiatorBreastplate;
|
||||
|
||||
public override int? LegPieceID => ItemID.GladiatorLeggings;
|
||||
|
||||
public override string ArmorSetName => "Gladiator";
|
||||
|
||||
public override bool NeedsToCreateSetBonusTextManually => true;
|
||||
|
||||
public const int HelmetRogueDamageBoostPercent = 3;
|
||||
public const int ChestplateRogueCritBoostPercent = 3;
|
||||
public const int LeggingRogueVelocityBoostPercent = 3;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText = "+3 defense\n" +
|
||||
"5% increased rogue damage and 10% increased velocity\n" +
|
||||
"Rogue stealth builds while not attacking and not moving, up to a max of 70\n" +
|
||||
"Once you have built max stealth, you will be able to perform a Stealth Strike\n" +
|
||||
"Rogue stealth only reduces when you attack, it does not reduce while moving\n" +
|
||||
"The higher your rogue stealth the higher your rogue damage, crit, and movement speed";
|
||||
}
|
||||
|
||||
public override void ApplyHeadPieceEffect(Player player)
|
||||
{
|
||||
player.Calamity().throwingDamage += HelmetRogueDamageBoostPercent * 0.01f;
|
||||
}
|
||||
|
||||
public override void ApplyBodyPieceEffect(Player player)
|
||||
{
|
||||
player.Calamity().throwingCrit += ChestplateRogueCritBoostPercent;
|
||||
}
|
||||
|
||||
public override void ApplyLegPieceEffect(Player player)
|
||||
{
|
||||
player.Calamity().throwingVelocity += LeggingRogueVelocityBoostPercent * 0.01f;
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.Calamity().rogueStealthMax += 0.7f;
|
||||
player.Calamity().wearingRogueArmor = true;
|
||||
player.Calamity().throwingDamage += 0.05f;
|
||||
player.Calamity().throwingVelocity += 0.1f;
|
||||
player.statDefense += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class GoldArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.GoldHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.GoldChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.GoldGreaves;
|
||||
|
||||
public override string ArmorSetName => "Gold";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 45;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class IronArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.IronHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.IronChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.IronGreaves;
|
||||
|
||||
public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.AncientIronHelmet };
|
||||
|
||||
public override string ArmorSetName => "Iron";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 25;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class LeadArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.LeadHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.LeadChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.LeadGreaves;
|
||||
|
||||
public override string ArmorSetName => "Lead";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 20;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class MeteorArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.MeteorHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.MeteorSuit;
|
||||
|
||||
public override int? LegPieceID => ItemID.MeteorLeggings;
|
||||
|
||||
public override string ArmorSetName => "Meteor";
|
||||
|
||||
// Meteor Armor only makes space gun cost 50% instead of zero mana.
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText = setBonusText.Replace("0", "50%");
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.spaceGun = false;
|
||||
player.Calamity().meteorSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class MoltenArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.TinHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.TinChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.TinGreaves;
|
||||
|
||||
public override string ArmorSetName => "Molten";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 10;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
string extraLine = "\n20% extra true melee damage\nGrants immunity to fire blocks and temporary immunity to lava";
|
||||
if (CalamityWorld.death)
|
||||
extraLine += CalamityGlobalItem.BothProtectionLine;
|
||||
setBonusText += extraLine;
|
||||
}
|
||||
|
||||
// TODO - The death mode immuntities are hardcoded in the misc player effects file. Perhaps make it into a generalized bool?
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.fireWalk = true;
|
||||
player.lavaMax += 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class MonkT2ArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.MonkBrows;
|
||||
|
||||
public override int? BodyPieceID => ItemID.MonkShirt;
|
||||
|
||||
public override int? LegPieceID => ItemID.MonkPants;
|
||||
|
||||
public override string ArmorSetName => "MonkTier2";
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += "\n10% increased melee speed, crit, and damage\n" +
|
||||
"15% increased minion damage";
|
||||
}
|
||||
|
||||
public override void ApplyHeadPieceEffect(Player player)
|
||||
{
|
||||
player.meleeSpeed -= 0.1f;
|
||||
}
|
||||
|
||||
public override void ApplyBodyPieceEffect(Player player)
|
||||
{
|
||||
player.minionDamage -= 0.1f;
|
||||
player.meleeDamage -= 0.1f;
|
||||
}
|
||||
|
||||
public override void ApplyLegPieceEffect(Player player)
|
||||
{
|
||||
player.minionDamage -= 0.05f;
|
||||
player.meleeCrit -= 10;
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.minionDamage += 0.15f;
|
||||
player.meleeDamage += 0.1f;
|
||||
player.meleeSpeed += 0.1f;
|
||||
player.meleeCrit += 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class ObsidianArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.ObsidianHelm;
|
||||
|
||||
public override int? BodyPieceID => ItemID.ObsidianShirt;
|
||||
|
||||
public override int? LegPieceID => ItemID.ObsidianPants;
|
||||
|
||||
public override string ArmorSetName => "Obsidian";
|
||||
|
||||
public override bool NeedsToCreateSetBonusTextManually => true;
|
||||
|
||||
public const int HelmetRogueDamageBoostPercent = 3;
|
||||
public const int ChestplateRogueCritBoostPercent = 3;
|
||||
public const int LeggingRogueVelocityBoostPercent = 3;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
string heatImmunity = CalamityWorld.death ? "\nProvides heat protection in Death Mode" : string.Empty;
|
||||
setBonusText = "+2 defense\n" +
|
||||
"5% increased rogue damage and critical strike chance\n" +
|
||||
"Grants immunity to fire blocks and temporary immunity to lava\n" +
|
||||
"Rogue stealth builds while not attacking and not moving, up to a max of 80\n" +
|
||||
"Once you have built max stealth, you will be able to perform a Stealth Strike\n" +
|
||||
"Rogue stealth only reduces when you attack, it does not reduce while moving\n" +
|
||||
"The higher your rogue stealth the higher your rogue damage, crit, and movement speed" + heatImmunity;
|
||||
}
|
||||
|
||||
public override void ApplyHeadPieceEffect(Player player)
|
||||
{
|
||||
player.Calamity().throwingDamage += HelmetRogueDamageBoostPercent * 0.01f;
|
||||
}
|
||||
|
||||
public override void ApplyBodyPieceEffect(Player player)
|
||||
{
|
||||
player.Calamity().throwingCrit += ChestplateRogueCritBoostPercent;
|
||||
}
|
||||
|
||||
public override void ApplyLegPieceEffect(Player player)
|
||||
{
|
||||
player.Calamity().throwingVelocity += LeggingRogueVelocityBoostPercent * 0.01f;
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.Calamity().rogueStealthMax += 0.8f;
|
||||
player.Calamity().wearingRogueArmor = true;
|
||||
player.Calamity().throwingDamage += 0.05f;
|
||||
player.Calamity().throwingCrit += 5;
|
||||
player.statDefense += 2;
|
||||
player.fireWalk = true;
|
||||
player.lavaMax += 180;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class PlatinumArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.PlatinumHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.PlatinumChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.PlatinumGreaves;
|
||||
|
||||
public override string ArmorSetName => "Platinum";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 40;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class SilverArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.SilverHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.SilverChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.SilverGreaves;
|
||||
|
||||
public override string ArmorSetName => "Silver";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 35;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class StardustArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.StardustHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.StardustBreastplate;
|
||||
|
||||
public override int? LegPieceID => ItemID.StardustLeggings;
|
||||
|
||||
public override string ArmorSetName => "Stardust";
|
||||
|
||||
public override void ApplyBodyPieceEffect(Player player)
|
||||
{
|
||||
player.maxMinions--;
|
||||
}
|
||||
|
||||
public override void ApplyLegPieceEffect(Player player)
|
||||
{
|
||||
player.maxMinions--;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class TinArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.TinHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.TinChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.TinGreaves;
|
||||
|
||||
public override string ArmorSetName => "Tin";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 10;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public class TungstenArmorSetChange : VanillaArmorChange
|
||||
{
|
||||
public override int? HeadPieceID => ItemID.TungstenHelmet;
|
||||
|
||||
public override int? BodyPieceID => ItemID.TungstenChainmail;
|
||||
|
||||
public override int? LegPieceID => ItemID.TungstenGreaves;
|
||||
|
||||
public override string ArmorSetName => "Tungsten";
|
||||
|
||||
public const int MiningSpeedPercentSetBonus = 30;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += CalamityGlobalItem.MiningSpeedString(MiningSpeedPercentSetBonus);
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player) => player.pickSpeed -= MiningSpeedPercentSetBonus * 0.01f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
// Certain things are virtual instead of abstract because not all pieces of armor are explicitly a part of any particular set.
|
||||
// The Wizard Hat is an example of this. The IDs are left abstract so that you don't mistakenly forget to override one of them.
|
||||
public abstract class VanillaArmorChange
|
||||
{
|
||||
public abstract int? HeadPieceID { get; }
|
||||
|
||||
public abstract int? BodyPieceID { get; }
|
||||
|
||||
public abstract int? LegPieceID { get; }
|
||||
|
||||
public virtual int[] AlternativeHeadPieceIDs => new int[0];
|
||||
|
||||
public virtual int[] AlternativeBodyPieceIDs => new int[0];
|
||||
|
||||
public virtual int[] AlternativeLegPieceIDs => new int[0];
|
||||
|
||||
public virtual string ArmorSetName => null;
|
||||
|
||||
public virtual bool NeedsToCreateSetBonusTextManually => false;
|
||||
|
||||
public virtual void UpdateSetBonusText(ref string setBonusText) { }
|
||||
|
||||
public virtual void ApplyHeadPieceEffect(Player player) { }
|
||||
|
||||
public virtual void ApplyBodyPieceEffect(Player player) { }
|
||||
|
||||
public virtual void ApplyLegPieceEffect(Player player) { }
|
||||
|
||||
public virtual void ApplyArmorSetBonus(Player player) { }
|
||||
|
||||
public bool IsWearingEntireSet(Player player)
|
||||
{
|
||||
// Check each individual piece of armor on the player with the respective expected item ID.
|
||||
// If no ID is applied/it's null, that signals that it doesn't matter, and to just fall through anyway.
|
||||
if ((HeadPieceID ?? player.armor[0].type) != player.armor[0].type && !AlternativeHeadPieceIDs.Contains(player.armor[0].type))
|
||||
return false;
|
||||
if ((BodyPieceID ?? player.armor[1].type) != player.armor[1].type && !AlternativeBodyPieceIDs.Contains(player.armor[1].type))
|
||||
return false;
|
||||
if ((LegPieceID ?? player.armor[2].type) != player.armor[2].type && !AlternativeLegPieceIDs.Contains(player.armor[2].type))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ApplyIndividualPieceEffects(Player player)
|
||||
{
|
||||
if ((HeadPieceID ?? ItemID.None) == player.armor[0].type || AlternativeHeadPieceIDs.Contains(player.armor[0].type))
|
||||
ApplyHeadPieceEffect(player);
|
||||
if ((HeadPieceID ?? ItemID.None) == player.armor[1].type || AlternativeBodyPieceIDs.Contains(player.armor[1].type))
|
||||
ApplyBodyPieceEffect(player);
|
||||
if ((HeadPieceID ?? ItemID.None) == player.armor[2].type || AlternativeLegPieceIDs.Contains(player.armor[2].type))
|
||||
ApplyLegPieceEffect(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Items.VanillaArmorChanges
|
||||
{
|
||||
public static class VanillaArmorChangeManager
|
||||
{
|
||||
internal static List<VanillaArmorChange> ArmorChanges;
|
||||
|
||||
internal static void Load()
|
||||
{
|
||||
ArmorChanges = new List<VanillaArmorChange>();
|
||||
foreach (Type type in CalamityMod.Instance.Code.GetTypes())
|
||||
{
|
||||
if (!type.IsSubclassOf(typeof(VanillaArmorChange)) || type.IsAbstract)
|
||||
continue;
|
||||
|
||||
ArmorChanges.Add((VanillaArmorChange)FormatterServices.GetUninitializedObject(type));
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Unload() => ArmorChanges = null;
|
||||
|
||||
public static void ApplySetBonusTooltipChanges(Item checkItem, ref string setBonusText)
|
||||
{
|
||||
for (int i = 0; i < ArmorChanges.Count; i++)
|
||||
{
|
||||
bool isValidHeadPiece = (ArmorChanges[i].HeadPieceID ?? ItemID.None) == checkItem.type ||
|
||||
ArmorChanges[i].AlternativeHeadPieceIDs.Contains(checkItem.type);
|
||||
bool isValidBodyPiece = (ArmorChanges[i].BodyPieceID ?? ItemID.None) == checkItem.type ||
|
||||
ArmorChanges[i].AlternativeBodyPieceIDs.Contains(checkItem.type);
|
||||
bool isValidLegPiece = (ArmorChanges[i].LegPieceID ?? ItemID.None) == checkItem.type ||
|
||||
ArmorChanges[i].AlternativeLegPieceIDs.Contains(checkItem.type);
|
||||
if (isValidHeadPiece || isValidBodyPiece || isValidLegPiece)
|
||||
ArmorChanges[i].UpdateSetBonusText(ref setBonusText);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateTooltipManuallyAsNecessary(Player player)
|
||||
{
|
||||
for (int i = 0; i < ArmorChanges.Count; i++)
|
||||
{
|
||||
if (ArmorChanges[i].IsWearingEntireSet(player) && ArmorChanges[i].NeedsToCreateSetBonusTextManually)
|
||||
{
|
||||
ArmorChanges[i].UpdateSetBonusText(ref player.setBonus);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetSetBonusName(Player player)
|
||||
{
|
||||
for (int i = 0; i < ArmorChanges.Count; i++)
|
||||
{
|
||||
if (ArmorChanges[i].IsWearingEntireSet(player))
|
||||
return ArmorChanges[i].ArmorSetName;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static void ApplyPotentialEffectsTo(Player player)
|
||||
{
|
||||
// Look through every armor change, apply individual set piece effects if pieces are being worn, and
|
||||
// if the entire set is worn, apply the set bonus.
|
||||
for (int i = 0; i < ArmorChanges.Count; i++)
|
||||
{
|
||||
ArmorChanges[i].ApplyIndividualPieceEffects(player);
|
||||
if (ArmorChanges[i].IsWearingEntireSet(player))
|
||||
ArmorChanges[i].ApplyArmorSetBonus(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user