BlueGit

timfa questward

Add Magic Missile as a tier-2 attack spell with spellbook.

Gives Magic an early non-elemental damage option at the same gate as Dark, learnable from item 402.

timfa Tim Falken · pushed by timfa

Authored 2026-08-30 · 2 months ago

Hash
f451b7629668e8573843e565b43141c02ffb70f9
Parent
5271ac24
4 files changed +20 −1
client/assets/spells/magic-missile.svg added +4 −0
@@ -0,0 +1,4 @@
1 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
2 <rect width="32" height="32" rx="6" fill="#4a7a98"/>
3 <text x="16" y="21" text-anchor="middle" fill="#f0ece0" font-size="11" font-family="Segoe UI,sans-serif" font-weight="600">MM</text>
4 </svg>
@@ -0,0 +1,4 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
2<rect width="32" height="32" rx="6" fill="#4a7a98"/>
3<text x="16" y="21" text-anchor="middle" fill="#f0ece0" font-size="11" font-family="Segoe UI,sans-serif" font-weight="600">MM</text>
4</svg>
server/tests/level-up-unlocks.test.js +2 −1
@@ -51,7 +51,8 @@ test("magic unlocks use tier skill gates, not every level", () =>
51 51 {
52 52 assert.deepEqual(skillUnlockMessages(SkillId.magic, 2, 3), []);
53 53 const atTen = skillUnlockMessages(SkillId.magic, 9, 10);
54 assert.ok(atTen.some((line) => /cast Dark/i.test(line) || /Birch staves/i.test(line)));
54 assert.ok(atTen.some((line) => /cast Dark/i.test(line) || /Magic Missile/i.test(line) || /Birch staves/i.test(line)));
55 assert.ok(atTen.some((line) => /Magic Missile/i.test(line)));
55 56 const atTwenty = skillUnlockMessages(SkillId.magic, 19, 20);
56 57 assert.ok(atTwenty.some((line) => /tier 3|Firebolt|Poison|Tinders/i.test(line)));
57 58 assert.equal(skillUnlockMessages(SkillId.magic, 3, 4).filter((l) => /cast/i.test(l)).length, 0);
@@ -51,7 +51,8 @@ test("magic unlocks use tier skill gates, not every level", () =>
51{
51{
52 assert.deepEqual(skillUnlockMessages(SkillId.magic, 2, 3), []);
52 assert.deepEqual(skillUnlockMessages(SkillId.magic, 2, 3), []);
53 const atTen = skillUnlockMessages(SkillId.magic, 9, 10);
53 const atTen = skillUnlockMessages(SkillId.magic, 9, 10);
54 assert.ok(atTen.some((line) => /cast Dark/i.test(line) || /Birch staves/i.test(line)));
54 assert.ok(atTen.some((line) => /cast Dark/i.test(line) || /Magic Missile/i.test(line) || /Birch staves/i.test(line)));
55 assert.ok(atTen.some((line) => /Magic Missile/i.test(line)));
55 const atTwenty = skillUnlockMessages(SkillId.magic, 19, 20);
56 const atTwenty = skillUnlockMessages(SkillId.magic, 19, 20);
56 assert.ok(atTwenty.some((line) => /tier 3|Firebolt|Poison|Tinders/i.test(line)));
57 assert.ok(atTwenty.some((line) => /tier 3|Firebolt|Poison|Tinders/i.test(line)));
57 assert.equal(skillUnlockMessages(SkillId.magic, 3, 4).filter((l) => /cast/i.test(l)).length, 0);
58 assert.equal(skillUnlockMessages(SkillId.magic, 3, 4).filter((l) => /cast/i.test(l)).length, 0);
shared/definitions/spellItems.js +1 −0
@@ -7,6 +7,7 @@ import { SpellId, spellDefinition, learnableSpellIds } from "./spells.js";
7 7 */
8 8 const SPELLBOOK_ID_BY_SPELL = Object.freeze({
9 9 [SpellId.dark]: 391,
10 [SpellId.magicMissile]: 402,
10 11 [SpellId.firebolt]: 392,
11 12 [SpellId.fireball]: 393,
12 13 [SpellId.blaze]: 394,
@@ -7,6 +7,7 @@ import { SpellId, spellDefinition, learnableSpellIds } from "./spells.js";
7 */
7 */
8const SPELLBOOK_ID_BY_SPELL = Object.freeze({
8const SPELLBOOK_ID_BY_SPELL = Object.freeze({
9 [SpellId.dark]: 391,
9 [SpellId.dark]: 391,
10 [SpellId.magicMissile]: 402,
10 [SpellId.firebolt]: 392,
11 [SpellId.firebolt]: 392,
11 [SpellId.fireball]: 393,
12 [SpellId.fireball]: 393,
12 [SpellId.blaze]: 394,
13 [SpellId.blaze]: 394,
shared/definitions/spells.js +13 −0
@@ -26,6 +26,7 @@ import { MagicElement } from "./attackTypes.js";
26 26 export const SpellId = Object.freeze({
27 27 light: "light",
28 28 dark: "dark",
29 magicMissile: "magic-missile",
29 30 // Fire damage tree
30 31 firebolt: "firebolt",
31 32 fireball: "fireball",
@@ -380,6 +381,18 @@ export const SPELL_DEFINITIONS = Object.freeze({
380 381 effect: "dark",
381 382 description: "A pool of shadow that drinks the light from a place, leaving the air thick and dim."
382 383 }),
384 [SpellId.magicMissile]: Object.freeze({
385 spellId: SpellId.magicMissile,
386 displayName: "Magic Missile",
387 tier: 2,
388 element: "none",
389 target: "entity",
390 autoRepeat: true,
391 minMagicLevel: spellMinMagicLevelFromTier(2),
392 projectileSprite: BOLT_PROJECTILE,
393 effect: "damage",
394 description: "A plain dart of force that flies true and strikes without favour of the elements."
395 }),
383 396 ...buildDamageTreeDefinitions(),
384 397 [SpellId.poison]: Object.freeze({
385 398 spellId: SpellId.poison,
@@ -26,6 +26,7 @@ import { MagicElement } from "./attackTypes.js";
26export const SpellId = Object.freeze({
26export const SpellId = Object.freeze({
27 light: "light",
27 light: "light",
28 dark: "dark",
28 dark: "dark",
29 magicMissile: "magic-missile",
29 // Fire damage tree
30 // Fire damage tree
30 firebolt: "firebolt",
31 firebolt: "firebolt",
31 fireball: "fireball",
32 fireball: "fireball",
@@ -380,6 +381,18 @@ export const SPELL_DEFINITIONS = Object.freeze({
380 effect: "dark",
381 effect: "dark",
381 description: "A pool of shadow that drinks the light from a place, leaving the air thick and dim."
382 description: "A pool of shadow that drinks the light from a place, leaving the air thick and dim."
382 }),
383 }),
384 [SpellId.magicMissile]: Object.freeze({
385 spellId: SpellId.magicMissile,
386 displayName: "Magic Missile",
387 tier: 2,
388 element: "none",
389 target: "entity",
390 autoRepeat: true,
391 minMagicLevel: spellMinMagicLevelFromTier(2),
392 projectileSprite: BOLT_PROJECTILE,
393 effect: "damage",
394 description: "A plain dart of force that flies true and strikes without favour of the elements."
395 }),
383 ...buildDamageTreeDefinitions(),
396 ...buildDamageTreeDefinitions(),
384 [SpellId.poison]: Object.freeze({
397 [SpellId.poison]: Object.freeze({
385 spellId: SpellId.poison,
398 spellId: SpellId.poison,