public override void Load() { //SoulLinkKey = RegisterHotKey("SoulLink", "E"); bashKey = RegisterHotKey("Bash", "Mouse2"); dashKey = RegisterHotKey("Dash", "LeftControl"); climbKey = RegisterHotKey("Climbing", "LeftShift"); featherKey = RegisterHotKey("Feather", "LeftShift"); chargeKey = RegisterHotKey("Charge", "W"); burrowKey = RegisterHotKey("Burrow", "LeftControl"); if (!Main.dedServ) { AddEquipTexture(null, EquipType.Head, "OriHead", "OriMod/PlayerEffects/OriHead"); } SeinData.Load(); }
/// <summary> /// Loads all Sein variants. Sein stats are hardcoded into this method. /// </summary> /// <remarks> /// Okay, no matter how many times I try to refactor this, I don't think it can be organized any better. /// <para>1. Memory is always only ever using 8 <see cref="SeinData"/>s, or however many is in <see cref="All"/>. Not too big a deal though.</para> /// <para>2. Readability. I feel that this is the best setup for a few reasons.</para> /// <para>2a. It's all in one file rather than multiple derived classes for easy comparison.</para> /// <para>2b. Only the changes/upgrades are shown, rather than having redundant data. The same could be accomplished with inheritance, but I'd rather not have 8 levels of it.</para> /// </remarks> internal static void Load() { SeinData defaultSein = new SeinData(); var fields = typeof(SeinData).GetFields(); var list = new List <SeinData>(); void AddNewSein(SeinData newSein) { SeinData lastSein = list.Count == 0 ? new SeinData() : list[list.Count - 1]; foreach (FieldInfo field in fields) { object defVal = field.GetValue(defaultSein); object oldVal = field.GetValue(lastSein); object newVal = field.GetValue(newSein); // If value is specified in constructor, use it // If value is unspecified, use value of previous upgrade if (newVal.ToString() == defVal.ToString()) { newVal = oldVal; } field.SetValue(newSein, newVal); } list.Add(newSein); //OriMod.Log.Debug(newSein.CalculateStuff(tierName)); } // Tier 1 (Silver) AddNewSein(new SeinData()); // Tier 2 (Demonite/Crimtane) // Increased shots per burst // Max damage per burst: 15 AddNewSein(new SeinData { rarity = ItemRarityID.Green, value = 3000, color = new Color(108, 92, 172), damage = 24, targets = 1, bursts = 3, projectileSpeedStart = 9f, homingIncreaseRate = 0.05f, dustScale = 1.8f, lightStrength = 1.6f, }); // Tier 3 (Hellstone) // 2 targets // Max damage per burst: 42 // For some sort of "rage" effect to pair with red theme, lower CD AddNewSein(new SeinData { rarity = ItemRarityID.Orange, value = 10000, color = new Color(240, 0, 0, 194), damage = 29, targets = 2, maxShotsAtOnce = 2, randDegrees = 100, cooldownMin = 5, cooldownShort = 16, cooldownLong = 35, projectileSpeedStart = 12.5f, projectileSpeedIncreaseRate = 0.7f, projectileSpeedIncreaseDelay = 10, targetMaxDist = 370f, dustScale = 2f, lightStrength = 1.275f, }); // Tier 4 (Mythril/Orichalcum) // 2 targets, 2 shots to primary, 3 shots max (rather than 4) // Max damage per burst: 81 AddNewSein(new SeinData { rarity = ItemRarityID.LightRed, value = 25000, color = new Color(185, 248, 248), damage = 33, shotsToPrimaryTarget = 2, maxShotsAtOnce = 3, randDegrees = 60, cooldownMin = 11, cooldownShort = 25, cooldownLong = 40, projectileSpeedStart = 13.5f, homingIncreaseRate = 0.06f, homingIncreaseDelay = 20, dustScale = 2.2f, lightStrength = 1.2f, }); // Tier 5 (Hallow) // 3 targets, 2 shots to primary, 4 shots max (rather than 5) // Max damage per burst: 132 AddNewSein(new SeinData { rarity = ItemRarityID.Pink, value = 50000, color = new Color(255, 228, 160), damage = 37, targets = 3, maxShotsAtOnce = 4, homingIncreaseDelay = 17, targetMaxDist = 440f, dustScale = 2.4f, lightStrength = 1.4f, }); // Tier 6 (Spectral) // 3 targets, 3 shots to primary, 5 shots max // Max damage per burst: 195 AddNewSein(new SeinData { rarity = ItemRarityID.Yellow, value = 100000, color = new Color(0, 180, 174, 210), damage = 42, shotsToPrimaryTarget = 3, maxShotsAtOnce = 5, cooldownMin = 12, cooldownShort = 26, cooldownLong = 52, targetThroughWallDist = 224f, homingIncreaseRate = 0.07f, projectileSpeedStart = 15f, projectileSpeedIncreaseRate = 0.85f, projectileSpeedIncreaseDelay = 14, randDegrees = 70, dustScale = 2.65f, lightStrength = 2.25f, }); // Tier 7 (Lunar) // 4 targets, 3 shots to primary, 2 to others, 6 shots max (rather than 9) // Max damage per burst: 282 AddNewSein(new SeinData { rarity = ItemRarityID.Cyan, value = 250000, color = new Color(78, 38, 102), damage = 47, targets = 4, shotsToPrimaryTarget = 3, shotsPerTarget = 2, maxShotsAtOnce = 9, homingIncreaseRate = 0.025f, projectileSpeedStart = 16f, targetMaxDist = 510f, randDegrees = 120, dustScale = 3f, lightStrength = 4.5f, }); // Tier 8 (Lunar Bars) // 5 targets, 4 shots to primary, 2 shots to others, 10 shots max (rather than 12) // Max damage per burst: 530 (too high?) AddNewSein(new SeinData { rarity = ItemRarityID.Red, value = 500000, color = new Color(220, 220, 220), damage = 53, bursts = 4, targets = 6, shotsToPrimaryTarget = 4, maxShotsAtOnce = 10, cooldownMin = 16, cooldownShort = 24, cooldownLong = 55, homingStrengthStart = 0.05f, homingIncreaseDelay = 15, projectileSpeedStart = 20f, projectileSpeedIncreaseRate = 1.25f, projectileSpeedIncreaseDelay = 28, randDegrees = 180, targetMaxDist = 650f, targetThroughWallDist = 370f, dustScale = 3.35f, lightStrength = 2.5f, }); All = list.ToArray(); OriMod.OnUnload += Unload; }