The Chain of Responsibility: Cascade of Runes
Pass requests along a chain of handlers until one resolves the invocation.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Evocation // Cascading
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
class_name DamageHandler extends Node
var next_handler: DamageHandler
func set_next(handler: DamageHandler) -> DamageHandler:
next_handler = handler
return handler
func handle_damage(amount: int, type: String) -> void:
if next_handler:
next_handler.handle_damage(amount, type)
# Concrete Handlers
class_name ShieldHandler extends DamageHandler
func handle_damage(amount: int, type: String) -> void:
if type == "Energy":
print("Shield absorbed energy damage.")
else:
super.handle_damage(amount, type)
class_name ArmorHandler extends DamageHandler
func handle_damage(amount: int, type: String) -> void:
if type == "Physical":
print("Armor mitigated physical damage.")
else:
super.handle_damage(amount, type)
When a system takes a blow, the impact ripples through the astral shields. The Chain of Responsibility forms a linked succession of defenses and handlers. A request—be it damage, an event, or an input—flows down this chain until a specialized rune intercepts and dissipates the invocation.
Runic Tags:
#godot
#gdscript
#chain
#behavior