The Decorator of Enchanted Weapons
Dynamically adding magical properties to items.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Transmutation // Enchanting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
module Decorator
type weapon = { damage: nat; name: string }
let base_sword : weapon = { damage = 10; name = "Iron Sword" }
let flaming_enchantment (w: weapon) : weapon =
{ damage = w.damage + 5; name = "Flaming " ^ w.name }
let holy_enchantment (w: weapon) : weapon =
{ damage = w.damage + 10; name = "Holy " ^ w.name }
Enhancing artifacts by wrapping their representations with pure functions, guaranteeing that enhancements strictly increase damage.
Runic Tags:
#decorator
#enchanting
#wrappers