finish lev3, add gord support

This commit is contained in:
Jeremy Penner 2020-02-22 15:15:00 -05:00
parent 0fd412510c
commit 52664a0311
5 changed files with 58 additions and 21 deletions

BIN
end.jim

Binary file not shown.

BIN
game.jim

Binary file not shown.

View file

@ -12,7 +12,8 @@ var player.prevdir
1 const MOVING userword
2 const NOCLIP userword
4 const HASNEUT userword
8 const ISPROG userword
8 const HASGORD userword
16 const ISPROG userword
1 player.state HASNEUT f!
@ -29,6 +30,12 @@ var posessed-rexx
isjaye? player.state MOVING f@ and
if {jaye-walk} else {jaye-stand} then ;
: {gord}
player.state HASGORD f@ if
isjaye? player.state MOVING f@ and
if {gord-walk} else {gord-stand} then
else {gord-sit} then ;
: player.canmove? ( x y -- )
player.state NOCLIP f@ not if
isneut? if NEUTABLE else WALKABLE then mapflag?
@ -36,6 +43,9 @@ var posessed-rexx
14 9 N ' {jaye} defentity Jaye
17 5 N ' {neut} defentity Neut
-10 -10 N ' {gord} defentity Gord
: gord-present? Gord entity>pos drop 0 >= ;
: player
isrexx? if posessed-rexx @ else
@ -152,7 +162,8 @@ var q-level
( S T U F F )
: reset-level
0 objects !
:| done |; ' entities redefine
:| player.state HASGORD f@ not gord-present? and if Gord yield then
done |; ' entities redefine
:| drop drop 0 |; ' jaye-touch redefine
:| drop drop 0 |; ' neut-touch redefine ; userword
@ -280,7 +291,11 @@ var _dorubber
: exitdoor create-linked-object
:| dup door-listener entering-door? if
responder entity.user @ queue-level
player.state HASGORD f@ not gord-present? and if
jaye say" I'm not leaving Gord behind."
else
responder entity.user @ queue-level
then
then |; listener! ;
: switch create-linked-object
@ -325,11 +340,20 @@ var _dorubber
: chain-listener ( entity xp -- ) swap dup @ , ! ; immediate
: cancel-ev ( ev -- EVNOP ) drop EVNOP ;
Gord :noname
dup EVTOUCH = isjaye? and player.state HASGORD f@ not and if
move-player
1 player.state HASGORD f!
Gord follow
then chain-listener ;
:noname
reset-level
' mode-move ' tick redefine
' full-draw ' draw redefine
:| Jaye yield done |; ' party redefine
:| Jaye yield
player.state HASGORD f@ if Gord yield then
done |; ' party redefine
:| ' tick-debounce ' tick redefine |; ' any-job-started redefine
:| ' mode-move ' tick redefine hide-footer |; ' all-jobs-complete redefine
; ' onload redefine

Binary file not shown.

View file

@ -20,7 +20,6 @@ defer c1 ' c1 8 3 computer c3
end.jor 0 4 exitdoor dx
' dx 0 5 scanner sx
6 7 N ' {gord-sit} defentity Gord
5 2 defrexx Rexx
: flicker c1 EVTOG entity>do 15 sleep ;
@ -51,8 +50,6 @@ DEV not if
prog-view
neut say" > CAN YOU REACH THE SWITCH\BEHIND YOU?"
human-view
gord say" Huh? Oh, there is a\switch there on the wall."
gord say" Never thought about what\it connected to."
then
5 sleep b1 EVACT entity>do 15 sleep
gord say" > I TURNED IT ON"
@ -80,35 +77,51 @@ Rexx :noname
var gord-jaye
d2 :noname
dup EVTOUCH = isjaye? and
gord-jaye @ not and
6 6 WALKABLE mapflag? not and if
dup EVTOUCH = isjaye? and gord-jaye @ not and if
1 gord-jaye !
cancel-ev
move-player
jaye say" Hey! Gord?\I'm Jaye."
gord say" Jaye, am I glad to see you.\Can you move this desk?"
jaye say" Let me try..."
jaye say" . . . .\!!!!....."
jaye say" !!!!!!!!!!!!!...."
jaye say" No, I don't think I can."
gord say" I keep staring at that\cleaning robot."
gord say" He looks like he could\lift a building."
6 6 WALKABLE mapflag? if
gord say" Jaye, am I glad to see you."
else
gord say" Jaye, am I glad to see you.\Can you move this desk?"
jaye say" Let me try..."
jaye say" . . . .\!!!!....."
jaye say" !!!!!!!!!!!!!...."
jaye say" No, I don't think I can."
gord say" I keep staring at that\cleaning robot."
gord say" He looks like he could\lift a building."
then
then chain-listener ;
var gord-up
Gord :noname
dup EVTOUCH = isrexx? and if
gord say" AHHH NOOO\NOT GARBAGE\I AM NOT GARBAGE"
rexx say" Whatever you say, boss!"
then chain-listener ;
then
dup EVTOUCH = isjaye? and gord-up @ not and if
jaye say" Are you hurt?"
gord say" My leg was pinned.\I don't think I can put\any weight on it."
jaye say" Here, let me help you up."
hide-footer
then
dup chain-listener
EVTOUCH = isjaye? and gord-up @ not and if
1 gord-up !
gord say" Thanks."
jaye say" Don't mention it."
jaye say" I can help you get around if\you help me navigate this\maze of a security system."
gord say" I'm just as eager to get\out of here as you."
gord say" Let's go."
then ;
:noname
reset-level O
:| Gord yield done |; ' entities redefine
s" lev00003.map" load-map
7 11 tile>world Jaye entity.pos!
6 12 tile>world Neut entity.pos!
6 7 tile>world Gord entity.pos!
; ' onload redefine