Skip to content

Commit 9c4f9fa

Browse files
committed
Noop check: partyfoul + add option to skip z_read_char
1 parent 93cff3f commit 9c4f9fa

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

frotz/src/games/partyfoul.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2424

2525
// Party Foul - http://ifdb.tads.org/viewgame?id=cqwq699i9qiqdju
2626

27-
const zword partyfoul_special_ram_addrs[3] = {
27+
const zword partyfoul_special_ram_addrs[4] = {
2828
17509, // Spread peanut butter on frank (alt. 17755, 19428, 21423, 47829)
2929
1923, // plug the toaster
30+
2259, // plug the hair dryer
3031
28036, // Waiting for your husband to be prepared to leave the party (alt. 28037, 32186)
3132
};
3233

33-
const char *partyfoul_intro[] = { "\n",
34-
"no\n" };
34+
const char *partyfoul_intro[] = { "\n", "no\n", "\n" };
3535

3636
zword* partyfoul_ram_addrs(int *n) {
37-
*n = 3;
37+
*n = 4;
3838
return partyfoul_special_ram_addrs;
3939
}
4040

4141
char** partyfoul_intro_actions(int *n) {
42-
*n = 2;
42+
*n = 3;
43+
skip_z_read_char = TRUE;
4344
return partyfoul_intro;
4445
}
4546

4647
char* partyfoul_clean_observation(char* obs) {
4748
char* pch;
48-
pch = strstr(obs, "> ");
49+
pch = strstr(obs, "> ");
4950
if (pch != NULL) {
50-
*(pch-2) = '\0';
51+
*(pch-1) = '\0';
5152
}
5253
return obs + strspn(obs, "\n "); // Skip leading newlines and whitespaces.
5354
}
@@ -108,4 +109,18 @@ int partyfoul_ignore_attr_clr(zword obj_num, zword attr_idx) {
108109
}
109110

110111
void partyfoul_clean_world_objs(zobject* objs) {
112+
for (int i=1; i<=partyfoul_get_num_world_objs(); ++i) {
113+
clear_attr(&objs[i], 29);
114+
clear_attr(&objs[i], 30);
115+
}
116+
117+
clear_attr(&objs[124], 21);
118+
119+
objs[49].parent = 0;
120+
objs[67].parent = 0;
121+
objs[84].parent = 0;
122+
objs[85].parent = 0;
123+
objs[86].parent = 0;
124+
objs[95].parent = 0;
125+
objs[100].parent = 0;
111126
}

frotz/src/interface/frotz_interface.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ extern int getRngCounter();
7373
extern void setRng(long, int, int);
7474

7575
zbyte next_opcode;
76+
bool skip_z_read_char = FALSE;
7677
int last_ret_pc = -1;
7778
int desired_seed = 0;
7879
int ROM_IDX = 0;
@@ -103,7 +104,7 @@ void zstep() {
103104
// Run the Z-Machine until it requires user input
104105
void run_free() {
105106
// Opcode 228 (z_read) and 246 (z_read_char) indicate need for user input
106-
while (next_opcode != 228 && next_opcode != 246 && emulator_halted <= 0) {
107+
while (next_opcode != 228 && (next_opcode != 246 || skip_z_read_char) && emulator_halted <= 0) {
107108
zstep();
108109
}
109110
}

frotz/src/interface/frotz_interface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ extern void getRAM(unsigned char *ram);
5353

5454
int filter_candidate_actions(char *candidate_actions, char *valid_actions, char *hashes);
5555

56+
extern bool skip_z_read_char;
57+
5658
extern char world[256 + 8192]; // Upper + lower screens.
5759

5860
extern int tw_max_score;

jericho/game_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
"name": "partyfoul",
335335
"rom": "partyfoul.z8",
336336
"seed" : 0,
337-
"walkthrough" : "l/give drink to frank/look at frank/look at ron/w/z/take purse/e/n/take jar/put jar in purse/w/l/take knife/put knife in purse/e/l/take peanut butter/s/w/take knife/spread peanut butter on frank/e/n/open door/l/open closet/take hair dryer/plug hair dryer into wall/turn on hair dryer/turn on space heater/drop hair dryer/e/nw/plug toaster into wall/turn on toaster/e/z/z/l/take napkin/s/order drink/take celery/wipe celery with napkin/put celery in purse/n/take peanut butter/w/take knife/put peanut butter on celery/put raisins on celery/give celery to barb/z/z/z",
337+
"walkthrough" : "give drink to frank/look at frank/look at ron/w/take purse/e/n/take jar/w/take knife/put knife in purse/e/take peanut butter/s/w/take knife/spread peanut butter on frank/put jar into purse/e/n/open door/open closet/take hair dryer/plug hair dryer into wall/turn on hair dryer/turn on space heater/drop hair dryer/e/nw/plug toaster into wall/z/z/turn on toaster/e/z/z/take napkin/s/order drink/take celery/wipe celery with napkin/put celery in purse/n/w/take knife/put peanut butter on celery/put raisins on celery/give celery to barb",
338338
"grammar" : "awake/awaken/wake;awake/awaken/wake up;blow my nose;blow nose;blow your nose;bother/curses/darn/drat;carry/hold/take inventory;chuckle/laugh;cringe/swear/pout/sigh;damn/fuck/shit;exit/leave/out/stand;get out/off/up;go/run/walk;hocus pocus;hop/jump/skip;i/inv/inventory;info/about/hints/hint/help;l/look;listen;long/verbose;magic word;magic words;magic/pocus/hocus/abracadab/plough/frotz/plover/sneeze/xyzzy;nap/sleep;no;normal/brief;notify;notify off;notify on;pray;pronouns/nouns;q/quit;remember;restart;restore;save;score;short/superbrie;sing;smell/sniff;sorry;stand up;stomp/yell/scream/answer/say/shout/speak;think;think harder;transcrip/script;transcrip/script off;transcrip/script on;tutorial mode;tutorial mode off;tutorial mode on;tutorial off;tutorial on;verify;version;wait/z;wave;y/yes;yawn;awake/awaken/wake OBJ;awake/awaken/wake OBJ up;awake/awaken/wake up OBJ;burn/light OBJ;buy/purchase OBJ;carry/hold/take off OBJ;chop/cut/prune/slice OBJ;clean/dust/polish/rub/scrub/shine/sweep/wipe OBJ;climb/scale OBJ;climb/scale up/over OBJ;close/cover/shut OBJ;close/cover/shut up OBJ;converse with OBJ;create/make OBJ;create/make a OBJ;create/make the OBJ;cross/enter/go/run/walk OBJ;discard/drop/throw OBJ;disconnec/unplug OBJ;disrobe/doff/shed/remove OBJ;don/wear OBJ;drag/pull OBJ;drink/sip/swallow OBJ;dry OBJ;eat OBJ;embrace/hug/kiss OBJ;feel/touch OBJ;flirt with OBJ;get in/into/on/onto OBJ;get off OBJ;get/carry/hold/take OBJ;go/run/walk into/in/inside/through OBJ;hear OBJ;kick/throttle/smother/attack/break/crack/destroy/fight/hit/kill/murder/punch/smash/thump/torture/wreck OBJ;knock over OBJ;l/look at OBJ;l/look inside/in/into/through OBJ;l/look under OBJ;listen to OBJ;mess up OBJ;mess/tilt/disturb OBJ;open/uncover/unwrap OBJ;order/buy/purchase OBJ;order/buy/purchase a OBJ;pick OBJ up;pick up OBJ;play OBJ;pour/spill OBJ;put OBJ down;put down OBJ;put on OBJ;read/check/describe/examine/watch/x OBJ;rotate/screw/turn/twist/unscrew OBJ;search OBJ;shoving/clear/move/press/push/shift OBJ;sit on OBJ;sit on top of OBJ;sit on/in/inside OBJ;smell/sniff OBJ;squash/squeeze OBJ;stand on OBJ;swing OBJ;swing on OBJ;switch OBJ;switch/rotate/screw/turn/twist/unscrew OBJ off;switch/rotate/screw/turn/twist/unscrew OBJ on;switch/rotate/screw/turn/twist/unscrew on OBJ;switch/rotate/screw/turn/twist/unscrew/close/cover/shut off OBJ;talk OBJ;talk to OBJ;taste OBJ;un plug OBJ;wave OBJ;wink at OBJ;adjust/set OBJ to OBJ;aim/point OBJ at OBJ;aim/point OBJ towards OBJ;answer/say/shout/speak OBJ to OBJ;apply OBJ to OBJ;apply/paint/spread/smear OBJ onto OBJ;ask OBJ about OBJ;ask OBJ for OBJ;attach/fasten/fix/tie OBJ to OBJ;carry/hold/take OBJ off OBJ;clean/dust/polish/rub/scrub/shine/sweep/wipe OBJ with OBJ;clean/dust/polish/rub/scrub/shine/sweep/wipe down OBJ with OBJ;clean/dust/polish/rub/scrub/shine/sweep/wipe up OBJ with OBJ;connect OBJ to OBJ;connect/plug OBJ into OBJ;consult OBJ on/about OBJ;discard/drop/throw OBJ at/against/on/onto OBJ;discard/drop/throw OBJ in/into/down OBJ;discard/drop/throw/put OBJ on/onto OBJ;display/present/show OBJ OBJ;display/present/show OBJ to OBJ;draw on OBJ with OBJ;feed/give/offer/pay OBJ OBJ;feed/give/offer/pay OBJ to OBJ;insert OBJ in/into OBJ;l/look up OBJ in OBJ;lock OBJ with OBJ;paint/spread/smear OBJ on OBJ;plug in OBJ OBJ;plug in OBJ into OBJ;plug in OBJ to OBJ;plug/plug OBJ in OBJ;put OBJ in/inside/into OBJ;read OBJ in OBJ;read about OBJ in OBJ;remove/get/carry/hold/take OBJ from OBJ;tell OBJ about OBJ;unlock/open/uncover/unwrap OBJ with OBJ;",
339339
"max_word_length" : 9
340340
}

tools/test_games.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,14 @@
471471
"examine tree", # snorkel hanging from the tree. You take it.
472472
"examine boot", # boot further reveals a crystal, which you take.
473473
]
474+
},
475+
"partyfoul.z8": {
476+
"*": [
477+
34, 35, # Lights turn off and back on.
478+
39, # It seems as if someone has just turned something off in another room (the hair dryer).
479+
41, # You get caugth with celery in your hands.
480+
47, # Abbey take the knife from your hands.
481+
],
474482
}
475483
}
476484

@@ -887,7 +895,11 @@
887895
]
888896
},
889897
"partyfoul.z8": {
890-
"z": [53, 54], # Ending sequence.
898+
1: "look at frank",
899+
2: "look at ron",
900+
7: "take jar", # Abbey stops you.
901+
30: "z", # Waiting for Abbey to leave the room.
902+
31: "z", # Waiting for Abbey to leave the room.
891903
},
892904
"pentari.z5": {},
893905
"planetfall.z3": {

0 commit comments

Comments
 (0)