(local {: deflevel : say : itile} (require :game.defs)) (local {: ev} (require :game.entity)) (local tile (require :game.tiles)) (local {: walkable : neutable : debris : sittable} tile.flag-to-bit) (local level (deflevel "game/map5.json")) (local vm level.vm) (vm:var :doortimer 0) (vm:word :start-doortimer 0x100 :doortimer :set) (vm:word :doortimer-tick :doortimer :get (vm:when :doortimer :get 1 :- :dup :doortimer :set :not (vm:when :lit :timedswitch ev.deact :entity>do))) (vm:word :do-timedswitch ; only gord is physically able to touch it :dup ev.touch := (vm:when :start-doortimer :drop ev.act) :switch) (vm:var :is-garbagerexx vm.false) (vm:var :garbagerexx-yx 0x0710) ; shit, rexx doesn't live in an object - I can't tag by word :/ (vm:word :garbagerexx ; ev -- :is-rexx? :swap :rexx :is-rexx? := :not (vm:when :is-rexx? (vm:if [ :garbagerexx-yx :get :get-responder :get := (vm:when vm.true :is-garbagerexx :set) ] [ :is-garbagerexx :get (vm:when :get-responder :get :garbagerexx-yx :set vm.false :is-garbagerexx :set) ]))) (vm:word :not-picking-up? ; yxdest -- f debris :flag-at? :not) (vm:word :can-drop-rubble? ; yxdest -- f :itile-at (itile :t-floor) := :rexx-yx :get :itile-at (itile :t-floor) := :&) (vm:word :move-garbagerexx ; yx -- f (vm:if-and [[:is-rexx?] [:is-garbagerexx :get]] [:dup 0xff :& 0x0d := (vm:if [ (say :rexx "PARITY ERROR!") :drop vm.true :ret ] [ (vm:if-and [[:dup :not-picking-up?] [:dup :can-drop-rubble?]] [:rexx-yx :get (itile :broken-table) :update-itile]) ])]) :move-noop) level