# George and the Troll
# Logging in as George, we create a character with the following answers:

# #+begin_example
#   large troll

#   neutral

#   balancing a giant die across its knuckles

#   A large troll with long black hair and greasy, green skin. Sporting a purple tunic with a |mWyldwood Bar and Games|n logo and the slogan: |wThe House better Win...or Else!|n

#   Troll
# #+end_example

# Create the rules that we can drop on a table or something.


# [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:1]]
@create rules: typeclasses.readables.Readable
#
@desc rules = A small, worn card with the rules of the game, |yHobbits and Trolls|n printed on it.
# George and the Troll:1 ends here



# And write out the rules:


# [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:2]]
@set rules/inside = The rules to |yTrolls and Hobbits|n are simple.

The player playing the |wtroll|n rolls a ten-sided die to set the
|wlevel|n to beat, called the |wknee|n. The player(s) playing the
|whobbits|n then roll two cubical dice to meet or exceed that value.

The higher the knee, the bigger the payout. Rule exceptions:
If knee is 1, the house wins with a |wkick|n.
Knee is 2-3, the house pays 1:1
Knee is 4-6, the house pays 2:1
Knee is 7-9, the house pays 3:1
Knee is 10, the house pays 5:1

If hobbits roll a 2, |wsnake eyes|n, troll is scared, and is a |wpush|n.
If hobbits roll 11 or 12, they overshoot into the |wmaw|n, and are eaten,
and the house wins.

If the hobbits |wtie|n with the troll's knee, they can either accept
the payout, or |wsplit|n, where they double their bet, roll a
second pair of dice that combines with the initial roll to make
two separate bids. The hobbits choose which of the new dice rolls
combine with the old rolls.
# George and the Troll:2 ends here



# Create the dice for others in the game:


# [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:3]]
@create pair of dice: typeclasses.things.Dice
#
@desc dice = Couple of cubical blocks painted green.
#
@set dice/number = 2
# George and the Troll:3 ends here



# And create the large d10 for the Troll:


# [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:4]]
@create die: typeclasses.things.Dice
#
@desc die = Large chipped bone to make a rollable die.
#
@set dice/size = 10
# George and the Troll:4 ends here



# Transfer the dice:


# [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:5]]
nick diceto $1 = @teleport dice = $1
# George and the Troll:5 ends here



# Adjust a character’s money:


# [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:6]]
@nick pouch $1 = py me.search("$1").create_pouch("pouch", "small, leather pouch", me)
#
@nick purse $1 = py me.search("$1").create_pouch("purse", "small, leather purse", me)
#
@nick gold $1 $2 = py me.search("$1").adjust_coins($2)
#
@nick gold $1 = py me.search("$1").how_many_coins()
# George and the Troll:6 ends here

# The Game Phrases
# Make them =nicks= to make it really easy to type them.


# [[file:../../../projects/mud-games.org::*The Game Phrases][The Game Phrases:1]]
@nick play = say Want to play |yTrollsess and Hobbitsess|n? It fun!
#
@nick play $1 = say/to $1 = Want to play |yTrollsess and Hobbitsess|n? It fun!
#
@nick bet = say What you want to bet?
#
@nick bet $1 = say/to $1 = What you want to bet?
#
@nick start = say Me start game. Me set |wknee|n. Bigger the knee, the more me give you. You roll lower, me keep your coins.
#
@nick next = say Now you |groll|n dice.
#
@nick next $1 = say/to $1 = Now you |groll|n dice.
#
@nick one = say << Hrrm, ^ Goood, ^ Mmmm, ^ >> Me got one! Me kick hobbitsess. Me won.
@nick maw = say << Hrrm, ^ Goood, ^ Mmmm, ^ >> You rolled too high! Me eatsess hobbitsess. Me won.
#
@nick two = say << Hrrm, ^ Ugh ^ Mmmm, ^ >> Me no like snake eyesess. No one win.
# The Game Phrases:1 ends here
