🦉 PROLOG ORACLE DIFFICULTY: Adept Structural

The Adapter of Arcane Translation

Bridge incompatible mystical interfaces using logical translation rules.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Adapter
ARCANUM SCHOOL: Transmutation // Wordmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PROLOG PATTERN //
% The Old API (Ancient Draconic)
draconic_ignis(Target, Damage) :-
    format('Ignis strikes ~w for ~w damage.', [Target, Damage]).

% The New API Expected by the Guild (Common Tongue)
% cast_spell(SpellName, Target)

% The Adapter
cast_spell(fireball, Target) :-
    BaseDamage = 40,
    draconic_ignis(Target, BaseDamage).

cast_spell(lesser_fireball, Target) :-
    BaseDamage = 15,
    draconic_ignis(Target, BaseDamage).

% ?- cast_spell(fireball, goblin).
% "Ignis strikes goblin for 40 damage."
Runic Tags: #adapter #structural #prolog #interface #translation