( Eat Drink Man Woman Ginger@FurToonia 09/04/98 ) ( ) ( Creates/deletes fake item foodstuffs and handles their consumption. ) ( ) ( Setup: @act feat;fdrink;order=# ) ( This program requires MACROS: .tell, .otell, .null? and .yes? ) ( ) ( Use: order pulls you into menu-driven creator ) ( feat/fdrink lets you consume created fake foodies ) ( ) ( You can also CALL this program from MUF or MPI. ) ( MUF: # CALL ) ( MPI: {muf:#,} ) ( ) ( is a list of parameters describing the food, separated by ) ( semicolons. Any omitted parameters will be replaced by defaults. ) ( order #help for more info. ) lvar arg lvar where lvar lname lvar drink? lvar descr lvar scent lvar usename lvar format lvar oformat lvar finishmsg lvar ofinishmsg lvar useddesc lvar bites lvar foodvalue lvar setup? lvar temp lvar count $def isbad? dup .null? if pop "EDMW: Food property error." .tell exit then : removefood descr @ where @ "/" strcat nextprop dup .null? if exit then temp ! begin temp @ dup .null? if pop break then dup descr @ swap nextprop swap descr @ swap remove_prop temp ! repeat ; : wherefood #-1 descr ! arg @ "*" strcat "*" swap strcat lname ! me @ "_fake/" nextprop begin dup .null? if break then dup temp ! "/" explode pop pop lname @ smatch if me @ temp @ "/isfood?" strcat getpropstr "y" stringpfx 1 = if temp @ where ! me @ descr ! count @ 1 + count ! then then me @ temp @ nextprop repeat descr @ ok? if exit then loc @ "_fake/" nextprop begin dup .null? if break then dup temp ! "/" explode pop pop lname @ smatch if loc @ temp @ "/isfood?" strcat getpropstr "y" stringpfx 1 = if temp @ where ! loc @ descr ! count @ 1 + count ! then then loc @ temp @ nextprop repeat ; : consume_me 0 count ! wherefood count @ 0 = if "I don't see that here." .tell exit then count @ 1 > if "I don't know which one you mean." .tell exit then drink? @ descr @ where @ "/drink?" strcat getpropstr .yes? not and if "You can't drink food." .tell exit then drink? @ not descr @ where @ "/drink?" strcat getpropstr .yes? and if "You can't eat a beverage." .tell exit then (now to eat the damn thing) descr @ where @ "/bites" strcat getpropstr isbad? atoi 1 - descr @ swap where @ "/bites" strcat swap intostr 0 addprop descr @ where @ "/bitten?" strcat getpropstr .yes? not if descr @ where @ "/bitten?" strcat "y" 0 addprop descr @ where @ "/useddesc" strcat getpropstr isbad? descr @ swap where @ "/desc" strcat swap 0 addprop then me @ "_prefs/hunger?" getpropstr .yes? if descr @ where @ "/foodvalue" strcat getpropstr isbad? atoi me @ "_hunger/current" getpropstr atoi + me @ swap "_hunger/current" swap intostr 0 addprop then descr @ where @ "/bites" strcat getpropstr atoi 1 < if descr @ where @ "/finishmsg" strcat getpropstr isbad? else descr @ where @ "/format" strcat getpropstr isbad? then where @ 6 strcut swap pop "%text" subst descr @ where @ "/usename" strcat getpropstr isbad? "%use" subst .tell descr @ where @ "/bites" strcat getpropstr atoi 1 < if descr @ where @ "/ofinishmsg" strcat getpropstr isbad? else descr @ where @ "/oformat" strcat getpropstr isbad? then where @ 6 strcut swap pop "%text" subst descr @ where @ "/usename" strcat getpropstr isbad? "%use" subst me @ swap pronoun_sub me @ name " " strcat swap strcat .otell descr @ where @ "/bites" strcat getpropstr atoi 1 < if removefood then ; : makethatbastard setup? @ not if "EDMW: Oopsie...." .tell exit then "Creating fake " drink? @ if "drink" else "food" then strcat " item...." strcat .tell me @ "_fake/" lname @ strcat "/show" strcat "yes" 0 addprop me @ "_fake/" lname @ strcat "/isfood?" strcat "yes" 0 addprop me @ "_fake/" lname @ strcat "/drink?" strcat drink? @ if "y" else "n" then 0 addprop me @ "_fake/" lname @ strcat "/desc" strcat descr @ 0 addprop me @ "_fake/" lname @ strcat "/scent" strcat scent @ 0 addprop me @ "_fake/" lname @ strcat "/usename" strcat usename @ 0 addprop me @ "_fake/" lname @ strcat "/format" strcat format @ 0 addprop me @ "_fake/" lname @ strcat "/oformat" strcat oformat @ 0 addprop me @ "_fake/" lname @ strcat "/finishmsg" strcat finishmsg @ 0 addprop me @ "_fake/" lname @ strcat "/ofinishmsg" strcat ofinishmsg @ 0 addprop me @ "_fake/" lname @ strcat "/useddesc" strcat useddesc @ 0 addprop me @ "_fake/" lname @ strcat "/bites" strcat bites @ intostr 0 addprop me @ "_fake/" lname @ strcat "/foodvalue" strcat foodvalue @ intostr 0 addprop " " .tell "Done." .tell ; : makeit (pulls props out of info string) setup? @ if makethatbastard exit then arg @ ";" explode 12 = not if "EDMW: Improper number of parameters given." .tell " " .tell "Format:" .tell "name;drink?;desc;scent;usename;format;oformat;finishmsg;ofinishmsg;useddesc;bites;foodvalue" .tell "To use defaults for an item, leave it out, but include all semicolons:" .tell " " .tell "Example: A Fluffy Hamster;n;A yummy hamster.;Smells tasty!;hamster;;;;;;;" .tell exit then dup .null? if pop "Something" then lname ! dup .null? swap "y" stringcmp 0 = not or if 0 else 1 then drink? ! dup .null? if pop drink? @ if "A drinkable looking liquid." else "Something edible looking." then then descr ! dup .null? if pop drink? @ if "Smells drinkable." else "Smells edible." then then scent ! dup .null? if pop lname @ then usename ! dup .null? if pop drink? @ if "You take a sip of %text, savoring its taste." else "You take a bite of %text, savoring its flavour." then then format ! dup .null? if pop drink? @ if "takes a sip of %text, obviously enjoying it." else "takes a bite of %text, obviously enjoying it." then then oformat ! dup .null? if pop drink? @ if "You take a sip of %text, finishing it off." else "You take a bite of %text, finishing it off." then then finishmsg ! dup .null? if pop drink? @ if "takes a sip of %text, finishing it off." else "takes a bite of %text, finishing it off." then then ofinishmsg ! dup .null? if pop drink? @ if "It looks drinkable, but someone has already had a sip." else "It looks edible, but someone has already eaten some of it." then then useddesc ! dup dup .null? swap number? not or if pop 3 else atoi then bites ! dup dup .null? swap number? not or if pop 5 else atoi then foodvalue ! 1 setup? ! makethatbastard ; : menus "Hi there!" .tell " " .tell "Would you like to enter the fake food creator (y/n)?" .tell read "y" stringcmp 0 = not if "Okay. Sorry to trouble you." .tell "Item will be made with all defaults." .tell arg @ ";;;;;;;;;;;" strcat arg ! makeit exit then "Cool! Welcome to the fake food creator." .tell " " .tell "The name of your food appears to be '" arg @ strcat "'." strcat .tell " Type . and return to keep that name, or enter a new name for the food:" .tell read dup "." stringcmp 0 = if pop arg @ then lname ! " " .tell "Is your item a drink (y/n)?" .tell read "y" stringpfx 1 = if 1 else 0 then drink? ! " " .tell "Please enter a description for your item, or . for defaults." .tell " Food default: Something edible looking." .tell " Drink default: A drinkable looking liquid." .tell read dup "." stringcmp 0 = if pop drink? @ if "A drinkable looking liquid." else "Something edible looking." then then descr ! " " .tell "Please enter a scent for your item, or . for defaults." .tell " Food default: Smells edible." .tell " Drink default: Smells drinkable." .tell read dup "." stringcmp 0 = if pop drink? @ if "Smells drinkable." else "Smells edible." then then scent ! " " .tell "Please give the food a name to be used in the eat/drink messages, or" .tell ". for defaults." .tell " This defaults to the full name of the item." .tell " Example: Name - A juicy steak; Usename - steak." .tell " This name is substituted for %use in the messages." .tell " The full name is substituted for %text." .tell read dup "." stringcmp 0 = if pop lname @ then usename ! " " .tell "Enter the message which the 'user' of the item sees when it is used, or" .tell ". for defaults." .tell " Food default: You take a bite of %text, savoring its flavour." .tell " Drink default: You take a sip of %text, savoring its taste." .tell read dup "." stringcmp 0 = if pop drink? @ if "You take a sip of %text, savoring its taste." else "You take a bite of %text, savoring its flavour." then then format ! " " .tell "Enter the message which others in the room see when the item is used." .tell ". for defaults." .tell " Food default: takes a bite of %text, obviously enjoying it." .tell " Drink default: takes a sip of %text, obviously enjoying it." .tell read dup "." stringcmp 0 = if pop drink? @ if "takes a sip of %text, obviously enjoying it." else "takes a bite of %text, obviously enjoying it." then then oformat ! " " .tell "Enter the message given when the last bit of the item is used, or ." .tell "for defaults." .tell " Food default: You take a bite of %text, finishing it off." .tell " Drink default: You take a sip of %text, finishing it off." .tell read dup "." stringcmp 0 = if pop drink? @ if "You take a sip of %text, finishing it off." else "You take a bite of %text, finishing it off." then then finishmsg ! " " .tell "Enter the message others see when the item is finished off, or . for" .tell "defaults." .tell " Food default: takes a bite of %text, finishing it off." .tell " Drink default: takes a sip of %text, finishing it off." .tell read dup "." stringcmp 0 = if pop drink? @ if "takes a sip of %text, finishing it off." else "takes a bite of %text, finishing it off." then then ofinishmsg ! " " .tell "Enter what the item looks like after it's been partially used, or ." .tell "for defaults." .tell " Food default: It looks edible, but someone has already eaten some of it." .tell " Drink default: It looks drinkable, but someone has already had a sip." .tell read dup "." stringcmp 0 = if pop drink? @ if "It looks drinkable, but someone has already had a sip." else "It looks edible, but someone has already eaten some of it." then then useddesc ! " " .tell "Enter the number of 'uses' the item has before it's all gone, or ." .tell "for default (3)." .tell read dup dup "." stringcmp 0 = swap number? not or if pop 3 else atoi then bites ! " " .tell "Some furs are very bored and assign a 'value' to their food items so that" .tell "they can roleplay hunger. Either assign a value or enter . for the" .tell "default (5):" .tell read dup dup "." stringcmp 0 = swap number? not or if pop 5 else atoi then foodvalue ! 1 setup? ! makethatbastard ; : printhelp " " .tell "Eat Drink Man Woman Ginger@FurToonia 09/04/98" .tell " " .tell "Use: order Create a fake food object (menu-driven)" .tell " feat Eat a fake food item called " .tell " fdrink Drink a fake drink called " .tell " " .tell "Setup: @open order;feat;fdrink=#" .tell " " .tell "The 'order' action may have any name but the 'eat' and 'drink' actions" .tell "MUST have the word 'eat' or 'drink' in their respective names. They can" .tell "be named 'eat' and 'drink' or 'gnarfeat' and 'beandrink' or whatever." .tell " " .tell command @ " #help2 for information about calling this program from MUF or MPI." strcat .tell command @ " #help3 for info about the 'food value' property." strcat .tell " " .tell ; : help2 " " .tell "Eat Drink Man Woman Ginger@FurToonia 09/04/98" .tell " " .tell "This program may be called from another program or from MPI, using the" .tell "following formats:" .tell " " .tell "MUF: # CALL" .tell "MPI: {muf:#,}" .tell " " .tell " is a command line containing the properties you want the" .tell "food to have, separated by semicolons. They must be given in order:" .tell "name;drink?;desc;scent;usename;format;oformat;finishmsg;ofinishmsg;" .tell "useddesc;bites;foodvalue" .tell " " .tell "You don't have to include all the parameters but you do need all the ;s." .tell "Example: A furry hamster;n;A soft yummy hamster;Smells hamstery.;;;;;;;;" .tell " " .tell ; : help3 " " .tell "Eat Drink Man Woman Ginger@FurToonia 09/04/98" .tell " " .tell "This program sets a food value on all its fake objects. No-one is quite" .tell "sure why." .tell " " .tell "When a character who is set _prefs/hunger?:yes consumes an EDMW food item," .tell "the program adds the value property of the food to a property on the" .tell "character called _hunger/current. Presumably this will aid in some form" .tell "of roleplaying -- but if you don't use it and don't know what it means," .tell "it will not hurt you. It probably involves either another program or" .tell "something nasty like MPI. :)" .tell " " .tell ; : main dup "#help3" stringcmp 0 = if pop help3 exit then dup "#help2" stringcmp 0 = if pop help2 exit then dup "#help" stringcmp 0 = if pop printhelp exit then dup .null? command @ "eat" instring 0 = not and if pop "EDMW: Eat what?" .tell exit then dup .null? command @ "drink" instring 0 = not and if pop "EDMW: Drink what?" .tell exit then dup .null? if pop printhelp exit then arg ! command @ "eat" instring 0 = not if 0 drink? ! consume_me exit then command @ "drink" instring 0 = not if 1 drink? ! consume_me exit then 0 setup? ! trig program? if makeit exit then arg @ ";" instr 0 = not if makeit exit then menus ;