🦉 PROLOG ORACLE DIFFICULTY: Adept Behavioral

The State of the Elemental Core

Alter an entity's behavior dynamically based on its internal elemental attunement.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Evocation // Elementmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PROLOG PATTERN //
% Behaviors based on State
elemental_reaction(fire_state, 'blasts intense heat').
elemental_reaction(ice_state, 'freezes the surrounding air').
elemental_reaction(void_state, 'absorbs all light').

% Context Entity
entity_action(EntityName, State) :-
    elemental_reaction(State, Reaction),
    format('The ~w ~w.', [EntityName, Reaction]).

% State Transitions
transition(fire_state, cool_down, ice_state).
transition(ice_state, shatter, void_state).

% ?- entity_action(golem, fire_state).
% "The golem blasts intense heat."
% ?- transition(fire_state, cool_down, NewState), entity_action(golem, NewState).
% NewState = ice_state.
% "The golem freezes the surrounding air."
Runic Tags: #state #behavioral #prolog #transitions #elements