diff --git a/game.exe b/game.exe index b34fc99..a394d0f 100755 Binary files a/game.exe and b/game.exe differ diff --git a/game.prj b/game.prj index 0020605..58563fb 100755 Binary files a/game.prj and b/game.prj differ diff --git a/jeanne.jor b/jeanne.jor index 37e8fa0..fee3c59 100755 --- a/jeanne.jor +++ b/jeanne.jor @@ -14,7 +14,7 @@ car :touch :noname 0 player.state DRIVING f! -:| chuck.state @ CHUCK-HOME = if e_chuck yield then +:| CHUCK-HOME state@ if e_chuck yield then player.driving? not if car yield then done |; ' entities redefine @@ -33,6 +33,7 @@ touch-next 6 21 2= dup pete say" Nobody home, I guess." jeanne say" Go away before I call the\cops, Pete!" pete say" Oh.\I guess she's still mad." + JEANNE-ANGRY setstate else pete say" Jeanne hates me enough already\without driving through her\front door!" then diff --git a/jorth.c b/jorth.c index a124805..c47c5e2 100755 --- a/jorth.c +++ b/jorth.c @@ -446,6 +446,7 @@ void f_comma() { } void f_allot() { + memset(HERE, 0, TOP().u); HERE = CELL_OFFSET(HERE, TOP().u); DROP(1); } diff --git a/petehous.jor b/petehous.jor index 579d375..f8d92a7 100755 --- a/petehous.jor +++ b/petehous.jor @@ -9,10 +9,55 @@ table :touch pete say" Yesterday's breakfast is still\on the table." say" Maybe the day before's too." ;entity chair :touch pete say" I've had my morning coffee\already." ;entity bed :touch pete say" I'm not tired yet." ;entity -e_phone :touch phone - :| s" [don't pick up]" :| pete say" Hmm... no answer." |; yield - s" Hey Pete, what's up?" :| pete say" Not much, old friend!" |; yield - done |; choose ;entity +e_phone :touch phone :| + +s" [don't pick up]" +:| pete say" Hmm... no answer." |; yield + +s" Hey Pete, what's up?" +:| pete say" Not much, old friend!" + 0 begin phone :| + JEANNE-ANGRY state@ CHUCK-GONE state@ not and if + s" I hear Jeanne's awful mad\at you!" + :| pete say" Ohh, she'll come round." + phone say" What'd you do, anyway?" + pete say" Me?! What makes you think I\did anything?" + phone say" Come on, Pete, how long\have we known each other?" + pete say" Haw haw haw! Well, it's a\pretty good story..." + say" I was taking Chuck out for a\midnight ride, see..." + phone say" *sigh* You didn't even think\of asking, did you." + pete say" Hell no! He's my horse!" + phone say" Chuck hasn't been your horse\for years, Pete. That's what\happens when you sell them." + pete say" Quit moralizing and let me tell\my story. So there I was,\riding on the trail..." + say" We get to the clearing, and\I look up at the stars." + say" It's the clearest night\you've ever seen in your life." + say" Just as I'm looking up,\I see something." + phone say" 'Something'?" + pete say" I have seen my share of\airplanes and shooting stars.\This was not that." + say" I'm not saying it was aliens..." + phone say" ... but it was aliens." + pete say" I'm not saying it!\You said it." + say" Anyway, I get off Chuck and\lie down on the grass, to\get a better look, see?" + say" Maybe have a pull or two of\whiskey, while I'm watching\the sky." + say" I guess I must've dozed off,\because next thing I know\it's morning and Chuck's gone." + phone say" You LOST him??" + pete say" I figured he just went home!\But when I went to Jeanne's,\he wasn't there." + phone say" You lost him." + pete say" He's a smart old goat,\just like me. He'll\turn up soon." + CHUCK-GONE setstate + |; yield + then + CHUCK-GONE state@ if + s" You found Chuck yet?" + :| pete say" I'm sure he'll turn up soon!\Sheesh, get off my back." |; yield + then + + s" Goodbye, Pete." :| pete say" Goodbye!" drop 1 |; yield + done |; choose + dup until drop +|; yield + +done |; choose ;entity :noname reset-level diff --git a/road.jor b/road.jor index 5d4ead4..118988f 100755 --- a/road.jor +++ b/road.jor @@ -4,7 +4,7 @@ :noname 1 player.state DRIVING f! - :| chuck.state @ CHUCK-HOME = if chuck yield then + :| CHUCK-HOME state@ if chuck yield then done |; ' entities redefine :| touch-begin E leaving? dup diff --git a/state.jor b/state.jor index 44d5561..b3fc23c 100755 --- a/state.jor +++ b/state.jor @@ -1,12 +1,20 @@ -0 const CHUCK-GONE -1 const CHUCK-SEARCH +0 const JEANNE-ANGRY +1 const CHUCK-GONE 2 const CHUCK-FOLLOW 3 const CHUCK-HOME -var chuck.state + +3 const LAST-STATE +array state LAST-STATE 8 / 1 + allot + +: statef ( f -- v f ) dup 8 % 1 swap << swap 8 / state + swap ; +: state! ( b f -- ) statef f! ; +: state@ ( b f -- ) statef f@ ; +: setstate 1 swap state! ; +: clearstate 0 swap state! ; 16 18 W ' {horse} defentity p_chuck :noname :| player yield - chuck.state @ CHUCK-FOLLOW = if p_chuck yield then + CHUCK-FOLLOW state@ if p_chuck yield then done |; ' party redefine ; ' onload redefine \ No newline at end of file diff --git a/trail1.jor b/trail1.jor index ff45383..187d567 100755 --- a/trail1.jor +++ b/trail1.jor @@ -10,7 +10,7 @@ car :touch :noname 0 player.state DRIVING f! -:| chuck.state @ CHUCK-SEARCH = if e_chuck yield then +:| CHUCK-GONE state@ if e_chuck yield then player.driving? not if car yield then done |; ' entities redefine @@ -21,7 +21,7 @@ touch-begin S leaving? dup else player move-entity 13 7 road.jor queue-level then then -chuck.state @ CHUCK-SEARCH = if +CHUCK-GONE state@ if touch-next 37 60 2= dup if pete say" Oh for the love of..."