From c6ad8731aeb2028f55a013d758178ceba74b9f85 Mon Sep 17 00:00:00 2001 From: XxFran10xX <318299142+XxFran10xX@users.noreply.github.com> Date: Sun, 4 Oct 2026 15:55:10 +0200 Subject: [PATCH] Fix school rune socket defaults and align live magic settings --- .../net/tfminecraft/magic/gear/GearCache.java | 2 +- .../magic/loader/ConfigLoader.java | 2 +- src/main/resources/config.yml | 12 +- src/main/resources/elements/elements.yml | 78 ++++---- src/main/resources/gear/archetypes.yml | 8 +- src/main/resources/gear/orbs.yml | 14 +- src/main/resources/gear/part-types.yml | 4 +- src/main/resources/gear/parts.yml | 102 +++++++--- src/main/resources/gear/socket-colours.yml | 9 +- src/main/resources/skills.yml | 181 +++++++++++++----- .../magic/BundledRuneConfigTest.java | 50 +++++ 11 files changed, 326 insertions(+), 136 deletions(-) create mode 100644 src/test/java/net/tfminecraft/magic/BundledRuneConfigTest.java diff --git a/src/main/java/net/tfminecraft/magic/gear/GearCache.java b/src/main/java/net/tfminecraft/magic/gear/GearCache.java index 10a033c..99452c2 100644 --- a/src/main/java/net/tfminecraft/magic/gear/GearCache.java +++ b/src/main/java/net/tfminecraft/magic/gear/GearCache.java @@ -14,7 +14,7 @@ public final class GearCache { public static boolean alignmentEnabled = false; /** When false, gem socket colour strings omit Common/Rare/Epic/Legendary prefix. */ - public static boolean socketRarityPrefix = true; + public static boolean socketRarityPrefix = false; /** Weapon tier band in the spell's element -> bonus. Never a penalty. */ private static final Map ALIGNMENT = new LinkedHashMap<>(); diff --git a/src/main/java/net/tfminecraft/magic/loader/ConfigLoader.java b/src/main/java/net/tfminecraft/magic/loader/ConfigLoader.java index ffc75e1..69065a5 100644 --- a/src/main/java/net/tfminecraft/magic/loader/ConfigLoader.java +++ b/src/main/java/net/tfminecraft/magic/loader/ConfigLoader.java @@ -173,7 +173,7 @@ private static void loadGear(ConfigurationSection section) { long confirm = section.getLong("confirm_seconds", 5L); net.tfminecraft.magic.gear.GearCache.confirmMillis = Math.max(1L, confirm) * 1000L; net.tfminecraft.magic.gear.GearCache.socketRarityPrefix = - section.getBoolean("socket_rarity_prefix", true); + section.getBoolean("socket_rarity_prefix", false); loadAlignment(section.getConfigurationSection("alignment")); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0a9a782..073ed4a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -28,12 +28,13 @@ equilibrium: 0: { mana: 0, damage: 0, cooldown: 0 } 100: { mana: -0.20, damage: 0.25, cooldown: -0.05 } -# Runes: MMOItems type ids (item-types.yml) that /magic rune keybind can rebind. -# keybinds: triggers a rune can be set to. The cast listener also treats them as a -# spell, besides CAST and API. A weapon still has to be attuned to the spell's element. +# School rune MMOItems type ids (item-types.yml) that /magic rune keybind can rebind. runes: types: - - GEM_STONE + - CERRITH_RUNES + - OSENI_RUNES + - SEITHR_RUNES + - MITLAN_RUNES keybinds: - RIGHT_CLICK - LEFT_CLICK @@ -109,7 +110,7 @@ gear: # When false, rune socket colours use only the archetype suffix (e.g. "Minor Rune") # without the band prefix (Common / Rare / Epic / Legendary). Band still gates attunement. - socket_rarity_prefix: true + socket_rarity_prefix: false # One-sided bonus for holding a weapon attuned to the element of the spell you cast. # Keyed by the weapon's tier band in that element. A weapon with no attunement in an @@ -136,4 +137,3 @@ gear: mana: 0.00 damage: 0.10 cooldown: -0.10 - diff --git a/src/main/resources/elements/elements.yml b/src/main/resources/elements/elements.yml index 2fef260..dbadffd 100644 --- a/src/main/resources/elements/elements.yml +++ b/src/main/resources/elements/elements.yml @@ -1,13 +1,13 @@ # Magic element catalog. Each element has a fixed GUI slot (0-53). -# color is one "#rrggbb", or a list of hex stops for a gradient across the name. # Row 2: Spirit (20), Arcanum (22), Illusion (24) # Row 3 (third from bottom): Cerrith, Seithr, Oseni, Mitlan # Row 4 (second from bottom): Shadowmancy, Necromancy, Bloodmagic cerrith: - name: Cerrith - icon: m.cerrith_runes.rune_of_cerrith_glyph - color: "#466629" + name: "Cerrith" + icon: m.icons.cerrith_rune + color: + - "#466629" slot: 28 aura_decay_per_hour: 0 resonance: @@ -15,9 +15,10 @@ cerrith: 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } seithr: - name: Seithr - icon: m.seithr_runes.rune_of_cold_embrace - color: "#15E5FF" + name: "Seithr" + icon: m.icons.seithr_rune + color: + - "#15E5FF" slot: 30 aura_decay_per_hour: 0 resonance: @@ -25,9 +26,10 @@ seithr: 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } oseni: - name: Oseni - icon: m.oseni_runes.rune_of_oseni_glyph - color: "#e29a00" + name: "Oseni" + icon: m.icons.oseni_rune + color: + - "#e29a00" slot: 32 aura_decay_per_hour: 0 resonance: @@ -35,9 +37,10 @@ oseni: 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } mitlan: - name: Mitlan - icon: v.LAPIS_LAZULI - color: "#5555ff" + name: "Mitlan" + icon: m.icons.mitlan_rune + color: + - "#3b8268" slot: 34 aura_decay_per_hour: 0 resonance: @@ -45,33 +48,33 @@ mitlan: 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } shadowmancy: - name: Shadowmancy - icon: v.INK_SAC - color: "#555555" + name: "Shadowmancy" + icon: m.icons.shadowmancy_rune + color: + - "#716f6f" slot: 40 - permission: magic.shadowmancy aura_decay_per_hour: 0 resonance: 0: { mana: 0.20, damage: -0.20, cooldown: 0.20 } 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } necromancy: - name: Necromancy - icon: v.WITHER_SKELETON_SKULL - color: "#00aaaa" + name: "Necromancy" + icon: m.icons.necromancy_rune + color: + - "#aa00aa" slot: 38 - permission: magic.necromancy aura_decay_per_hour: 0 resonance: 0: { mana: 0.20, damage: -0.20, cooldown: 0.20 } 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } arcanum: - name: Arcanum - icon: v.ENCHANTED_BOOK - color: "#aa00aa" + name: "Arcanum" + icon: m.icons.arcanum_rune + color: + - "#c471ed" slot: 22 - permission: magic.arcanum decay_per_hour: -0.035 aura_decay_per_hour: 0 resonance: @@ -79,33 +82,34 @@ arcanum: 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } spirit: - name: Spirit - icon: v.FEATHER - color: "#e8d5a3" + name: "Spirit" + icon: m.icons.spiritual_rune + color: + - "#67b26f" slot: 20 - permission: magic.spirit aura_decay_per_hour: 0 resonance: 0: { mana: 0.20, damage: -0.20, cooldown: 0.20 } 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } illusion: - name: Illusion - icon: v.ENDER_PEARL - color: "#e070b0" + name: "Illusion" + icon: m.icons.illusion_rune + color: + - "#feac5e" slot: 24 - permission: magic.illusion aura_decay_per_hour: 0 resonance: 0: { mana: 0.20, damage: -0.20, cooldown: 0.20 } 100: { mana: -0.20, damage: 0.20, cooldown: -0.20 } bloodmagic: - name: Bloodmagic - icon: v.REDSTONE - color: "#aa0000" - slot: 42 + name: "Bloodmagic" permission: magic.bloodmagic + icon: m.icons.bloodmagic_rune + color: + - "#d10202" + slot: 42 aura_decay_per_hour: 0 resonance: 0: { mana: 0.20, damage: -0.20, cooldown: 0.20 } diff --git a/src/main/resources/gear/archetypes.yml b/src/main/resources/gear/archetypes.yml index d949c13..c1603fb 100644 --- a/src/main/resources/gear/archetypes.yml +++ b/src/main/resources/gear/archetypes.yml @@ -1,12 +1,12 @@ # Mage weapon archetypes. Templates are TLibs MMOItems paths Fran owns. # slots: id -> TLibs colour suffix. Prefix comes from socket-colours.yml. -# Colour written = "{prefix} {suffix}", e.g. "Rare Staff Projectile Rune". +# By default only the suffix is written, matching the school runes' gem-color. # icon: ItemRef path for picker/assembly GUIs (v.MATERIAL, m.TYPE.ID, ia.namespace:id). staff: name: Staff template: m.mage_staffs.mage_custom_staff - icon: v.STICK + icon: m.mage_staffs.mage_custom_staff melee: false required: - core @@ -23,7 +23,7 @@ staff: wand: name: Wand template: m.mage_wands.mage_custom_wand - icon: v.BLAZE_ROD + icon: m.mage_wands.mage_custom_wand melee: false required: - core @@ -38,7 +38,7 @@ wand: sword: name: Sword template: m.mage_swords.mage_custom_sword - icon: v.IRON_SWORD + icon: m.mage_swords.mage_custom_sword melee: true required: - core diff --git a/src/main/resources/gear/orbs.yml b/src/main/resources/gear/orbs.yml index 891bb27..f91b6ed 100644 --- a/src/main/resources/gear/orbs.yml +++ b/src/main/resources/gear/orbs.yml @@ -49,7 +49,7 @@ rift: # Removed once when a later charge completes. Never applied on the first charge. per_recharge: 10 -# live: max orbs in the air at once +# live: max orbs in the air at once. The opening set, including rift orbs, spawns within spawn_burst_ticks. # good_ratio: chance a spawned orb is good # speed: angular speed multiplier # good_target: good hits needed for a full capture @@ -67,14 +67,14 @@ tiers: window_ticks: 260 good_target: 5 3: - live: 6 + live: 5 good_ratio: 0.55 speed: 1.15 window_ticks: 240 - good_target: 6 + good_target: 5 4: - live: 8 - good_ratio: 0.45 + live: 5 + good_ratio: 0.50 speed: 1.3 - window_ticks: 220 - good_target: 8 + window_ticks: 260 + good_target: 6 diff --git a/src/main/resources/gear/part-types.yml b/src/main/resources/gear/part-types.yml index 3b711e1..6bcf66f 100644 --- a/src/main/resources/gear/part-types.yml +++ b/src/main/resources/gear/part-types.yml @@ -11,7 +11,7 @@ tome: name: Tome tome2: slot: 13 - name: Tome2 + name: Tome II tome3: slot: 14 - name: Tome3 \ No newline at end of file + name: Tome III \ No newline at end of file diff --git a/src/main/resources/gear/parts.yml b/src/main/resources/gear/parts.yml index 8b0023e..91761d9 100644 --- a/src/main/resources/gear/parts.yml +++ b/src/main/resources/gear/parts.yml @@ -17,6 +17,8 @@ iron_staff_core: - m.currency.enchanted_dust(4) part-limit: - handle + stats: + - max_item_damage(500.0) sockets: {} lore: - "§7A basic magical core with one rune slot" @@ -35,6 +37,8 @@ steel_staff_core: part-limit: - handle - tome + stats: + - max_item_damage(1000.0) sockets: {} lore: - "§7A more advanced magical core with two rune slots" @@ -54,6 +58,8 @@ abyssalite_staff_core: - handle - tome - tome2 + stats: + - max_item_damage(2000.0) sockets: {} lore: - "§7An incredible magical core with three rune slots" @@ -74,6 +80,8 @@ mythril_staff_core: - tome - tome2 - tome3 + stats: + - max_item_damage(4000.0) sockets: {} lore: - "§7An insanely powerful magical core with four rune slots" @@ -92,9 +100,10 @@ iron_wand_core: part-limit: - handle stats: - - attack_damage(4) + - attack_damage(4.5) - attack_speed(1.2) - mana_cost(2) + - max_item_damage(500.0) sockets: {} lore: - "§7A basic magical core with one rune slot and a simple way of mana channeling" @@ -112,6 +121,11 @@ steel_wand_core: - m.currency.enchanted_dust(4) part-limit: - handle + stats: + - attack_damage(5.0) + - attack_speed(1.2) + - mana_cost(2) + - max_item_damage(1000.0) sockets: {} lore: - "§7An improved magical core with one rune slot and a better way of mana channeling" @@ -130,6 +144,11 @@ abyssalite_wand_core: part-limit: - handle - tome + stats: + - attack_damage(5.5) + - attack_speed(1.2) + - mana_cost(1) + - max_item_damage(2000.0) sockets: {} lore: - "§7A good magical core with two rune slots and an advanced way of mana channeling" @@ -152,6 +171,7 @@ mythril_wand_core: - attack_damage(6) - attack_speed(1.2) - mana_cost(1) + - max_item_damage(4000.0) sockets: {} lore: - "§7A great magical core with two rune slots and a powerful way of mana channeling" @@ -169,6 +189,10 @@ iron_sword_core: - m.currency.enchanted_dust(4) part-limit: - handle + stats: + - attack_damage(4.5) + - attack_speed(1.2) + - max_item_damage(500.0) sockets: {} lore: - "§7A basic magical core with one rune slot and a simple blade edge" @@ -186,6 +210,10 @@ steel_sword_core: - m.currency.enchanted_dust(4) part-limit: - handle + stats: + - attack_damage(5.0) + - attack_speed(1.2) + - max_item_damage(1000.0) sockets: {} lore: - "§7An improved magical core with one rune slot and a better blade edge" @@ -204,6 +232,10 @@ abyssalite_sword_core: part-limit: - handle - tome + stats: + - attack_damage(5.5) + - attack_speed(1.2) + - max_item_damage(2000.0) sockets: {} lore: - "§7A good magical core with two rune slots and an advanced blade edge" @@ -222,6 +254,10 @@ mythril_sword_core: part-limit: - handle - tome + stats: + - attack_damage(6.0) + - attack_speed(1.2) + - max_item_damage(4000.0) sockets: {} lore: - "§7A great magical core with two rune slots and a powerful blade edge" @@ -302,9 +338,9 @@ normal_oak_tome: - staff - wand - sword - item: v.book + item: m.materials.book cost: - - v.book(2) + - m.materials.book(2) lore: - "§7A mundane book with no effect" @@ -316,9 +352,9 @@ oak_tome: - staff - wand - sword - item: v.book + item: m.materials.book cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(2) sockets: minor_rune: 1 @@ -335,7 +371,7 @@ basic_tome: - sword item: m.materials.basic_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(4) sockets: lesser_rune: 1 @@ -352,7 +388,7 @@ petty_tome: - sword item: m.materials.petty_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(6) sockets: greater_rune: 1 @@ -369,7 +405,7 @@ heavy_tome: - sword item: m.materials.heavy_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(8) sockets: ascendant_rune: 1 @@ -382,11 +418,9 @@ normal_oak_tome2: tier: 1 type: - staff - - wand - - sword - item: v.book + item: m.materials.book cost: - - v.book(2) + - m.materials.book(2) lore: - "§7A mundane book with no effect" @@ -396,9 +430,9 @@ oak_tome2: tier: 1 type: - staff - item: v.book + item: m.materials.book cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(2) sockets: minor_rune: 1 @@ -413,7 +447,7 @@ basic_tome2: - staff item: m.materials.basic_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(4) sockets: lesser_rune: 1 @@ -428,7 +462,7 @@ petty_tome2: - staff item: m.materials.petty_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(6) sockets: greater_rune: 1 @@ -443,7 +477,7 @@ heavy_tome2: - staff item: m.materials.heavy_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(8) sockets: ascendant_rune: 1 @@ -456,11 +490,9 @@ normal_oak_tome3: tier: 1 type: - staff - - wand - - sword - item: v.book + item: m.materials.book cost: - - v.book(2) + - m.materials.book(2) lore: - "§7A mundane book with no effect" @@ -470,9 +502,9 @@ oak_tome3: tier: 1 type: - staff - item: v.book + item: m.materials.book cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(2) sockets: minor_rune: 1 @@ -487,7 +519,7 @@ basic_tome3: - staff item: m.materials.basic_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(4) sockets: lesser_rune: 1 @@ -502,7 +534,7 @@ petty_tome3: - staff item: m.materials.petty_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(6) sockets: greater_rune: 1 @@ -517,7 +549,7 @@ heavy_tome3: - staff item: m.materials.heavy_tome cost: - - v.book(2) + - m.materials.book(2) - m.currency.enchanted_dust(8) sockets: ascendant_rune: 1 @@ -525,3 +557,21 @@ heavy_tome3: - "§7An amazing tome capable of channeling ascendant runes" + +# Historical dev/tutorial ID: refresh existing weapons, hide from new crafts. +petty_tom32: + disabled: true + name: "§dPetty Magical Tome" + part-type: tome3 + tier: 3 + type: + - staff + item: m.materials.petty_tome + cost: + - m.materials.book(2) + - m.currency.enchanted_dust(6) + sockets: + greater_rune: 1 + lore: + - "§7An advanced tome capable of channeling greater runes" + diff --git a/src/main/resources/gear/socket-colours.yml b/src/main/resources/gear/socket-colours.yml index 4cbbaf5..930abfa 100644 --- a/src/main/resources/gear/socket-colours.yml +++ b/src/main/resources/gear/socket-colours.yml @@ -1,7 +1,6 @@ # Resonance band -> TLibs colour prefix. -# Colour string = prefix + " " + archetype slot suffix (when config gear.socket_rarity_prefix is true). -# Must match tlibs socket-tier-groups keys exactly. -# Set gear.socket_rarity_prefix: false in config.yml to write suffix only (no Common/Rare/Epic/Legendary). +# Prefix is used only when gear.socket_rarity_prefix is true (default: false). +# School runes use the suffix alone; it must match TLibs' mage_runes group exactly. prefix: default: Common @@ -15,8 +14,8 @@ labels: minor_rune: Minor Rune lesser_rune: Lesser Rune greater_rune: Greater Rune - asecandt_rune: Ascendant Rune + ascendant_rune: Ascendant Rune minor_armor_rune: Minor Armor Rune lesser_armor_rune: Lesser Armor Rune greater_armor_rune: Greater Armor Rune - asecandt_armor_rune: Ascendant Armor Rune + ascendant_armor_rune: Ascendant Armor Rune diff --git a/src/main/resources/skills.yml b/src/main/resources/skills.yml index c743332..68d6708 100644 --- a/src/main/resources/skills.yml +++ b/src/main/resources/skills.yml @@ -1,4 +1,4 @@ -# skill id -> element + tier (MythicLib / MMOItems). Jar does not overwrite a live copy. +# skill id -> element id (MythicLib / MMOItems). Jar does not overwrite a live copy. # # The id is the MythicLib skill handler id, lowercase, which is what an MMOItems # ability reports. Flat or nested both work: @@ -7,93 +7,180 @@ # # arcanum_bolt: # element: arcanum -# tier: 1 # -# element: which weapon imbue and player resonance gate the cast, and which alignment -# band the weapon contributes. A skill with no binding is never gated. -# -# tier: 1-4 (Minor / Lesser / Greater / Ascendant). The weapon must hold that element -# at this band, and the caster's resonance must meet the same band. Omitted tier is 1. +# The element decides two things: which weapon requirement gates the cast, and which +# alignment band the weapon contributes. A skill with no binding is never gated. #Cerrith Healing_Orb: - element: Cerrith - tier: 1 + element: Cerrith + tier: 1 Shielding_Orb: - element: Cerrith - tier: 1 + element: Cerrith + tier: 1 Hand_Cure: - element: Cerrith - tier: 2 + element: Cerrith + tier: 2 Blessing_Of_Swiftness: - element: Cerrith - tier: 2 + element: Cerrith + tier: 2 Cerrith_Glyph: - element: Cerrith - tier: 3 + element: Cerrith + tier: 3 Restoration: - element: Cerrith - tier: 3 + element: Cerrith + tier: 3 Blessing_Of_Healing: - element: Cerrith - tier: 4 + element: Cerrith + tier: 4 Mana_Transfer: - element: Cerrith - tier: 4 + element: Cerrith + tier: 4 + +#Temp +TEMP_Quickshot: + element: Cerrith + tier: 1 + +TEMP_Earth_Spike: + element: Cerrith + tier: 2 + +TEMP_Vine_Wave: + element: Cerrith + tier: 3 + +TEMP_Shock_Wave: + element: Cerrith + tier: 4 #Oseni Fire_Shard: - element: Oseni - tier: 1 + element: Oseni + tier: 1 Fire_Breath: - element: Oseni - tier: 2 + element: Oseni + tier: 2 Oseni_Glyph: - element: Oseni - tier: 3 + element: Oseni + tier: 3 Fire_Rain: - element: Oseni - tier: 4 + element: Oseni + tier: 4 + +#Temp +TEMP_Meteor: + element: Oseni + tier: 1 + +TEMP_Summon_Phoenix: + element: Oseni + tier: 2 + +TEMP_Last_Stand: + element: Oseni + tier: 3 + +TEMP_Blazing_Barrage: + element: Oseni + tier: 4 #Seithr Silencing_Shard: - element: Seithr - tier: 1 + element: Seithr + tier: 1 Ice_Shard: - element: Seithr - tier: 1 + element: Seithr + tier: 1 Ice_Shield: - element: Seithr - tier: 2 + element: Seithr + tier: 2 Ice_Wave: - element: Seithr - tier: 2 + element: Seithr + tier: 2 Seithr_Glyph: - element: Seithr - tier: 3 + element: Seithr + tier: 3 Cold_Embrace: - element: Seithr - tier: 3 + element: Seithr + tier: 3 Frostveil: - element: Seithr - tier: 4 + element: Seithr + tier: 4 Frozen_Tomb: - element: Seithr - tier: 4 + element: Seithr + tier: 4 + +#Temp +TEMP_Frost_Bolt: + element: Seithr + tier: 1 + +TEMP_Icicle_Blitz: + element: Seithr + tier: 2 + +TEMP_Glacial_Fan: + element: Seithr + tier: 3 + +TEMP_Hailpiercer: + element: Seithr + tier: 4 + +#Mitlan +Tide_Shard: + element: Mitlan + tier: 1 + +Bubble_Shard: + element: Mitlan + tier: 1 + +Scalding_Wave: + element: Mitlan + tier: 2 + +Tidal_Shield: + element: Mitlan + tier: 2 + +Mitlan_Glyph: + element: Mitlan + tier: 3 + +Crashing_Wave: + element: Mitlan + tier: 3 + +Maelstrom: + element: Mitlan + tier: 4 + +Drowning_Prison: + element: Mitlan + tier: 4 + +# Class spells (MMOCore subclasses) are deliberately NOT bound here: a binding would let +# Magic's resonance modifiers, weapon gating and wear act on class casts. Their element +# and rune tier are recorded where they live: +# MythicMobs/skills/TFMC/Classes/tfmc__skills.yml ('Class exclusive' sections) +# MythicLib/skill/tfmc_.yml (class-exclusive spells and CLASS_ copies of runes) +# MMOCore/classes/.yml (element and tier comment above each spell) diff --git a/src/test/java/net/tfminecraft/magic/BundledRuneConfigTest.java b/src/test/java/net/tfminecraft/magic/BundledRuneConfigTest.java new file mode 100644 index 0000000..61c25a9 --- /dev/null +++ b/src/test/java/net/tfminecraft/magic/BundledRuneConfigTest.java @@ -0,0 +1,50 @@ +package net.tfminecraft.magic; + +import static org.junit.jupiter.api.Assertions.*; + +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.List; +import org.bukkit.configuration.file.YamlConfiguration; +import org.junit.jupiter.api.Test; + +class BundledRuneConfigTest { + private YamlConfiguration resource(String path) { + return YamlConfiguration.loadConfiguration(new InputStreamReader( + getClass().getResourceAsStream("/" + path), StandardCharsets.UTF_8)); + } + + @Test + void mageSocketsUseTheSameNamesAsSchoolRunes() { + var config = resource("config.yml"); + assertFalse(config.getBoolean("gear.socket_rarity_prefix")); + assertEquals(List.of("CERRITH_RUNES", "OSENI_RUNES", "SEITHR_RUNES", "MITLAN_RUNES"), + config.getStringList("runes.types")); + var archetypes = resource("gear/archetypes.yml"); + var labels = resource("gear/socket-colours.yml"); + for (String type : List.of("staff", "wand", "sword")) { + for (String tier : List.of("minor", "lesser", "greater", "ascendant")) { + String id = tier + "_rune"; + String expected = Character.toUpperCase(tier.charAt(0)) + tier.substring(1) + " Rune"; + assertEquals(expected, archetypes.getString(type + ".slots." + id)); + assertEquals(expected, labels.getString("labels." + id)); + } + } + var parts = resource("gear/parts.yml"); + assertTrue(parts.getBoolean("petty_tom32.disabled")); + assertEquals(parts.getConfigurationSection("petty_tome3.sockets").getValues(false), + parts.getConfigurationSection("petty_tom32.sockets").getValues(false)); + } + + @Test + void mitlanRunesHaveBindingsAtEveryTierAndClassSpellsStaySeparate() { + var skills = resource("skills.yml"); + var names = List.of("Tide_Shard", "Bubble_Shard", "Scalding_Wave", "Tidal_Shield", + "Mitlan_Glyph", "Crashing_Wave", "Maelstrom", "Drowning_Prison"); + for (int i = 0; i < names.size(); i++) { + assertEquals("Mitlan", skills.getString(names.get(i) + ".element")); + assertEquals(i / 2 + 1, skills.getInt(names.get(i) + ".tier")); + } + assertTrue(skills.getKeys(false).stream().noneMatch(k -> k.toUpperCase().startsWith("CLASS_"))); + } +}