BREAKING CHANGES: - Relationship syntax now requires blocks for all participants - Removed self/other perspective blocks from relationships - Replaced 'guard' keyword with 'if' for behavior tree decorators Language Features: - Add tree-sitter grammar with improved if/condition disambiguation - Add comprehensive tutorial and reference documentation - Add SBIR v0.2.0 binary format specification - Add resource linking system for behaviors and schedules - Add year-long schedule patterns (day, season, recurrence) - Add behavior tree enhancements (named nodes, decorators) Documentation: - Complete tutorial series (9 chapters) with baker family examples - Complete reference documentation for all language features - SBIR v0.2.0 specification with binary format details - Added locations and institutions documentation Examples: - Convert all examples to baker family scenario - Add comprehensive working examples Tooling: - Zed extension with LSP integration - Tree-sitter grammar for syntax highlighting - Build scripts and development tools Version Updates: - Main package: 0.1.0 → 0.2.0 - Tree-sitter grammar: 0.1.0 → 0.2.0 - Zed extension: 0.1.0 → 0.2.0 - Storybook editor: 0.1.0 → 0.2.0
319 lines
9.2 KiB
Plaintext
319 lines
9.2 KiB
Plaintext
//! The Royal Court of Hearts: tyrannical hierarchy
|
|
|
|
use schema::core_enums::{Size, EmotionalState, CardSuit, CardRank};
|
|
use schema::templates::{PlayingCard, CourtMember};
|
|
use schema::beings::PlayingCardPerson;
|
|
|
|
character QueenOfHearts: PlayingCardPerson from PlayingCard, CourtMember {
|
|
// Card identity
|
|
suit: hearts
|
|
rank: queen
|
|
current_size: normal
|
|
fear_of_queen: 0.0 // She IS the Queen
|
|
|
|
// Personality
|
|
emotional_state: angry
|
|
follows_logic: false
|
|
awareness_of_absurdity: 0.0
|
|
|
|
// Royal traits
|
|
loyalty_to_queen: 1.0 // To herself
|
|
times_threatened_with_beheading: 0 // She's the one doing the threatening
|
|
survival_instinct: 0.1 // Reckless with her own safety
|
|
|
|
// Tyrannical nature
|
|
temper: 1.0
|
|
mercy: 0.0
|
|
subjects_beheaded_today: 47 // So far today
|
|
off_with_their_heads_count: 347 // Total for today
|
|
|
|
// Game preferences
|
|
cheats_at_croquet: true
|
|
patience_for_rules: 0.0
|
|
|
|
---description
|
|
The terrifying matriarch of Wonderland's Court of Hearts. Quick
|
|
to rage, quicker to order executions. Her signature phrase
|
|
"Off with their heads!" rings out constantly across the croquet
|
|
grounds and palace halls.
|
|
|
|
Plays croquet with live flamingos and hedgehogs, cheats brazenly,
|
|
and flies into a fury when contradicted or when anyone wins.
|
|
---
|
|
|
|
---psychological_profile
|
|
The Queen represents arbitrary authority and irrational rage.
|
|
She sees slights everywhere, interprets everything as disrespect,
|
|
and her solution to all problems is immediate execution.
|
|
|
|
Notably, while she orders constant beheadings, the King quietly
|
|
pardons everyone afterward. The Queen never notices this
|
|
undermining of her authority.
|
|
---
|
|
}
|
|
|
|
character KingOfHearts: PlayingCardPerson from PlayingCard, CourtMember {
|
|
// Card identity
|
|
suit: hearts
|
|
rank: king
|
|
current_size: small // Shorter than the Queen
|
|
fear_of_queen: 0.95 // Terrified but hides it well
|
|
|
|
// Personality
|
|
emotional_state: frightened
|
|
follows_logic: true
|
|
awareness_of_absurdity: 0.7
|
|
|
|
// Royal traits
|
|
loyalty_to_queen: 1.0 // Out of fear
|
|
times_threatened_with_beheading: 156 // Even kings aren't safe
|
|
survival_instinct: 1.0
|
|
|
|
// Peacemaking nature
|
|
mercy: 1.0
|
|
secretly_pardons_everyone: true
|
|
attempts_to_calm_queen: true
|
|
|
|
---description
|
|
The meek and mild King of Hearts, thoroughly dominated by
|
|
his wife. He attempts to moderate her rage with whispered
|
|
pleas like "Consider, my dear: she is only a child!"
|
|
|
|
Serves as judge at the trial, but his authority is purely
|
|
nominal. Secretly pardons all the Queen's execution orders,
|
|
which is how anyone survives in Wonderland.
|
|
---
|
|
}
|
|
|
|
character CardGardenerTwo: PlayingCardPerson from PlayingCard {
|
|
suit: spades
|
|
rank: two
|
|
current_size: normal
|
|
|
|
emotional_state: frightened
|
|
fear_of_queen: 1.0
|
|
follows_logic: true
|
|
awareness_of_absurdity: 0.8
|
|
|
|
// Gardener traits
|
|
currently_painting_roses: true
|
|
roses_painted_white_to_red: 247 // About halfway done
|
|
mistakes_admitted: 1 // The white rose tree
|
|
|
|
---description
|
|
One of three card gardeners (Two, Five, Seven) caught painting
|
|
white roses red. They planted a white rose tree by mistake
|
|
when the Queen wanted red. Now desperately painting before
|
|
she arrives, knowing the penalty is beheading.
|
|
---
|
|
}
|
|
|
|
character CardGardenerFive: PlayingCardPerson from PlayingCard {
|
|
suit: spades
|
|
rank: five
|
|
current_size: normal
|
|
|
|
emotional_state: angry
|
|
fear_of_queen: 1.0
|
|
follows_logic: true
|
|
awareness_of_absurdity: 0.8
|
|
|
|
currently_painting_roses: true
|
|
quick_to_blame_others: true
|
|
splashed_by_seven: true
|
|
|
|
---description
|
|
The irritable middle gardener who gets splashed with paint
|
|
and immediately blames Seven. More concerned with assigning
|
|
fault than finishing the job before the Queen arrives.
|
|
---
|
|
}
|
|
|
|
character CardGardenerSeven: PlayingCardPerson from PlayingCard {
|
|
suit: spades
|
|
rank: seven
|
|
current_size: normal
|
|
|
|
emotional_state: angry
|
|
fear_of_queen: 1.0
|
|
follows_logic: true
|
|
awareness_of_absurdity: 0.8
|
|
|
|
currently_painting_roses: true
|
|
accused_of_bringing_tulip_roots: true
|
|
elbow_jogged_five: true
|
|
|
|
---description
|
|
The gardener blamed for both jogging Five's elbow and for
|
|
bringing the cook tulip-roots instead of onions. Accused
|
|
of all manner of things, deserves beheading according to
|
|
the Queen.
|
|
---
|
|
}
|
|
|
|
behavior QueenOfHearts_RagePattern {
|
|
---description
|
|
Models the Queen's hair-trigger temper and constant execution
|
|
orders. Any perceived slight triggers the same response.
|
|
|
|
Uses a selector to try different rage escalations, all ending
|
|
in "Off with their heads!"
|
|
---
|
|
|
|
// Repeats forever - the Queen never runs out of rage
|
|
repeat {
|
|
then rage_cycle {
|
|
// Wait for any stimulus
|
|
WaitForInteraction
|
|
|
|
// Selector: Interpret stimulus as offense
|
|
choose perceived_offense {
|
|
// Minor perceived slight
|
|
then minor_slight {
|
|
DetectMinorIrregularity
|
|
TurnCrimson
|
|
Glare
|
|
Scream
|
|
StompFoot
|
|
}
|
|
|
|
// Someone wins at croquet
|
|
then croquet_outrage {
|
|
ObserveSomeoneScoring
|
|
DeclareCheating
|
|
Rage
|
|
OrderExecution
|
|
}
|
|
|
|
// Anyone speaks back
|
|
then contradiction_fury {
|
|
HearContradiction
|
|
TurnPurpleWithFury
|
|
Shriek
|
|
TurnToKing
|
|
DemandAgreement
|
|
}
|
|
|
|
// Painted roses discovered
|
|
then painting_discovery {
|
|
NoticePaintBrushes
|
|
DemandExplanation
|
|
InterruptExplanation
|
|
OrderImmediateBeheading
|
|
}
|
|
|
|
// Default: random rage
|
|
then irrational_anger {
|
|
FeelIrrationalAnger
|
|
LookForTarget
|
|
FindTarget
|
|
ScreamOffWithTheirHeads
|
|
}
|
|
}
|
|
|
|
// King attempts to moderate
|
|
choose king_intervention {
|
|
then whispered_plea {
|
|
King_WhispersPleas
|
|
Queen_IgnoresEntirely
|
|
}
|
|
then reminder_backfires {
|
|
King_RemindsOfMercy
|
|
Queen_GlaresAtKing
|
|
ConsiderBeheadingKingToo
|
|
}
|
|
}
|
|
|
|
// Execution order given (but secretly pardoned later)
|
|
then execution_ordered {
|
|
IncrementBeheadingCount
|
|
SoldiersLookUncertain
|
|
VictimPleadsOrFlees
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
behavior CardGardeners_DesperatePainting {
|
|
---description
|
|
Three gardeners frantically painting white roses red before
|
|
the Queen discovers their mistake. Models coordinated panic.
|
|
---
|
|
|
|
then desperate_work {
|
|
// Initial panic
|
|
then assessment {
|
|
CheckQueensPosition
|
|
EstimateTimeRemaining
|
|
PaintFaster
|
|
}
|
|
|
|
// Coordination breaks down under stress - repeat until Queen arrives
|
|
repeat {
|
|
choose panic_actions {
|
|
// Blame game
|
|
then argument {
|
|
Five_GetsSplashed
|
|
Five_BlameSeven
|
|
Seven_DefendsHimself
|
|
Two_AttemptsMediation
|
|
AllArgumentInterrupted
|
|
}
|
|
|
|
// Desperate painting
|
|
then frantic_painting {
|
|
Two_PaintsRose
|
|
Five_PaintsRose
|
|
Seven_PaintsRose
|
|
}
|
|
|
|
// Discovery and panic
|
|
then discovery {
|
|
HearQueensProcession
|
|
Five_Shouts
|
|
AllThrowThemselvesFlat
|
|
AwaitFate
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
behavior KingOfHearts_SecretPardons {
|
|
---description
|
|
The King's quiet subversion of the Queen's execution orders.
|
|
Runs in background after each of her rage episodes.
|
|
---
|
|
|
|
// Repeats forever - the King never stops being merciful
|
|
repeat {
|
|
then mercy_cycle {
|
|
// Wait for Queen's execution order
|
|
WaitForOffWithTheirHeads
|
|
|
|
// Let some time pass
|
|
WaitThirtySeconds
|
|
|
|
// Secretly pardon
|
|
choose pardon_method {
|
|
then whispered_pardon {
|
|
QueenIsDistracted
|
|
QuietlyApproachSoldiers
|
|
WhisperPardon
|
|
SoldiersNodRelief
|
|
VictimQuietlyEscapes
|
|
}
|
|
then written_pardon {
|
|
WritePardonOrder
|
|
SlipItToKnave
|
|
KnaveDeliversMercy
|
|
EveryonePretendExecutionHappened
|
|
}
|
|
}
|
|
|
|
// This is how anyone survives in Wonderland
|
|
DecrementActualBeheadingCount
|
|
}
|
|
}
|
|
}
|