ature.78b 99 KB

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