Start each magic tier at 50% cast chance on unlock.
Spell difficulty is now unlock Magic level + 1 (1/10/20/… gates), so tiers open at exactly 50% and climb with the same contest math.
@@ -12,6 +12,7 @@ import
12
12
} from "/shared/definitions/mobs.js";
13
13
import { spellCastSuccessChancePercent } from "/shared/combat/magic.js";
14
14
import { SPELL_DEFINITIONS, spellMinMagicLevel } from "/shared/definitions/spells.js";
15
import { spellDifficultyFromTier } from "/shared/spells/constants.js";
15
16
import { centralExchangeStaffCount } from "/shared/market/exchange.js";
16
17
import { ITEM_DEFINITIONS, itemDefinition, isDyeableClothing, listAllItemPickerEntries } from "/shared/definitions/items.js";
17
18
import { listRawFishPickerEntries, normalizeFishingSpotConfig, fishTierRankFromItemId } from "/shared/definitions/fishItems.js";
@@ -905,7 +906,7 @@ export function initTileConfigModal ({
905
906
const successPct = spellCastSuccessChancePercent(level, tier);
906
907
const chanceLabel = document.createElement("span");
907
908
chanceLabel.className = "hint";
908
chanceLabel.title = `Channel success: Magic ${level} vs tier ${tier} (difficulty ${tier * 2})`;
909
chanceLabel.title = `Channel success: Magic ${level} vs tier ${tier} (difficulty ${spellDifficultyFromTier(tier)})`;
909
910
chanceLabel.textContent = level < minLv
910
911
? `needs Lv.${minLv}`
911
912
: `cast ${formatCastChancePercent(successPct)}%`;
@@ -12,6 +12,7 @@ import12
} from "/shared/definitions/mobs.js";12
} from "/shared/definitions/mobs.js";13
import { spellCastSuccessChancePercent } from "/shared/combat/magic.js";13
import { spellCastSuccessChancePercent } from "/shared/combat/magic.js";14
import { SPELL_DEFINITIONS, spellMinMagicLevel } from "/shared/definitions/spells.js";14
import { SPELL_DEFINITIONS, spellMinMagicLevel } from "/shared/definitions/spells.js";15
import { spellDifficultyFromTier } from "/shared/spells/constants.js";15
import { centralExchangeStaffCount } from "/shared/market/exchange.js";16
import { centralExchangeStaffCount } from "/shared/market/exchange.js";16
import { ITEM_DEFINITIONS, itemDefinition, isDyeableClothing, listAllItemPickerEntries } from "/shared/definitions/items.js";17
import { ITEM_DEFINITIONS, itemDefinition, isDyeableClothing, listAllItemPickerEntries } from "/shared/definitions/items.js";17
import { listRawFishPickerEntries, normalizeFishingSpotConfig, fishTierRankFromItemId } from "/shared/definitions/fishItems.js";18
import { listRawFishPickerEntries, normalizeFishingSpotConfig, fishTierRankFromItemId } from "/shared/definitions/fishItems.js";@@ -905,7 +906,7 @@ export function initTileConfigModal ({905
const successPct = spellCastSuccessChancePercent(level, tier);906
const successPct = spellCastSuccessChancePercent(level, tier);906
const chanceLabel = document.createElement("span");907
const chanceLabel = document.createElement("span");907
chanceLabel.className = "hint";908
chanceLabel.className = "hint";908
chanceLabel.title = `Channel success: Magic ${level} vs tier ${tier} (difficulty ${tier * 2})`;909
chanceLabel.title = `Channel success: Magic ${level} vs tier ${tier} (difficulty ${spellDifficultyFromTier(tier)})`;909
chanceLabel.textContent = level < minLv910
chanceLabel.textContent = level < minLv910
? `needs Lv.${minLv}`911
? `needs Lv.${minLv}`911
: `cast ${formatCastChancePercent(successPct)}%`;912
: `cast ${formatCastChancePercent(successPct)}%`;@@ -1,6 +1,6 @@
1
1
import test from "node:test";
2
2
import assert from "node:assert/strict";
3
import { resolveMagicAttack, resolveMagicEffect, resolveSpellCast } from "../../shared/combat/magic.js";
3
import { resolveMagicAttack, resolveMagicEffect, resolveSpellCast, spellCastSuccessChancePercent } from "../../shared/combat/magic.js";
4
4
import { spellDefinition, spellDifficulty, SpellId } from "../../shared/definitions/spells.js";
5
5
import { spellDifficultyFromTier } from "../../shared/spells/constants.js";
6
6
@@ -82,6 +82,17 @@ test("non-damage spell applies effect only after a successful cast roll", () =>
82
82
assert.equal(result.effectId, "slow");
83
83
});
84
84
85
test("spell difficulty is unlock Magic level + 1 (50% at unlock)", () =>
86
{
87
assert.equal(spellDifficultyFromTier(1), 2);
88
assert.equal(spellDifficultyFromTier(2), 11);
89
assert.equal(spellDifficultyFromTier(3), 21);
90
assert.equal(spellDifficultyFromTier(7), 91);
91
assert.equal(Math.round(spellCastSuccessChancePercent(1, 1)), 50);
92
assert.equal(Math.round(spellCastSuccessChancePercent(10, 2)), 50);
93
assert.equal(Math.round(spellCastSuccessChancePercent(90, 7)), 50);
94
});
95
85
96
test("spell definitions expose tier-based difficulty", () =>
86
97
{
87
98
const firebolt = spellDefinition(SpellId.firebolt);
@@ -1,6 +1,6 @@1
import test from "node:test";1
import test from "node:test";2
import assert from "node:assert/strict";2
import assert from "node:assert/strict";3
import { resolveMagicAttack, resolveMagicEffect, resolveSpellCast } from "../../shared/combat/magic.js";3
import { resolveMagicAttack, resolveMagicEffect, resolveSpellCast, spellCastSuccessChancePercent } from "../../shared/combat/magic.js";4
import { spellDefinition, spellDifficulty, SpellId } from "../../shared/definitions/spells.js";4
import { spellDefinition, spellDifficulty, SpellId } from "../../shared/definitions/spells.js";5
import { spellDifficultyFromTier } from "../../shared/spells/constants.js";5
import { spellDifficultyFromTier } from "../../shared/spells/constants.js";6
6
@@ -82,6 +82,17 @@ test("non-damage spell applies effect only after a successful cast roll", () =>82
assert.equal(result.effectId, "slow");82
assert.equal(result.effectId, "slow");83
});83
});84
84
85
test("spell difficulty is unlock Magic level + 1 (50% at unlock)", () =>86
{87
assert.equal(spellDifficultyFromTier(1), 2);88
assert.equal(spellDifficultyFromTier(2), 11);89
assert.equal(spellDifficultyFromTier(3), 21);90
assert.equal(spellDifficultyFromTier(7), 91);91
assert.equal(Math.round(spellCastSuccessChancePercent(1, 1)), 50);92
assert.equal(Math.round(spellCastSuccessChancePercent(10, 2)), 50);93
assert.equal(Math.round(spellCastSuccessChancePercent(90, 7)), 50);94
});95
85
test("spell definitions expose tier-based difficulty", () =>96
test("spell definitions expose tier-based difficulty", () =>86
{97
{87
const firebolt = spellDefinition(SpellId.firebolt);98
const firebolt = spellDefinition(SpellId.firebolt);