improve Chuck Mode, add cheat sound
This commit is contained in:
parent
1e062dd281
commit
14bd76edcc
BIN
NeutTower.dsk
BIN
NeutTower.dsk
Binary file not shown.
|
@ -81,5 +81,6 @@
|
||||||
(vm.code:append [:dw (- (note-wavelength n) 0xd0)]))
|
(vm.code:append [:dw (- (note-wavelength n) 0xd0)]))
|
||||||
(vm:word :snd-keypad ; digit --
|
(vm:word :snd-keypad ; digit --
|
||||||
:dup :+ :lit :keypad-boops :+ :get 0x10d0 :swap :bliptone)
|
:dup :+ :lit :keypad-boops :+ :get 0x10d0 :swap :bliptone)
|
||||||
|
(vm:word :snd-cheat (notes [:g4 :f#4 :d#4 :a4 :g#3 :e4 :g#4 :c5] 0x30 0x20))
|
||||||
|
|
||||||
{: note : notes}
|
{: note : notes}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
(vm:word :cheatguard ; char cheatdata -- [optional rdrop]
|
(vm:word :cheatguard ; char cheatdata -- [optional rdrop]
|
||||||
:dup :pcheatnext :bget :<rot := (vm:if ; cheatdata
|
:dup :pcheatnext :bget :<rot := (vm:if ; cheatdata
|
||||||
[:dup :bget :inc :over :bset
|
[:dup :bget :inc :over :bset
|
||||||
:dup :pcheatnext :bget (vm:if [:drop :rdrop] [:reset-cheat])]
|
:dup :pcheatnext :bget (vm:if [:drop :rdrop] [:snd-cheat :reset-cheat])]
|
||||||
[:reset-cheat :rdrop]))
|
[:reset-cheat :rdrop]))
|
||||||
|
|
||||||
(defcheat :NTSPISPOPD :noclip :get :not :noclip :set)
|
(defcheat :NTSPISPOPD :noclip :get :not :noclip :set)
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
level)
|
level)
|
||||||
|
|
||||||
(fn say-runon [portrait ...]
|
(fn say-runon [portrait ...]
|
||||||
(local result [:vm :show-footer :lit (.. :p portrait) :draw-portrait])
|
(local result [:vm (.. :draw-p portrait)])
|
||||||
(local lines [...])
|
(local lines [...])
|
||||||
(local ilineOffset (if (< (length lines) 4) 1 0))
|
(local ilineOffset (if (< (length lines) 4) 1 0))
|
||||||
(each [iline line (ipairs lines)]
|
(each [iline line (ipairs lines)]
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
(tile.appendtiles org.code)
|
(tile.appendtiles org.code)
|
||||||
(org.code:append [:align 0x100] :font)
|
(org.code:append [:align 0x100] :font)
|
||||||
(tile.appendgfx org.code (tile.loadgfx tile.fn-font))
|
(tile.appendgfx org.code (tile.loadgfx tile.fn-font))
|
||||||
|
(tile.append-portraitwords vm {:pneut #[:vm :chuck-mode :get (vm:if [:lit :pchuck] [:lit :pneut])]})
|
||||||
|
|
||||||
(util.reload :game.level1)
|
(util.reload :game.level1)
|
||||||
(util.reload :game.level2)
|
(util.reload :game.level2)
|
||||||
|
|
|
@ -139,7 +139,9 @@
|
||||||
|
|
||||||
(vm:var :chuck-mode vm.false)
|
(vm:var :chuck-mode vm.false)
|
||||||
(vm:word :two-frame :tick-count :get 0x1f :& 0x10 :<)
|
(vm:word :two-frame :tick-count :get 0x1f :& 0x10 :<)
|
||||||
(vm:word :neut-tile :chuck-mode :get (vm:if [(itile :t-chuck)] [:two-frame (vm:if [(itile :neut1)] [(itile :neut2)])]))
|
(vm:word :neut-tile :two-frame :chuck-mode :get (vm:if
|
||||||
|
[(vm:if [(itile :t-chuck)] [(itile :t-chuck2)])]
|
||||||
|
[(vm:if [(itile :neut1)] [(itile :neut2)])]))
|
||||||
(vm:word :libb-tile :two-frame (vm:if [(itile :libb1)] [(itile :libb2)]))
|
(vm:word :libb-tile :two-frame (vm:if [(itile :libb1)] [(itile :libb2)]))
|
||||||
|
|
||||||
(vm:word :flag-at? ; yx flag -- f
|
(vm:word :flag-at? ; yx flag -- f
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
[{"gfx":"8080808080E0E0F0F8FC2CBCACACACAC80809CFEFFFFFFD7D5D5555D4F5DD5D5BCB8B8B8F8F8F8F8FCFCFEFE86D0D0D495D5D5E5D5D5D5D7C797D7D0AAAAAAAA808086BFFFFFFFFAEAAA2A2E3C2EAAAA80808080808183878787058F8D8D8D8FAAAAAAA7AAAAEAEAE2E8EA8AD5D5D5D58F8F8787878F8F8F9F9FBFBE808A8AAA","label":"pjaye","flags":[]},{"gfx":"00002020000000004808080800202028004040011404450144010805445420352020000808084800000000202000000020544405080144014504140140400000000202012921220122011021222A052D00000405000001011211101100040415052A222110012201222129010202000004040011101112010100000504000000","label":"pneut","flags":[]},{"gfx":"80C090808484848484848484A8A8A8A8AA8080808080D4D4D5D5F59DFDD5D5D5A8A08080808080808080808080E0F8FC95D5D5D5F595D5D4D084D4D4D4D7FFFFD58080808080AAAAAAAABAE2FAAAAAA280828880A0A0A0A1A1A1A1A195959595A0AAAAAAAFA8AAAA8AA0AAAAAAEAFFFF95858181818181808080808080879FBF","label":"pgord","flags":[]},{"gfx":"808080808080C0C0C0C0C0C0C0C0C0C0808080808080AAAAFAFAFAAAAAAAAAAA8080808080C0D0D0D0D0D0D0D0D0D0D0A0A0A0A0A0AAAAAAA8A8A8A8A8A8A8A8808080808080D5D5DFDFDFD5D5D5D5D5808080808080828282828282828282828585858585D5D5D595959595959595958080808080828A8A8A8A8A8A8A8A8A8A","label":"prexx","flags":[]},{"gfx":"808080F8F8F8F8F8F8B8B8F8F8B8B8F8808080FFFFFFFFDFDFFDFDDFDFFDFDDFF8B8B8F8F8B8B8F8F8F8F8F8F8D0D080DFFDFDDFDFFDFDDFDFFFFFFFFFAAAA80808080FFFFFFFFFEFEAFAFFEFEAFAFFE8080808FAFAFAFAFAFAFAFAFAFAFAFAFFEAFAFFEFEAFAFFEFEFFFFFFFFD5D580AFAFAFAFAFAFAFAFAFAFAFAFAFAAAA80","label":"ppady","flags":[]},{"gfx":"0080C07070303030303030303030303000AAAA7F0045001400150051005400003030707000703018187C4C7E000000000000007F007F0000007F017F0000000000D5D57F400A0028000A002000080000008A8A8B8B8B8B8B8B8B8B8B8B8B8B8B0000407F007F6030301F187F000000008B8B8B03000F0C060603030100000000","label":"pterm","flags":[]},{"gfx":"80808080808080A0C0A0C0A0808088AA8080808080808185AA858285C1D0A0D0D4AA94AA94AA888080A0C0A0C0A08080AAD2A2D2A2D2A2D2C185AA858285818080A0A8D0A8A09090D581A1C1A0C2A1C280808180818080808081858285828582A1828182959291929090D5808080808085818080808084958A958A958A958480","label":"plibb","flags":[]}]
|
[{"gfx":"8080808080E0E0F0F8FC2CBCACACACAC80809CFEFFFFFFD7D5D5555D4F5DD5D5BCB8B8B8F8F8F8F8FCFCFEFE86D0D0D495D5D5E5D5D5D5D7C797D7D0AAAAAAAA808086BFFFFFFFFAEAAA2A2E3C2EAAAA80808080808183878787058F8D8D8D8FAAAAAAA7AAAAEAEAE2E8EA8AD5D5D5D58F8F8787878F8F8F9F9FBFBE808A8AAA","label":"pjaye","flags":[]},{"gfx":"00002020000000004808080800202028004040011404450144010805445420352020000808084800000000202000000020544405080144014504140140400000000202012921220122011021222A052D00000405000001011211101100040415052A222110012201222129010202000004040011101112010100000504000000","label":"pneut","flags":[]},{"gfx":"80C090808484848484848484A8A8A8A8AA8080808080D4D4D5D5F59DFDD5D5D5A8A08080808080808080808080E0F8FC95D5D5D5F595D5D4D084D4D4D4D7FFFFD58080808080AAAAAAAABAE2FAAAAAA280828880A0A0A0A1A1A1A1A195959595A0AAAAAAAFA8AAAA8AA0AAAAAAEAFFFF95858181818181808080808080879FBF","label":"pgord","flags":[]},{"gfx":"808080808080C0C0C0C0C0C0C0C0C0C0808080808080AAAAFAFAFAAAAAAAAAAA8080808080C0D0D0D0D0D0D0D0D0D0D0A0A0A0A0A0AAAAAAA8A8A8A8A8A8A8A8808080808080D5D5DFDFDFD5D5D5D5D5808080808080828282828282828282828585858585D5D5D595959595959595958080808080828A8A8A8A8A8A8A8A8A8A","label":"prexx","flags":[]},{"gfx":"808080F8F8F8F8F8F8B8B8F8F8B8B8F8808080FFFFFFFFDFDFFDFDDFDFFDFDDFF8B8B8F8F8B8B8F8F8F8F8F8F8D0D080DFFDFDDFDFFDFDDFDFFFFFFFFFAAAA80808080FFFFFFFFFEFEAFAFFEFEAFAFFE8080808FAFAFAFAFAFAFAFAFAFAFAFAFFEAFAFFEFEAFAFFEFEFFFFFFFFD5D580AFAFAFAFAFAFAFAFAFAFAFAFAFAAAA80","label":"ppady","flags":[]},{"gfx":"0080C07070303030303030303030303000AAAA7F0045001400150051005400003030707000703018187C4C7E000000000000007F007F0000007F017F0000000000D5D57F400A0028000A002000080000008A8A8B8B8B8B8B8B8B8B8B8B8B8B8B0000407F007F6030301F187F000000008B8B8B03000F0C060603030100000000","label":"pterm","flags":[]},{"gfx":"80808080808080A0C0A0C0A0808088AA8080808080808185AA858285C1D0A0D0D4AA94AA94AA888080A0C0A0C0A08080AAD2A2D2A2D2A2D2C185AA858285818080A0A8D0A8A09090D581A1C1A0C2A1C280808180818080808081858285828582A1828182959291929090D5808080808085818080808084958A958A958A958480","label":"plibb","flags":[]},{"gfx":"808080808080808088A082A8A0AAA8AA849494D4D4D4D0D5D4D1D5D58595D5D5AAAA8AAA8AAA82AA828A808280808080D4D5D4D5D4D5D4D4D4D4D0C0C0C080808080808080A288A2A08AA2AAAAAAAAAA84949495958585808181848184848581AAAAAA8AAA8AAA8AAAAAA8A2A2AAAA8080818181818181818585818185818080","label":"pchuck","flags":[]}]
|
|
@ -50,6 +50,15 @@
|
||||||
(set flags (bit.bor flags (. flag-to-bit flag))))
|
(set flags (bit.bor flags (. flag-to-bit flag))))
|
||||||
(org:append [:db flags])))
|
(org:append [:db flags])))
|
||||||
|
|
||||||
|
(fn append-portraitwords [vm ?overrides]
|
||||||
|
(local overrides (or ?overrides {}))
|
||||||
|
(each [_ p (ipairs (loadgfx fn-portraits))]
|
||||||
|
(let [wordname (.. :draw- p.label)
|
||||||
|
override (. overrides p.label)]
|
||||||
|
(vm:word (.. :draw- p.label) :show-footer
|
||||||
|
(if override (override p.label) [:vm :lit p.label])
|
||||||
|
:draw-portrait))))
|
||||||
|
|
||||||
(fn encode-yx [xy]
|
(fn encode-yx [xy]
|
||||||
(if xy (bit.bor (bit.lshift (- xy.y 1) 8) (- xy.x 1)) 0xffff))
|
(if xy (bit.bor (bit.lshift (- xy.y 1) 8) (- xy.x 1)) 0xffff))
|
||||||
|
|
||||||
|
@ -70,6 +79,6 @@
|
||||||
(if (= tile.label label) (encode-itile itile)
|
(if (= tile.label label) (encode-itile itile)
|
||||||
(find-itile tiles label (+ itile 1))))
|
(find-itile tiles label (+ itile 1))))
|
||||||
|
|
||||||
{: loadgfx : savegfx : appendtiles : appendgfx : flags : flag-to-bit : find-itile
|
{: loadgfx : savegfx : appendtiles : appendgfx : append-portraitwords : flags : flag-to-bit : find-itile
|
||||||
: fn-tiles : fn-portraits : fn-font : encode-yx : encode-itile : decode-itile}
|
: fn-tiles : fn-portraits : fn-font : encode-yx : encode-itile : decode-itile}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue