From 69bab3aacdbe3e41d312a49541e002d5f23d5c30 Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Mon, 20 May 2019 15:12:25 -0400 Subject: [PATCH] complete chuck arc, complete rename of state to flag --- jeanne.jor | 10 +++++----- pete.jor | 19 +++++++++++++++++-- petehous.jor | 22 ++++++++++++++++++---- road.jor | 6 +++--- state.jor | 17 ++++++++++------- trail1.jor | 19 ++++++++----------- trail1.map | Bin 5629 -> 5629 bytes 7 files changed, 61 insertions(+), 32 deletions(-) diff --git a/jeanne.jor b/jeanne.jor index f84d44f..c3c0a1f 100755 --- a/jeanne.jor +++ b/jeanne.jor @@ -14,8 +14,8 @@ car :touch :noname 0 player.state DRIVING f! -:| CHUCK-HOME state@ if e_chuck yield then - player.driving? not if car yield then +:| CHUCK-HOME flag@ if e_chuck yield then + player.driving? not CHUCK-FOLLOW flag@ not and if car yield then done |; ' entities redefine :| @@ -27,13 +27,13 @@ touch-begin S leaving? dup then touch-next 6 21 2= dup if player.driving? not - if CHUCK-FOLLOW state@ not if + if CHUCK-FOLLOW flag@ not if noone say" * knock knock *" clear 30 sleep 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 + JEANNE-ANGRY setflag else pete say" I brought you your\damn horse, Jeanne!" jeanne say" Oh my God. Is he okay?\Hold on, I'm coming outside." @@ -46,7 +46,7 @@ touch-next 6 21 2= dup jeanne say" Don't think for a MINUTE\I'm not still furious at you." jeanne say" If I catch you on my property\again, I *will* call the cops." pete say" Alright, alright, I'm going!\Christ, no good deed goes\unpunished." - CHUCK-HOME setstate CHUCK-FOLLOW clearstate + CHUCK-HOME setflag CHUCK-FOLLOW clearflag 10 6 petehous.jor queue-level then else diff --git a/pete.jor b/pete.jor index 0ac313c..1f714ac 100755 --- a/pete.jor +++ b/pete.jor @@ -1,19 +1,26 @@ ( P E T E ) 13 8 N ' {car} defentity car +32 5 W ' {horse} defentity e_chuck car :touch move-player 1 player.state DRIVING f! ;entity +e_chuck :touch + pete say" It's good to have you\back, Chuck." + chuck say" * w h i n n y *\(I remember this place...)" +;entity + :noname -:| player.driving? not if car yield then +:| player.driving? not CHUCK-FOLLOW flag@ not and if car yield then + CHUCK-STOLEN flag@ if e_chuck yield then done |; ' entities redefine :| touch-begin S leaving? dup - if player.driving? not + if player.driving? not CHUCK-FOLLOW flag@ not and if pete say" It's too far to walk to town." else move-player 5 10 road.jor queue-level then @@ -24,6 +31,14 @@ touch-next 13 8 2= player.driving? and dup W player entity.dir ! move-player then +touch-next 19 9 2= CHUCK-FOLLOW flag@ and player entity.dir @ E = and dup + if pete say" Hmm, yeah, lots of good\grazing over here..." + say" Let's get you comfy, Chuck." move-player then +touch-next 22 9 2= CHUCK-FOLLOW flag@ and dup + if pete say" Welcome home, old buddy." + chuck say" * n e i g h *\(OK, Pete.)" + CHUCK-FOLLOW clearflag CHUCK-STOLEN setflag + 13 7 petehous.jor queue-level then touch-next 12 7 2= player.driving? not and dup if move-player 16 9 petehous.jor queue-level then touch-next 30 7 2= dup diff --git a/petehous.jor b/petehous.jor index 4ed2b1b..c5c8ec6 100755 --- a/petehous.jor +++ b/petehous.jor @@ -17,7 +17,7 @@ s" [don't pick up]" s" Hey Pete, what's up?" :| pete say" Not much, old friend!" 0 begin phone :| - JEANNE-ANGRY state@ CHUCK-GONE state@ not and if + JEANNE-ANGRY flag@ CHUCK-GONE flag@ 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?" @@ -44,14 +44,28 @@ s" Hey Pete, what's up?" 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 + CHUCK-GONE setflag |; yield then - CHUCK-GONE state@ if + CHUCK-GONE flag@ if s" You found Chuck yet?" :| pete say" I'm sure he'll turn up soon!\Sheesh, get off my back." |; yield then - + CHUCK-FOLLOW flag@ if + s" You found Chuck yet?" + :| pete say" He's right here." + chuck say" * s n o r t *" + phone say" You brought him in your house??" + phone say" Of course you did.\Never mind.\Don't even bother explaining." + |; yield + then + CHUCK-STOLEN flag@ CHUCK-HOME flag@ or CHUCK-EXPLAINED flag@ not and if + s" You found Chuck yet?" + :| pete say" He found his way home." + phone say" Well, thank goodness\for that." + CHUCK-EXPLAINED setflag + |; yield + then s" Goodbye, Pete." :| pete say" Goodbye!" drop 1 |; yield done |; choose dup until drop diff --git a/road.jor b/road.jor index 17169df..6abb7eb 100755 --- a/road.jor +++ b/road.jor @@ -3,13 +3,13 @@ 24 4 N ' {horse} defentity chuck :noname - CHUCK-FOLLOW state@ not player.state DRIVING f! - :| CHUCK-HOME state@ if chuck yield then + CHUCK-FOLLOW flag@ not player.state DRIVING f! + :| CHUCK-HOME flag@ if chuck yield then done |; ' entities redefine :| touch-begin E leaving? dup if pete say" It's 100 miles to the next town." then -touch-next 24 15 2= CHUCK-FOLLOW state@ and dup +touch-next 24 15 2= CHUCK-FOLLOW flag@ and dup if pete say" I'm not walking all the way into\town with a horse!" then touch-next 5 9 2= dup if move-player 13 12 pete.jor queue-level then diff --git a/state.jor b/state.jor index 08cda77..767c829 100755 --- a/state.jor +++ b/state.jor @@ -2,19 +2,22 @@ 1 const CHUCK-GONE 2 const CHUCK-FOLLOW 3 const CHUCK-HOME +4 const CHUCK-STOLEN +5 const CHUCK-EXPLAINED -3 const LAST-STATE -array flags LAST-STATE 8 / 1 + allot +6 const FLAG-COUNT -: flagstof ( f -- v f ) dup 8 % 1 swap << swap 8 / flags + swap ; +array flags FLAG-COUNT 8 / 1 + allot + +: flagstof ( f -- v f ) dup 8 / flags + swap 8 % 1 swap << ; : flagsf! ( b f -- ) flagstof f! ; -: state@ ( b f -- ) flagstof f@ ; -: setstate 1 swap flagsf! ; -: clearstate 0 swap flagsf! ; +: flag@ ( f -- b ) flagstof f@ ; +: setflag 1 swap flagsf! ; +: clearflag 0 swap flagsf! ; 16 18 W ' {horse} defentity p_chuck :noname :| player yield - CHUCK-FOLLOW state@ if p_chuck yield then + CHUCK-FOLLOW flag@ 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 62ef442..5f8132e 100755 --- a/trail1.jor +++ b/trail1.jor @@ -1,10 +1,10 @@ ( T R A I L 1 ) -38 60 E ' {horse} defentity e_chuck +50 17 E ' {horse} defentity e_chuck 39 71 N ' {car} defentity car car :touch - CHUCK-FOLLOW state@ if + CHUCK-FOLLOW flag@ if pete say" I can't leave Chuck here!" else move-player 1 player.state DRIVING f! @@ -12,31 +12,28 @@ car :touch ;entity e_chuck :touch - pete say" Woah, boy. Calm down." + pete say" Woah, boy. Calm down." move-player chuck say" * w h i n n y *\(You came back!)" pete say" Of course I did, boy.\Of course I did." - p_chuck follow -( e_chuck entity>pos p_chuck entity.pos! - p_chuck entity>pos player entity>pos facing player.prevdir ! ) - CHUCK-GONE clearstate CHUCK-FOLLOW setstate + p_chuck follow CHUCK-GONE clearflag CHUCK-FOLLOW setflag ;entity :noname 0 player.state DRIVING f! -:| CHUCK-GONE state@ if e_chuck yield then +:| CHUCK-GONE flag@ if e_chuck yield then player.driving? not if car yield then done |; ' entities redefine :| touch-begin S leaving? dup - if player.driving? not CHUCK-FOLLOW state@ not and + if player.driving? not CHUCK-FOLLOW flag@ not and if pete say" I'm not walking." else move-player 13 7 road.jor queue-level then then -CHUCK-GONE state@ if - touch-next 37 60 2= dup +CHUCK-GONE flag@ if + touch-next 49 17 2= dup if pete say" Oh for the love of..." say" Chuck! How on Earth did you\end up over there!?" diff --git a/trail1.map b/trail1.map index ca9af507ebde8c72b189aa2eb8653e3ff8c3ab79..483e3669a567426ecb6f6880a1f93c5ddac73a2a 100755 GIT binary patch literal 5629 zcmeH}U2^L%2!-uJC^w2InR0$K#VF&rSkub)I+sDiAs;gCRWO-9=yzHwmk5h^|^&?z#< z^R!C$9hShKs`BHEl21K?LtF&P19kop6_F`7ZJMN=ZCeCZ6SV}?NN=O`fEqBB7fL6 z`K1pru?V+WaD%|vfP2P@`ej@zXQ>4kH(=Jyj4d(Kt%~i|g7yz6zdmY{A_1LgFI3ry zT%eu!6oqDa(uuM}9-xhwnW7Fu;R@Na8G922fW8EB*em72LE~MNM3>P1k4N`U(Ow`h zzk@>8V{n<%^7~R!WjE`mD(#dRNPK=;U@6a%&$Rbc;rdLKw@m)Ca*OND`^dDS)TBiz z4n5tBB>FC%B zk(DPup;??L30382+eoq{y7H{4S78bu6wJ8mztJx89eP>dCfG+stNn%2mYM)KsP z7I~#=!}Z39zGRNCLlwf^nC3T7(kju9OFl1>#fh7Xlth@QG;ppwV& E4KgcOKL7v# delta 637 zcmbtRze~eF7&SjGxoeWAQi$%XQ(GJDQgX6yU^6tIw^3CeAdjHbESij452UADJilJvj*kil+bn=ja zOP^Ucm!qSECx?UUJ{pFF16Dzk3p9j>3FnZyO}vTwyiDX1R>masV`bsgYR5`inzlj< zZ?XXCleG~fX|F{KA7%|#W;s?Nh5Kn(8Mh|?lR-<55?$N$G7Vb18mm%jz;MksVpT|y zjd#92?{97?QdXcQR^jVB4a(RmMph2zQL$^--Q2%WtXzDB0*d`Q4W&SvN9Z^TBQwI- zWJ`GJY@wm&(@BIlb~iCGLXvtk0*)TxnM1FplISH^N&aLuw?w_bFJ1$E+rdaL|L|SP zKgwr$W@fm!k>*vPi~twBh^AksUR-SjL%&6pM?N;ryd7%Tnb)D*#)+^8hq9{SF%0ma Ti@{B>ra{?^lHI{`xNm#|-Pyfc