Files
CalamityModPublic/CalamityConfig.cs
T
Altixal f408d6fffb 53 left
- Another StrikeNPC fix
- Removed IL editing unloads
- Adjusted config item icon injection
- rocketDamage -> specialistDamage
- Fixed the blatantly wrong tooltip on Hoverboard
2023-05-19 22:26:20 +07:00

377 lines
16 KiB
C#

using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.Serialization;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.DifficultyItems;
using CalamityMod.Items.DraedonMisc;
using CalamityMod.Items.Dyes.HairDye;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.UI;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
using CalamityMod.Items.PermanentBoosters;
using CalamityMod.UI.Rippers;
using CalamityMod.UI.DraedonsArsenal;
using CalamityMod.UI.SulphurousWaterMeter;
using CalamityMod.Items.Tools.ClimateChange;
namespace CalamityMod
{
[Label("$Mods.CalamityMod.Config.MainTitle")]
[BackgroundColor(49, 32, 36, 216)]
public class CalamityConfig : ModConfig
{
public static CalamityConfig Instance;
// TODO -- Not all Calamity config settings should be considered client side.
// There are many configs which are server side and should stay that way.
public override ConfigScope Mode => ConfigScope.ClientSide;
public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message) => true;
// Clamps values that would cause ugly problems if loaded directly without sanitization.
[OnDeserialized]
internal void ClampValues(StreamingContext context)
{
BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
RipperMeterShake = Utils.Clamp(RipperMeterShake, MinMeterShake, MaxMeterShake);
}
#region Graphics Changes
[Header("$Mods.CalamityMod.Config.SectionTitle.Graphics")]
[Label("$Mods.CalamityMod.Config.EntryTitle.Afterimages")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.Afterimages")]
public bool Afterimages { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ParticleLimit")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0, 1000)]
[DefaultValue(500)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ParticleLimit")]
public int ParticleLimit { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.BossesStopWeather")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.BossesStopWeather")]
public bool BossesStopWeather { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.Screenshake")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.Screenshake")]
public bool Screenshake { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.StealthInvisibility")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.StealthInvisibility")]
public bool StealthInvisibility { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ShopNewAlert")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ShopNewAlert")]
public bool ShopNewAlert { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.WikiStatusMessage")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.WikiStatusMessage")]
public bool WikiStatusMessage { get; set; }
#endregion
#region UI Changes
[Header("$Mods.CalamityMod.Config.SectionTitle.UI")]
[Label("$Mods.CalamityMod.Config.EntryTitle.BossHealthBarExtraInfo")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.BossHealthBarExtraInfo")]
public bool BossHealthBarExtraInfo { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.DebuffDisplay")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.DebuffDisplay")]
public bool DebuffDisplay { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.CooldownDisplay")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 2f)]
[DefaultValue(2f)]
[Increment(1f)]
[DrawTicks]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.CooldownDisplay")]
public float CooldownDisplay { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.VanillaCooldownDisplay")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.VanillaCooldownDisplay")]
public bool VanillaCooldownDisplay { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[Label("$Mods.CalamityMod.Config.EntryTitle.MeterPosLock")]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.MeterPosLock")]
public bool MeterPosLock { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.StealthMeter")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.StealthMeter")]
public bool StealthMeter { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.StealthMeterPosX")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(StealthUI.DefaultStealthPosX)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.StealthMeterPosX")]
public float StealthMeterPosX { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.StealthMeterPosY")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(StealthUI.DefaultStealthPosY)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.StealthMeterPosY")]
public float StealthMeterPosY { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.SulphuricWaterMeterPosX")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(SulphurousWaterMeterUI.DefaultPosX)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SulphuricWaterMeterPosX")]
public float SulphuricWaterMeterPosX { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.SulphuricWaterMeterPosY")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(SulphurousWaterMeterUI.DefaultPosY)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SulphuricWaterMeterPosY")]
public float SulphuricWaterMeterPosY { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ChargeMeter")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ChargeMeter")]
public bool ChargeMeter { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ChargeMeterPosX")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(ChargeMeterUI.DefaultChargePosX)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ChargeMeterPosX")]
public float ChargeMeterPosX { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ChargeMeterPosY")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(ChargeMeterUI.DefaultChargePosY)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ChargeMeterPosY")]
public float ChargeMeterPosY { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.SpeedrunTimer")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SpeedrunTimer")]
public bool SpeedrunTimer { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.SpeedrunTimerPosX")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(SpeedrunTimerUI.DefaultTimerPosX)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SpeedrunTimerPosX")]
public float SpeedrunTimerPosX { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.SpeedrunTimerPosY")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(SpeedrunTimerUI.DefaultTimerPosY)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SpeedrunTimerPosY")]
public float SpeedrunTimerPosY { get; set; }
#endregion
#region General Gameplay Changes
[Header("$Mods.CalamityMod.Config.SectionTitle.Gameplay")]
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterFallHotkey")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterFallHotkey")]
public bool FasterFallHotkey { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.RemoveReforgeRNG")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.RemoveReforgeRNG")]
public bool RemoveReforgeRNG { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.EarlyHardmodeProgressionRework")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.EarlyHardmodeProgressionRework")]
public bool EarlyHardmodeProgressionRework { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.BossZen")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.BossZen")]
public bool BossZen { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.PotionSelling")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.PotionSelling")]
public bool PotionSelling { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.TownNPCsSpawnAtNight")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.TownNPCsSpawnAtNight")]
public bool TownNPCsSpawnAtNight { get; set; }
private const int MinTownNPCSpawnMultiplier = 1;
private const int MaxTownNPCSpawnMultiplier = 10;
[Label("$Mods.CalamityMod.Config.EntryTitle.TownNPCSpawnRateMultiplier")]
[BackgroundColor(192, 54, 64, 192)]
[Range(MinTownNPCSpawnMultiplier, MaxTownNPCSpawnMultiplier)]
[Increment(1)]
[DrawTicks]
[DefaultValue(MinTownNPCSpawnMultiplier)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.TownNPCSpawnRateMultiplier")]
public int TownNPCSpawnRateMultiplier { get; set; }
private const float MinBossHealthBoost = 0f;
private const float MaxBossHealthBoost = 900f;
[Label("$Mods.CalamityMod.Config.EntryTitle.BossHealthBoost")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(MinBossHealthBoost, MaxBossHealthBoost)]
[Increment(25f)]
[DrawTicks]
[DefaultValue(MinBossHealthBoost)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.BossHealthBoost")]
public float BossHealthBoost { get; set; }
#endregion
#region Default Player Stat Boosts
[Header("$Mods.CalamityMod.Config.SectionTitle.BaseBoosts")]
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterBaseSpeed")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterBaseSpeed")]
public bool FasterBaseSpeed { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.HigherJumpHeight")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.HigherJumpHeight")]
public bool HigherJumpHeight { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterJumpSpeed")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterJumpSpeed")]
public bool FasterJumpSpeed { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterTilePlacement")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterTilePlacement")]
public bool FasterTilePlacement { get; set; }
#endregion
#region Expert and Master Mode Changes
[Header("$Mods.CalamityMod.Config.SectionTitle.ExpertMaster")]
[Label("$Mods.CalamityMod.Config.EntryTitle.NerfExpertDebuffs")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.NerfExpertDebuffs")]
public bool NerfExpertDebuffs { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ChilledWaterRework")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ChilledWaterRework")]
public bool ChilledWaterRework { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.ForceTownSafety")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ForceTownSafety")]
public bool ForceTownSafety { get; set; }
#endregion
#region Revengeance Mode Changes
[Header("$Mods.CalamityMod.Config.SectionTitle.Revengeance")]
private const float MinMeterShake = 0f;
private const float MaxMeterShake = 4f;
[Label("$Mods.CalamityMod.Config.EntryTitle.RipperMeterShake")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(MinMeterShake, MaxMeterShake)]
[Increment(1f)]
[DrawTicks]
[DefaultValue(2f)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.RipperMeterShake")]
public float RipperMeterShake { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.RageMeterPosX")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(RipperUI.DefaultRagePosX)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.RageMeterPosX")]
public float RageMeterPosX { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.RageMeterPosY")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(RipperUI.DefaultRagePosY)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.RageMeterPosY")]
public float RageMeterPosY { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.AdrenalineMeterPosX")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(RipperUI.DefaultAdrenPosX)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.AdrenalineMeterPosX")]
public float AdrenalineMeterPosX { get; set; }
[Label("$Mods.CalamityMod.Config.EntryTitle.AdrenalineMeterPosY")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
[DefaultValue(RipperUI.DefaultAdrenPosY)]
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.AdrenalineMeterPosY")]
public float AdrenalineMeterPosY { get; set; }
#endregion
}
}