The Prototype Incantation
Cloning and modifying existing magical patterns using symbolic substitution.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Prototype
ARCANUM SCHOOL: Illusion // Cloning
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MATHEMATICA PATTERN //
(* The base prototype *)
baseSpell = Spell["Arcane Missile", {Damage -> 5, Element -> "Arcane", Cost -> 10}];
(* The Cloning Ritual utilizing ReplaceAll (/.) for modifications *)
CloneSpell[prototype_, modifications___Rule] :=
prototype /. {modifications, Rule[k_, v_] :> Rule[k, v]};
(* Usage: Cloning with specific tweaks *)
empoweredSpell = CloneSpell[baseSpell, Damage -> 15, Cost -> 20];
fireSpell = CloneSpell[baseSpell, Element -> "Fire", Name -> "Fire Missile"];
Print["Base: ", baseSpell];
Print["Empowered: ", empoweredSpell];
Print["Fire Variant: ", fireSpell];
Runic Tags:
#cloning
#rules
#replacement
#substitution