Home
Explore games
Help
Log in
Playfic is now in read-only mode.
You can still play existing games, but new signups and game editing is disabled.
Read the announcement.
Log in
Username
Password (
Forgot it?
)
Login
Sushi Delivery
by
Nolan
Played 2,953 times
View game source
(spoilers!)
Download the
.z8 file
Source Code
"Sushi Delivery" To remove stray punctuation: (- PunctuationStripping(); players_command = 100 + WordCount(); -) To remove quotes: (- Quotestripping(); players_command = 100 + WordCount(); -) To remove apostrophes: (- SingleQuotestripping(); players_command = 100 + WordCount(); -) To remove question marks: (- Questionstripping(); players_command = 100 + WordCount(); -) To remove exclamation points: (- ExclamationStripping(); players_command = 100 + WordCount(); -) To remove periods: (- PeriodStripping(); players_command = 100 + WordCount(); -) To resolve punctuated titles: (- DeTitler(); players_command = 100 + WordCount(); -) Include (- [ Detitler i j buffer_length flag; #ifdef TARGET_ZCODE; buffer_length = buffer->1+(WORDSIZE-1); #endif; #ifdef TARGET_GLULX; buffer_length = (buffer-->0)+(WORDSIZE-1); #endif; for (i = WORDSIZE : i <= buffer_length: i++) { if ((buffer->i) == '.' && (i > WORDSIZE + 1)) { if ((buffer->(i-1)=='r') && (buffer->(i-2)=='m') && ((buffer->(i-3)==' ') || ((i-3) < WORDSIZE))) flag = 1; if ((buffer->(i-1)=='r') && (buffer->(i-2)=='d') && ((buffer->(i-3)==' ') || ((i-3) < WORDSIZE))) flag = 1; if ((buffer->(i-1)=='t') && (buffer->(i-2)=='s') && ((buffer->(i-3)==' ') || ((i-3) < WORDSIZE))) flag = 1; if ((buffer->(i-1)=='s') && (buffer->(i-2)=='r') && (buffer->(i-3)=='m') && ((buffer->(i-4)==' ') || ((i-4) < WORDSIZE))) flag = 1; if ((buffer->(i-1)=='v') && (buffer->(i-2)=='e') && (buffer->(i-3)=='r') && ((buffer->(i-4)==' ') || ((i-4) < WORDSIZE))) flag = 1; if ((buffer->(i-1)=='f') && (buffer->(i-2)=='o') && (buffer->(i-3)=='r') && (buffer->(i-4)=='p') && ((buffer->(i-5)==' ') || ((i-5) < WORDSIZE))) flag = 1; if (flag) buffer->i = ' '; } } VM_Tokenise(buffer, parse); ]; -) Include (- [ KeyPause i; i = VM_KeyChar(); rfalse; ]; [ SPACEPause i; while (i ~= 13 or 31 or 32) { i = VM_KeyChar(); } ]; [ GetKey i; i = VM_KeyChar(); return i; ]; -) To clear the/-- screen: (- VM_ClearScreen(0); -) To clear only the/-- main screen: (- VM_ClearScreen(2); -) To clear only the/-- status line: (- VM_ClearScreen(1); -). To wait for any key: (- KeyPause(); -) To wait for the/-- SPACE key: (- SPACEPause(); -) To decide what number is the chosen letter: (- GetKey() -) To pause the/-- game: say "[paragraph break]Please press SPACE to continue."; wait for the SPACE key; clear the screen. To center (quote - text): (- CenterPrintComplex({quote}); -); To center (quote - text) at the/-- row (depth - a number): (- CenterPrint({quote}, {depth}); -); To stop the/-- game abruptly: (- quit; -) To show the/-- current quotation: (- ClearBoxedText(); -); Include (- #ifndef printed_text; Array printed_text --> 64; #endif; [ CenterPrint str depth i j; font off; i = VM_ScreenWidth(); VM_PrintToBuffer(printed_text, 63, str); j = (i-(printed_text-->0))/2; j = j-1; VM_MoveCursorInStatusLine(depth, j); print (I7_string) str; font on; ]; [ CenterPrintComplex str i j; font off; print "^"; i = VM_ScreenWidth(); VM_PrintToBuffer(printed_text, 63, str); j = (i-(printed_text-->0))/2; spaces j-1; print (I7_string) str; font on; ]; -) To decide what number is screen width: (- VM_ScreenWidth() -); To decide what number is screen height: (- I7ScreenHeight() -); Include (- [ I7ScreenHeight i screen_height; i = 0->32; if (screen_height == 0 or 255) screen_height = 18; screen_height = screen_height - 7; return screen_height; ]; -) To deepen the/-- status line to (depth - a number) rows: (- DeepStatus({depth}); -); To move the/-- cursor to (depth - a number): (- I7VM_MoveCursorInStatusLine({depth}); -) To right align the/-- cursor to (depth - a number): (- RightAlign({depth}); -) Include (- [ DeepStatus depth i screen_width; VM_StatusLineHeight(depth); screen_width = VM_ScreenWidth(); #ifdef TARGET_GLULX; VM_ClearScreen(1); #ifnot; style reverse; for (i=1:i<depth+1:i++) { @set_cursor i 1; spaces(screen_width); } #endif; ]; [ I7VM_MoveCursorInStatusLine depth; VM_MoveCursorInStatusLine(depth, 1); ]; [ RightAlign depth screen_width o n; screen_width = VM_ScreenWidth(); n = (+ right alignment depth +); o = screen_width - n; VM_MoveCursorInStatusLine(depth, o); ]; -) Table of Ordinary Status left central right "[location]" "" "[score]/[turn count]" Status bar table is a table-name that varies. Status bar table is the Table of Ordinary Status. To fill the/-- status bar/line with (selected table - a table-name): let __n be the number of rows in the selected table; deepen status line to __n rows; let __index be 1; repeat through selected table begin; move cursor to __index; say "[left entry]"; center central entry at row __index; right align cursor to __index; say "[right entry]"; increase __index by 1; end repeat. To say default letters: (- @set_colour 1 1; -) To say red letters: (- @set_colour 3 0; -) To say green letters: (- @set_colour 4 0; -) To say yellow letters: (- @set_colour 5 0; -) To say blue letters: (- @set_colour 6 0; -) To say magenta letters: (- @set_colour 7 0; -) To say cyan letters: (- @set_colour 8 0; -) To say white letters: (- @set_colour 9 0; -) To say black letters: (- @set_colour 2 0; -) To turn the/-- background black: (- @set_colour 0 2; -); To turn the/-- background red: (- @set_colour 0 3; -); To turn the/-- background green: (- @set_colour 0 4; -); To turn the/-- background yellow: (- @set_colour 0 5; -); To turn the/-- background blue: (- @set_colour 0 6; -); To turn the/-- background magenta: (- @set_colour 0 7; -); To turn the/-- background cyan: (- @set_colour 0 8; -); To turn the/-- background white: (- @set_colour 0 9; -); Right alignment depth is a number that varies. Right alignment depth is 14. Use undo prevention. Use no scoring. Table of Types of Sushi Topic "california roll" "tamago" "salmon" "sake" "tuna" "toro" "eel" "unagi" "sea urchin" "uni" "crab" "crab stick" "crab sticks" "kani" "kani salad" "seaweed salad" "miso soup" "wasabi" "spicy salmon" "spicy salmon roll" "spicy tuna" "spicy tuna roll" "roll" "sushi roll" "maki" "nigiri" "handroll" "hand roll" "sushi" "honey roll" "tempura" "dragon roll" "dragon" "california" "cucumber roll" "cucumber" "dynamite roll" "tomago" "tobiko" "ikura" "saba" "mackerel" "rice" "donburri" "donburi" "raw fish" "fish" "temaki" "kalbi" "gyoza" "tempura honey roll" "yam tempura honey roll" "yam tempura roll" "gyoza dumplings" "dargon roll" "red dragon roll" "red dragon" "green dragon roll" "green dragon" "black dragon roll" "black dragon" "rainbow roll" "rainbow" "salmon rose" "salmon roses" "salmon flower" "salmon flowers" "sashimi" "sashimi sushi" "sushi and sashimi" "sashimi and sushi" There is a room called On the Phone. "You are ordering sushi on the phone. Type 'order (type of sushi)' to order that type of sushi." There is a telephone. The player carries the telephone. Understand "phone" as the telephone. Instead of dropping or attacking the telephone: say "But you're in the middle of an order!"; Instead of taking the telephone: say "You're holding the telephone already!"; Understand "hang up", "hang up phone", "hang phone up", "hang up telephone" or "hang telephone up" as hanging up. Hanging up is an action applying to nothing. Carry out hanging up: try dropping the telephone; Check requesting the pronoun meanings: say "That's not a verb I recognise." instead; Understand "order [text]" as ordering. Ordering is an action applying to one topic. Carry out ordering: if the topic understood is a topic listed in the Table of Types of Sushi: say "[one of]'I'm sorry, we seem to be out of that.'[or]'We don't seem to have that today.'[or]'Wait ... no, it's not here at the moment.'[or]'Sorry, our mascot ate all of those.'[or]'Try the sushi place down the street for that.'[purely at random]"; otherwise: say "[one of]'I don't think that's even sushi!'[or]'You know this is a sushi restaurant, right?'[or]'You are a very strange customer to be asking for that.'[or]'Are you, you know, aware what kind of place this is?'[purely at random]"; Instead of jumping: say "You might get tangled in the nonexistent phone cord." Understand the command "throw" as something new. Understand "throw [something]" as throwing. Throwing is an action applying to one thing. Carry out throwing something (called the subject): try dropping the subject; Understand "give up" or "throw in the towel" as quitting the game.