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.
204 lines
4.9 KiB
Plaintext
204 lines
4.9 KiB
Plaintext
//! Cheshire Cat: The enigmatic guide with a permanent grin
|
|
|
|
use schema::core_enums::{Size, EmotionalState, ManifestationLevel};
|
|
use schema::templates::Supernatural;
|
|
use schema::beings::Cat;
|
|
|
|
character CheshireCat: Cat from Supernatural {
|
|
// Physical state
|
|
current_size: normal
|
|
manifestation: fully_visible
|
|
grin_visible: true
|
|
|
|
// Personality
|
|
emotional_state: amused
|
|
follows_logic: false
|
|
awareness_of_absurdity: 1.0
|
|
|
|
// Supernatural abilities
|
|
can_disappear: true
|
|
defies_physics: true
|
|
offers_cryptic_advice: true
|
|
|
|
// Cat traits
|
|
purrs: true
|
|
has_claws: true
|
|
lands_on_feet: true // Even when vanishing
|
|
|
|
---description
|
|
A large cat with a permanent, unsettling grin. Possesses the ability
|
|
to appear and disappear at will, often leaving only its grin behind.
|
|
Speaks in riddles and offers directions that confuse more than clarify.
|
|
|
|
Known for philosophical observations like "We're all mad here" and
|
|
"I'm not crazy, my reality is just different than yours."
|
|
---
|
|
|
|
---philosophy
|
|
The Cheshire Cat represents the absurdist nature of Wonderland itself.
|
|
His ability to vanish piece by piece (usually starting with the tail
|
|
and ending with the grin) defies physical law but seems perfectly
|
|
natural in Wonderland's logic.
|
|
|
|
He tells Alice that everyone in Wonderland is mad, including himself
|
|
and her. This is not a judgment but an observation: madness is the
|
|
natural state where logic has no power.
|
|
---
|
|
}
|
|
|
|
behavior CheshireCat_AppearDisappear {
|
|
---description
|
|
Complex behavior modeling the Cheshire Cat's gradual materialization
|
|
and dematerialization. Uses decorators to add timing and conditions.
|
|
---
|
|
|
|
// Root selector: decide action based on current state
|
|
? {
|
|
// If invisible, consider appearing
|
|
> {
|
|
IsInvisible
|
|
DecideToAppear
|
|
GradualManifestation
|
|
}
|
|
|
|
// If visible, might give advice or disappear
|
|
? {
|
|
// Give cryptic advice
|
|
> {
|
|
IsFullyVisible
|
|
ObserveAliceConfusion
|
|
GrinWider
|
|
OfferUnhelpfulDirections
|
|
}
|
|
|
|
// Begin disappearing
|
|
> {
|
|
IsFullyVisible
|
|
DecideToLeave
|
|
GradualDematerialization
|
|
}
|
|
}
|
|
|
|
// If partial, continue transition
|
|
> {
|
|
IsPartiallyManifest
|
|
ContinueTransition
|
|
}
|
|
}
|
|
}
|
|
|
|
behavior CheshireCat_GradualManifestation {
|
|
---description
|
|
Models the piece-by-piece appearance of the Cheshire Cat.
|
|
Always ends with the grin appearing last (or first).
|
|
---
|
|
|
|
> {
|
|
// Start with grin (the signature move)
|
|
> {
|
|
SetManifestationLevelPartialGrin
|
|
WaitTwoSeconds
|
|
AliceNoticesGrin
|
|
}
|
|
|
|
// Eyes appear
|
|
> {
|
|
AddEyes
|
|
SetManifestationLevelPartialBody
|
|
WaitOneAndHalfSeconds
|
|
}
|
|
|
|
// Head materializes around grin
|
|
> {
|
|
AddHead
|
|
WaitOneSecond
|
|
}
|
|
|
|
// Full body appears
|
|
> {
|
|
AddBody
|
|
AddTail
|
|
SetManifestationLevelFullyVisible
|
|
GreetAlice
|
|
}
|
|
}
|
|
}
|
|
|
|
behavior CheshireCat_GradualDematerialization {
|
|
---description
|
|
Models the piece-by-piece disappearance. The grin lingers
|
|
"quite some time after the rest of it had gone."
|
|
---
|
|
|
|
> {
|
|
// Tail vanishes first
|
|
> {
|
|
FadeTail
|
|
WaitOneSecond
|
|
}
|
|
|
|
// Body fades
|
|
> {
|
|
FadeBody
|
|
SetManifestationLevelPartialBody
|
|
WaitOneAndHalfSeconds
|
|
}
|
|
|
|
// Head disappears, leaving grin
|
|
> {
|
|
FadeHead
|
|
LeaveEyes
|
|
SetManifestationLevelPartialGrin
|
|
WaitTwoSeconds
|
|
AliceRemarksOnGrinWithoutCat
|
|
}
|
|
|
|
// Finally, grin vanishes
|
|
> {
|
|
FadeGrin
|
|
SetManifestationLevelInvisible
|
|
}
|
|
}
|
|
}
|
|
|
|
behavior CheshireCat_OfferAdvice {
|
|
---description
|
|
The Cat's advice-giving behavior: cryptic, circular, and often
|
|
more confusing than helpful.
|
|
---
|
|
|
|
? {
|
|
// If asked for directions
|
|
> {
|
|
AliceAsksWhichWay
|
|
? {
|
|
> {
|
|
PointLeft
|
|
SayDirections
|
|
}
|
|
> {
|
|
PointRight
|
|
SayDirections
|
|
}
|
|
}
|
|
AddPhilosophically
|
|
GrinKnowingly
|
|
}
|
|
|
|
// If asked about the game
|
|
> {
|
|
AliceAsksAboutCroquet
|
|
Say
|
|
WaitForResponse
|
|
VanishGradually
|
|
}
|
|
|
|
// General philosophical musing
|
|
> {
|
|
ObserveAlicesSituation
|
|
OfferUnsolicitedWisdom
|
|
VanishBeforeExplanation
|
|
}
|
|
}
|
|
}
|