Been playing around with the multiple choice commands. They seem to work quite well and save a lot of faffing around with booleans and integers! Choices-within-choices also nice and straightforward :)
(I probably have a few too many 'dones' in this code snippet - a result of not having the time to ascertain exactly where one was missing! The following does work as it's supposed to, though.)
: match "talk server" {
: if (is_at "food_van") {
: if (!menu_examined) {
: print "'WHAT YOU WANT? LOOK AT MENU.'" ;
: done ;
}
: if (menu_examined) {
: add_choice "ICE CREAM" {
: print "'SILVER COIN PLEASE.'" ;
: if (is_carried "silver_coin") {
: add_choice "Y" {
: print "'HERE'S YOUR ICE CREAM. THANKS!'" ;
: create "ice_cream" target = "inventory" ;
: destroy {
entity = silver_coin
}
: success ;
: done ;
}
: add_choice "N" {
: print "MAYBE ANOTHER TIME..." ;
: done ;
}
: choose "GIVE SILVER COIN?" ;
: done ;
}
: done ;
}
: add_choice "POPCORN" {
: print "'GOLD COIN PLEASE.'" ;
: if (is_carried "gold_coin") {
: add_choice "Y" {
: print "'HERE'S YOUR POPCORN. THANKS!'" ;
: create "popcorn" target = "inventory" ;
: destroy {
entity = gold_coin
}
: success ;
: done ;
}
: add_choice "N" {
: print "MAYBE ANOTHER TIME..." ;
: done ;
}
: choose "GIVE GOLD COIN?" ;
: done ;
}
: done ;
}
: add_choice "HOT DOG" {
: print "'PLATINUM COIN PLEASE.'" ;
: done ;
}
: choose "WHAT YOU WANT?" ;
: done ;
}
: done ;
}
}