ature.78b 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898
  1. rem ' Ature Adventure
  2. rem ' Copyright beoran@rubyforge.org 2009, 2010.'
  3. rem ' May be distributed under the Zlib License. No warranty, use at your own risk.'
  4. ; Modified for 7800Basic by Karl Garrison (kgarrison@pobox.com)
  5. ; Add some 7800Basic configuration options
  6. set zoneheight 16
  7. set basepath gfx
  8. set romsize 48k
  9. displaymode 160A
  10. rem 'Commonly used NTSC Colors
  11. const black=0
  12. const gray=6
  13. const white=14
  14. const yellow=30
  15. const brown=32
  16. const orange=32
  17. const blue=144
  18. const skyblue=174
  19. const green=192
  20. const darkgreen=191
  21. const riverblue=170
  22. rem ' XXX: there is a bug in the ompiler (or my patches to it)
  23. rem ' some of my consants like the one below are translated in stead
  24. rem ' like a dim statement: eg const turfy=218 -> dim turfy=218
  25. rem ' a workaround seem to be to reorder the constants a bit
  26. rem ' or to remove a few of them, but this only bugs out other constants :p
  27. rem ' so I replaced some constants by their values, and use the cpp
  28. rem ' preprocessor in stead.
  29. ; #define seablue 144
  30. const seablue = 144
  31. const red = 64
  32. const pink = 78
  33. const skin = 254
  34. const sand = 230
  35. const turfy = 218
  36. rem ' const ochre=16
  37. rem 'Playfield dimensions
  38. const field_left=17
  39. const field_left_enter=18
  40. const field_right=$88
  41. const field_right_enter=$87
  42. const field_top=10
  43. const field_top_enter=11
  44. const field_bottom=90
  45. const field_bottom_enter=89
  46. const field_hcenter=61
  47. const field_vcenter=44
  48. rem ' Note definitions and length const music_voice=12
  49. rem const note_c4=30
  50. rem const note_d4=27
  51. rem const note_e4=24
  52. rem const note_f4=23
  53. rem const note_g4=20
  54. rem const note_a4=18
  55. rem const note_b4=16
  56. rem const note_c5=15
  57. rem const note_none=0
  58. rem const note_full=60
  59. rem const note_half=30
  60. rem const note_quarter=15
  61. rem const note_fullrest=58
  62. rem const note_halfrest=28
  63. rem const note_quarterest=13
  64. rem const note_ndot=2
  65. rem ' An object will be positioned at 255 to hide it
  66. const nowhere=255
  67. rem 'Timer ticks per second, 60 for NTSC
  68. const ticks_per_second=60
  69. rem 'Score, split up in individual digits
  70. dim sc0=score
  71. dim sc1=score+1
  72. dim sc2=score+2
  73. rem 'Initial values
  74. rem 'Normal start
  75. const room_start=49
  76. rem '49
  77. rem 'On the east side of the river
  78. rem 'const room_start=4
  79. const hero_start_x=75
  80. const hero_start_y=75
  81. const item_start_x=60
  82. const item_start_y=40
  83. const item_start_hp=1
  84. const hero_base_hp=11
  85. const hero_high=8
  86. const hero_half_high=4
  87. const hero_feet_high=4
  88. const hero_wide=8
  89. const hero_half_wide=4
  90. rem 'Hero's position, speed and room
  91. dim hero_x=player0x
  92. dim hero_y=player0y
  93. dim hero_oldx=v
  94. dim hero_oldy=w
  95. rem 'Flags:
  96. dim hero_flags=g
  97. rem 'hero_flags{0} -> facing north
  98. rem 'hero_flags{1} -> facing east
  99. rem 'hero_flags{2} -> facing south
  100. rem 'hero_flags{3} -> facing west
  101. rem 'hero_flags{4} -> set when attacking is allowed, blocked when not
  102. dim hero_items=q
  103. rem 'hero_items{0} -> Key Leaf 1
  104. rem 'hero_items{1} -> Key Leaf 2
  105. rem 'hero_items{2} -> Key Leaf 3
  106. rem 'hero_items{3} -> Numen Shield
  107. rem 'hero_items{4} -> Numen Armor
  108. rem 'hero_items{5} -> Numen Sword
  109. rem 'hero_items{6} -> Heal Book
  110. rem 'hero_items{7} -> Strike Book
  111. dim hero_room=r
  112. ; dim hero_hp=statusbarlength
  113. dim hero_mp=o
  114. dim hero_next=k
  115. dim hero_level=l
  116. rem 'Quest flags contain important achievments of Signe.'
  117. dim quest_flags=h
  118. rem 'quest_flags{0} -> Defeated Ikaza
  119. rem 'quest_flags{1} -> Flipped Switch 1
  120. rem 'quest_flags{2} -> Flipped Switch 2
  121. rem 'quest_flags{3} -> Flipped Switch 3
  122. rem 'quest_flags{4} -> Flipped Switch 4
  123. rem 'quest_flags{5} -> Flipped Switch 5
  124. rem 'quest_flags{6} -> Flipped Switch 6
  125. rem 'quest_flags{7} -> Flipped Switch 7
  126. rem 'Other flags: Reserved for future extension
  127. rem 'quest_flags{1} -> Defeated Armor Boss
  128. rem 'quest_flags{2} -> Defeated Sword Boss
  129. rem 'quest_flags{3} -> Defeated
  130. rem 'quest_flags{0} -> Defeated Leaf Boss 1
  131. rem 'quest_flags{1} -> Defeated Leaf Boss 2
  132. rem 'quest_flags{2} -> Defeated Leaf Boss 3
  133. rem 'status bar color in Z, which si otherwise used for debugging
  134. rem ' Can't sue changes top platfield row color somehow. :p
  135. rem ' dim statusbarcolor=z
  136. const strike_cost=1
  137. const last_monster=32
  138. const hero_speed=1
  139. const hero_speed_negative=#-1
  140. rem item/monster position speed and kind
  141. dim item_x=player1x
  142. dim item_y=player1y
  143. dim item_kind=s
  144. dim item_hp=i
  145. dim item_oldx=t
  146. dim item_oldy=u
  147. rem 'Active item flags:
  148. dim item_flags=f
  149. rem 'item_flags{0} -> Monster missile flies north
  150. rem 'item_flags{1} -> Monster missile flies east
  151. rem 'item_flags{2} -> Monster missile flies south
  152. rem 'item_flags{3} -> Monster missile flies west
  153. rem 'Game timer. Controls animation. Keeps on ticking, by overflow.'
  154. dim game_timer=e
  155. const timer_loop=128
  156. const timer_second=60
  157. rem 'Item and monster kinds.'
  158. rem 'Monster kind is divided as follows: the 6 bits record the looks
  159. rem 'and the 'index' for data tables of the monster or item
  160. rem 'The high 2 bits are used for 2 flag variables:
  161. rem 'If item_kind{7} is set it's an immobile item, otherwise, a monster
  162. rem '6 is yet to be determined
  163. const item_kind_mask=%00111111
  164. const is_item_mask=%10000000
  165. const item_none=%10000000
  166. const monster_slime=1
  167. const monster_crab=2
  168. const monster_bat=3
  169. const monster_scorpio=4
  170. rem 'The famous rabid rabbit ^_^
  171. const monster_rabid=5
  172. const monster_spider=6
  173. const monster_snake=7
  174. const monster_fish=8
  175. const monster_lion=9
  176. const monster_wolf=10
  177. const monster_grunt=11
  178. const monster_archer=12
  179. const monster_knight=13
  180. const monster_cannon=14
  181. const monster_zombie=15
  182. const monster_skeleton=16
  183. const monster_ghost=17
  184. const monster_mage=18
  185. const monster_flower=19
  186. const monster_treant=20
  187. const monster_mushroom=21
  188. const monster_book=22
  189. const monster_sword=23
  190. rem 'Monster curse blocks the way in rooms. It's invulnerable,
  191. rem 'but can be removed by game events.'
  192. const monster_curse=24
  193. const monster_first_boss=25
  194. const monster_leaf1_boss=25
  195. const monster_leaf2_boss=26
  196. const monster_leaf3_boss=27
  197. const monster_armor_boss=28
  198. rem 'Boss that guards the Numen Sword
  199. const monster_sword_boss=29
  200. rem 'Boss that guards the Strike book
  201. const monster_strike_boss=30
  202. const monster_ikaza=31
  203. const item_inventory_mask=160
  204. const item_leaf1=160
  205. const item_leaf2=161
  206. const item_leaf3=162
  207. const item_armor=163
  208. const item_shield=164
  209. const item_sword=165
  210. const item_bookheal=166
  211. const item_bookstrike=167
  212. const item_healhp=168
  213. const item_healmp=169
  214. const item_healallhp=170
  215. const item_healallmp=171
  216. const item_first_switch=172
  217. const item_switch_on=7
  218. const item_switch1=172
  219. const item_switch2=173
  220. const item_switch3=174
  221. const item_switch4=175
  222. const item_switch5=176
  223. const item_switch6=177
  224. const item_switch7=178
  225. const item_last_switch=178
  226. const item_first_switch_on=179
  227. const item_switch1_on=179
  228. const item_switch2_on=180
  229. const item_switch3_on=181
  230. const item_switch4_on=182
  231. const item_switch5_on=183
  232. const item_switch6_on=184
  233. const item_switch7_on=185
  234. const item_last_switch_on=182
  235. const item_victory=191
  236. const monster_normal=0
  237. rem 'Bit 0 in monster flags
  238. const monster_shoots=1
  239. rem 'Bit 1 in monster flags
  240. const monster_randomwalk=2
  241. rem 'Bit 2 in monster flags
  242. const monster_aggressive=4
  243. rem 'Bit 3 in monster flags
  244. const monster_static=8
  245. rem 'Bit 4 in monster flags
  246. const monster_alwaysdrop=16
  247. rem 'Bit 5 in monster flags
  248. const monster_nowalls=32
  249. rem 'Bit 6 in monster flags
  250. const monster_huge=64
  251. rem 'Bit 7 in monster flags. Will triple if huge is also set
  252. rem 'Currently, double nor triple doesn't work well with the AI
  253. const monster_double=128
  254. const monster_boss_info=monster_alwaysdrop + monster_shoots + monster_huge + monster_nowalls
  255. const monster_boss2_info=monster_alwaysdrop + monster_shoots + monster_huge + monster_nowalls
  256. const monster_boss3_info=monster_alwaysdrop + monster_shoots + monster_huge + monster_nowalls
  257. const monster_swordboss_info=monster_alwaysdrop + monster_aggressive + monster_nowalls
  258. const monster_cannon_info=monster_shoots + monster_static + monster_nowalls
  259. rem ' Music wave form to use.'
  260. const music_instrument=12
  261. const music_notes=69
  262. rem 'Timer and pointer for music and sound
  263. dim music_pointer=m
  264. dim music_timer=n
  265. dim music_which=d
  266. dim sound_timer=p
  267. rem 'Unused variables: a b c
  268. rem 'Set back to 1 when not debugging.'
  269. const hero_start_level=20
  270. rem 'set back to 0 when not debugging
  271. const hero_start_items=
  272. rem ' Colors to use for the item display
  273. data item_colors
  274. black, green, red, blue, black, green, red, blue,
  275. black, green, red, blue, black, green, red, blue,
  276. black, green, red, blue, black, green, red, blue,
  277. black, black, red, red, black, orange, red, blue,
  278. black, green, red, blue, black, green, red, blue,
  279. red , green, red, green, black, green, red, blue,
  280. white, yellow, orange, black, green, red, blue, white,
  281. yellow, orange, blue, black, green, red, blue, blue,
  282. end
  283. rem 'Damage modifier for the MONSTER/item. 0 means no damage
  284. rem 'There is no monster nr 0, that's for item_none.'
  285. rem 'The curse deals massive damage to be sure it works.'
  286. data item_damage
  287. 0, 1, 1, 1, 1, 2, 2, 2
  288. 2, 4, 4, 4, 4, 6, 6, 6
  289. 10, 16, 16, 1, 16, 4, 16, 16
  290. 128, 20, 22, 24, 48, 48, 48, 64
  291. 0, 0, 0, 0, 0, 0, 0, 0
  292. 0, 0, 0, 0, 0, 0, 0, 0
  293. 0, 0, 0, 0, 0, 0, 0, 0
  294. 0, 0, 0, 0, 0, 0, 0, 0
  295. end
  296. rem '
  297. rem ' Monster information, bitflags (monster 0 doesn't exist, but is in this list!)
  298. data monster_info
  299. monster_normal, monster_normal, monster_nowalls+monster_shoots, monster_nowalls
  300. monster_normal, monster_nowalls, monster_normal, monster_aggressive
  301. monster_shoots + monster_nowalls, monster_normal, monster_normal, monster_normal
  302. monster_shoots, monster_aggressive, monster_cannon_info, monster_randomwalk
  303. monster_normal, monster_nowalls, monster_nowalls + monster_shoots, monster_cannon_info
  304. monster_normal, monster_normal, monster_cannon_info, monster_static + monster_nowalls
  305. monster_static + monster_huge + monster_nowalls, monster_boss_info, monster_boss_info, monster_boss3_info
  306. monster_boss_info, monster_swordboss_info, monster_boss_info, monster_aggressive + monster_shoots
  307. end
  308. rem ' Items the monster drops, or for items, what item flag to set
  309. data monster_drops
  310. item_healhp, item_healhp, item_healhp, item_healmp,
  311. item_healhp, item_healhp, item_healhp, item_healhp,
  312. item_healhp, item_healhp, item_healhp, item_healhp,
  313. item_healhp, item_healallhp, item_healhp, monster_skeleton,
  314. monster_ghost, item_switch5, monster_book, item_healmp,
  315. item_healallmp, item_healhp, item_bookheal, item_sword,
  316. item_healhp, item_leaf1, item_leaf2 , item_leaf3,
  317. item_armor, monster_sword, item_bookstrike, item_healallhp,
  318. end
  319. rem VOLUME DOWN AND SET CHANNELS
  320. AUDV0=0
  321. AUDV1=0
  322. AUDC0=music_instrument
  323. rem INITIALIZE POINTERS AND TIMERS
  324. rem 'lives control
  325. ; lifecolor=black
  326. rem 'Lives are used for the MP
  327. ; lives=32
  328. ; lives:
  329. ; %00010000
  330. ; %00010000
  331. ; %01010100
  332. ; %10111010
  333. ; %01010100
  334. ; %00010000
  335. ; %00010000
  336. ; %00010000
  337. ;end
  338. incgraphic bgchars.png 0 1 2 3
  339. characterset bgchars
  340. alphachars '.X'
  341. P0C1=$0F
  342. P0C2=$0F
  343. P0C3=$0F
  344. rem 'Go to intro screen, but not now while we are debugging.'
  345. gosub intro_screen
  346. goto main_loop_start
  347. main_loop_start
  348. rem ' Set up initial values.'
  349. gosub music_restart
  350. BACKGRND = black
  351. ; lifecolor=yellow
  352. hero_room=room_start
  353. hero_x=hero_start_x
  354. hero_oldx=hero_start_x
  355. hero_y=hero_start_y
  356. hero_oldy=hero_start_x
  357. quest_flags=0
  358. hero_level=hero_start_level
  359. hero_next=(hero_level / 2) + 1
  360. hero_hp=hero_level*2+hero_base_hp
  361. rem 'MP is between 1 and 6
  362. hero_mp=hero_level/16 + 1
  363. gosub set_mp_display
  364. hero_flags = 0
  365. item_flags = 0
  366. game_timer = 0
  367. item_kind=item_none
  368. hero_items = hero_start_items
  369. rem 'Player starts facing south, able to attack
  370. hero_flags{2} = 1
  371. hero_flags{4} = 1
  372. rem player0x=75
  373. rem player0y=75
  374. item_x=item_start_x
  375. item_oldx=item_start_x
  376. item_y=item_start_y
  377. item_oldy=item_start_x
  378. missile1x=nowhere
  379. missile1y=nowhere
  380. ; scorecolor=64
  381. item_hp=item_start_hp
  382. gosub show_inventory
  383. gosub hero_draw_s
  384. gosub room_draw
  385. drawscreen
  386. main_loop
  387. COLUP0 = skin
  388. temp1 = item_kind & item_kind_mask
  389. COLUP1 = item_colors[temp1]
  390. rem 'Special effects for the item (double or triple size, double or triple instances)
  391. if item_kind{7} goto special_effects_end
  392. temp2 = monster_info[item_kind]
  393. if temp2{6} then NUSIZ1 = $07
  394. if temp2{7} then NUSIZ1 = $02
  395. if temp2{7} && temp2{7} then NUSIZ1 =$06
  396. special_effects_end
  397. PF0=$00
  398. rem 'Collisions with the walls. For now, we use push-back collision
  399. rem 'for the monsters, and preventive collision detection for the player.'
  400. rem 'This is inconsistent, but push-back is easier to manage with regards to
  401. rem 'and matters less for AI, so I'll leave it at that for now.'
  402. if !collision(player0, playfield) then goto herofield_collide_end
  403. rem 'Could do something here ??? Some overlap is OK, IMO
  404. herofield_collide_end
  405. rem 'Collisions with the walls
  406. rem 'For the item
  407. if !collision(player1, playfield) then goto itemfield_collide_end
  408. temp2 = monster_info[item_kind]
  409. rem 'Some monsters ignore walls
  410. if temp2{5} then goto itemfield_collide_end
  411. if item_y = item_oldy && item_x = item_oldx then goto itemfield_collide_still
  412. item_y = item_oldy
  413. item_x = item_oldx
  414. goto itemfield_collide_end
  415. itemfield_collide_still
  416. rem if item_y < field_vcenter then item_y = item_oldy - 1 else item_y = item_oldy + 1
  417. rem if item_x < field_hcenter then item_x = item_oldx - 1 else item_x = hero_oldx + 1
  418. itemfield_collide_end
  419. rem 'Remember curent position which should be OK here,
  420. rem 'and with that I mean not colliding with the walls.'
  421. hero_oldx = hero_x
  422. hero_oldy = hero_y
  423. item_oldx = item_x
  424. item_oldy = item_y
  425. rem 'Teleport to Sygne's home on reset button
  426. if !switchreset then goto reset_end
  427. hero_room=room_start
  428. hero_x=hero_start_x
  429. hero_oldx=hero_start_x
  430. hero_y=hero_start_y
  431. hero_oldy=hero_start_x
  432. gosub room_draw
  433. reset_end
  434. rem 'Update game timer, and let it overflow back to 0 .'
  435. game_timer = game_timer + 1
  436. rem 'Update sound timer, and set to silence if sound is done
  437. if sound_timer < 1 then goto sound_end
  438. sound_timer = sound_timer - 1
  439. if sound_timer > 1 then goto sound_end
  440. AUDV1 = 0
  441. AUDC1 = 0
  442. AUDF1 = 0
  443. sound_timer = 0
  444. sound_end
  445. rem 'Collision between hero and monster/item or the monster's missile
  446. if !collision(player0, missile1) then goto no_missile_collide
  447. rem 'Ennemy missile hit player, remove it
  448. missile1y = nowhere
  449. missile1x = nowhere
  450. item_flags= 0
  451. rem ' If the player doesn't have a shield, jump to monster collide
  452. rem 'Otherwise ignore the projectile and remove it
  453. if !hero_items{3} then goto monster_collide
  454. no_missile_collide
  455. if !collision(player0, player1) then goto item_collide_end
  456. rem 'Distinguish between item or monster collide
  457. if item_kind{7} then goto item_collide
  458. rem 'Collision with monster or monster missile
  459. monster_collide
  460. COLUP0 = red
  461. rem 'Make a hit sound
  462. sound_timer=2
  463. AUDC1=6
  464. AUDF1=10
  465. AUDV1=14
  466. rem 'Push back the hero, but only if the playfield is free behind her.'
  467. rem 'Also don't push back if too close to the edge of the screen.'
  468. if !hero_flags{0} then goto hero_hit_north_end
  469. temp1 = (hero_x + hero_half_wide - 17) / 4
  470. temp2 = (hero_y + 8 - 1) / 8
  471. if pfread(temp1, temp2) goto hero_hit_north_end
  472. hero_y = hero_y + 8
  473. rem 'Still inside the screen?
  474. if hero_y < field_bottom then goto hero_hit_north_end
  475. rem 'if we get here, we'd be pushed out of the screen. Prevent this.'
  476. hero_y = field_bottom_enter
  477. hero_hit_north_end
  478. if !hero_flags{1} then goto hero_hit_east_end
  479. temp1 = (hero_x - 8 - 17) / 4
  480. temp2 = (hero_y - hero_half_high - 1) / 8
  481. if pfread(temp1, temp2) goto hero_hit_east_end
  482. hero_x = hero_x - 8
  483. rem 'Still inside the screen?
  484. if field_left < hero_x then goto hero_hit_east_end
  485. rem 'if we get here, we'd be pushed out of the screen. Prevent this.'
  486. hero_x = field_left_enter
  487. hero_hit_east_end
  488. if !hero_flags{2} then goto hero_hit_south_end
  489. if pfread(temp1, temp2) then goto hero_hit_south_end
  490. temp1 = (hero_x + hero_half_wide - 17) / 4
  491. temp2 = (hero_y - hero_high - 8 - 1) / 8
  492. hero_y = hero_y - 8
  493. if hero_y > field_top then goto hero_hit_south_end
  494. rem 'if we get here, we'd be pushed out of the screen. Prevent this.'
  495. hero_y = field_top_enter
  496. hero_hit_south_end
  497. if !hero_flags{3} then goto hero_hit_west_end
  498. temp1 = (hero_x + hero_wide + 8 - 17) / 4
  499. temp2 = (hero_y - hero_half_high - 1) / 8
  500. if pfread(temp1, temp2) then goto hero_hit_west_end
  501. hero_x = hero_x + 8
  502. rem 'Still inside the screen?
  503. if hero_x < field_right then goto hero_hit_west_end
  504. rem 'if we get here, we'd be pushed out of the screen. Prevent this.'
  505. hero_x = field_right_enter
  506. hero_hit_west_end
  507. temp1 = item_kind & item_kind_mask
  508. temp1 = item_damage[temp1]
  509. rem 'Halve damage if hero has the armor
  510. if hero_items{4} then temp1 = temp1 / 2
  511. rem 'Game over if damage is higher than health
  512. if temp1 < hero_hp then goto do_damage
  513. rem 'But escape by the skin of the teeth if Signe has the healing book and
  514. rem 'Numen to use it.'
  515. if hero_items{6} && hero_mp > 0 then goto use_heal_spell
  516. hero_hp = 0
  517. goto game_over
  518. use_heal_spell
  519. COLUP0 = green
  520. hero_mp = hero_mp - 1
  521. gosub set_mp_display
  522. hero_hp = hero_level * 2 + hero_base_hp
  523. goto item_collide_end
  524. do_damage
  525. hero_hp = hero_hp - temp1
  526. goto item_collide_end
  527. item_collide
  528. rem 'If colliding with an item, pick it up if it is not a switch.'
  529. if item_kind < item_switch1 then goto item_do_collide
  530. if item_kind > item_switch7_on then goto item_do_collide
  531. goto item_collide_end
  532. item_do_collide
  533. gosub item_pickup
  534. gosub show_inventory
  535. item_collide_end
  536. rem 'Collision between monster missile and field.'
  537. rem 'Or between sword and monster missile. Remove missile.'
  538. rem 'Remove misile if monster is gone.'
  539. if item_kind > last_monster then goto missile_remove
  540. if collision(missile0, missile1) then goto missile_remove
  541. if missile1x > field_right then goto missile_remove
  542. if missile1x < field_left then goto missile_remove
  543. if missile1y < field_top then goto missile_remove
  544. if missile1y > field_bottom then goto missile_remove
  545. if !collision(missile1, playfield) then goto missile_remove_end
  546. rem 'Don't remove the misile even when coliding with the playfield if the
  547. rem 'monster ignores the walls.'
  548. temp2 = monster_info[item_kind]
  549. rem 'temp2 = temp2 & monster_nowalls
  550. if temp2{5} then goto missile_remove_end
  551. missile_remove
  552. missile1y = nowhere
  553. missile1x = nowhere
  554. item_flags= 0
  555. missile_remove_end
  556. rem 'Collision between monster and hero's attack
  557. if !collision(player1, missile0) then goto slash_collide_end
  558. rem 'Distinguish between item or monster collide
  559. if item_kind{7} then goto slash_item_collide
  560. rem 'The curse monster cannot be harmed normally.'
  561. rem 'It can be harmed if Signe has the three leaves, or the Numen Sword.'
  562. rem 'Do the special handling here.'
  563. if item_kind <> monster_curse then goto monster_no_curse
  564. rem 'Signe has the sword? The curse can be damaged.'
  565. if hero_items{5} then goto monster_no_curse
  566. rem 'Signe has the three leaves? The curse can be damaged.'
  567. if hero_items{0} && hero_items{1} && hero_items{2} then goto monster_no_curse
  568. rem 'If we get here, Signe's unable to do any damage.'
  569. rem 'Make a deflected sound
  570. sound_timer=2
  571. AUDC1=12
  572. AUDV1=14
  573. AUDF1=1
  574. goto slash_collide_end
  575. monster_no_curse
  576. rem 'Make a hit sound once
  577. sound_timer=1
  578. AUDC1=8
  579. AUDF1=2
  580. AUDV1=8
  581. hero_flags{4} = 0
  582. rem COLUP1 = red
  583. rem 'Push back monster
  584. if hero_flags{0} then item_y = item_y - 4
  585. if hero_flags{1} then item_x = item_x + 4
  586. if hero_flags{2} then item_y = item_y + 4
  587. if hero_flags{3} then item_x = item_x - 4
  588. rem 'Damage is level / 2 + 1
  589. temp1 = (hero_level / 2)
  590. temp1 = temp1 + 1
  591. rem 'Double damage with the Numen Sword
  592. if hero_items{5} then temp1 = temp1 * 2
  593. rem 'Prevent damage overflow
  594. if temp1 < 0 then temp1 = 0 - temp1
  595. if temp1 < item_hp then goto item_survived
  596. rem 'Item / monster killed or destroyed
  597. if item_kind = monster_ikaza then quest_flags{0} = 1
  598. rem 'Make sure Ikaza cannot come back
  599. rem 'Give experience and level up if needed
  600. rem 'Experience received is danger level of the monster
  601. temp2 = item_damage[item_kind]
  602. rem 'No experience for killing the curse, as it's a sitting duck.'
  603. if item_kind = monster_curse then goto give_experience_end
  604. if temp2 < hero_next then goto give_experience
  605. rem 'Level up, but not more than 99
  606. if hero_level > 98 then goto give_experience_end
  607. rem 'Level up sound
  608. COLUP0=blue
  609. AUDV1=8
  610. AUDF1=24
  611. AUDC1=12
  612. sound_timer=8
  613. hero_level = hero_level + 1
  614. hero_hp = hero_level * 2 + hero_base_hp
  615. rem 'Actually, this is buggy for levels above 80
  616. hero_mp = hero_level/16 + 1
  617. gosub set_mp_display
  618. hero_next = (hero_level / 2) + 1
  619. COLUP0 = turfy
  620. goto give_experience_end
  621. give_experience
  622. hero_next = hero_next - temp2
  623. give_experience_end
  624. rem 'Drop an item, perhaps
  625. temp6 = monster_info[item_kind]
  626. rem 'Bit 4: monster always drops item
  627. if temp6{4} then goto drop_item
  628. if rand > 128 then goto drop_item
  629. rem 'Drop occasional, not always, depeding on monster flags
  630. drop_no_item
  631. item_kind = item_none
  632. item_hp = 0
  633. item_x = nowhere
  634. item_y = nowhere
  635. goto drop_item_done
  636. drop_item
  637. temp2 = monster_drops[item_kind]
  638. item_kind = temp2
  639. gosub item_setup_kind
  640. drop_item_done
  641. goto slash_collide_end
  642. item_survived
  643. item_hp = item_hp - temp1
  644. rem 'Push item around
  645. if hero_flags{0} then item_y = item_y - 4
  646. if hero_flags{1} then item_x = item_x + 4
  647. if hero_flags{2} then item_y = item_y + 4
  648. if hero_flags{3} then item_x = item_x - 4
  649. goto slash_collide_end
  650. slash_item_collide
  651. rem 'Make a hit sound once
  652. sound_timer=1
  653. AUDC1=8
  654. AUDF1=2
  655. AUDV1=8
  656. if item_kind < item_switch1 then goto slash_item_pickup
  657. if item_kind > item_switch7_on then goto slash_item_pickup
  658. rem 'If colliding with an item that's not a switch, pick it up.'
  659. rem 'Otherwise it's a switch that's hit.
  660. goto hit_switch
  661. slash_item_pickup
  662. gosub item_pickup
  663. gosub show_inventory
  664. goto slash_collide_end
  665. hit_switch
  666. rem 'Do nothing with the already triggered switches.'
  667. rem '(Turn them off again, perhaps?)
  668. if item_kind > item_switch7 then goto slash_collide_end
  669. rem 'Handle hitting of the switch: set the quest flag and change the display.'
  670. if item_kind = item_switch1 then quest_flags{1} = 1
  671. if item_kind = item_switch2 then quest_flags{2} = 1
  672. if item_kind = item_switch3 then quest_flags{3} = 1
  673. if item_kind = item_switch4 then quest_flags{4} = 1
  674. if item_kind = item_switch5 then quest_flags{5} = 1
  675. if item_kind = item_switch6 then quest_flags{6} = 1
  676. if item_kind = item_switch7 then quest_flags{7} = 1
  677. gosub item_setup_kind
  678. slash_collide_end
  679. rem 'Player action though button
  680. if !joy0fire then goto hero_action_done
  681. rem 'Skip all this if action is blocked.'
  682. if !hero_flags{4} then goto hero_action_blocked
  683. if !hero_items{7} then goto hero_act_nostrike
  684. if hero_mp < strike_cost then goto hero_act_nostrike
  685. rem ' The b switch controls whether the book of striking is in use or not.'
  686. if switchleftb then goto hero_act_nostrike
  687. if item_kind < last_monster then goto hero_act_strike
  688. if item_kind >= item_switch1 && item_kind <= item_switch7 then goto hero_act_strike
  689. hero_act_nostrike
  690. temp1 = hero_flags & %00001111
  691. rem 'Use this to jump to the right attack action.'
  692. rem ' 0 1=north 2=east 3=ne 4=south 5=n+s(emu onlu) 6=se 7=nse
  693. rem ' 8 = west
  694. rem ' 9 10 11 12 13 14 15(all sides, emu only)
  695. on temp1 goto had hero_act_n hero_act_e hero_act_n hero_act_s hero_act_s hero_act_n hero_act_n hero_act_w hero_act_n hero_act_w hero_act_s had had had
  696. hero_act_n
  697. missile0x=hero_x + 4
  698. missile0y=hero_y - 14
  699. missile0height=8
  700. NUSIZ0=$00
  701. goto hero_action_end
  702. hero_act_e
  703. missile0x=hero_x + 9
  704. missile0y=hero_y - 4
  705. missile0height=0
  706. NUSIZ0=$30
  707. goto hero_action_end
  708. hero_act_s
  709. missile0x=hero_x + 4
  710. missile0y=hero_y + 8
  711. missile0height=8
  712. NUSIZ0=$00
  713. goto hero_action_end
  714. hero_act_w
  715. missile0x=hero_x - 7
  716. missile0y=hero_y - 4
  717. missile0height=0
  718. NUSIZ0=$30
  719. goto hero_action_end
  720. rem NUSIZ0=$00
  721. hero_act_strike
  722. hero_mp = hero_mp - strike_cost
  723. gosub set_mp_display
  724. rem 'Strike will hit the ennemy wherever it is. A guaranteed hit I'd say ^_^
  725. missile0x=item_x
  726. missile0y=item_y
  727. missile0height=8
  728. NUSIZ0=$30
  729. COLUP0=rand
  730. COLUP1=red
  731. goto hero_action_end
  732. had
  733. hero_action_done
  734. hero_flags{4} = 1
  735. rem 'Allow attacks again
  736. hero_action_blocked
  737. rem 'If the action is blocked or released, hide the missile
  738. missile0x = nowhere
  739. missile0y = nowhere
  740. hero_action_end
  741. rem 'Deterimine hero's motion and direction from the joystick
  742. rem 'In NESW order
  743. rem ' hero_flags = (hero_flags / 16) * 16 preserves the higher nibble (I hope)
  744. rem '
  745. rem 'For the player collision detection, we calculate the playfield position
  746. rem 'at any of the four points around the feet of the player, and check if
  747. rem 'if anything is there with pfread, and prevent motion if it is so.
  748. rem ' Note that we do allow Signe to turn her facing even when she cannot move.'
  749. if !joy0up then goto joy0up_end
  750. hero_flags = (hero_flags / 16) * 16
  751. hero_flags{0} = 1
  752. rem 'Check top middle point
  753. temp1 = (hero_x + hero_half_wide - 17) / 4
  754. temp2 = (hero_y - hero_high - 1 - 1) / 8
  755. if pfread(temp1, temp2) goto joy0up_end
  756. hero_y = hero_y - 1
  757. joy0up_end
  758. if !joy0right then goto joy0right_end
  759. hero_flags = (hero_flags / 16) * 16
  760. hero_flags{1} = 1
  761. temp1 = (hero_x + hero_wide + 1 - 17) / 4
  762. temp2 = (hero_y - hero_half_high - 1) / 8
  763. rem 'Prevent motion if something is there
  764. if pfread(temp1, temp2) goto joy0right_end
  765. hero_x = hero_x + 1
  766. joy0right_end
  767. if !joy0down then goto joy0down_end
  768. hero_flags = (hero_flags / 16) * 16
  769. hero_flags{2} = 1
  770. temp1 = (hero_x + hero_half_wide - 17) / 4
  771. temp2 = (hero_y + 1 - 1) / 8
  772. rem 'Check bottom middle point. don't move if it's blocked by the playfield.'
  773. if pfread(temp1, temp2) then goto joy0down_end
  774. hero_y = hero_y + 1
  775. joy0down_end
  776. if !joy0left then goto joy0left_end
  777. hero_flags = (hero_flags / 16) * 16
  778. hero_flags{3} = 1
  779. temp1 = (hero_x - 1 - 17) / 4
  780. temp2 = (hero_y - hero_half_high - 1) / 8
  781. rem 'Check point to the west of the feet
  782. if pfread(temp1, temp2) goto joy0left_end
  783. hero_x = hero_x - 1
  784. joy0left_end
  785. rem 'Monster "AI":
  786. rem 'Animate missile if it has been launched
  787. if missile1y = nowhere then goto missile_move_end
  788. if item_flags{3} then missile1x = missile1x - 2 : goto missile_move_end
  789. if item_flags{0} then missile1y = missile1y - 2 : goto missile_move_end
  790. if item_flags{1} then missile1x = missile1x + 2 : goto missile_move_end
  791. if item_flags{2} then missile1y = missile1y + 2 : goto missile_move_end
  792. missile_move_end
  793. rem 'Move the item if it's a mobile (id lower than 128)
  794. if item_kind{7} then goto item_move_end
  795. temp1 = rand
  796. rem ' Shoot a missile sometimes...'
  797. temp6 = monster_info[item_kind]
  798. rem 'But not if the monster cannot shoot (bit 0)
  799. if !temp6{0} then goto activate_missile_end
  800. if !game_timer{4} then goto activate_missile_end
  801. if !game_timer{7} then goto activate_missile_end
  802. if !temp1{0} then goto activate_missile_end
  803. if missile1y <> nowhere then goto activate_missile_end
  804. rem 'Make a shot sound
  805. sound_timer=2
  806. AUDC1=14
  807. AUDV1=8
  808. AUDF1=20
  809. rem 'Place the missile
  810. missile1x = item_x + 4
  811. missile1y = item_y - 4
  812. temp4 = item_x + 8
  813. if hero_x > temp4 then item_flags{1} = 1
  814. temp4 = item_x - 8
  815. if hero_x < temp4 then item_flags{3} = 1
  816. if hero_y > item_y then item_flags{2} = 1
  817. if hero_y < item_y then item_flags{0} = 1
  818. missile1height=4
  819. activate_missile_end
  820. rem 'Agressive chasing if aggressive flag is set
  821. if temp6{2} then goto monster_chase
  822. rem 'Don't move if monster is static
  823. if temp6{3} then goto item_move_end
  824. rem 'Only move half the time
  825. if game_timer{2} goto item_move_end
  826. rem 'Only move if the 4th and 5th bit are not set
  827. if temp1{1} then goto item_move_end
  828. rem 'Random walking monsters don't give chase
  829. if temp6{1} then goto monster_random_walk
  830. monster_chase
  831. if hero_x > item_x then item_x = item_x + 1 else item_x = item_x - 1
  832. if hero_y > item_y then item_y = item_y + 1 else item_y = item_y - 1
  833. if temp6{2} then goto item_move_end
  834. rem 'Aggressive ennemies don't random walk
  835. monster_random_walk
  836. rem 'Use bits of random number for random walk.'
  837. if temp1{0} then item_y = item_y - 1
  838. if temp1{4} then item_x = item_x - 1
  839. if temp1{0} || temp1{4} then goto item_move_end
  840. if temp1{2} then item_y = item_y + 1
  841. if temp1{6} then item_x = item_x + 1
  842. item_move_end
  843. rem 'Activate missile if needed
  844. rem 'Debug by showing flags in score field
  845. rem sc0 = hero_flags
  846. rem temp2 = monster_info[item_kind]
  847. rem sc1 = temp2
  848. rem sc2 = hero_room
  849. rem 'Music, disabled for now.'
  850. rem 'Is it time to update the note?
  851. rem if music_timer = 0 then gosub music_change_note
  852. rem music_timer = music_timer - 1
  853. rem 'Collision op hero with edge of field, transfer to other field.'
  854. if field_left < hero_x then goto exit_left_done
  855. hero_x = field_right_enter
  856. hero_oldx = field_right
  857. hero_room = hero_room - 1
  858. gosub room_draw
  859. goto exit_done
  860. exit_left_done
  861. if hero_x < field_right then goto exit_right_done
  862. hero_x = field_left_enter
  863. hero_oldx = field_left
  864. hero_room = hero_room + 1
  865. gosub room_draw
  866. goto exit_done
  867. exit_right_done
  868. if hero_y > field_top then goto exit_top_done
  869. hero_y = field_bottom_enter
  870. hero_oldy = field_bottom
  871. hero_room = hero_room - 8
  872. gosub room_draw
  873. goto exit_done
  874. exit_top_done
  875. if hero_y < field_bottom then goto exit_bottom_done
  876. hero_y = field_top_enter
  877. hero_oldy = field_top
  878. hero_room = hero_room + 8
  879. gosub room_draw
  880. goto exit_done
  881. exit_bottom_done
  882. exit_done
  883. rem 'Collision of item with edge of field, bounce back.'
  884. if item_x < field_left then item_x=field_left_enter
  885. if item_x > field_right then item_x=field_right_enter
  886. if item_y < field_top then item_y=field_top_enter
  887. if item_y > field_bottom then item_x=field_bottom_enter
  888. rem 'Draw acting player in position 2
  889. if joy0fire goto player_animate_2
  890. rem 'Draw non moving player not animated
  891. if hero_x = hero_oldx && hero_y = hero_oldy then goto player_animate_1
  892. rem 'Draw and animate player every so many ticks
  893. if !game_timer{4} then goto player_animate_2
  894. player_animate_1
  895. if hero_flags{0} then gosub hero_draw_n
  896. if hero_flags{1} then gosub hero_draw_e
  897. if hero_flags{2} then gosub hero_draw_s
  898. if hero_flags{3} then gosub hero_draw_w
  899. goto player_animate_end
  900. player_animate_2
  901. if hero_flags{0} then gosub hero_draw_n2
  902. if hero_flags{1} then gosub hero_draw_e2
  903. if hero_flags{2} then gosub hero_draw_s2
  904. if hero_flags{3} then gosub hero_draw_w2
  905. player_animate_end
  906. rem 'Reflect sprite if moving west, otherwise, don't
  907. if hero_flags{3} then REFP0 = 8 else REFP0 = 0
  908. rem draw screen
  909. drawscreen
  910. rem And continue main loop
  911. goto main_loop
  912. rem 'Vblank sub. Do something useful in here...'
  913. vblank
  914. rem 'Do something here...'
  915. return
  916. rem 'Gosub that correctly displays MP
  917. set_mp_display
  918. ; lives=hero_mp * 32
  919. ; lives:
  920. ; %00010000
  921. ; %00010000
  922. ; %01010100
  923. ; %10111010
  924. ; %01010100
  925. ; %00010000
  926. ; %00010000
  927. ; %00010000
  928. ;end
  929. return
  930. rem 'Display inventory ggosub
  931. show_inventory
  932. sc0 = 0
  933. sc1 = 0
  934. sc2 = 0
  935. rem 'Add up score to display Numen Leaves
  936. if hero_items{0} then sc0 = sc0 + 16
  937. if hero_items{1} then sc0 = sc0 + 16
  938. if hero_items{2} then sc0 = sc0 + 16
  939. rem 'Display shield if we have it
  940. if hero_items{3} then sc0 = sc0 + 4
  941. rem 'Display Armor
  942. if hero_items{4} then sc1 = sc1 + 80
  943. rem 'Display Sword
  944. if hero_items{5} then sc1 = sc1 + 6
  945. if hero_items{6} then sc2 = sc2 + 112
  946. if hero_items{7} then sc2 = sc2 + 8
  947. return
  948. rem 'Item Pickup gosub
  949. item_pickup
  950. rem 'All sorts of item pickup effects, should be in a gosub, I guess
  951. rem 'Win game if finding victory item
  952. rem 'Make a pickup sound
  953. sound_timer=2
  954. AUDC1=12
  955. AUDV1=8
  956. AUDF1=2
  957. if item_kind = item_victory then goto game_win
  958. if item_kind = item_leaf1 then hero_items{0} = 1
  959. if item_kind = item_leaf2 then hero_items{1} = 1
  960. if item_kind = item_leaf3 then hero_items{2} = 1
  961. if item_kind = item_shield then hero_items{3} = 1
  962. if item_kind = item_armor then hero_items{4} = 1
  963. if item_kind = item_sword then hero_items{5} = 1
  964. if item_kind = item_bookheal then hero_items{6} = 1
  965. if item_kind = item_bookstrike then hero_items{7} = 1
  966. if item_kind <> item_healhp then goto no_healhp
  967. hero_hp = hero_hp + 8
  968. temp2 = hero_level * 2 + hero_base_hp
  969. if hero_hp > temp2 then hero_hp = temp2
  970. no_healhp
  971. if item_kind <> item_healmp then goto no_healmp
  972. hero_mp = hero_mp + 1
  973. temp2 = hero_level / 16 + 1
  974. if hero_mp > temp2 then hero_mp = temp2
  975. gosub set_mp_display
  976. no_healmp
  977. if item_kind <> item_healallhp then goto no_healallhp
  978. hero_hp = hero_level * 2 + hero_base_hp
  979. no_healallhp
  980. if item_kind <> item_healallmp then goto no_healallmp
  981. rem 'Actually, this is buggy for levels above 80
  982. hero_mp = hero_level/16 + 1
  983. gosub set_mp_display
  984. no_healallmp
  985. rem " All done with item effects
  986. rem ' Remove item
  987. item_kind = item_none
  988. item_hp = 0
  989. item_x = nowhere
  990. item_y = nowhere
  991. return
  992. hero_draw_n
  993. REFP0=0
  994. player0:
  995. %01101100
  996. %01101100
  997. %01101100
  998. %01111100
  999. %10111010
  1000. %01111100
  1001. %10111010
  1002. %11111110
  1003. %11111110
  1004. %11111110
  1005. %11111110
  1006. %01111100
  1007. %00111000
  1008. end
  1009. return
  1010. hero_draw_s
  1011. REFP0=0
  1012. player0:
  1013. %01101100
  1014. %01101100
  1015. %01111100
  1016. %01111100
  1017. %10111010
  1018. %01111100
  1019. %10111010
  1020. %11111110
  1021. %11010110
  1022. %11010110
  1023. %11111110
  1024. %01111100
  1025. %00111000
  1026. end
  1027. return
  1028. hero_draw_w
  1029. REFP0=8
  1030. goto hero_draw_e_start
  1031. hero_draw_e
  1032. REFP0=0
  1033. hero_draw_e_start
  1034. player0:
  1035. %00011100
  1036. %10011000
  1037. %10011000
  1038. %10111000
  1039. %10111100
  1040. %10011100
  1041. %10111000
  1042. %11111100
  1043. %11110100
  1044. %11110110
  1045. %11111110
  1046. %01111100
  1047. %00111000
  1048. end
  1049. return
  1050. hero_draw_n2
  1051. REFP0=0
  1052. player0:
  1053. %01100000
  1054. %01100000
  1055. %01101100
  1056. %01101100
  1057. %01111101
  1058. %00111010
  1059. %10111100
  1060. %11111010
  1061. %11111110
  1062. %11111110
  1063. %11111110
  1064. %11111110
  1065. %01111100
  1066. %00111000
  1067. end
  1068. return
  1069. hero_draw_s2
  1070. REFP0=0
  1071. player0:
  1072. %01100000
  1073. %01100000
  1074. %01101100
  1075. %01111100
  1076. %01111101
  1077. %00111010
  1078. %10111100
  1079. %11111010
  1080. %11111110
  1081. %11010110
  1082. %11010110
  1083. %11111110
  1084. %01111100
  1085. %00111000
  1086. end
  1087. return
  1088. hero_draw_w2
  1089. REFP0=8
  1090. goto hero_draw_e2_start
  1091. hero_draw_e2
  1092. REFP0=0
  1093. hero_draw_e2_start
  1094. player0:
  1095. %11000011
  1096. %01100110
  1097. %00111100
  1098. %10111001
  1099. %11111110
  1100. %10111100
  1101. %10111000
  1102. %11111100
  1103. %11110100
  1104. %11110110
  1105. %11111110
  1106. %01111100
  1107. %00111000
  1108. end
  1109. return
  1110. ;#if 0 // we don't need this one
  1111. ;music_change_note
  1112. ; AUDF0 = music_data[music_pointer]
  1113. ; AUDC0 = music_instrument
  1114. ; if music_data[music_pointer] = $FF then AUDV0 = 0 else AUDV0 = 8
  1115. ; music_pointer = music_pointer + 1
  1116. ; music_timer = music_data[music_pointer]
  1117. ; music_pointer = music_pointer + 1
  1118. ; if music_pointer > music_notes then music_pointer = 0
  1119. ; return
  1120. ;#endif
  1121. room_draw
  1122. rem 'Reset the monster missile and item flags
  1123. missile1x = nowhere
  1124. missile1y = nowhere
  1125. item_flags = 0
  1126. rem 'Set up item and draw it
  1127. goto item_setup
  1128. item_setup_done
  1129. if hero_room > 39 then goto room_draw_40_local
  1130. if hero_room > 63 then goto room_draw_64
  1131. on hero_room goto r00 r01 r02 r03 r04 r05 r06 r07 r08 r09 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 r32 r33 r34 r35 r36 r37 r38 r39 r40
  1132. rem r41 r42 r43 r44 r45 r46 r47 r48 r49 r50
  1133. rem r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63 r64
  1134. room_draw_40_local
  1135. goto room_draw_40
  1136. room_draw_64
  1137. rem 'If we get here, the room number s not valid. Go to room room_start (49)
  1138. hero_room = room_start
  1139. goto r00
  1140. rem r64
  1141. rem r65 r66 r67 r68 r69 r70 r71 r72 r73 r74 r75 r76 r77 r78 r79 r80 r81 r82 r83 r84 r85 r86 r87 r88 r89 r90 r91 r92 r93 r94 r95 r96 r97 r98 r99 r100
  1142. room_draw_end
  1143. rem 'Clear bottom scrolling playfield row, so collision detection works properly
  1144. var44 = 0
  1145. var45 = 0
  1146. var46 = 0
  1147. var47 = 0
  1148. return
  1149. ;end
  1150. r00
  1151. alphadata r00_background
  1152. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1153. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1154. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1155. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1156. 'X..............................X'
  1157. 'X..............................X'
  1158. 'X..............................X'
  1159. 'X..............................X'
  1160. 'X..............................X'
  1161. 'X..............................X'
  1162. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1163. end
  1164. plotmap r00_background 0 16 0 32 11
  1165. goto room_draw_end
  1166. r01
  1167. if quest_flags{1} then BACKGRND=gray else BACKGRND=black
  1168. alphadata r01_background
  1169. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1170. 'X..............................X'
  1171. 'X..............................X'
  1172. 'X..............................X'
  1173. 'X...............................'
  1174. 'X...............................'
  1175. 'X......XX..............XX.......'
  1176. 'X..............................X'
  1177. 'X..............................X'
  1178. 'X..............................X'
  1179. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1180. end
  1181. plotmap r01_background 0 16 0 32 11
  1182. goto room_draw_end
  1183. r02
  1184. if quest_flags{1} then BACKGRND=gray else BACKGRND=black
  1185. alphadata r02_background
  1186. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1187. 'X........XX...............XX...X'
  1188. 'X........XX...............XX...X'
  1189. 'X...XX...XX...XXXXXXXXXX..XX...X'
  1190. '....XX...XX...X................X'
  1191. '....XX...XX...X................X'
  1192. '....XX........X.......XXXXXXXXXX'
  1193. 'XXXXXXXXXXXXXXXXXXX............X'
  1194. 'X..............................X'
  1195. 'X..............................X'
  1196. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1197. end
  1198. plotmap r02_background 0 16 0 32 11
  1199. goto room_draw_end
  1200. r03
  1201. BACKGRND = sand
  1202. alphadata r03_background
  1203. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1204. 'X.........XXXXXXXXXXXX..........'
  1205. 'X.........XXXXXXXXXXXX..........'
  1206. 'X.........XXXXXXXXXXXX..........'
  1207. 'X.........XXXXXXXXXXXX..........'
  1208. 'X.........XXXXXXXXXXXX..........'
  1209. 'X........XXXXXXXXXXXXXX.........'
  1210. 'XX......XXXXXXXXXXXXXXXX........'
  1211. 'XX.....XXXXXXXXXXXXXXXXXX.......'
  1212. 'XX....XXXXXXXXXXXXXXXXXXXXX.....'
  1213. 'XX.....XXXXXXXXXXXXXXXXXX.......'
  1214. end
  1215. plotmap r03_background 0 16 0 32 11
  1216. goto room_draw_end
  1217. r04
  1218. BACKGRND=gray
  1219. alphadata r04_background
  1220. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1221. '...............................X'
  1222. '...............X...............X'
  1223. '..XX........XX.X.XX........XX..X'
  1224. '..XX.......X..XXX..X.......XX..X'
  1225. '............XX.X.XX............X'
  1226. '...............X...............X'
  1227. '..XX....XX...........XX....XX..X'
  1228. '..XX....XX...........XX....XX..X'
  1229. '...............................X'
  1230. '...............................X'
  1231. end
  1232. plotmap r04_background 0 16 0 32 11
  1233. goto room_draw_end
  1234. r05
  1235. BACKGRND=turfy
  1236. alphadata r05_background
  1237. 'XXXXXXXX..XXXXXXXXXX..XXXXXXXXXX'
  1238. 'X.XXXX...XXXXXXXXXXXX...XXXXXXXX'
  1239. 'X.......XXXXXXXXXXXXXXX........X'
  1240. 'X......XXXXXXXXXXXXXXX.........X'
  1241. 'X.......XXXXXXXXXXXXXX.........X'
  1242. 'X...........XXXXXX.............X'
  1243. 'X...........XXXXXX.............X'
  1244. 'X..........X......X............X'
  1245. 'X..............................X'
  1246. 'X..............................X'
  1247. 'X..............................X'
  1248. end
  1249. plotmap r05_background 0 16 0 32 11
  1250. goto room_draw_end
  1251. r06
  1252. BACKGRND=turfy
  1253. alphadata r06_background
  1254. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1255. 'XX.......XX.....................'
  1256. 'XX.......XX.....................'
  1257. 'XX...XX..XX....XXXXXXXXXXXXXXXXX'
  1258. 'XX...XX........XX...........X...'
  1259. 'XX...XX........XX...........X...'
  1260. 'XX...XXXXXX....XX......XX...XXXX'
  1261. 'XX...XXX...............XX.......'
  1262. 'XX....XX...............XX.......'
  1263. 'XX....XX...XXXXXXXXX...XX.......'
  1264. 'XX....XX...XXXXXXXXX...XX.....XX'
  1265. end
  1266. plotmap r06_background 0 16 0 32 11
  1267. goto room_draw_end
  1268. r07
  1269. BACKGRND=turfy
  1270. alphadata r07_background
  1271. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1272. '.............X.................X'
  1273. '.............X.................X'
  1274. 'XXXXXXXXX....X...XXXXXXXXX.....X'
  1275. '.............X...XXX...........X'
  1276. '.............X...XXX...........X'
  1277. 'XXXXXX.....XXX...XXX...XXX.....X'
  1278. '.....X.....XXX...XXX...XXX.....X'
  1279. '.....X.....XXX...XXX...XXX.....X'
  1280. '.....X.....XXX...XXX...XXX.....X'
  1281. 'XX...X.....XXX...XXX...XXX.....X'
  1282. end
  1283. plotmap r07_background 0 16 0 32 11
  1284. goto room_draw_end
  1285. r08
  1286. BACKGRND=brown
  1287. if quest_flags{3} goto r08_open
  1288. alphadata r08_background
  1289. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1290. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1291. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1292. 'XXXX.....................XXXXXXX'
  1293. 'XX........................XXXXXX'
  1294. 'XX..............................'
  1295. 'X...............................'
  1296. 'X...............................'
  1297. 'XXXXX..................XXXXXXXXX'
  1298. 'XXXXXXX..............XXXXXXXXXXX'
  1299. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1300. end
  1301. plotmap r08_background 0 16 0 32 11
  1302. goto r08_end
  1303. r08_open
  1304. alphadata r08_open_background
  1305. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1306. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1307. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1308. 'XXXX.....................XXXXXXX'
  1309. 'XX........................XXXXXX'
  1310. 'XX..............................'
  1311. 'X...............................'
  1312. 'X...............................'
  1313. 'XXXXX..................XXXXXXXXX'
  1314. 'XXXXXXX..............XXXXXXXXXXX'
  1315. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1316. end
  1317. plotmap r08_open_background 0 16 0 32 11
  1318. r08_end
  1319. goto room_draw_end
  1320. r09
  1321. BACKGRND=sand
  1322. alphadata r09_background
  1323. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1324. 'XXXXXXXXXXXXXXXXXXX.............'
  1325. 'XXXXXXXXXXX.....................'
  1326. 'XXXXXXXXX....................XXX'
  1327. 'XXXXXXX.....XXXXXXXXXXXXXXXXXXXX'
  1328. '...XX......XXX..................'
  1329. '...........XX...................'
  1330. '......XXXXXX......XXXX....XXXXXX'
  1331. 'XX...XXX........XXXXXXX.........'
  1332. 'XXXXXXX.......XXXXXXXXXX........'
  1333. 'XXXXXX.......XXXXXXXXXXXX....XXX'
  1334. end
  1335. plotmap r09_background 0 16 0 32 11
  1336. goto room_draw_end
  1337. r10
  1338. BACKGRND=sand
  1339. alphadata r10_background
  1340. 'XXXXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1341. '............XX.................X'
  1342. '.............XX................X'
  1343. 'XXX...........XX.....XX........X'
  1344. 'XXXXXXXXXX.....XX...XX........XX'
  1345. '...................XX.......XXXX'
  1346. '..................XX......XXXX..'
  1347. 'XXXXXXXXXXXXXXXXXXX.....XXXX....'
  1348. '.....................XXXXXX.....'
  1349. '....................XXXX........'
  1350. 'XXXXXXXXXXXXXXXXXXXXXXX.........'
  1351. end
  1352. plotmap r10_background 0 16 0 32 11
  1353. goto room_draw_end
  1354. r11
  1355. BACKGRND=turfy
  1356. alphadata r11_background
  1357. 'XX.......XXXXXXXXXXXXXX.........'
  1358. 'XX.......XXXXXXXXXXXXXX.........'
  1359. 'XX........XXXXXXXXXXXX..........'
  1360. 'XX........XXXXXXXXXXXX..........'
  1361. 'XX........XXXXXXXXXXXX..........'
  1362. 'XX........XXXXXXXXXXXX..........'
  1363. '..........XXXXXXXXXXXX..........'
  1364. '..........XXXXXXXXXXXX..........'
  1365. '..........XXXXXXXXXXXX..........'
  1366. '..........XXXXXXXXXXXX..........'
  1367. '..........XXXXXXXXXXXX..........'
  1368. end
  1369. plotmap r11_background 0 16 0 32 11
  1370. goto room_draw_end
  1371. r12
  1372. BACKGRND=gray
  1373. alphadata r12_background
  1374. '...............................X'
  1375. '...............................X'
  1376. '...............................X'
  1377. '..XX....XX...........XX....XX..X'
  1378. '..XX....XX...........XX....XX..X'
  1379. '...............................X'
  1380. '...............................X'
  1381. '..XX....XX...........XX....XX..X'
  1382. '..XX....XX...........XX....XX..X'
  1383. '...............................X'
  1384. '...............................X'
  1385. end
  1386. plotmap r12_background 0 16 0 32 11
  1387. goto room_draw_end
  1388. r13
  1389. BACKGRND=turfy
  1390. alphadata r13_background
  1391. 'XXXXXXXXXXXXXX...XXXXXXXXXXXXXXX'
  1392. 'X..............................X'
  1393. 'X..............................X'
  1394. 'X..............................X'
  1395. 'X..............................X'
  1396. 'X..............................X'
  1397. 'X..............................X'
  1398. 'X..............................X'
  1399. 'X...............................'
  1400. 'X...............................'
  1401. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1402. end
  1403. plotmap r13_background 0 16 0 32 11
  1404. goto room_draw_end
  1405. r14
  1406. BACKGRND=turfy
  1407. alphadata r14_background
  1408. 'XXX...XX...XXXXXXXXX...XX.....XX'
  1409. 'XXX...XX...XXXXXXXXX...XX.......'
  1410. 'XXX...XX...............XX.......'
  1411. 'XXX...XX...............XX.......'
  1412. 'XXX...XXXXXXXXXXXXXX...XXXXXXXXX'
  1413. 'XXX.............................'
  1414. 'XXX.............................'
  1415. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1416. '................................'
  1417. '................................'
  1418. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1419. end
  1420. plotmap r14_background 0 16 0 32 11
  1421. goto room_draw_end
  1422. r15
  1423. alphadata r15_background
  1424. 'XX...XXX...XXX...XXX...XXX.....X'
  1425. '.....XXX...XXX...XXX...XXX.....X'
  1426. '.....XXX.......................X'
  1427. '.....XXX.......................X'
  1428. 'XXXXXXXXXXXXXXXXXXXXXXXXXXX....X'
  1429. '....XXX........................X'
  1430. '....XXX........................X'
  1431. 'XX..XXX....XXXXXXXXXXXXXXXXXXXXX'
  1432. '....XXX....X...................X'
  1433. '....XXX....X...................X'
  1434. 'XXXXXXX....XXXXXXXXXXXXXXX.....X'
  1435. end
  1436. plotmap r15_background 0 16 0 32 11
  1437. goto room_draw_end
  1438. r16
  1439. BACKGRND=yellow
  1440. alphadata r16_background
  1441. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1442. 'X..............................X'
  1443. 'X..............................X'
  1444. 'X...XX....................XX...X'
  1445. 'X...XX....................XX...X'
  1446. 'X...XX....................XX...X'
  1447. 'X..............................X'
  1448. 'X...XX....................XX...X'
  1449. 'X...XX....................XX...X'
  1450. 'X...XX....................XX...X'
  1451. 'X..............................X'
  1452. end
  1453. plotmap r16_background 0 16 0 32 11
  1454. goto room_draw_end
  1455. r17
  1456. BACKGRND=sand
  1457. alphadata r17_background
  1458. 'XXXXXX.......XXXXXXXXXXXX....XXX'
  1459. 'XXXXXXXX.......XXXXXXXX.......XX'
  1460. 'XXXXXXXXXX..........XX..........'
  1461. 'XXXXXXXXXXXXX........XX.........'
  1462. 'XXXXXXXXXXXXXXXX......XX........'
  1463. 'XXXXXXXXXXXXXXXXXX....XX........'
  1464. 'XXXXXXXXXXXXXXXX....XXXX........'
  1465. 'XXXXXXXXXXXXXXX....XXXX.........'
  1466. 'XXXXXXXXXXXXXXXXX...............'
  1467. 'XXXXXXXXXXXXXXXXXXX.............'
  1468. 'XXXXXXXXXXXXXXXXXXXXXX..........'
  1469. end
  1470. plotmap r17_background 0 16 0 32 11
  1471. goto room_draw_end
  1472. r18
  1473. BACKGRND = turfy
  1474. alphadata r18_background
  1475. 'XXXXXXXXXXXXXXXXXXXXXXX.........'
  1476. 'XXXXXXXXXXXXXXXXXXX.............'
  1477. '................................'
  1478. '................................'
  1479. '...XXXXXXXXXXXXXX...............'
  1480. '..XXXXXXXXXXXXXXXX..............'
  1481. '.XXXXXXXXXXXXXXXXXX.............'
  1482. '..XXXXXXXXXXXXXXXX..............'
  1483. '..XX..XX...XXX..XX..............'
  1484. '..XXXXXX...XXXXXXX..............'
  1485. '................................'
  1486. end
  1487. plotmap r18_background 0 16 0 32 11
  1488. goto room_draw_end
  1489. r19
  1490. BACKGRND=sand
  1491. alphadata r19_background
  1492. '..........XXXXXXXXXXXX..........'
  1493. '..........XXXXXXXXXXXX..........'
  1494. '..........XXXXXXXXXXXXX.........'
  1495. '..........XXXXXXXXXXXXX.........'
  1496. '.........XXXXXXXXXXXXXX.........'
  1497. '.........XXXXXXXXXXXXXX.........'
  1498. '.........XXXXXXXXXXXXX..........'
  1499. '.........XXXXXXXXXXXXX..........'
  1500. '.........XXXXXXXXXXXXX..........'
  1501. '..........XXXXXXXXXXXX..........'
  1502. '..........XXXXXXXXXXXX..........'
  1503. end
  1504. plotmap r19_background 0 16 0 32 11
  1505. goto room_draw_end
  1506. r20
  1507. BACKGRND=sand
  1508. alphadata r20_background
  1509. '...............................X'
  1510. '....X.X.X.....XX.XX.XX.....X.X.X'
  1511. '....XXXXX.....XXXXXXXX.....XXXXX'
  1512. '....X...X.....X......X.....X...X'
  1513. '....X...XXXXXXX......XXXXXXX...X'
  1514. '....X...........................'
  1515. '....X...........................'
  1516. '....X...XXXXXXXXXXXXXXXXXXXXXXXX'
  1517. '....X............XX.............'
  1518. '....X............XX.............'
  1519. '....X............XX...........XX'
  1520. end
  1521. plotmap r20_background 0 16 0 32 11
  1522. goto room_draw_end
  1523. r21
  1524. BACKGRND=turfy
  1525. alphadata r21_background
  1526. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1527. '....X.X.X......X.XX.X......X.X.X'
  1528. '....XXXXX......XXXXXX......XXXXX'
  1529. '....X...XXXXXXXX....XXXXXXXX...X'
  1530. 'XXXXX..........................X'
  1531. '...............................X'
  1532. '...............................X'
  1533. 'XXXXX..........................X'
  1534. '....X..........................X'
  1535. '....X..........................X'
  1536. 'XX..XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1537. end
  1538. plotmap r21_background 0 16 0 32 11
  1539. goto room_draw_end
  1540. r22
  1541. BACKGRND=turfy
  1542. alphadata r22_background
  1543. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1544. 'XXXXXXXXX...XXX...XXXXXXXXXXXXXX'
  1545. 'XXXXXXX.............XXXXXXXXXXXX'
  1546. 'XXXXXX................XXXXXXXXXX'
  1547. 'XXXX....................XXXXXXXX'
  1548. 'XXXX.......................XXXXX'
  1549. 'XXX.........................XXXX'
  1550. 'XX....X..............X.......XXX'
  1551. 'XX...XXXX...........XXXX........'
  1552. 'X.....X..............X..........'
  1553. 'X...............................'
  1554. end
  1555. plotmap r22_background 0 16 0 32 11
  1556. goto room_draw_end
  1557. r23
  1558. BACKGRND=turfy
  1559. alphadata r23_background
  1560. 'XXXXXXX...XXXXXXXXXXXXXXXX.....X'
  1561. 'XXXXXXX...XXXXXXXXXXXXXXXX.....X'
  1562. 'XXXXXXX....XXXXXXXXXXXXX.......X'
  1563. 'XXXXXXX.....XXXXXXXXXXX........X'
  1564. 'XXXXXXX........................X'
  1565. 'XXXXXXX........................X'
  1566. 'XXXXXXXXXXXXXXXX..XXXXXXXXXXXXXX'
  1567. '.....X......X.......X..........X'
  1568. '....XXXX...XXXX....XXXX........X'
  1569. '.....X......X.......X..........X'
  1570. '...............................X'
  1571. end
  1572. plotmap r23_background 0 16 0 32 11
  1573. goto room_draw_end
  1574. r24
  1575. BACKGRND=yellow
  1576. if quest_flags{5} then goto r24_open
  1577. alphadata r24_background
  1578. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1579. 'X..............................X'
  1580. 'X...XX....................XX...X'
  1581. 'X...XX....................XX...X'
  1582. 'X...XX....................XX...X'
  1583. 'X.............XXXX.............X'
  1584. 'X...XX.......XXXXXX.......XX...X'
  1585. 'X...XX....................XX...X'
  1586. 'X...XX....................XX...X'
  1587. 'X..............................X'
  1588. 'X......XXXXXXX....XXXXXXX.....XX'
  1589. end
  1590. plotmap r24_end_background 0 16 0 32 11
  1591. goto r24_end
  1592. r24_open
  1593. alphadata r24_open_background
  1594. 'X..............................X'
  1595. 'X..............................X'
  1596. 'X...XX....................XX...X'
  1597. 'X...XX....................XX...X'
  1598. 'X...XX....................XX...X'
  1599. 'X.............XXXX.............X'
  1600. 'X...XX.......XXXXXX.......XX...X'
  1601. 'X...XX....................XX...X'
  1602. 'X...XX....................XX...X'
  1603. 'X..............................X'
  1604. 'X......XXXXXXX....XXXXXXX.....XX'
  1605. end
  1606. r24_end
  1607. plotmap r24_open 0 16 0 32 11
  1608. goto room_draw_end
  1609. r25
  1610. BACKGRND=turfy
  1611. alphadata r25_background
  1612. 'XXXXXXXXXXXXXXXXXXXXXX..........'
  1613. 'XXXXXXXXXXXXXXXXXXXX............'
  1614. 'XXXXXXXXXXXXXXXXXX.XXXXXXXXXX...'
  1615. 'XXXXXXXXXXXXXXX...XXXXXXXXXXXX..'
  1616. 'XXXXXXXXXXXXX....XXXXXXXXXXXXXX.'
  1617. 'XXXXXXXXXXX.......XXXXXXXXXXXX..'
  1618. 'XXXXXXXXX.........XXX..XX...XX..'
  1619. 'XXXXXX............XXXXXXX...XX..'
  1620. 'XXXXX...........................'
  1621. 'XX..............................'
  1622. 'XX..............................'
  1623. end
  1624. plotmap r25_background 0 16 0 32 11
  1625. goto room_draw_end
  1626. r26
  1627. BACKGRND = turfy
  1628. alphadata r26_background
  1629. '................................'
  1630. '................................'
  1631. '...XXXXXXX.....XXXXXXXXXXXXX....'
  1632. '..XXXXXXXXX...XXXXXXXXXXXXXXX...'
  1633. '.XXXXXXXXXXX.XXXXXXXXXXXXXXXXX..'
  1634. '..XXXXXXXXX...XXXXXXXXXXXXXXX...'
  1635. '..XX.X...XX...XX..XX...XX..XX...'
  1636. '..XXXX...XX...XXXXXX...XXXXXX...'
  1637. '................................'
  1638. '................................'
  1639. '................................'
  1640. end
  1641. plotmap r26_background 0 16 0 32 11
  1642. goto room_draw_end
  1643. r27
  1644. BACKGRND=sand
  1645. alphadata r27_background
  1646. '..........XXXXXXXXXXXX..........'
  1647. '..........XXXXXXXXXXXX..........'
  1648. '..........XXXXXXXXXXXX..........'
  1649. '..........XXXXXXXXXXXXX.........'
  1650. '..........XXXXXXXXXXXXX.........'
  1651. '..........XXXXXXXXXXXXX.........'
  1652. '..........XXXXXXXXXXXXX.........'
  1653. '..........XXXXXXXXXXXX..........'
  1654. '..........XXXXXXXXXXXX..........'
  1655. '..........XXXXXXXXXXXX..........'
  1656. '..........XXXXXXXXXXXX..........'
  1657. end
  1658. plotmap r27_background 0 16 0 32 11
  1659. goto room_draw_end
  1660. r28
  1661. BACKGRND=sand
  1662. alphadata r28_background
  1663. '....X............XX...........XX'
  1664. '....XXXXXXXXXX...XX.....XXXXXXXX'
  1665. '....X............XX...........XX'
  1666. '....X............XX...........XX'
  1667. '....X...XXXXXXXXXXXXXXXXXXX...XX'
  1668. '....X...X.................X...XX'
  1669. '....X.........................XX'
  1670. '....XX.....XXXXXXXXXXXXXX....XXX'
  1671. '....XXXXXXXXX..........XXXXXXXXX'
  1672. '................................'
  1673. '................................'
  1674. end
  1675. plotmap r28_background 0 16 0 32 11
  1676. goto room_draw_end
  1677. r29
  1678. BACKGRND=turfy
  1679. if quest_flags{6} then goto r29_open
  1680. if item_flags{3} then goto r29_open
  1681. alphadata r29_background
  1682. 'XX..XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1683. 'XX..X.........................XX'
  1684. 'XX..X.........................XX'
  1685. 'XX..X..XXXXXXXXXXXXXXXXXX.....XX'
  1686. 'XX..X..XXXXXXX.XX.XXXXXXX.....XX'
  1687. 'XX..X..XXXXX.X.XX.X.XXXXX.....XX'
  1688. 'XX.....XXXXX.XXXXXX.XXXXX.....XX'
  1689. 'XX.....XXXXX.X.XX.X.XXXXX.....XX'
  1690. 'XXXXXXXXX..............XXXXXXXXX'
  1691. '..............................XX'
  1692. '..............................XX'
  1693. end
  1694. plotmap r29_background 0 16 0 32 11
  1695. goto room_draw_end
  1696. r29_open
  1697. alphadata r29_open_background
  1698. 'XX..XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1699. 'XX..X.........................XX'
  1700. 'XX..X.........................XX'
  1701. 'XX..X..XXXXXXXX..XXXXXXXX.....XX'
  1702. 'XX..X..XXXXXX......XXXXXX.....XX'
  1703. 'XX..X..XXXXX........XXXXX.....XX'
  1704. 'XX.....XXXXX........XXXXX.....XX'
  1705. 'XX.....XXXXX........XXXXX.....XX'
  1706. 'XXXXXXXXX..............XXXXXXXXX'
  1707. '..............................XX'
  1708. '..............................XX'
  1709. end
  1710. plotmap r29_open_background 0 16 0 32 11
  1711. goto room_draw_end
  1712. r30
  1713. alphadata r30_background
  1714. 'X...............................'
  1715. 'XX......X.....X.....X.....X.....'
  1716. 'XXX....XXX...XXX...XXX...XXX....'
  1717. 'XX....XXXXX.XXXXX.XXXXX.XXXXX...'
  1718. 'X.......X.....X.....X.....X.....'
  1719. 'XX..............................'
  1720. 'XX...X......X......X.....X......'
  1721. 'X...XXX....XXX....XXX...XXX.....'
  1722. 'X..XXXXX..XXXXX..XXXXX.XXXXX....'
  1723. 'X....X......X......X.....X......'
  1724. 'X.............................XX'
  1725. 'XX............................XX'
  1726. end
  1727. plotmap r30_background 0 16 0 32 11
  1728. goto room_draw_end
  1729. r31
  1730. alphadata r31_background
  1731. '...............................X'
  1732. '...............................X'
  1733. '...............................X'
  1734. '.......XXX..............XXX....X'
  1735. '......XXXXX.....X......XXXXX...X'
  1736. '......XXXXX....XXX.....XXXXX...X'
  1737. '.......XXX....XXXXX.....XXX....X'
  1738. '........X.......X........X.....X'
  1739. '........X................X.....X'
  1740. '...............................X'
  1741. 'XXX...........................XX'
  1742. end
  1743. plotmap r31_background 0 16 0 32 11
  1744. goto room_draw_end
  1745. r32
  1746. BACKGRND=turfy
  1747. if quest_flags{2} then goto r32_open
  1748. alphadata r32_background
  1749. 'X.....XXXXXXXXXXXXXXXXXXX.....XX'
  1750. 'X....XXXXXXXXXXXXXXXXXXXXX....XX'
  1751. 'X...XXXXXXXXXXXXXXXXXXXXXXX...XX'
  1752. 'X..XXXXXXXXXXXXXXXXXXXXXXXXX..XX'
  1753. 'X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1754. 'X..XX..XX..XX..XX..XX..XX..XX...'
  1755. 'X..XX..XX..XX..XX..XX..XX..XX...'
  1756. 'X..XX..XX..XX..XX..XX..XX..XX...'
  1757. 'X.XXXXXXXXXXXXXXXXXXXXXXXXXXXX..'
  1758. 'X...............................'
  1759. 'X...............................'
  1760. end
  1761. plotmap r32_background 0 16 0 32 11
  1762. goto room_draw_end
  1763. r32_open
  1764. alphadata r32_open_background
  1765. 'X.....XXXXXXXX....XXXXXXX.....XX'
  1766. 'X....XXXXXXXXX....XXXXXXXX....XX'
  1767. 'X...XXXXXXXXX......XXXXXXXX...XX'
  1768. 'X..XXXXXXXXXX......XXXXXXXXX..XX'
  1769. 'X.XXXXXXXXXXXX....XXXXXXXXXXXXXX'
  1770. 'X..XX..XX..XX......XX..XX..XX...'
  1771. 'X..XX..XX..XX......XX..XX..XX...'
  1772. 'X..XX..XX..XX......XX..XX..XX...'
  1773. 'X.XXXXXXXXXXX......XXXXXXXXXXX..'
  1774. 'X...............................'
  1775. 'X...............................'
  1776. end
  1777. plotmap r32_open_background 0 16 0 32 11
  1778. goto room_draw_end
  1779. r33
  1780. alphadata r33_background
  1781. 'XX..............................'
  1782. 'XX.............XXX..............'
  1783. 'XX...........XX...XX............'
  1784. 'XX.............XXX..............'
  1785. 'XX..............................'
  1786. '....XXXXXXXXXXXX....XXXXXXXXXX..'
  1787. '...XXXXXXXXXXXXXX..XXXXXXXXXXXX.'
  1788. '....XXXXXXXXXXXX....XXXXXXXXXX..'
  1789. '....XX.XX...XX.X....XX.XX...XX..'
  1790. '....XXXXX...XXXX....XXXXX...XX..'
  1791. '................................'
  1792. end
  1793. plotmap r33_background 0 16 0 32 11
  1794. goto room_draw_end
  1795. r34
  1796. BACKGRND = turfy
  1797. alphadata r34_background
  1798. '................................'
  1799. '................................'
  1800. '...XXXXXXXXXXXXX......XXXXXXX...'
  1801. '..XXXXXXXXXXXXXXX....XXXXXXXXX..'
  1802. '.XXXXXXXXXXXXXXXXX..XXXXXXXXXXX.'
  1803. '..XXXXXXXXXXXXXXX....XXXXXXXXX..'
  1804. '..XX..XX...XX..XX....XX.XX...X..'
  1805. '..XXXXXX...XXXXXX....XXXXX...X..'
  1806. '................................'
  1807. '................................'
  1808. '................................'
  1809. end
  1810. plotmap r34_background 0 16 0 32 11
  1811. goto room_draw_end
  1812. r35
  1813. BACKGRND=sand
  1814. if quest_flags{4} then goto r35_open
  1815. alphadata r35_background
  1816. '..........XXXXXXXXXXXX..........'
  1817. '..........XXXXXXXXXXXX..........'
  1818. '..........XXXXXXXXXXXX..........'
  1819. '...........XXXXXXXXXX...........'
  1820. '............XXXXXXXX............'
  1821. '............XXXXXXXX............'
  1822. '...........XXXXXXXXXX...........'
  1823. '..........XXXXXXXXXXXX..........'
  1824. '.........XXXXXXXXXXXXX..........'
  1825. '..........XXXXXXXXXXXX..........'
  1826. '..........XXXXXXXXXXXX..........'
  1827. end
  1828. plotmap r35_background 0 16 0 32 11
  1829. goto room_draw_end
  1830. r35_open
  1831. alphadata r35_open_background
  1832. '..........XXXXXXXXXXXX..........'
  1833. '..........XXXXXXXXXXXX..........'
  1834. '..........XXXXXXXXXXXX..........'
  1835. '...........XXXXXXXXXX...........'
  1836. '................................'
  1837. '................................'
  1838. '...........XXXXXXXXXX...........'
  1839. '..........XXXXXXXXXXXX..........'
  1840. '.........XXXXXXXXXXXXX..........'
  1841. '..........XXXXXXXXXXXX..........'
  1842. '..........XXXXXXXXXXXX..........'
  1843. end
  1844. plotmap r35_open_background 0 16 0 32 11
  1845. goto room_draw_end
  1846. r36
  1847. BACKGRND=turfy
  1848. alphadata r36_background
  1849. '................................'
  1850. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1851. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1852. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1853. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1854. '................................'
  1855. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1856. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1857. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1858. '..XXXXXXXX..XXXXXXXX..XXXXXXXX..'
  1859. '................................'
  1860. end
  1861. plotmap r36_background 0 16 0 32 11
  1862. goto room_draw_end
  1863. r37
  1864. BACKGRND=turfy
  1865. alphadata r37_background
  1866. '................................'
  1867. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1868. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1869. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1870. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1871. '................................'
  1872. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1873. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1874. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1875. '..XXXXXXX..XXXXXXXXXX..XXXXXXX..'
  1876. '................................'
  1877. end
  1878. plotmap r37_background 0 16 0 32 11
  1879. goto room_draw_end
  1880. r38
  1881. BACKGRND=turfy
  1882. alphadata r38_background
  1883. 'XX............................XX'
  1884. '......XXXXXXXXXXXXXXXXXXX.......'
  1885. '....XXX................XXXX.....'
  1886. '...XX.....................XX....'
  1887. '..XX.......................XX...'
  1888. '..XX........................XX..'
  1889. '..XX........................XX..'
  1890. '..XXX.....................XXXX..'
  1891. '..X.XXX.................XXX.XX..'
  1892. '..X.......XXXXXXXXXXXXXX.XX.XX..'
  1893. '..X.......X.XXXXXXXX.XXX.XXXXX..'
  1894. end
  1895. plotmap r38_background 0 16 0 32 11
  1896. goto room_draw_end
  1897. r39
  1898. BACKGRND=turfy
  1899. alphadata r39_background
  1900. 'XXX...........................XX'
  1901. '..XX...X........X.......X....XXX'
  1902. '..XX..XXX......XXX.....XXX...XXX'
  1903. '...XX..X...X....X.......X.....XX'
  1904. '..XX......XXX.................XX'
  1905. '...XX......X.......X.........XXX'
  1906. '..XX.........X....XXX.........XX'
  1907. '...XX...X...XXX....X....X....XXX'
  1908. '..XX...XXX...X.........XXX...XXX'
  1909. '...XX...X...............X.....XX'
  1910. '..XX...........................X'
  1911. end
  1912. plotmap r39_background 0 16 0 32 11
  1913. goto room_draw_end
  1914. room_draw_40
  1915. temp1=hero_room-40
  1916. on temp1 goto r40 r41 r42 r43 r44 r45 r46 r47 r48 r49 r50 r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63
  1917. goto room_draw_end
  1918. r40
  1919. alphadata r40_background
  1920. 'X...............................'
  1921. 'XXX.............................'
  1922. 'XXXXX...........................'
  1923. 'XXXXXXX.........................'
  1924. 'XXXXXXXXXX......XXX.............'
  1925. 'XXXXXXXX.......XXXXX............'
  1926. 'XXXXXX.......XXXXXXXXX..........'
  1927. 'XXXXXX........XXXXXX............'
  1928. 'XXXXX...........XXXXXX..........'
  1929. 'XXX...............XXXXX.........'
  1930. 'X...............................'
  1931. end
  1932. plotmap r40_background 0 16 0 32 11
  1933. goto room_draw_end
  1934. r41
  1935. BACKGRND = turfy
  1936. alphadata r41_background
  1937. '................................'
  1938. '.............X..................'
  1939. '............XXX.................'
  1940. '...........XXXXX................'
  1941. '.............X..................'
  1942. '.....X..........................'
  1943. '....XXX............X............'
  1944. '....XXXX..........XXX...........'
  1945. '...XXXXX.........XXXXX..........'
  1946. '.....X.............X............'
  1947. '................................'
  1948. end
  1949. plotmap r41_background 0 16 0 32 11
  1950. goto room_draw_end
  1951. r42
  1952. BACKGRND = turfy
  1953. alphadata r42_background
  1954. '................................'
  1955. '..........................X.....'
  1956. '.........................XXX....'
  1957. '........................XXXXX...'
  1958. '..........................X.....'
  1959. '.....X..........................'
  1960. '....XXX............X............'
  1961. '....XXXX..........XXX...........'
  1962. '...XXXXX.........XXXXX..........'
  1963. '.....X.............X..........XX'
  1964. '..............................XX'
  1965. end
  1966. plotmap r42_background 0 16 0 32 11
  1967. goto room_draw_end
  1968. r43
  1969. BACKGRND = sand
  1970. alphadata r43_background
  1971. '..........XXXXXXXXXXXX..........'
  1972. '..........XXXXXXXXXXXXX.........'
  1973. '..........XXXXXXXXXXXXX.........'
  1974. '..........XXXXXXXXXXXXXX........'
  1975. '.........XXXXXXXXXXXXXXX........'
  1976. '.........XXXXXXXXXXXXXXXXX......'
  1977. '.......XXXXXXXXXXXXXXXXXXXXX....'
  1978. '.....XXXXXXXXXXXXXXXXXXXXXXXX...'
  1979. '..XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.'
  1980. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1981. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  1982. end
  1983. plotmap r43_background 0 16 0 32 11
  1984. goto room_draw_end
  1985. r44
  1986. BACKGRND=sand
  1987. alphadata r44_background
  1988. '................................'
  1989. '........X.........X.............'
  1990. '.......XXX.......XXX............'
  1991. '......XXXXX.....XXXXX...........'
  1992. '.....XXX.XXX...XXX.XXX...X......'
  1993. '....XXX...XXX.XXX...XXX.XXX.....'
  1994. '.......................XXXXX....'
  1995. '......................XXX.XXX...'
  1996. '.....................XXX...XXX..'
  1997. 'XX..............................'
  1998. 'XX..............................'
  1999. end
  2000. plotmap r44_background 0 16 0 32 11
  2001. goto room_draw_end
  2002. r45
  2003. BACKGRND = sand
  2004. alphadata r45_background
  2005. '................................'
  2006. '................................'
  2007. '................................'
  2008. '................................'
  2009. '...XXX..XXX...XXXX....XXX..XXX..'
  2010. '..X...XX...X.XXXXXX..X...XX...X.'
  2011. '......XX.....XXXXXX.....XX......'
  2012. '.......XX....XX..XX.....XX......'
  2013. '.......XX....XX..XX....XX.......'
  2014. '........XX.............XX.......'
  2015. '................................'
  2016. end
  2017. plotmap r45_background 0 16 0 32 11
  2018. goto room_draw_end
  2019. r46
  2020. BACKGRND=turfy
  2021. alphadata r46_background
  2022. '..X.......X.XXX..XXX.XXXXXXXXX..'
  2023. '..X....XXXXXXXX..XXXXXXX.XXXXX..'
  2024. '..X.......XXXXXXXXXX.XXX.XXXXX..'
  2025. '..XXX........XXXXXXX.XXXXXX.XX..'
  2026. '..XX.XXX..........XXXXXXXXX.XX..'
  2027. '..XXXXX.XXX..........XXX.XXXXX..'
  2028. '..XXXXX.XXXXXX..........XXXXXX..'
  2029. '..XX.XXXXXX.XXXXXXX........XXX..'
  2030. '..XX.XXXXXXXXXX..XXXXX.......X..'
  2031. '..XXXXX.XXXXXXXXXXXXXXXXX....X..'
  2032. '..XXXXX.XXX.XXXXXXXX.X.....XXX..'
  2033. '..XX.XXXXXX.XXX..XXX.X.....XXX..'
  2034. end
  2035. plotmap r46_background 0 16 0 32 11
  2036. goto room_draw_end
  2037. r47
  2038. alphadata r47_background
  2039. '..XX...........................X'
  2040. '...XX..X....X.....X.....X......X'
  2041. '..XX..XXX..XXX...XXX...XXX....XX'
  2042. '...XX..X....X.....X.....X.....XX'
  2043. '..XX.....X.....X.....X.......XXX'
  2044. '...XX...XXX...XXX...XXX......XXX'
  2045. '...XX....X.....X.....X......XXXX'
  2046. '..XX...X....X.....X.....X....XXX'
  2047. '..XX..XXX..XXX...XXX...XXX....XX'
  2048. '..XX...X....X.....X.....X......X'
  2049. '...XX..........................X'
  2050. end
  2051. plotmap r47_background 0 16 0 32 11
  2052. goto room_draw_end
  2053. r48
  2054. BACKGRND = turfy
  2055. alphadata r48_background
  2056. 'X...............................'
  2057. 'X...........X...................'
  2058. 'X...............................'
  2059. 'X.....X.....................X...'
  2060. 'X...............................'
  2061. 'X...............................'
  2062. 'X...............................'
  2063. 'X...................X...........'
  2064. 'X...............................'
  2065. 'X..X............................'
  2066. 'X...............X...............'
  2067. end
  2068. plotmap r48_background 0 16 0 32 11
  2069. goto room_draw_end
  2070. r49
  2071. BACKGRND=turfy
  2072. alphadata r49_background
  2073. '................................'
  2074. '................................'
  2075. '.......XXXXXXXXXXXXXXXXXX.......'
  2076. '......XXXXXXXXXXXXXXXXXXXX......'
  2077. '.....XXXXXXXXXXXXXXXXXXXXXX.....'
  2078. '......XXXXXXXXXXXXXXXXXXXX......'
  2079. '......XXX..XXX...XXXX..XXX......'
  2080. '......XXXXXXXX...XXXXXXXXX......'
  2081. '................................'
  2082. '................................'
  2083. '................................'
  2084. end
  2085. COLUPF=red
  2086. plotmap r49_background 0 16 0 32 11
  2087. goto room_draw_end
  2088. r50
  2089. BACKGRND = sand + 0
  2090. alphadata r50_background
  2091. '..............................XX'
  2092. '.............................XXX'
  2093. '...........................XXXXX'
  2094. '.........................XXXXXXX'
  2095. '........................XXXXXXXX'
  2096. '......................XXXXXXXXXX'
  2097. '.....................XXXXXXXXXXX'
  2098. '...................XXXXXXXXXXXXX'
  2099. '..................XXXXXXXXXXXXXX'
  2100. '..................XXXXXXXXXXXXXX'
  2101. '.................XXXXXXXXXXXXXXX'
  2102. '................XXXXXXXXXXXXXXXX'
  2103. end
  2104. plotmap r50_background 0 16 0 32 11
  2105. goto room_draw_end
  2106. r51
  2107. rem 'black ship top
  2108. BACKGRND = seablue + 2
  2109. alphadata r51_background
  2110. '.............XXXXXXXXXXXXX......'
  2111. '...........XXXXXXXXXXXXXXX......'
  2112. '..........XXXXXXXXXXXXXXXX......'
  2113. '........XXXXXXXXXXXXXXXXXX......'
  2114. '......XXXXXXXXXXXXXXXXXXXX......'
  2115. '.....XXXXXXXXXXXXXXXXXXXXX......'
  2116. '...............XX...............'
  2117. '....XXXXXXXXXXXXXXXXXXXXXXXXXX..'
  2118. '...XX..........XX............XX.'
  2119. '..XXX..........XX............XX.'
  2120. '.XXXX..........XX............XXX'
  2121. end
  2122. plotmap r51_background 0 16 0 32 11
  2123. goto room_draw_end
  2124. r52
  2125. BACKGRND = sand
  2126. alphadata r52_background
  2127. 'XX..............................'
  2128. 'XXX.............................'
  2129. 'XXXX............................'
  2130. 'XXXXX...........................'
  2131. 'XXXXXXX.........................'
  2132. 'XXXXXXXXXXX.....................'
  2133. 'XXXXXXXXXXXXXX..................'
  2134. 'XXXXXXXXXXXXXXXXX...............'
  2135. 'XXXXXXXXXXXXXXXXXXXXX...........'
  2136. 'XXXXXXXXXXXXXXXXXXXXXXXXXX......'
  2137. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2138. end
  2139. plotmap r52_background 0 16 0 32 11
  2140. goto room_draw_end
  2141. r53
  2142. BACKGRND = sand
  2143. alphadata r53_background
  2144. '................................'
  2145. '......XXX..XXX......XXX..XXX....'
  2146. '.....X...XX...X....X...XX...X...'
  2147. '.........XX............XX.......'
  2148. '........XX............XX........'
  2149. '.......XX............XX.........'
  2150. '......XX............XX..........'
  2151. '................................'
  2152. '................................'
  2153. '................................'
  2154. 'XX..............................'
  2155. end
  2156. plotmap r53_background 0 16 0 32 11
  2157. goto room_draw_end
  2158. r54
  2159. BACKGRND = turfy
  2160. if quest_flags{3} then goto r54_open
  2161. alphadata r54_background
  2162. '..XX.XXXXXX.XXXXXXXX.XXXXXX.XX..'
  2163. '..XX.XXXXXXXXXX..XXXXXXXXXX.XX..'
  2164. '..XXXXX.XXXXXXX..XXXXXXX.XXXXX..'
  2165. '..XXXXX.XXX.XXXXXXXX.XXX.XXXXX..'
  2166. '..XX.XXXXXX.XXXXXXXX.XXXXXX.XX..'
  2167. '..XX.XXXXXXXX.XX...XXXXXXXX.XX..'
  2168. '..XXXXX.XXXXXXX.X.X.XXXX.XXXX...'
  2169. '...XXXX.XXX.XX.X.X.X.XXX.XXX....'
  2170. '....XXXXXXX.XX.X.X.X.XXXXXX.....'
  2171. '......XXXXXXXXXXXXXXXXXXX.....XX'
  2172. '..............................XX'
  2173. end
  2174. plotmap r54_background 0 16 0 32 11
  2175. goto room_draw_end
  2176. r54_open
  2177. alphadata r54_open_background
  2178. '..XX.XXXXXX.XXXXXXXXXX.....XXX..'
  2179. '..XX.XXXXXXXX...........XXXXXX..'
  2180. '..XXXXX.XXXXX........XXX.XXXXX..'
  2181. '..XXXXX.XXX.X.....XXXXXX.XXXXX..'
  2182. '..XX.XXXXXX.X...XXXX.XXXXXX.XX..'
  2183. '..XX.XXXXXXXX......XXXXXXXX.XX..'
  2184. '..XXXXX.XXXXXXX..XXXXXXX.XXXX...'
  2185. '...XXXX.XXX.XX....XX.XXX.XXX....'
  2186. '....XXXXXXX.XX....XX.XXXXXX.....'
  2187. '......XXXXXXXX....XXXXXXX.....XX'
  2188. '..............................XX'
  2189. end
  2190. plotmap r54_open_background 0 16 0 32 11
  2191. goto room_draw_end
  2192. r55
  2193. BACKGRND = sand
  2194. if quest_flags{7} then goto r55_open
  2195. alphadata r55_background
  2196. '...XX..........................X'
  2197. '...............................X'
  2198. '.......XXXXXXX.................X'
  2199. '......XXXXXXXXX................X'
  2200. '.......X.X.X.X.................X'
  2201. '...............................X'
  2202. '...............................X'
  2203. '..................XXXXXXXXXXXXXX'
  2204. '...XXXX.........XXXX......XXXXXX'
  2205. 'XXXXXXXXX...XXXXXXXXXX...XXXXXXX'
  2206. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2207. end
  2208. plotmap r55_background 0 16 0 32 11
  2209. goto room_draw_end
  2210. r55_open
  2211. alphadata r55_open_background
  2212. '...XX..........................X'
  2213. '...............................X'
  2214. '.......XXXXXXX.................X'
  2215. '......XXXXXXXXX................X'
  2216. '.......X.X.X.X.................X'
  2217. '...............................X'
  2218. '...............................X'
  2219. '............................XXXX'
  2220. '...XXXX.........XXXX......XXXXXX'
  2221. 'XX..XX...........X...........XXX'
  2222. 'XX.............................X'
  2223. end
  2224. plotmap r55_open_background 0 16 0 32 11
  2225. goto room_draw_end
  2226. r56
  2227. rem 'Shield on island
  2228. BACKGRND = sand
  2229. if !quest_flags{6} then goto r56_closed
  2230. alphadata r56_background
  2231. 'X...............................'
  2232. 'X...............................'
  2233. 'XXX.............................'
  2234. 'XXXXX...........................'
  2235. 'XXXXX..XX.......................'
  2236. 'XXXXX..XXXXXXX..................'
  2237. 'XXXX....XXXXXXXXXX..............'
  2238. 'XXX......XXXXXXXXXXXX...........'
  2239. 'XXX......XXXXXXXXXXXXXXXXX......'
  2240. 'XXXX....XXXXXXXXXXXXXXXXXXXXXXXX'
  2241. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2242. end
  2243. plotmap r56_background 0 16 0 32 11
  2244. goto room_draw_end
  2245. r56_closed
  2246. alphadata r56_closed_background
  2247. 'X...............................'
  2248. 'X...............................'
  2249. 'XXX.............................'
  2250. 'XXXXXX..........................'
  2251. 'XXXXXXXXX.......................'
  2252. 'XXXXXXXXXXXXXX..................'
  2253. 'XXXX....XXXXXXXXXX..............'
  2254. 'XXX......XXXXXXXXXXXX...........'
  2255. 'XXX......XXXXXXXXXXXXXXXXX......'
  2256. 'XXXX....XXXXXXXXXXXXXXXXXXXXXXXX'
  2257. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2258. end
  2259. r56_end
  2260. plotmap r56_closed_background 0 16 0 32 11
  2261. goto room_draw_end
  2262. r57
  2263. BACKGRND = sand
  2264. alphadata r57_background
  2265. '................................'
  2266. '................................'
  2267. '................................'
  2268. '................................'
  2269. '................................'
  2270. '......................X.........'
  2271. '.....................XXX........'
  2272. '................................'
  2273. '.....XXXX...XXXXXX.......XXXX...'
  2274. 'XXXXXXXXXXXXXXXXXXXX...XXXXXXXXX'
  2275. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2276. end
  2277. plotmap r57_background 0 16 0 32 11
  2278. goto room_draw_end
  2279. r58
  2280. BACKGRND = sand
  2281. if quest_flags{2} goto r58_open
  2282. alphadata r58_background
  2283. '................XXXXXXXXXXXXXXXX'
  2284. '................XXXXXXXXXXXXXXXX'
  2285. '...............XXXXXXXXXXXXXXXXX'
  2286. '..............XXXXXXXXXXXXXXXXXX'
  2287. '..............XXXXXXXXXXXXXXXXXX'
  2288. '.............XXXXXXXXXXXXXXXXXXX'
  2289. '..........XXXXXXXXXXXXXXXXXXXXXX'
  2290. '........XXXXXXXXXXXXXXXXXXXXXXXX'
  2291. '....XXXXXXXXXXXXXXXXXXXXXXXX....'
  2292. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX...'
  2293. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2294. end
  2295. plotmap r58_background 0 16 0 32 11
  2296. goto room_draw_end
  2297. r58_open
  2298. alphadata r58_open_background
  2299. '................XXXXXXXXXXXXXXXX'
  2300. '...................XXXXXXXXXXXXX'
  2301. '.....................XXXXXXXXXXX'
  2302. '.......................XXXXXXXXX'
  2303. '.........................XXXXXXX'
  2304. '...........................XXXXX'
  2305. '.............................XXX'
  2306. '................................'
  2307. '................................'
  2308. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2309. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2310. end
  2311. plotmap r58_open_background 0 16 0 32 11
  2312. goto room_draw_end
  2313. r59
  2314. BACKGRND = seablue + 1
  2315. rem 'black ship bottom, when switch3 isn't pressed
  2316. if quest_flags{3} goto black_ship_open
  2317. alphadata r59_background
  2318. '.XXXX..XX......XX...XXXXX....XXX'
  2319. 'XXXXX...............X...X....XXX'
  2320. '.XXXX........................XXX'
  2321. '..XXX......................XXXX.'
  2322. '...XXXXXXXXXXXX...XXXXXXXXXXXXX.'
  2323. '....XXXXXXXXXXX...XXXXXXXXXXXXX.'
  2324. 'XXXXXXXXXXXXXXX...XXXXXXXXXXXX..'
  2325. '..................XX............'
  2326. '..................XX............'
  2327. 'XXXXXXXXXXXXXXXXXXXX............'
  2328. 'XXXXXXXXXXXXXXXXXXXX............'
  2329. end
  2330. plotmap r59_background 0 16 0 32 11
  2331. goto black_ship_end
  2332. black_ship_open
  2333. alphadata black_ship_open_background
  2334. '.XXXX..XX......XX...XXXXX....XX.'
  2335. 'XXXXX...............X...X....XX.'
  2336. '.XXXX........................XX.'
  2337. '..XXX........................XX.'
  2338. '...XXXXXXXXXXXX...XXXXXXXXXXXX..'
  2339. '....XXXXXXXXXXX...XXXXXXXXXXXX..'
  2340. 'XXXXXXXXXXXXXXX...XXXXXXXXXXXXXX'
  2341. '................................'
  2342. '................................'
  2343. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2344. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2345. end
  2346. black_ship_end
  2347. plotmap black_ship_open_background 0 16 0 32 11
  2348. goto room_draw_end
  2349. r60
  2350. rem 'Boss 3, Kraken room.'
  2351. BACKGRND = black
  2352. alphadata r60_background
  2353. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2354. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2355. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2356. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2357. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2358. 'XX............................XX'
  2359. 'XX............................XX'
  2360. '..............................XX'
  2361. '..............................XX'
  2362. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2363. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2364. end
  2365. plotmap r60_background 0 16 0 32 11
  2366. goto room_draw_end
  2367. r61
  2368. BACKGRND = sand
  2369. if !hero_items{5} then goto r61_closed
  2370. alphadata r61_background
  2371. 'X...............................'
  2372. 'X...............................'
  2373. 'XXX.............................'
  2374. 'XXXXX...........................'
  2375. 'XXXXX..XX.......................'
  2376. 'XXXXX..XXXXXXX..................'
  2377. 'XXXX....XXXXXXXXXX..............'
  2378. 'XXX......X..XXXXXXXXX...........'
  2379. 'XXX......XXX..XX..XXXXXXXX......'
  2380. 'XXXX....XXXXXX..XXXXXXXXXXXXXXXX'
  2381. 'XXXXXXXXXXXX..XX..XXXXXXXXXXXXXX'
  2382. end
  2383. plotmap r61_background 0 16 0 32 11
  2384. goto room_draw_end
  2385. r61_closed
  2386. alphadata r61_closed_background
  2387. 'XX..............................'
  2388. 'XXXXX...........................'
  2389. 'XXXXXXXX........................'
  2390. 'XXXXXXXXXXXX....................'
  2391. 'XXXXXXXXXXXXXX..................'
  2392. 'XXXXXXXXXXXXXXXX................'
  2393. 'XXXX....XXXXXXXXXX..............'
  2394. 'XXX......XXXXXXXXXXXX...........'
  2395. 'XXX......XXXXXXXXXXXXXXXXX......'
  2396. 'XXXX....XXXXXXXXXXXXXXXXXXXXXXXX'
  2397. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2398. end
  2399. plotmap r61_closed_background 0 16 0 32 11
  2400. goto room_draw_end
  2401. r62
  2402. BACKGRND = sand
  2403. alphadata r62_background
  2404. '...............................X'
  2405. '..............................XX'
  2406. '..............................XX'
  2407. '............................XXXX'
  2408. '.............................XXX'
  2409. '............................XXXX'
  2410. '..........................XXXXXX'
  2411. '.........................XXXXXXX'
  2412. '...XXX......XXXXX.......XXXXXXXX'
  2413. 'XXXXXXXX..XXXXXXXXXX...XXXXXXXXX'
  2414. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2415. end
  2416. plotmap r62_background 0 16 0 32 11
  2417. goto room_draw_end
  2418. r63
  2419. BACKGRND = sand
  2420. alphadata r63_background
  2421. 'XX.............................X'
  2422. 'XX............................XX'
  2423. 'XX............................XX'
  2424. 'XXX.........................XXXX'
  2425. 'XXX..........................XXX'
  2426. 'XXX.........................XXXX'
  2427. 'XXXX......................XXXXXX'
  2428. 'XXXX.....................XXXXXXX'
  2429. 'XXXXXXX.....XXXXX.......XXXXXXXX'
  2430. 'XXXXXXXXXXXXXXXXXXXX...XXXXXXXXX'
  2431. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  2432. end
  2433. plotmap r63_background 0 16 0 32 11
  2434. goto room_draw_end
  2435. rem 'Item sprites as well as initial data for item and sprites are in bank 4
  2436. rem 'Items/monsters/mobiles in any given room
  2437. rem '8 items per line means it corresponds with map layout
  2438. data room_items
  2439. monster_leaf2_boss, monster_leaf1_boss, monster_bat, item_switch4
  2440. monster_zombie, item_victory, monster_treant, monster_wolf
  2441. item_switch1, monster_mushroom, monster_scorpio, monster_mushroom
  2442. monster_zombie, monster_ikaza, monster_wolf, monster_treant,
  2443. monster_sword_boss, monster_scorpio, monster_grunt, monster_fish,
  2444. monster_knight, monster_armor_boss, item_switch2, monster_curse
  2445. item_switch7, monster_archer, monster_grunt, monster_rabid
  2446. monster_archer, monster_grunt, monster_lion, monster_snake
  2447. item_none, monster_mushroom, monster_grunt, monster_fish,
  2448. monster_cannon, monster_cannon, monster_mage, monster_lion,
  2449. monster_scorpio, monster_slime, monster_bat, monster_snake
  2450. monster_archer, monster_knight, monster_spider, monster_mushroom
  2451. monster_flower, item_healhp, monster_slime, item_switch3,
  2452. monster_scorpio, monster_crab, item_none, monster_fish
  2453. item_shield, monster_crab, monster_scorpio, item_none,
  2454. monster_leaf3_boss, item_switch6, monster_crab, monster_strike_boss
  2455. end
  2456. data item_hplist
  2457. 4, 4, 8, 8, 8, 16, 16, 16, 16, 32, 32, 32, 32, 64, 32, 32
  2458. 64, 80,100, 4, 64, 32, 64, 64, 64, 80, 80, 80, 80,100,100,120
  2459. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  2460. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  2461. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  2462. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  2463. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  2464. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  2465. end
  2466. rem 'Shorthand for the center of screen positions.'
  2467. const hc=73
  2468. const vc=49
  2469. data item_xlist
  2470. hc, hc, 84, 37,109, 70, hc - 8, hc,
  2471. hc, hc, hc, 37, hc, hc, hc, hc,
  2472. hc,113,113, 37, hc + 12, hc, hc, hc,
  2473. hc, hc, 63,113, hc,120, hc, hc,
  2474. hc, 37, 90, 37, 53, 53, hc, hc,
  2475. 77, hc, hc,123, 66, hc, hc, 61,
  2476. hc, hc, hc,113, hc, hc, hc, hc,
  2477. 37, hc, 37, 37, hc, 37, hc, hc,
  2478. end
  2479. data item_ylist
  2480. vc, vc, vc, 25, 70, 65, vc, vc,
  2481. vc, vc, vc, vc, vc, vc, vc, vc + 4,
  2482. vc, vc, vc, vc, vc + 1, vc, vc, vc + 8,
  2483. vc, vc, 70, vc, vc + 8, vc, vc, vc - 16,
  2484. vc, 29, 70, vc, 41, 41, vc, vc,
  2485. 33, vc, vc, vc, 70, 25, vc, vc,
  2486. vc, 55, vc, 80, vc, vc, vc, vc,
  2487. 73, vc, vc, vc, vc, 73, vc, vc,
  2488. end
  2489. item_setup
  2490. item_kind = room_items[hero_room]
  2491. gosub item_setup_kind
  2492. goto item_setup_done
  2493. rem 'You must set item_kind before gosubbing to this one
  2494. item_setup_kind
  2495. rem 'Initialize item/mobile, and it's position, HP and speed
  2496. rem 'First, handle switches
  2497. if item_kind < item_switch1 then goto item_switch_end
  2498. if item_kind > item_switch7 then goto item_switch_end
  2499. rem 'set switch to on if needed
  2500. if quest_flags{1} && item_kind = item_switch1 then item_kind = item_kind + item_switch_on
  2501. if quest_flags{2} && item_kind = item_switch2 then item_kind = item_kind + item_switch_on
  2502. if quest_flags{3} && item_kind = item_switch3 then item_kind = item_kind + item_switch_on
  2503. if quest_flags{4} && item_kind = item_switch4 then item_kind = item_kind + item_switch_on
  2504. if quest_flags{5} && item_kind = item_switch5 then item_kind = item_kind + item_switch_on
  2505. if quest_flags{6} && item_kind = item_switch6 then item_kind = item_kind + item_switch_on
  2506. if quest_flags{7} && item_kind = item_switch7 then item_kind = item_kind + item_switch_on
  2507. item_switch_end
  2508. rem 'Next, handle bosses that may already be dead.'
  2509. rem 'Ikaza
  2510. if item_kind < monster_leaf1_boss then goto item_boss_end
  2511. if item_kind > monster_ikaza then goto item_boss_end
  2512. if quest_flags{0} && item_kind = monster_ikaza then item_kind = item_none
  2513. rem 'Leaf 1 dropped by boss 1
  2514. if hero_items{0} && item_kind = monster_leaf1_boss then item_kind = item_none
  2515. rem 'Leaf 2 dropped by boss 2
  2516. if hero_items{1} && item_kind = monster_leaf2_boss then item_kind = item_none
  2517. rem 'Leaf 3 dropped by boss 3
  2518. if hero_items{2} && item_kind = monster_leaf3_boss then item_kind = item_none
  2519. rem 'Armor Dropped by armor boss
  2520. if hero_items{4} && item_kind = monster_armor_boss then item_kind = item_none
  2521. rem 'Sword dropped by sword boss
  2522. if hero_items{5} && item_kind = monster_sword_boss then item_kind = item_none
  2523. rem 'Strike book dropped by strike book boss
  2524. if hero_items{7} && item_kind = monster_strike_boss then item_kind = item_none
  2525. rem 'Heal book and shield are not dropped by a boss, but just found
  2526. item_boss_end
  2527. rem 'Finally handle the case of the shield and the heal book that should drop only once
  2528. if hero_items{3} && item_kind = item_shield then item_kind = item_none
  2529. if hero_items{6} && item_kind = item_bookheal then item_kind = item_none
  2530. temp1 = item_kind_mask & item_kind
  2531. item_hp = item_hplist[temp1]
  2532. if temp1 > 31 then goto item_draw_32
  2533. on temp1 goto i00 i01 i02 i03 i04 i05 i06 i07 i08 i09 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31
  2534. goto item_draw_done
  2535. item_draw_32
  2536. temp1 = temp1 - 32
  2537. on temp1 goto i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63
  2538. item_draw_done
  2539. if item_kind <> item_none then goto item_not_none
  2540. item_x = nowhere
  2541. item_oldx = nowhere
  2542. item_y = nowhere
  2543. item_oldy = nowhere
  2544. return
  2545. item_not_none
  2546. rem temp1 = item_kind & item_kind_mask
  2547. rem 'look up location in table.'
  2548. item_oldx = item_xlist[hero_room]
  2549. item_x = item_xlist[hero_room]
  2550. item_oldy = item_ylist[hero_room]
  2551. item_y = item_ylist[hero_room]
  2552. return
  2553. i00
  2554. COLUP1=black
  2555. player1:
  2556. %10000001
  2557. %01000010
  2558. %00100100
  2559. %00011000
  2560. %00011000
  2561. %00100100
  2562. %01000010
  2563. %10000001
  2564. end
  2565. goto item_draw_done
  2566. i01
  2567. COLUP1=black
  2568. player1:
  2569. %01111100
  2570. %11111110
  2571. %11010110
  2572. %01111100
  2573. %00111000
  2574. end
  2575. goto item_draw_done
  2576. i02
  2577. COLUP1=red
  2578. player1:
  2579. %00100100
  2580. %01011010
  2581. %10111101
  2582. %01111110
  2583. %01011010
  2584. %01000010
  2585. %10100101
  2586. %10100101
  2587. end
  2588. goto item_draw_done
  2589. i03
  2590. rem 'bat.xpm
  2591. player1:
  2592. %01000010
  2593. %10000001
  2594. %10011001
  2595. %10111101
  2596. %11111111
  2597. %11100111
  2598. %11000011
  2599. %01000010
  2600. end
  2601. goto item_draw_done
  2602. i04
  2603. rem 'scorpio.xpm
  2604. player1:
  2605. %00101000
  2606. %00010010
  2607. %00011111
  2608. %00111100
  2609. %01100101
  2610. %10000010
  2611. %10010001
  2612. %01100000
  2613. end
  2614. goto item_draw_done
  2615. i05
  2616. COLUP1=black
  2617. rem 'rabid.xpm
  2618. player1:
  2619. %00011000
  2620. %00111100
  2621. %01111110
  2622. %11011011
  2623. %11111111
  2624. %01111110
  2625. %11011011
  2626. %11000011
  2627. end
  2628. goto item_draw_done
  2629. i06
  2630. COLUP1=black
  2631. rem 'spider.xpm
  2632. player1:
  2633. %10100101
  2634. %10011001
  2635. %01011010
  2636. %00111100
  2637. %01100110
  2638. %10111101
  2639. %10100101
  2640. %00100100
  2641. end
  2642. goto item_draw_done
  2643. i07
  2644. COLUP1=black
  2645. rem 'snake.xpm
  2646. player1:
  2647. %00111110
  2648. %01000011
  2649. %00111000
  2650. %00000100
  2651. %00111000
  2652. %01000000
  2653. %00110000
  2654. %00001000
  2655. end
  2656. goto item_draw_done
  2657. i08
  2658. COLUP1=black
  2659. rem 'fish.xpm
  2660. player1:
  2661. %10001100
  2662. %11011110
  2663. %11111101
  2664. %11111110
  2665. %11111111
  2666. %11111011
  2667. %11011110
  2668. %10001100
  2669. end
  2670. goto item_draw_done
  2671. i09
  2672. COLUP1=black
  2673. rem 'lion.xpm
  2674. player1:
  2675. %11011011
  2676. %01100110
  2677. %01000010
  2678. %11111111
  2679. %11011011
  2680. %11111111
  2681. %01011010
  2682. %00100100
  2683. end
  2684. goto item_draw_done
  2685. i10
  2686. COLUP1=black
  2687. rem 'wolf.xpm
  2688. player1:
  2689. %10100101
  2690. %10100101
  2691. %01111110
  2692. %01111100
  2693. %10000111
  2694. %10001101
  2695. %10001110
  2696. %00000100
  2697. end
  2698. goto item_draw_done
  2699. i11
  2700. COLUP1=black
  2701. rem 'captain.xpm, used for monster_grunt. (captain and grunt were doubles)
  2702. player1:
  2703. %01101100
  2704. %01101100
  2705. %01101100
  2706. %01101100
  2707. %00101000
  2708. %10111011
  2709. %01111111
  2710. %01111101
  2711. %01101101
  2712. %01010100
  2713. %11111110
  2714. %00111000
  2715. %01010100
  2716. %10010010
  2717. %01111100
  2718. %00111000
  2719. end
  2720. goto item_draw_done
  2721. i12
  2722. COLUP1=black
  2723. rem 'archer.xpm
  2724. player1:
  2725. %01101100
  2726. %01101100
  2727. %01101100
  2728. %01101100
  2729. %00101010
  2730. %00110110
  2731. %01101001
  2732. %01010001
  2733. %01111111
  2734. %01010001
  2735. %01101001
  2736. %00110110
  2737. %01111110
  2738. %01010100
  2739. %01111100
  2740. %00111000
  2741. end
  2742. goto item_draw_done
  2743. i13
  2744. COLUP1=black
  2745. rem 'knight.xpm
  2746. player1:
  2747. %01101100
  2748. %01101100
  2749. %01101100
  2750. %01111100
  2751. %10111010
  2752. %11111110
  2753. %11111110
  2754. %11111110
  2755. %00111000
  2756. %01111100
  2757. %11010110
  2758. %10010010
  2759. %11111110
  2760. %01111100
  2761. %00111000
  2762. %01010100
  2763. end
  2764. goto item_draw_done
  2765. i14
  2766. COLUP1=black
  2767. rem 'cannon.xpm
  2768. player1:
  2769. %00011100
  2770. %00001000
  2771. %10001000
  2772. %11111001
  2773. %10011111
  2774. %00010001
  2775. %00010000
  2776. %00111000
  2777. end
  2778. goto item_draw_done
  2779. i15
  2780. COLUP1=black
  2781. rem 'zombie.xpm
  2782. player1:
  2783. %00101100
  2784. %01101000
  2785. %00101000
  2786. %00101100
  2787. %01101000
  2788. %10111001
  2789. %01111001
  2790. %01011001
  2791. %01111101
  2792. %01101110
  2793. %01111110
  2794. %00111000
  2795. %01011100
  2796. %01110110
  2797. %00111110
  2798. %00011000
  2799. end
  2800. goto item_draw_done
  2801. i16
  2802. COLUP1=black
  2803. rem 'skeleton.xpm
  2804. player1:
  2805. %01101100
  2806. %00101000
  2807. %00101000
  2808. %00101000
  2809. %10101010
  2810. %10010010
  2811. %10111010
  2812. %01010100
  2813. %00111000
  2814. %00010000
  2815. %00101000
  2816. %01111100
  2817. %01010100
  2818. %10010010
  2819. %01111100
  2820. %00111000
  2821. end
  2822. goto item_draw_done
  2823. i17
  2824. COLUP1=black
  2825. rem 'ghost.xpm
  2826. player1:
  2827. %10101010
  2828. %11111110
  2829. %11111110
  2830. %11111110
  2831. %01111100
  2832. %01111100
  2833. %01111100
  2834. %11111110
  2835. %11111110
  2836. %10111010
  2837. %00111000
  2838. %01111100
  2839. %11010110
  2840. %10111010
  2841. %01111100
  2842. %00111000
  2843. end
  2844. goto item_draw_done
  2845. i18
  2846. COLUP1=black
  2847. rem 'bitmap/mage.xpm
  2848. player1:
  2849. %00101001
  2850. %01111101
  2851. %01111101
  2852. %01111101
  2853. %00111001
  2854. %10111011
  2855. %10010011
  2856. %01111101
  2857. %00010001
  2858. %00111001
  2859. %01111101
  2860. %01010101
  2861. %01111101
  2862. %00111001
  2863. %00111010
  2864. %00010001
  2865. end
  2866. goto item_draw_done
  2867. i19
  2868. COLUP1=black
  2869. rem 'flower.xpm
  2870. player1:
  2871. %00010000
  2872. %00111000
  2873. %01010100
  2874. %00010000
  2875. %00101000
  2876. %01000100
  2877. %00101000
  2878. %00010000
  2879. end
  2880. goto item_draw_done
  2881. i20
  2882. COLUP1=black
  2883. rem 'treant.xpm
  2884. player1:
  2885. %10101010
  2886. %01111100
  2887. %00111000
  2888. %00111000
  2889. %00111000
  2890. %00111000
  2891. %00111000
  2892. %00111000
  2893. %01111000
  2894. %10111100
  2895. %00111010
  2896. %01111000
  2897. %10111100
  2898. %00010010
  2899. %00110000
  2900. %01001000
  2901. end
  2902. goto item_draw_done
  2903. i21
  2904. COLUP1=black
  2905. rem 'muschroom.xpm
  2906. player1:
  2907. %01111110
  2908. %00111100
  2909. %00011000
  2910. %00011000
  2911. %00011000
  2912. %11111111
  2913. %01111110
  2914. %00111100
  2915. end
  2916. goto item_draw_done
  2917. i22
  2918. COLUP1=black
  2919. rem 'book.xpm
  2920. player1:
  2921. %11111111
  2922. %10100101
  2923. %10100101
  2924. %10010101
  2925. %11001101
  2926. %10110101
  2927. %10000101
  2928. %11111111
  2929. end
  2930. goto item_draw_done
  2931. i23
  2932. COLUP1=black
  2933. rem 'sword.xpm. It's a fake Numen Sword that hurts the one who touches it.'
  2934. player1:
  2935. %10010000
  2936. %01100000
  2937. %01110000
  2938. %10111000
  2939. %00011100
  2940. %00001110
  2941. %00000111
  2942. %00000011
  2943. end
  2944. goto item_draw_done
  2945. i24
  2946. COLUP1=black
  2947. rem 'Curse, entrance blocking item
  2948. player1:
  2949. %00111100
  2950. %01111110
  2951. %11111111
  2952. %11111111
  2953. %11111111
  2954. %11111111
  2955. %11111111
  2956. %11111111
  2957. %11111111
  2958. %11000111
  2959. %11000111
  2960. %11111111
  2961. %10010011
  2962. %10010011
  2963. %10010011
  2964. %11111111
  2965. %11111111
  2966. %11111111
  2967. %11111111
  2968. %11111111
  2969. %11111111
  2970. %11111111
  2971. %01111110
  2972. %00111100
  2973. end
  2974. goto item_draw_done
  2975. i25
  2976. COLUP1=black
  2977. rem 'boss1.xpm
  2978. player1:
  2979. %01000100
  2980. %10101010
  2981. %10101010
  2982. %01000100
  2983. %01000100
  2984. %00000000
  2985. %00101000
  2986. %00111000
  2987. %01111100
  2988. %11111110
  2989. %11010110
  2990. %10111010
  2991. %11111110
  2992. %01111101
  2993. %01111100
  2994. %01111100
  2995. %01111100
  2996. %10111010
  2997. %00111000
  2998. %01111000
  2999. %00111000
  3000. %00010100
  3001. %00010000
  3002. %00010000
  3003. end
  3004. goto item_draw_done
  3005. i26
  3006. COLUP1=black
  3007. rem 'boss2.xpm
  3008. player1:
  3009. %01011010
  3010. %01011010
  3011. %01011010
  3012. %10011001
  3013. %10111101
  3014. %10011001
  3015. %10111101
  3016. %10011001
  3017. %10011001
  3018. %10111101
  3019. %11011011
  3020. %10111101
  3021. %10111101
  3022. %11100111
  3023. %11000011
  3024. %10011001
  3025. %10100101
  3026. %10011001
  3027. %10111101
  3028. %10100101
  3029. %10000001
  3030. %01000010
  3031. %01000010
  3032. %01000010
  3033. end
  3034. goto item_draw_done
  3035. i27
  3036. COLUP1=black
  3037. rem 'boss3.xpm
  3038. player1:
  3039. %10100101
  3040. %10100101
  3041. %10100101
  3042. %10100101
  3043. %10100101
  3044. %10100101
  3045. %10111101
  3046. %01111110
  3047. %11011011
  3048. %10011001
  3049. %10011001
  3050. %10011001
  3051. %10011001
  3052. %11011011
  3053. %11111111
  3054. %01111110
  3055. %01111110
  3056. %01111110
  3057. %00111100
  3058. %00111100
  3059. %00111100
  3060. %00011000
  3061. %00011000
  3062. %00011000
  3063. end
  3064. goto item_draw_done
  3065. i28
  3066. COLUP1=black
  3067. rem 'armorboss.xpm
  3068. player1:
  3069. %00011000
  3070. %00111100
  3071. %01011010
  3072. %01111110
  3073. %00011000
  3074. %00111100
  3075. %10111101
  3076. %11111111
  3077. %01111110
  3078. %01111110
  3079. %11011011
  3080. %11100111
  3081. %11111111
  3082. %01011010
  3083. %01100110
  3084. %11111111
  3085. %10111101
  3086. %00111100
  3087. %00111100
  3088. %00001000
  3089. %00011000
  3090. %00010000
  3091. %00001000
  3092. %00001000
  3093. end
  3094. goto item_draw_done
  3095. i29
  3096. COLUP1=black
  3097. rem 'Sword boss is a player frame
  3098. player1:
  3099. %01101100
  3100. %01101100
  3101. %01111100
  3102. %01111100
  3103. %10111010
  3104. %01111100
  3105. %10111010
  3106. %11111110
  3107. %11010110
  3108. %11010110
  3109. %11111110
  3110. %01111100
  3111. %00111000
  3112. end
  3113. goto item_draw_done
  3114. i30
  3115. COLUP1=black
  3116. rem 'Strike boss is a one point sprite which is difficult to hit
  3117. player1:
  3118. %00010000
  3119. end
  3120. goto item_draw_done
  3121. i31
  3122. rem 'ikaza.xpm
  3123. rem 'ikaza.xpm
  3124. player1:
  3125. %00101000
  3126. %11111110
  3127. %01111100
  3128. %01111100
  3129. %00111000
  3130. %10111010
  3131. %11010110
  3132. %01111100
  3133. %01010100
  3134. %00111000
  3135. %01111100
  3136. %11010110
  3137. %10111010
  3138. %01111100
  3139. %01111100
  3140. %01010100
  3141. end
  3142. goto item_draw_done
  3143. i32
  3144. i33
  3145. i34
  3146. rem 'leaf.xpm
  3147. player1:
  3148. %00000000
  3149. %00000000
  3150. %00111000
  3151. %01111100
  3152. %11111111
  3153. %01111100
  3154. %00111000
  3155. %00000000
  3156. end
  3157. goto item_draw_done
  3158. i35
  3159. rem 'armor.xpm
  3160. player1:
  3161. %01111110
  3162. %01011010
  3163. %10100101
  3164. %11011011
  3165. %11111111
  3166. %01111110
  3167. %00011000
  3168. %00000000
  3169. end
  3170. goto item_draw_done
  3171. i36
  3172. rem 'shield.xpm
  3173. player1:
  3174. %00010000
  3175. %00111000
  3176. %01010100
  3177. %11010110
  3178. %10111010
  3179. %11010110
  3180. %10010010
  3181. %11111110
  3182. end
  3183. goto item_draw_done
  3184. i37
  3185. rem 'sword.xpm
  3186. player1:
  3187. %10010000
  3188. %01100000
  3189. %01110000
  3190. %10111000
  3191. %00011100
  3192. %00001110
  3193. %00000111
  3194. %00000011
  3195. end
  3196. goto item_draw_done
  3197. i38
  3198. rem 'healbook.xpm
  3199. player1:
  3200. %11111110
  3201. %10000010
  3202. %10000010
  3203. %10010010
  3204. %10111010
  3205. %10101010
  3206. %10000010
  3207. %11111110
  3208. end
  3209. goto item_draw_done
  3210. i39
  3211. rem 'strikebook.xpm
  3212. player1:
  3213. %11111110
  3214. %10010010
  3215. %10001010
  3216. %11111110
  3217. %10100010
  3218. %10010010
  3219. %10001010
  3220. %11111110
  3221. end
  3222. goto item_draw_done
  3223. i40
  3224. rem 'healhp.xpm
  3225. player1:
  3226. %00000000
  3227. %00000000
  3228. %00010000
  3229. %00111000
  3230. %01111100
  3231. %01111100
  3232. %00101000
  3233. %00000000
  3234. end
  3235. goto item_draw_done
  3236. i41
  3237. rem 'healmp.xpm
  3238. player1:
  3239. %00000000
  3240. %00000000
  3241. %00010000
  3242. %01010100
  3243. %10111010
  3244. %01010100
  3245. %00010000
  3246. %00000000
  3247. end
  3248. goto item_draw_done
  3249. i42
  3250. rem 'healallhp.xpm
  3251. player1:
  3252. %00000000
  3253. %00010000
  3254. %00111000
  3255. %01111100
  3256. %11111110
  3257. %11111110
  3258. %01101100
  3259. %00000000
  3260. end
  3261. goto item_draw_done
  3262. i43
  3263. rem 'healallmp.xpm
  3264. player1:
  3265. %00000000
  3266. %00010000
  3267. %01010100
  3268. %10111010
  3269. %10010010
  3270. %10111010
  3271. %01010100
  3272. %00010000
  3273. end
  3274. goto item_draw_done
  3275. i44
  3276. i45
  3277. i46
  3278. i47
  3279. i48
  3280. i49
  3281. i50
  3282. rem 'bitmap/switch.xpm
  3283. player1:
  3284. %00000000
  3285. %11111111
  3286. %00111110
  3287. %00001000
  3288. %00010000
  3289. %00100000
  3290. %11000000
  3291. %11000000
  3292. end
  3293. goto item_draw_done
  3294. i51
  3295. i52
  3296. i53
  3297. i54
  3298. i55
  3299. i56
  3300. i57
  3301. rem 'bitmap/switch_on.xpm
  3302. player1:
  3303. %00000000
  3304. %11111111
  3305. %01111100
  3306. %00010000
  3307. %00001000
  3308. %00000100
  3309. %00000011
  3310. %00000011
  3311. end
  3312. goto item_draw_done
  3313. i58
  3314. i59
  3315. i60
  3316. i61
  3317. i62
  3318. COLUP1=black
  3319. player1:
  3320. %10000001
  3321. %01000010
  3322. %00100100
  3323. %00011000
  3324. %00011000
  3325. %00100100
  3326. %01000010
  3327. %10000001
  3328. end
  3329. goto item_draw_done
  3330. i63
  3331. COLUP1=pink
  3332. player1:
  3333. %00011100
  3334. %11111110
  3335. %01111100
  3336. %10111000
  3337. %10111110
  3338. %10011110
  3339. %10111000
  3340. %11111100
  3341. %11110100
  3342. %11110110
  3343. %11111110
  3344. %01111100
  3345. %00111000
  3346. end
  3347. goto item_draw_done
  3348. rem ' Bank 5 contains the game over, game win and game intro, screen
  3349. rem 'as well as a music playing routine for them.'
  3350. const music_which_intro=0
  3351. const music_which_gameover=1
  3352. const music_which_victory=2
  3353. game_over
  3354. gosub music_restart
  3355. music_which=music_which_gameover
  3356. BACKGRND = red
  3357. hero_x=70
  3358. hero_y=80
  3359. player0:
  3360. %1000001
  3361. %1000001
  3362. %1000010
  3363. %1111110
  3364. %1000001
  3365. %1111110
  3366. %0000000
  3367. %1111111
  3368. %1000000
  3369. %1111111
  3370. %1000000
  3371. %1111111
  3372. %0000000
  3373. %0001000
  3374. %0010100
  3375. %0100010
  3376. %1000001
  3377. %1000001
  3378. %0000000
  3379. %0011100
  3380. %0100010
  3381. %1000001
  3382. %1000001
  3383. %0100010
  3384. %0011100
  3385. %0000000
  3386. %0000000
  3387. %0000000
  3388. %0000000
  3389. %0000000
  3390. %0000000
  3391. %0000000
  3392. %0000000
  3393. %1111111
  3394. %1000000
  3395. %1111111
  3396. %1000000
  3397. %1111111
  3398. %0000000
  3399. %1000001
  3400. %1000001
  3401. %1001001
  3402. %1010101
  3403. %1100011
  3404. %1000001
  3405. %0000000
  3406. %1000001
  3407. %1000001
  3408. %1111111
  3409. %0100010
  3410. %0010100
  3411. %0001000
  3412. %0000000
  3413. %0011110
  3414. %0100010
  3415. %1000111
  3416. %1000000
  3417. %0100010
  3418. %0011100
  3419. end
  3420. game_over_loop
  3421. rem 'Teleport to Sygne's home on reset button, with some losses
  3422. if !switchreset then goto reset_go_end
  3423. hero_room=room_start
  3424. hero_x=hero_start_x
  3425. hero_oldx=hero_start_x
  3426. hero_y=hero_start_y
  3427. hero_oldy=hero_start_x
  3428. hero_hp = hero_level + hero_base_hp
  3429. hero_next = hero_level
  3430. hero_mp = 0
  3431. rem ' Restart the game with stats somewhat reduced,
  3432. gosub music_restart
  3433. gosub set_mp_display
  3434. gosub hero_draw_s
  3435. gosub room_draw
  3436. goto main_loop
  3437. reset_go_end
  3438. COLUP0=white
  3439. COLUP1=black
  3440. rem 'Make monster look x3 size, to maintain boss size and suggest something for non bosses.
  3441. NUSIZ1 = $07
  3442. special_effects_go_end
  3443. gosub music_play
  3444. drawscreen
  3445. goto game_over_loop
  3446. data music_data
  3447. 24,30,27,30,30,30,27,30,24,28,-1,2,24,28,-1,2,24,60
  3448. 27,28,-1,2,27,28,-1,2,27,60,24,30,20,28,-1,2,20,60
  3449. 24,30,27,30,30,30,27,30,24,28,-1,2,24,28,-1,2,24,28,-1,2
  3450. 24,30,27,28,-1,2,27,30,24,30,27,30,30,120
  3451. end
  3452. game_win
  3453. gosub music_restart
  3454. music_which=music_which_victory
  3455. BACKGRND = white
  3456. COLUPF = yellow
  3457. item_x=80
  3458. item_y=80
  3459. hero_x=84
  3460. hero_y=80
  3461. player1:
  3462. %00011100
  3463. %11111110
  3464. %01111100
  3465. %00111000
  3466. %10111110
  3467. %10011110
  3468. %10111000
  3469. %11111100
  3470. %11110100
  3471. %11110110
  3472. %11111110
  3473. %01111100
  3474. %00111000
  3475. %00000000
  3476. %00010000
  3477. %00111000
  3478. %01111100
  3479. %11111110
  3480. %11111110
  3481. %01101100
  3482. %00000000
  3483. %00000000
  3484. %00000000
  3485. %11111000
  3486. %10000100
  3487. %10000010
  3488. %10000010
  3489. %10000100
  3490. %11111000
  3491. %00000000
  3492. %00000000
  3493. %10000110
  3494. %10001010
  3495. %10010010
  3496. %10100010
  3497. %11000010
  3498. %00000000
  3499. %00000000
  3500. %11111110
  3501. %10000000
  3502. %11111110
  3503. %10000000
  3504. %11111110
  3505. %00000000
  3506. %00000000
  3507. %00000000
  3508. %00000000
  3509. %11111110
  3510. %10000000
  3511. %11111110
  3512. %10000000
  3513. %11111110
  3514. %00000000
  3515. %10000010
  3516. %10000010
  3517. %11111110
  3518. %10000010
  3519. %10000010
  3520. %00000000
  3521. %00010000
  3522. %00010000
  3523. %00010000
  3524. %00010000
  3525. %11111110
  3526. %00000000
  3527. %00000000
  3528. %00000000
  3529. %00010000
  3530. %00111000
  3531. %01111100
  3532. %11111110
  3533. %11111110
  3534. %01101100
  3535. end
  3536. game_win_loop
  3537. BACKGRND = white
  3538. COLUP1 = rand
  3539. COLUP0 = rand
  3540. REFP0 = 8
  3541. gosub music_play
  3542. drawscreen
  3543. rem 'Go back to house, but level up to 90 if not so already
  3544. if !switchreset then goto reset_win_end
  3545. hero_room=room_start
  3546. hero_x=hero_start_x
  3547. hero_oldx=hero_start_x
  3548. hero_y=hero_start_y
  3549. hero_oldy=hero_start_x
  3550. if hero_level < 90 then hero_level = 90
  3551. hero_hp = hero_level * 2 + hero_base_hp
  3552. hero_mp = hero_level / 16 + 1
  3553. gosub music_restart
  3554. gosub room_draw
  3555. gosub hero_draw_s
  3556. gosub room_draw
  3557. goto main_loop
  3558. reset_win_end
  3559. goto game_win_loop
  3560. intro_screen
  3561. gosub music_restart
  3562. music_which=music_which_intro
  3563. BACKGRND = black
  3564. COLUPF = white
  3565. alphadata intro_screen_background
  3566. '..X....XXXXX..X...X..XXX...XXXX.'
  3567. '.X.X.....X....X...X..X..X..X....'
  3568. 'X...X....X....X...X..XXX...XXXX.'
  3569. 'XXXXX....X....X...X..X..X..X....'
  3570. 'X...X....X.....XXX...X..X..XXXX.'
  3571. '................................'
  3572. 'XXX..XXXX..XX..XXX...XX..X..X...'
  3573. 'X..X.X....X..X.X..X.X..X.XX.X...'
  3574. 'XXX..XXXX.X..X.XXX..XXXX.X.XX...'
  3575. 'X..X.X....X..X.X..X.X..X.X..X...'
  3576. 'XXX..XXXX..XX..X..X.X..X.X..X...'
  3577. end
  3578. BACKGRND = black
  3579. intro_loop
  3580. rem COLUP1 = rand
  3581. rem COLUP0 = rand
  3582. rem REFP0 = 8
  3583. gosub music_play
  3584. drawscreen
  3585. if switchreset || joy0fire then return
  3586. goto intro_loop
  3587. const music_volume = 4
  3588. const note_rest = 0
  3589. const music_voice = 4
  3590. const music_voice_2 = 12
  3591. const c4 = 30
  3592. const d4 = 27
  3593. const e4 = 24
  3594. const f4 = 23
  3595. const g4 = 20
  3596. const a4 = 18
  3597. const b4 = 16
  3598. const c5 = 15
  3599. const rn = note_rest
  3600. const n_1 = 240
  3601. const n0 = 120
  3602. const n1 = 60
  3603. const n2 = 30
  3604. const n3 = 20
  3605. const n4 = 15
  3606. const n6 = 10
  3607. const n8 = 8
  3608. ; const music_size_victory = 48
  3609. const music_size_intro = 56
  3610. music_notes_intro_p
  3611. data music_notes_intro
  3612. c5, n2, a4, n2, f4, n2, d4, n2, rn, n8
  3613. c5, n2, a4, n2, f4, n2, d4, n2, rn, n8
  3614. c4, n2, f4, n2, g4, n2, d4, n2, rn, n8
  3615. c4, n2, f4, n2, g4, n2, d4, n2, rn, n8
  3616. a4, n0, f4, n0, d4, n0, rn, n0
  3617. f4, n0, a4, n0, c5, n0, rn, n0
  3618. end
  3619. const music_size_gameover = 20
  3620. music_notes_gameover_p
  3621. data music_notes_gameover
  3622. e4, n0, a4, n0, g4, n0, e4, n0, rn, n0
  3623. a4, n0, b4, n0, g4, n0, a4, n0, rn, n0
  3624. end
  3625. const music_size_victory = 32
  3626. music_notes_victory_p
  3627. data music_notes_victory
  3628. c4, n2, e4, n2, g4, n2, c5, n2
  3629. g4, n2, e4, n2, c4, n1, rn, n0
  3630. c4, n2, d4, n2, e4, n4, g4, n2
  3631. c5, n2, e4, n2, c4, n1, rn, n0
  3632. end
  3633. data music_sizes
  3634. music_size_intro, music_size_gameover, music_size_victory
  3635. end
  3636. rem 'restarts the music
  3637. music_restart
  3638. music_timer=1
  3639. music_pointer=0
  3640. AUDV0=0
  3641. AUDV1=0
  3642. return
  3643. music_play
  3644. rem ' Update music timer and change note if needed
  3645. rem ' If we get here, the timer is not 0 yet.'
  3646. rem ' Go on to the next note, and leave it at that
  3647. if music_timer = 0 then goto music_do_note_change
  3648. goto music_no_note_change
  3649. music_do_note_change
  3650. gosub music_change_note
  3651. music_no_note_change
  3652. music_timer = music_timer - 1
  3653. rem ' BACKGRND = music_timer
  3654. return
  3655. music_change_note
  3656. rem ' choose the not from the right music table
  3657. if music_which = music_which_intro then temp1 = music_notes_intro[music_pointer]
  3658. if music_which = music_which_gameover then temp1 = music_notes_gameover[music_pointer]
  3659. if music_which = music_which_victory then temp1 = music_notes_victory[music_pointer]
  3660. AUDF0 = temp1
  3661. AUDF1 = temp1
  3662. AUDC0 = music_voice
  3663. AUDC1 = music_voice_2
  3664. if temp1 = note_rest then AUDV0 = 0 else AUDV0 = music_volume
  3665. if temp1 = note_rest then AUDV1 = 0 else AUDV1 = music_volume
  3666. music_pointer = music_pointer + 1
  3667. rem ' Get right timig for note from right music
  3668. if music_which = music_which_intro then music_timer = music_notes_intro[music_pointer]
  3669. if music_which = music_which_gameover then music_timer = music_notes_gameover[music_pointer]
  3670. if music_which = music_which_victory then music_timer = music_notes_victory[music_pointer]
  3671. music_pointer = music_pointer + 1
  3672. temp3 = music_sizes[music_which]
  3673. if music_which = music_which_intro then temp3 = music_size_intro
  3674. if music_which = music_which_gameover then temp3 = music_size_gameover
  3675. if music_which = music_which_victory then temp3 = music_size_victory
  3676. if music_pointer >= temp3 then music_pointer = 0
  3677. return
  3678. ; inline 6lives_statusbar.asm