Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
<<silently>>
<<set _contents to Story.get("Reign Event")>>
<<set _passageText to _contents.text>>
<<set _splitContents to _passageText.split("\n")>>
<<set _randomNumber to random(0, _splitContents.length-1)>>
<<set $randomReignEvent to _splitContents[_randomNumber]>>
<</silently>>In this example, we will start with a year zero and generate a ruler, their gender, how long they ruled, and how their reign ended based on some simple rules.
<<for _i to 0; _i < 30; _i++>>
<<include "Simple History">>
Years $currentYear-<<print $currentYear + $reign>>:
$title $randomRoyalName ruled. $pronoun reigned for $reign years. $possessivePronoun reign ended because of $randomReignEvent.
<</for>>
<<silently>>
<<set $title to either("King", "Queen")>>
<<if $title is "King">>
<<set $pronoun to either("He", "They")>>
<<if $pronoun is "He">>
<<set $possessivePronoun to "His">>
<<else>>
<<set $possessivePronoun to "Their">>
<</if>>
<<else>>
<<set $pronoun to either("She", "They")>>
<<if $pronoun is "She">>
<<set $possessivePronoun to "Her">>
<<else>>
<<set $possessivePronoun to "Their">>
<</if>>
<</if>>
<<if State.variables.hasOwnProperty("currentYear") >>
<<set $currentYear to $currentYear + $reign>>
<<else>>
<<set $currentYear to 0>>
<</if>>
<<set $reign to random(2, 70)>>
<<include "Royal Name Generation">>
<<include "Reign Event Generation">>
<</silently>><<silently>>
<<set _passageContents to Story.get("Royal Names")>>
<<set _passageText to _passageContents.text>>
<<set _splitContents to _passageText.split("\n")>>
<<set _randomSyllables to random(1,3)>>
<<set $randomRoyalName to _splitContents.pluck()>>
<<for _k to 0; _k < _randomSyllables; _k++>>
<<set _randomNumber to random(0, _splitContents.length)>>
<<set $randomRoyalName to $randomRoyalName + _splitContents.pluck()>>
<</for>>
<<set $randomRoyalName to $randomRoyalName.replace(/^\w/, c => c.toUpperCase())>>
<</silently>>en
men
dur
ub
ara
tu
et
jus
hur
bar
sal
nuna
ilta
sadum
lugal
banda
kulla
ssina
bel
kali
bum
zuq
aqip
melem
kish
ilku
enme
bar
agesi
puan
num
kial
umum
mash
da
arw
ium
nang
ish
lis
hma
utu
heng
al
merkar
bal
ih
ur
zab
aba
mam
agalassassination
famine
revolution
flood
fire
storm
coup