Add comprehensive example demonstrating all major features of the Storybook DSL through Lewis Carroll's Alice in Wonderland. Contents: - 12 characters (Alice, WhiteRabbit, CheshireCat, MadHatter, etc.) - 7 relationships with named participant blocks - 3 institutions (tea parties, royal court) - 1 schedule (Mad Tea Party eternal rotation) - 12 behavior trees using new syntax features - 1 life arc (Alice's journey) Demonstrates: - Cross-file template resolution (schema/templates.sb) - Template inheritance and includes - Strict template validation - Action parameters and repeater decorators - Named participant relationship blocks - Species-based character typing - Rich prose blocks throughout All content validates successfully.
286 lines
8.1 KiB
Plaintext
286 lines
8.1 KiB
Plaintext
//! The Mad Tea Party trio: stuck in eternal teatime
|
|
|
|
use schema::core_enums::{Size, EmotionalState, TimeState};
|
|
use schema::templates::MadTeaPartyMember;
|
|
use schema::beings::{Human, Hare, Dormouse};
|
|
|
|
character MadHatter: Human from MadTeaPartyMember {
|
|
// Physical traits
|
|
current_size: normal
|
|
wears_top_hat: true
|
|
hat_size_label: "10/6" // Price tag still attached
|
|
|
|
// Personality
|
|
emotional_state: confused
|
|
follows_logic: false
|
|
awareness_of_absurdity: 0.1 // Unaware of his own madness
|
|
|
|
// Tea party state
|
|
stuck_at_teatime: true
|
|
current_seat_position: 1
|
|
riddles_asked: 847
|
|
unanswerable_riddles: 847 // All of them
|
|
|
|
// Time relationship
|
|
quarreled_with_time: true
|
|
murdered_time: true // According to Time
|
|
time_frozen_at: 18:00 // 6 o'clock, always
|
|
|
|
---backstory
|
|
Once sang at a concert for the Queen of Hearts. Accused of
|
|
"murdering the time" for his poor performance of "Twinkle,
|
|
twinkle, little bat." As punishment, Time refuses to move
|
|
for him - it's always six o'clock, always tea-time.
|
|
|
|
Now stuck rotating around a table with the March Hare and
|
|
Dormouse, moving to the next seat as dishes get dirty,
|
|
asking riddles with no answers.
|
|
---
|
|
}
|
|
|
|
character MarchHare: Hare from MadTeaPartyMember {
|
|
// Physical traits
|
|
current_size: normal
|
|
whiskers_twitching: true
|
|
|
|
// Personality
|
|
emotional_state: amused
|
|
follows_logic: false
|
|
awareness_of_absurdity: 0.05
|
|
|
|
// Tea party state
|
|
stuck_at_teatime: true
|
|
current_seat_position: 2
|
|
riddles_asked: 723
|
|
|
|
// March madness (breeding season)
|
|
madness_level: 1.0 // It's always March for him too
|
|
offers_nonexistent_wine: true
|
|
|
|
---backstory
|
|
Partner in madness with the Hatter. The March Hare embodies
|
|
the saying "mad as a March hare" - the wild behavior of
|
|
hares during breeding season.
|
|
|
|
Delights in contradiction: offering wine when there's only
|
|
tea, claiming things are "the same" when they're opposite,
|
|
dipping watches in tea to fix them with "the best butter."
|
|
---
|
|
}
|
|
|
|
character TheDormouse: Dormouse from MadTeaPartyMember {
|
|
// Physical traits
|
|
current_size: tiny
|
|
currently_sleeping: true
|
|
|
|
// Personality
|
|
emotional_state: melancholy
|
|
follows_logic: true // When awake, which is rare
|
|
awareness_of_absurdity: 0.6
|
|
|
|
// Tea party state
|
|
stuck_at_teatime: true
|
|
current_seat_position: 0 // Between Hatter and March Hare
|
|
riddles_asked: 3
|
|
|
|
// Sleep patterns
|
|
sleep_cycles_per_hour: 12
|
|
used_as_cushion: true
|
|
pinched_to_wake: 15..100 // Times per tea party
|
|
|
|
---backstory
|
|
A chronically sleepy dormouse who serves as a cushion
|
|
between the Hatter and March Hare. They rest their elbows
|
|
on him and talk over his head.
|
|
|
|
Occasionally rouses to tell meandering stories about three
|
|
sisters living in a treacle well, drawing all manner of
|
|
things beginning with M - mousetraps, the moon, memory,
|
|
and muchness.
|
|
---
|
|
|
|
---notable_quote
|
|
"I breathe when I sleep is the same thing as I sleep when
|
|
I breathe!" - said in his sleep, demonstrating the circular
|
|
logic of the tea party even while unconscious.
|
|
---
|
|
}
|
|
|
|
// The eternal tea party schedule - always 6 o'clock
|
|
schedule MadTeaPartyRotation {
|
|
---description
|
|
Models the endless, circular nature of the Mad Tea Party.
|
|
Because time is frozen at 6 o'clock (tea-time), they never
|
|
wash dishes - instead they rotate around the table as each
|
|
seat's dishes get dirty.
|
|
---
|
|
|
|
18:00 -> 18:01: TeaRound {
|
|
---narrative
|
|
Begin a new rotation. All participants have tea, ask
|
|
riddles, and engage in nonsensical conversation.
|
|
|
|
The Dormouse starts awake, attempts to contribute,
|
|
then falls asleep again mid-sentence.
|
|
---
|
|
}
|
|
|
|
18:01 -> 18:02: RiddlePhase {
|
|
---narrative
|
|
The Hatter asks "Why is a raven like a writing-desk?"
|
|
|
|
Alice attempts to solve it. The Hatter admits he doesn't
|
|
know the answer. No one knows the answer. There is no
|
|
answer. This is the point.
|
|
---
|
|
}
|
|
|
|
18:02 -> 18:03: ContradictionPhase {
|
|
---narrative
|
|
March Hare contradicts Alice: "You should say what you mean."
|
|
Alice: "I do!"
|
|
Hatter: "Not the same thing a bit! 'I see what I eat' vs
|
|
'I eat what I see'!"
|
|
|
|
The logic spirals into beautiful nonsense.
|
|
---
|
|
}
|
|
|
|
18:03 -> 18:04: DormouseStory {
|
|
---narrative
|
|
They pinch the Dormouse awake. He tells a drowsy story
|
|
about three sisters living in a treacle-well, drawing
|
|
treacle, drawing things that begin with M.
|
|
|
|
The story makes no sense but continues anyway.
|
|
---
|
|
}
|
|
|
|
18:04 -> 18:05: RotateSeats {
|
|
---narrative
|
|
"Move down!" The dirty dishes pile up. Everyone shifts
|
|
to the next seat clockwise around the table.
|
|
|
|
This is their solution to never washing dishes: infinite
|
|
table, infinite seats, infinite tea-time.
|
|
---
|
|
}
|
|
|
|
18:05 -> 18:00: LoopToBeginning {
|
|
---narrative
|
|
Time hasn't moved. It's still 6 o'clock. It's always
|
|
6 o'clock. The party begins again, identical to the last,
|
|
identical to the next.
|
|
|
|
The Dormouse is asleep. The Hatter checks his broken watch.
|
|
The March Hare offers wine that doesn't exist.
|
|
|
|
Forever.
|
|
---
|
|
}
|
|
}
|
|
|
|
behavior MadTeaParty_CoordinatedMadness {
|
|
---description
|
|
Models the three-way coordination of the Mad Tea Party members.
|
|
They interrupt each other, build on each other's nonsense,
|
|
and create a cascade of illogic.
|
|
---
|
|
|
|
> {
|
|
// Initialization: Set up eternal tea time
|
|
> {
|
|
SetTimeStateFrozen
|
|
SetCurrentTimeToSix
|
|
VerifyTimeStillSix
|
|
}
|
|
|
|
// Main party loop (runs forever)
|
|
// TODO: Add repeater decorator support
|
|
> {
|
|
// Selector: Choose a mad activity
|
|
? {
|
|
// Riddle sequence
|
|
> {
|
|
MadHatter_AskRiddle
|
|
AliceAttemptsSolution
|
|
MadHatter_AdmitsNoAnswer
|
|
MarchHare_ChangesSubject
|
|
}
|
|
|
|
// Contradition game
|
|
> {
|
|
AliceMakesStatement
|
|
MarchHare_ContradictLogic
|
|
MadHatter_BuildsOnContradiction
|
|
Dormouse_MuttersInSleep
|
|
}
|
|
|
|
// Story time
|
|
> {
|
|
PinchDormouse
|
|
Dormouse_WakesGroggily
|
|
Dormouse_BeginsMeanderingStory
|
|
Dormouse_FallsAsleepMidWord
|
|
}
|
|
|
|
// Butter the watch
|
|
> {
|
|
MadHatter_ChecksBrokenWatch
|
|
MarchHare_OffersButterAsRepair
|
|
DipWatchInTea
|
|
ExamineWatchHopefully
|
|
DeclareItStillBroken
|
|
}
|
|
|
|
// Seat rotation
|
|
> {
|
|
DeclareNoRoom
|
|
ShiftSeatsClockwise
|
|
IncrementSeatPositions
|
|
}
|
|
}
|
|
|
|
// Always end by verifying time hasn't moved
|
|
> {
|
|
CheckTime
|
|
ConfirmStillSixOClock
|
|
SighPhilosophically
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
behavior Dormouse_SleepCycle {
|
|
---description
|
|
Models the Dormouse's constant oscillation between sleep
|
|
and brief, drowsy wakefulness. Uses a repeater decorator.
|
|
---
|
|
|
|
// TODO: Add repeater decorator support
|
|
> {
|
|
> {
|
|
FallAsleep
|
|
BeUsedAsCushion
|
|
WaitForPinch
|
|
}
|
|
|
|
> {
|
|
WakeWithStart
|
|
MutterConfusedly
|
|
? {
|
|
> {
|
|
BeginStory
|
|
DescribeTheirNames
|
|
ExplainTreacleWell
|
|
FallAsleepMidSentence
|
|
}
|
|
> {
|
|
MakeCircularStatement
|
|
CloseEyesAgain
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|