without warning
without type_check

include exfix.ew
include ddrawX.ew
include dinputX.ew
include inputAmia.e
include nafTimer.e
include nei_sound.e


---------MISC----------
atom t_color  --the transparent color
object feh
------------------------


-----------INTRO VARIABLES-------------
integer introduction,shown_intro
introduction=1 shown_intro=0

------------------

--------animations------------
sequence blink_mode
--blink variables={current state of cursor,current time,time for change,if initiated}
blink_mode={0,0,0,0}

-----------------------

------------FONT/TEXT----------
atom font1
sequence font,text,txtloc

font = "Arial"
 font1 = createfont( 24, 10, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, 
            OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, 
                   FF_ROMAN, font)
use_font(font1) 
txtloc={50,320,50,320}
text={"The happiness of a warm home and loving family"}                  
--------------------------------------------


------------------CONFIGURE UTILITY------------------------
object NeiConfiguration
atom fnCFG
integer gameSelect
gameSelect=1

fnCFG=open("kan.ini","r")
if fnCFG = -1 then
 
    abort(1)
end if
NeiConfiguration=get(fnCFG)
NeiConfiguration=NeiConfiguration[2]
enable_music=NeiConfiguration[1]
ignore_gamepad=NeiConfiguration[2]
introduction=NeiConfiguration[3]
gameSelect=NeiConfiguration[4]


close(fnCFG)
----------------------------------------------------




---------------MENU VARIABLES-----------------
sequence main_menuings
integer pointer_on,disabled,main_menu_po,item_menu_po
object testvar1,testvar2
disabled=0 main_menu_po=1 item_menu_po=2
pointer_on=main_menu_po
--main_menuings={60,96,132,168,204}
main_menuings={53,92,131,170,208}


main_menu_po=1

sequence item_list
--******item list01 stuff----
sequence picked_item, item_list_one
sequence IM1_plaq_loc,IM1_pnt_loc,IM2_plaq_loc,IM2_pnt_loc,itm2plc
integer item_menu01_pos,item_menu02_pos
picked_item={"Nothing"}
item_menu01_pos=1 item_menu01_pos=1
IM1_plaq_loc={114,183,252,321,390}
IM1_pnt_loc={IM1_plaq_loc[1]+8,IM1_plaq_loc[2]+8,IM1_plaq_loc[3]+8,IM1_plaq_loc[4]+8,IM1_plaq_loc[5]+8}
IM2_plaq_loc={114,183,252,321,390,440}
IM2_pnt_loc={IM1_plaq_loc[1]+8,IM1_plaq_loc[2]+8,IM1_plaq_loc[3]+8,IM2_plaq_loc[4]+8,IM2_plaq_loc[5]+8,IM2_plaq_loc[6]+8}
itm2plc={
{46,114},{46,183},{46,252},{46,321},{46,390},
{338,114},{338,183},{338,252},{338,321},{338,390}
}


--------------------------------

--******EventVAriables******
integer look_cat,need_area11shot, jerky_give, KiddVar, old_man_var , science_note, RudgerVar ,givenClaw, scarStatus, YoungMstatus
look_cat=0 need_area11shot=1 jerky_give=0 KiddVar=0 old_man_var=0 science_note=0 RudgerVar=0 givenClaw=0 scarStatus=0 YoungMstatus=0

integer trapSprung26
trapSprung26=0


-----*******************LOCATION VARIABLES*******
sequence exitall,lookall,dropitems,dropitems2,enter_loc_flag,extra_loc_flag
integer location,re_initiate_area_variable


location=1



re_initiate_area_variable=0
exitall={ 
{0,2,0,0,0,0,0},{0,3,0,1,0,0,0},{4,8,5,2,0,0,0}, --1,2,3
{0,0,3,0,0,0,0},{3,0,6,7,0,0,0},{5,0,0,0,0,0,0}, --4,5,6
{0,5,0,0,0,0,0},{9,0,10,3,0,0,0},{0,0,8,0,0,0,0}, --7,8,9
{8,0,0,0,0,0,0},{3,0,6,12,0,0,0},{0,0,0,0,0,0,0}, --10,11,12
{0,14,0,0,0,0,0},{3,0,6,13,0,0,0},{0,0,3,0,0,0,0}, --13,14,15
{0,17,4,19,0,0,0},{0,0,0,0,0,0,0},{0,0,0,0,0,0,0}, --16,17,18
{21,16,20,0,0,0,0},{19,0,0,0,0,0,0},{22,25,19,0,0,0,0}, --19,20,21
{0,23,21,0,0,0,0},{0,0,0,22,0,0,0},{0,0,25,22,0,0,0}, --22,23,24
{23,26,0,21,0,0,0},{0,27,0,25,0,0,0},{0,0,28,26,0,0,0},  --25,26,27
{27,0,0,0,0,0,0},{0,0,0,28,0,0,0},{0,28,0,0,0,0,0}, --28,29,30
{0,0,29,0,0,0,0},{0,0,0,29,0,0,0},{29,0,0,0,0,0,0}, --31,32,33
{33,0,35,36,0,0,0},{34,0,0,0,0,0,0},{0,34,0,0,0,0,0} ,                    --34,35,36
{36,35,0,38,0,0,0},{0,37,0,39,0,0,0},{40,38,0,0,0,0,0},             --37,38,39
{0,0,39,0,0,0,0},{0,44,42,43,0,0,0},{41,0,0,0,0,0,0},           --40,41,42
{0,41,0,0,0,0,0}, {0,41,0,0,0,0,0},{44,0,0,0,0,0,0},  --43,44,45
{0,0,47,44,0,0,0},{0,0,0,0,0,0,0},{0,0,0,0,0,0,0},  --46,47,48
{0,50,0,51,0,0,0},{0,0,0,49,0,0,0},{52,49,53,55,0,0,0} ,              --49,50,51
{0,0,51,0,0,0,0},{51,0,54,0,0,0,0},{0,0,0,0,0,0,0},         --52,53,54
{0,51,0,0,0,0,0},{0,0,55,57,0,0,0},{0,56,0,0,0,0,0},                    --55,56,57
{0,0,59,60,0,0,0},{58,0,0,0,0,0,0},{0,58,61,0,0,0,0},  --58,59,60
{60,0,62,63,0,0,0},{61,0,0,0,0,0,0},{0,0,0,0,0,0,0}  --61,62,63
}                        

--this lookall is a mess, from 10 on. Fix when get a good amount of time
lookall={  
{"Dashboard","Control Panel"},{"Village","Dome Farm","Mountain Area"},{"Dome Farm","Mountain Range"}, --1,2,3
{"blank"},{"Storehouse","Dome Control Room"},{"Vegetables"}, --4,5,6
{"blank"},{"blank"},{"Villagers"}, --7,8,9
{"Man"},{"Storehouse","Dome Control Room"},{"blank"}, --10,11,12
{"blank"},{"Storehouse","Dome Control Room"},{"Footprints"}, --13,14,15
{"Dark Shadow"},{"Bat Monster"},{"blank"}, --16,17,18
{"blank"},{"Stick"},{"Moss"}, --19,20,21
 {"blank"},{"Motavian Crow","Nest"},{"Moss"}, --22,23,24
 {"blank"},{"Something","Rock Walls"},{"blank"}, --25,26,27
 {"blank"},{"Knothole"},{"blank"},                    --28,29,30
 {"Table"},{"Boxes"},{"Hack"}, --31,32,33
 {"blank"},{"Hole Worm"},{"Rock Bee"}, --34,25,36
 {"Desert","Wind"},{"Base of the Cliff","Desert","Wind"},{"Cabin"}, --37,38,39
{"Cloth"},{"blank"},{"Sun-bleached bones"}, --40,41,42
{"Rock","Box"},{"Sand","Green Hill"} ,{"Cactuses","Thorns"},            --45
{"Human Figure"},{"Vortex","Motavians","Hack"},{"Motavians","Hack"}, --46,47,48
{"Hack"},{"Ceiling"},{"blank"},            --49,50,51
{"Nest"},{"Swamp","Surface of the Water"},{"blank"}, --52,53,54
{"Kolgen","Rain"},{"Small Shrine"},{"Rain"},  --55,56,57
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"Monitor"}

}

dropitems={
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"Board"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"Mushroom"},
{"blank"},{"Stick"},{"blank"},
{"blank"},{"blank"},{"blank"}, --22,23,24
{"blank"},{"blank"},{"blank"}, --25,26,27
{"blank"},{"blank"},{"blank"}, --28,29,30
{"Food"},{"blank"},{"blank"}, --31,32,33
{"blank"},{"blank"},{"blank"}, 
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"}, --40,41,42
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"},
{"blank"},{"blank"},{"blank"}
}

enter_loc_flag={
{1},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0},
{0},{0},{0}
}

extra_loc_flag={
{0,0,0,0},{0,0},{0,0}, --3
{0,0},{0,0},{0,0}, --6
{0,0},{0,0},{0,0}, --9
{0,0},{0,0},{0,0}, --12
{0,0},{0,0},{0,0}, --15
{0,0},{0,0},{0,0}, --18
{0,0},{0,0},{0,0}, --21
{0,0},{0,0},{0,0}, --24
{0,0},{0,0},{0,0}, --27
{0,0},{0,0},{0,0}, --30
{0,0},{0,0},{0,0}, --33
{0,0},{0,0},{0,0}, --36
{0,0},{0,0},{0,0}, --39
{0,0},{0,0},{0,0}, --42
{0,0},{0,0},{0,0}, --45
{0,0},{0,0},{0,0}, --48
{0,0},{0,0},{0,0}, --51
{0,0},{0,0},{0,0}, --54
{0,0},{0,0},{0,0},
{0,0},{0,0},{0,0},
{0,0},{0,0},{0,0},
{0,0},{0,0},{0,0},
{0,0},{0,0},{0,0},
{0,0},{0,0},{0,0},
{0,0},{0,0},{0,0}
}
-----***********


--------STATS-----
sequence items
integer hp,ap,meseta,max_hp,captured
hp=50 max_hp=50 ap=0 meseta=20 captured=15
items={"blank"}
-----------------




------BATTLE----
integer damage_monster,damage_nei,crow_dead,damage,crow_hp,HoleWormHP,RockBeeHP,combat,kolgen_hp, batHP
sequence txtB1,txtB2,txtB3

crow_hp=30 batHP=20
HoleWormHP=10 RockBeeHP=10 kolgen_hp=9999

damage_monster=0 damage_nei=0 crow_dead=0
damage=0
combat=0

---ap
integer ap_crow,ap_kolgen
ap_crow=2 ap_kolgen=2

txtB1 = sprintf("Wham!  Nei takes the board and puts on", damage)
txtB2 = sprintf("her best battle face...", damage)
txtB3 = sprintf("Nei inflicted %g damage points upon the crow.", damage)

---------------


atom BACKGROUND,NEITITLE,NEIICON,MTEXT,RPOINT,USEWIN,NULRPOINT,ARW_UP_Y,
ARW_R_Y,ARW_D_Y,ARW_L_Y,ARW_N,ARW_W,ARW_E,ARW_S,ARW_UP_W,
ARW_RIGHT_W,ARW_DOWN_W,ARW_LEFT_W,CROW,USE_NULPOINT,BACKGROUND_FADE,
BAT,TENTICLE,BEE,FROG,BATRED,TENTICLERED,BEERED,CROWRED

BACKGROUND = 0 NEITITLE=1 NEIICON=2 MTEXT=3 RPOINT=4 USEWIN=5 NULRPOINT=6 ARW_UP_Y=7
ARW_R_Y=8 ARW_D_Y=9 ARW_L_Y=10 ARW_N=11 ARW_W=12 ARW_E=13 ARW_S=14 ARW_UP_W=15
ARW_RIGHT_W=16 ARW_DOWN_W=17 ARW_LEFT_W=18 CROW=19 USE_NULPOINT=20 BACKGROUND_FADE=21
BAT=22 TENTICLE=23 BEE=24 FROG=25 BATRED=26 TENTICLERED=27 BEERED=28 CROWRED=29

report_mode("E_Report",1)
app_title = "Amia"
exotica_init()
file_report(" GETPIXEL.EXW REPORT_FILE")
if ddraw_init() then exotica_abort(1) end if
if set_video_mode(640, 480, 16) then exotica_abort(1) end if
set_system_palette()
 if dinput_init() then exotica_abort(1) end if
 if keyboard_init(0) then exotica_abort(1) end if
 if mouse_init() then exotica_abort(1) end if


    if ignore_gamepad=0 then
setup_gamepad()
    end if






---------LOAD BMP-----------


if load_bitmap("KanAmia/AmiaAllPic.dat",BACKGROUND,1) then exotica_abort(1) end if


  if load_bitmap("KanAmia/AmiaAllPicShadowed.dat",BACKGROUND_FADE,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/kan_amia01.dat",NEITITLE,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/sprite.dat",NEIICON,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/arrowSmall.dat",MTEXT,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/kan_amia_rpoint.dat",RPOINT,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/use_window.dat",USEWIN,1) then exotica_abort(1) end if
 --if load_bitmap("kan_nei/kan_nei_null_rpoint.dat",NULRPOINT,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_up_y.dat",ARW_UP_Y,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_right_y.dat",ARW_R_Y,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_down_y.dat",ARW_D_Y,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_left_y.dat",ARW_L_Y,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/north.dat",ARW_N,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/west.dat",ARW_W,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/east.dat",ARW_E,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/south.dat",ARW_S,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_up_w.dat",ARW_UP_W,1) then exotica_abort(1) end if      
 if load_bitmap("KanAmia/nei_arrow_right_w.dat",ARW_RIGHT_W,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_down_w.dat",ARW_DOWN_W,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/nei_arrow_left_w.dat",ARW_LEFT_W,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/crow.dat",CROW,1) then exotica_abort(1) end if
 if load_bitmap("KanAmia/use_window_nulpoint2.dat",USE_NULPOINT,1) then exotica_abort(1) end if
 
if load_bitmap("KanAmia/bat.dat",BAT,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/tenticle.dat",TENTICLE,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/bee.dat",BEE,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/frog.dat",FROG,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/crowRed.dat",CROWRED,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/batred.dat",BATRED,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/tenticlered.dat",TENTICLERED,1) then exotica_abort(1) end if 
if load_bitmap("KanAmia/beered.dat",BEERED,1) then exotica_abort(1) end if 
 
         
t_color= c_func(MAKE_RGB,{255,129,017})
c_proc(SET_ALL_BITMAPS_TRANS_COLOR,{t_color}) 
                           
    
--********************************   






procedure display_main_pointer()
--blink variables={current state of cursor,current time,time for change, if initiated}
if blink_mode[4]=0 then blink_mode[4]=1 blink_mode[2]=time() blink_mode[3]=time()+.8 end if
blink_mode[2]=time()
if blink_mode[2]>blink_mode[3] then blink_mode[3]=time()+.8
if blink_mode[1]=0 then blink_mode[1]=1 elsif blink_mode[1]=1 then blink_mode[1]=0 end if
end if

if blink_mode[1]=1 then
if trans_blitfast(RPOINT, 482, main_menuings[main_menu_po]) then exotica_abort(1) end if
elsif blink_mode[1]=0 then
--if trans_trans_blitfast(NULRPOINT, 472, main_menuings[main_menu_po]) then exotica_abort(1) end if
end if
end procedure



procedure AmiaSavegame()

object savefile
atom fn

savefile=repeat(1, 42) 

fn=open("amia.sv","w")
if fn = -1 then
    abort(1)
end if

savefile[1]=trapSprung26
savefile[2]= exitall
savefile[3]=lookall
savefile[4]=dropitems
--savefile[5]= dropitems2
savefile[6]=enter_loc_flag 
savefile[7]=extra_loc_flag 
savefile[8]=location 
savefile[9]=re_initiate_area_variable
savefile[10]=items
savefile[11]=hp
savefile[12]=ap
savefile[13]=meseta
savefile[14]=max_hp 
savefile[15]=captured 
savefile[16]=damage_monster 
savefile[17]=damage_nei
savefile[18]=crow_dead 
savefile[19]=damage
savefile[20]=crow_hp
savefile[21]=HoleWormHP
savefile[22]=RockBeeHP 
savefile[23]= combat
savefile[24]=kolgen_hp 
savefile[25]=txtB1 
savefile[26]= txtB2
savefile[27]= txtB3
savefile[28]= captured
print(fn,savefile)
close(fn)


text={
"Amia's Adventure betaR2-game saved"
}

end procedure


procedure AmiaLoadgame()


object savefile
atom fn

fn=open("amia.sv","r")
if fn = -1 then
 
    abort(1)
end if
savefile=get(fn)
savefile=savefile[2]


trapSprung26=savefile[1]
exitall=savefile[2]
lookall=savefile[3]
dropitems=savefile[4]
--dropitems2=savefile[5]
enter_loc_flag=savefile[6]
extra_loc_flag=savefile[7]
location=savefile[8]
re_initiate_area_variable=savefile[9]
items=savefile[10]
hp=savefile[11]
ap=savefile[12]
meseta=savefile[13]
max_hp=savefile[14] 
captured=savefile[15] 
damage_monster=savefile[16] 
damage_nei=savefile[17]
crow_dead=savefile[18] 
damage=savefile[19]
crow_hp=savefile[20]
HoleWormHP=savefile[21]
RockBeeHP=savefile[22] 
combat=savefile[23]
kolgen_hp=savefile[24] 
txtB1=savefile[25] 
txtB2=savefile[26]
txtB3=savefile[27]
captured=savefile[28]

close(fn)

--location=37

text={
"Amia's Adventure betaR2-game loaded"
}

end procedure



function display_main_pointer2(sequence pnt2locblit )
integer pnt2return
pnt2return=0
--blink variables={current state of cursor,current time,time for change, if initiated}
if blink_mode[4]=0 then blink_mode[4]=1 blink_mode[2]=time() blink_mode[3]=time()+.8 end if
blink_mode[2]=time()
if blink_mode[2]>blink_mode[3] then blink_mode[3]=time()+.8
if blink_mode[1]=0 then blink_mode[1]=1 elsif blink_mode[1]=1 then blink_mode[1]=0 end if
end if

if blink_mode[1]=1 then
if trans_blitfast(RPOINT, pnt2locblit[1]-5, pnt2locblit[2]-3) then exotica_abort(1) end if
elsif blink_mode[1]=0 then
end if

return pnt2return
end function

function display_main_pointer3(sequence pnt3locblit )
integer pnt3return
pnt3return=0
--blink variables={current state of cursor,current time,time for change, if initiated}
if blink_mode[4]=0 then blink_mode[4]=1 blink_mode[2]=time() blink_mode[3]=time()+.8 end if
blink_mode[2]=time()
if blink_mode[2]>blink_mode[3] then blink_mode[3]=time()+.8
if blink_mode[1]=0 then blink_mode[1]=1 elsif blink_mode[1]=1 then blink_mode[1]=0 end if
end if

if blink_mode[1]=1 then
if trans_blitfast(RPOINT, pnt3locblit[1]-4, pnt3locblit[2]-3) then exotica_abort(1) end if
elsif blink_mode[1]=0 then
end if

return pnt3return
end function


procedure text_wait()
new_input()
while new_enter=0 do
new_input()
if surface_flip() then exotica_abort(1) end if
end while
while new_enter=1 do
new_input()
end while
end procedure

procedure draw_text()


end procedure



procedure display_background(integer fade)
if fade=0 then
if blitfast(BACKGROUND, 0, 0) then exotica_abort(1) end if

--------------
        if combat=1 then
        
   if location=23 then
 if crow_hp>=1 then
if trans_blitfast(CROW, 31, 43) then exotica_abort(1) end if   
 elsif crow_hp<1 then
 if trans_blitfast(CROWRED, 32, 34) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 23 if  

--------------

        
   if location=17 then
 if crow_hp>=1 then
if trans_blitfast(BAT, 31, 43) then exotica_abort(1) end if   
 elsif crow_hp<1 then
 if trans_blitfast(BATRED, 32, 34) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 23 if  


-----**

   if location=35 then
 if HoleWormHP>=1 then
if trans_blitfast(TENTICLE, 32, 34) then exotica_abort(1) end if   
 elsif HoleWormHP<1 then
 if trans_blitfast(TENTICLERED, 32, 34) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 35 if     

   if location=36 then
 if RockBeeHP>=1 then
if trans_blitfast(BEE, 32, 42) then exotica_abort(1) end if   
 elsif RockBeeHP<1 then
 if trans_blitfast(BEERED, 32, 42) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 35 if    


  if location=55 then
 
if trans_blitfast(FROG, 32, 34) then exotica_abort(1) end if   


   
end if --location 35 if     
 
   
   
end if --end combat if   







if gdi_textout(85,247,sprintf("%d", hp),c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
if ap !=0 then
if gdi_textout(150,247,sprintf("%d", ap),c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if
if gdi_textout(380,247,sprintf("%d", captured),c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if

for zz=1 to length(text) do
if gdi_textout(txtloc[3],txtloc[4],text[zz],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
txtloc[4]=txtloc[4]+30
end for
txtloc[4]=txtloc[2]
music_main()
elsif fade=1 then
if blitfast(BACKGROUND_FADE, 0, 0) then exotica_abort(1) end if


--------------COMBAT FADE--------------------------
        if combat=1 then
        
   if location=23 then
 if crow_hp>=1 then
if trans_blitfast(CROW,31,43) then exotica_abort(1) end if   
 elsif crow_hp<1 then
 if trans_blitfast(CROWRED, 32, 34) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 23 if  


   if location=17 then
 if crow_hp>=1 then
if trans_blitfast(BAT, 31, 43) then exotica_abort(1) end if   
 elsif crow_hp<1 then
 if trans_blitfast(BATRED, 32, 34) then exotica_abort(1) end if    --should be red crow pic
   end if end if--end if crow hp if



-----**

   if location=35 then
 if HoleWormHP>=1 then
if trans_blitfast(TENTICLE, 32, 34) then exotica_abort(1) end if   
 elsif HoleWormHP<1 then
 if trans_blitfast(TENTICLERED, 32, 34) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 35 if     

   if location=36 then
 if RockBeeHP>=1 then
if trans_blitfast(BEE, 32, 42) then exotica_abort(1) end if   
 elsif RockBeeHP<1 then
 if trans_blitfast(BEERED, 32, 42) then exotica_abort(1) end if    --should be red crow pic
   end if --end if crow hp if
   
end if --location 35 if    


  if location=55 then
 
if trans_blitfast(FROG, 32, 34) then exotica_abort(1) end if   


   
end if --location 35 if     


   
 end if --end combat if  
---------------


if gdi_textout(85,247,sprintf("%d", hp),c_func(MAKE_RGB,{80,110,109}),1) then exotica_abort(1) end if
if ap !=0 then
if gdi_textout(150,247,sprintf("%d", ap),c_func(MAKE_RGB,{80,110,109}),1) then exotica_abort(1) end if
end if
if gdi_textout(380,247,sprintf("%d", captured),c_func(MAKE_RGB,{80,110,109}),1) then exotica_abort(1) end if

for zz=1 to length(text) do
if gdi_textout(txtloc[3],txtloc[4],text[zz],c_func(MAKE_RGB,{80,110,109}),1) then exotica_abort(1) end if
txtloc[4]=txtloc[4]+30
end for
txtloc[4]=txtloc[2]
music_main()

end if

end procedure

procedure print_more_text()
new_input()
while new_enter=0 do
new_input()
display_background(0)
--if trans_blitfast(MTEXT, 484,440) then exotica_abort(1) end if
if trans_blitfast(MTEXT, 482,441) then exotica_abort(1) end if
if surface_flip() then exotica_abort(1) end if
end while
while new_enter=1 do
new_input()
end while
end procedure

procedure add_lookall(sequence added_item,integer eft_location)
for x=1 to length(lookall[eft_location]) do
if compare(lookall[eft_location][x],added_item)=0 then return end if
end for

--if compare(lookall[location][1],"blank")=0 then lookall[eft_location]={added_item}
--else lookall[eft_location]=lookall[eft_location]&added_item

if compare(lookall[eft_location][1],"blank")=0 then lookall[eft_location]={added_item}
else lookall[eft_location]=append(lookall[eft_location],added_item)

--dropitems2=append(dropitems2,lookall[location][x])
end if

end procedure

procedure add_hack(sequence added_item)

for y=50 to 57 do

for x=1 to length(lookall[y]) do
if compare(lookall[y][x],added_item)=0 then return end if
end for

--if compare(lookall[location][1],"blank")=0 then lookall[eft_location]={added_item}
--else lookall[eft_location]=lookall[eft_location]&added_item

if compare(lookall[y][1],"blank")=0 then lookall[y]={added_item}
else lookall[y]=append(lookall[y],added_item)

--dropitems2=append(dropitems2,lookall[location][x])
end if

end for -- end 50 to

end procedure



procedure add_dropitem(sequence added_item)
if compare(dropitems[location][1],"blank")=0 then dropitems[location]={added_item}
else dropitems[location]=append(dropitems[location],added_item)
--dropitems[location]&added_item
end if

end procedure

function check_areaall(sequence deleteditem)
sequence dropitems2
dropitems2={}
for x=1 to length(dropitems[location]) do
testvar1=compare(deleteditem,dropitems[location][x])
if testvar1=0 then
return 1
end if
--if testvar1 !=0 then
--return 0
--end if
end for
return 2
end function

function check_dropitems(sequence deleteditem)
sequence dropitems2
dropitems2={}
for x=1 to length(dropitems[location]) do
testvar1=compare(deleteditem,dropitems[location][x])
if testvar1=0 then
return 1
end if

end for


return 0

end function

procedure delete_areaall(sequence deleteditem)
sequence dropitems2
dropitems2={}
for x=1 to length(lookall[location]) do
testvar1=compare(deleteditem,lookall[location][x])
if testvar1=0 then
end if
if testvar1 !=0 then
dropitems2=append(dropitems2,lookall[location][x])
end if
end for
lookall[location]=dropitems2

if compare(lookall[location],{})=0 then lookall[location]={"blank"} end if

end procedure


procedure deleteitem(sequence deleteditem)
sequence dropitems2
dropitems2={}
for x=1 to length(items) do
testvar1=compare(deleteditem,items[x])
if testvar1=0 then
end if
if testvar1 !=0 then
dropitems2=append(dropitems2,items[x])
end if
end for
items=dropitems2

if compare(items,{})=0 then items={"blank"} end if

end procedure


function checkInventory(sequence checkItem)
integer returnValue
returnValue=1
for x=1 to length(items) do
returnValue=compare(checkItem,items[x])
if returnValue=0 then exit end if
end for
return returnValue
end function


procedure take_description_text(sequence desc_item)

if compare(desc_item,"Picture")=0 then
text={
"Amia takes the picture.",
"It is a picture of a human couple. Since the Hack",
"has been carrying it for a long time, it is",
"tattered and torn."
} 
end if


if compare(desc_item,"Egg")=0 then
text={
"Amia takes the egg.",
"It is large and of an eerie color."
} 
end if


if compare(desc_item,"Handcuffs")=0 then
text={
"This is a new type of handcuffs that doesn’t have",
"a chain connecting the cuffs. If the prisoner",
"leaves the set area of the signal coming from the",
"bracelet on Amia’s arm, his or her nervous system"
} print_more_text()
text={
"will be temporarily paralyzed. They are quite",
"useful for freely leading a prisoner around on",
"foot."
}
end if

if compare(desc_item,"Sand-skis")=0 then
text={
"Amia takes the sand-skis. They are made from",
"sheets of fiberglass. With these, the sandy soil",
"that is difficult to walk in can be skied over."
} 
end if

if compare(desc_item,"Silver Key")=0 then
text={
"Amia takes the silver key.",
"The key is not all that old."

} 
end if

if compare(desc_item,"Hang glider")=0 then
text={
"It looks like the wings of a bat. Even Amia can",
"fly with the sky as long as she has this."
} 
end if

if compare(desc_item,"Knife")=0 then
text={
"It is small knife made of a titanium alloy."
} extra_loc_flag[1][3]=1 extra_loc_flag[1][1]=1
end if

if compare(desc_item,"Mushroom")=0 then
text={
"Amia takes the mushroom.",
"It looks edible."
}
end if

if compare(desc_item,"Stick")=0 then
text={
"Amia takes the stick.",
"It is a tree branch with a red piece of cloth",
"attached to one end."
}
end if

if compare(desc_item,"Wanted Poster")=0 then
text={
"Amia takes the Wanted Poster.",
"On the poster there is a picture of a lanky",
"Motavian covered from head to toe in a cloak.",
"“Motavian Hack” is written below the picture."
} extra_loc_flag[1][4]=1 extra_loc_flag[1][2]=1
end if

if compare(desc_item,"Food")=0 then
text={
"Amia takes the food.",
"Amia helps herself to the food. This Motavian",
"cactus dish is…simply wonderful! Amia feels",
"great." 
} hp=max_hp delete_areaall("Food") deleteitem("Food")
end if

if compare(desc_item,"Boomerang")=0 then
text={
"Amia takes the boomerang.",
"It is a simple boomerang that bends in the middle",
"like the Japanese hiragana “ku.” There is an",
"engraving on the top."
}
end if

if compare(desc_item,"Infrared scope")=0 then
text={
"By wearing this, Amia can see in the darkness as",
"if it was bright as day."
}
end if


end procedure

procedure takemodarea()



if location=7 and crow_dead=0 then
end if

if location=15 and science_note=1 then
science_note=2 
text={
"Nei takes the note.",
"It's a chart tracking a biomonster's growth",
"The chart stops abruptly at what would be six",
"months ago."
}
end if
end procedure



function check_lookall(sequence deleteditem)
sequence dropitems2
dropitems2={}
for x=1 to length(lookall[location]) do
testvar1=compare(deleteditem,lookall[location][x])
if testvar1=0 then
return 1
end if

end for


return 0

end function




procedure enterArea()

if location=1 then
  if enter_loc_flag[1][1]=0 then
text={
"Amia is in the driver’s seat of her beloved car.",
"Sitting here, with the control panel just to her",
"front, she feels relaxed and calm. The car’s",
"dashboard is situated next to the steering wheel."
} 

 enter_loc_flag[1][1]=1
elsif enter_loc_flag[1][1]=1 then
text={
"Jet Buggy:"
} end if --end area1enterloc
end if   --end location 1 if

if location=2 then
  if enter_loc_flag[2][1]=0 then
text={
"Hill:",
"From the hill Beerock Village, the enormous Dome",
"Farm, and the mountain area behind it can be",
"taken in in one glance. From here, the road leads"
}
print_more_text()
text={
"to the Dome Farm, and then continues east to the",
"village. There is a Jet Buggy parked in the",
"bushes along the road."
} enter_loc_flag[2][1]=1
elsif enter_loc_flag[2][1]=1 then
text={
"Hill:"
} end if --end area2enterloc
end if   --end location 2 if

if location=3 then
  if enter_loc_flag[3][1]=0 then
text={
"Dome Farm Entrance:",
"Amia is in front of the Dome Farm. A road runs",
"east and west from here. Going east leads to the",
"village and going west leads to a small hill."
} print_more_text()
text={
"A steep mountain range lies to the north. The",
"mountains almost appear to be heaped on top of",
"each other."
} enter_loc_flag[3][1]=1
elsif enter_loc_flag[3][1]=1 then
text={
"Dome Farm Entrance:"
} end if --end area3enterloc
end if --end location 3 if

if location=4 then
  if enter_loc_flag[4][1]=0 then
text={
"Base of the Mountain:",
"The steep rock of the mountain towers above Amia.",
"It doesn’t look like even a master of rock",
"climbing could climb this mountain."
} enter_loc_flag[4][1]=1
elsif enter_loc_flag[4][1]=1 then
text={
"Base of the Mountain:"
} end if --end area4enterloc
end if --end location 4 if




if location=5 then
  if enter_loc_flag[5][1]=0 then
text={
"Dome Farm:",
"The computer here seems to be out of order.",
"Inside the dome many edible plants have been",
"cultivated, but most of them are withered and"
} print_more_text()
text={
"dying. There is a storehouse in the south, and",
"the room to the west is the Dome Control Room."
} enter_loc_flag[5][1]=1
elsif enter_loc_flag[5][1]=1 then
text={
"Dome Farm:"
} end if --end area4enterloc
end if --end location 5 if

if location=6 then
  if enter_loc_flag[6][1]=0 then
text={
"Storehouse:",
"Harvested vegetables, fertilizers, and the like",
"are stored here."
} enter_loc_flag[6][1]=1
elsif enter_loc_flag[6][1]=1 then
text={
"Storehouse"
} end if --end area6enterloc
end if --end location 6 if

if location=7 then
  if enter_loc_flag[7][1]=0 then
text={
"Dome Control Room:",
"Lots of monitors are lined up. The computer here",
"receives commands directly from the Mother Brain,",
"and controls everything in the dome."
} enter_loc_flag[7][1]=1
elsif enter_loc_flag[7][1]=1 then
text={
"Dome Control Room:"
} end if --end area7enterloc
end if --end location 7 if

if location=8 then
  if enter_loc_flag[8][1]=0 then
text={
"Beerock Village:",
"It is a gloomy village. The doors on most of the",
"houses here are tightly shut. However, the door",
"on the house in the south is open. The village"
} print_more_text()
text={
"square is north of here."
} enter_loc_flag[8][1]=1
elsif enter_loc_flag[8][1]=1 then
text={
"Beerock Village:"
} end if --end area8enterloc
end if --end location 8 if

if location=9 then
  if enter_loc_flag[9][1]=0 then
text={
"Village Square:",
"There are several villagers here."
} enter_loc_flag[9][1]=1
elsif enter_loc_flag[9][1]=1 then
text={
"Village Square:"
} end if --end area9enterloc
end if --end location 9 if

if location=10 then
  if enter_loc_flag[10][1]=0 then
text={
"Villager’s House:",
"A man is drinking alone. He is looking at Amia",
"with suspicious eyes."
} enter_loc_flag[10][1]=1
elsif enter_loc_flag[10][1]=1 then
text={
"Villager’s House:"
} end if --end area10enterloc
end if --end location 10 if

if location=11 then
  if enter_loc_flag[11][1]=0 then
text={
"Dome Farm:",
"Dusk has fallen and so the inside of the dome has",
"become rather dark. Amia hides behind a planter.",
"and then Motavians wrapped in cloaks appear."
} print_more_text() text={
"About 7 or 8 of them appear from the entrance and",
"then enter the storehouse. However, a tall",
"Motavian heads alone toward the Dome Control Room",
"instead."
}print_more_text() 
text={
"His silhouette is surprisingly tall for a",
"Motavian… No doubt about it, this the Hack Amia",
"is looking for."
} enter_loc_flag[11][1]=1
elsif enter_loc_flag[11][1]=1 then
text={
"Dome Farm:"
} end if --end area11enterloc
end if --end location 11 if

if location=12 then
  if enter_loc_flag[12][1]=0 then
text={
"Dome Control Room:",
"The Hack is absorbed in doing something at the",
"control board. Amia sneaks up behind him."
} add_lookall("Hack",12) print_more_text()
text={ 
"“Capturing and then turning him over to the agent",
"will finish this job… But, I don’t expect it to",
"be this easy.”"
} print_more_text()
text={ 
"Just as Amia thinks this, the Hack suddenly turns",
"around."
}enter_loc_flag[12][1]=1
elsif enter_loc_flag[12][1]=1 then
text={
"Dome Farm:"
} end if --end area12enterloc
end if --end location 12 if


if location=13 then
  if enter_loc_flag[13][1]=0 then
text={
"Dome Control Room:"
} enter_loc_flag[13][1]=1
elsif enter_loc_flag[13][1]=1 then
text={
"Dome Control Room:"
} end if --end area13enterloc
end if --end location 13 if

if location=14 then
  if enter_loc_flag[14][1]=0 then
text={
"Dome Farm:",
"There is no longer anyone inside the dome. There",
"is a storehouse to the south, and the Dome",
"Control Room is to the west."
} enter_loc_flag[14][1]=1
elsif enter_loc_flag[14][1]=1 then
text={
"Dome Farm:"
} end if --end area14enterloc
end if --end location 14 if

if location=15 then
  if enter_loc_flag[15][1]=0 then
text={
"Base of the Mountain:",
"The steep rock of the mountain towers above Amia.",
"There are Motavian footprints on the ground!"
} enter_loc_flag[15][1]=1
elsif enter_loc_flag[15][1]=1 then
text={
"Base of the Mountain:"
} end if --end area15enterloc
end if --end location 15 if

if location=16 then
  if enter_loc_flag[16][1]=0 then
text={
"Fork in the Road:",
"Between the rocks, a narrow path continues. From",
"here, it splits to the east, west, and south.",
"Beyond the path to the east, a dark shadow of"
} print_more_text()
text={
"some sort appears to have just moved."
} enter_loc_flag[16][1]=1
elsif enter_loc_flag[16][1]=1 then
text={
"Fork in the Road:"
} end if --end area16enterloc
end if --end location 16 if

if location=17 then --before killing bat monsters, then to 18
 if batHP>0 then combat=1 end if
  if enter_loc_flag[17][1]=0 then
text={
"In the rocky area, Bat Monsters have flocked",
"together and are flying about."
} print_more_text()
text={
"The shadow was not a shadow, but a Bat Monster",
"that is nesting in the rocky area."
} enter_loc_flag[17][1]=1
elsif enter_loc_flag[17][1]=1 then
text={
"Rocky Area:"
} end if --end area16enterloc
end if --end location 17 if

if location=18 then 
  if enter_loc_flag[18][1]=0 then
text={
"Rocky Area:",
"There are rocks everywhere, so it is impossible",
"to go any further. A mushroom is growing near",
"Amia’s feet."
} enter_loc_flag[18][1]=1
elsif enter_loc_flag[18][1]=1 then
text={
"Rocky Area:"
} end if --end area18enterloc
end if --end location 18 if
  
if location=19 then 
  if enter_loc_flag[19][1]=0 then
text={
"Cliff:",
"There is a precipice to the west. Below it, there",
"is a deep valley. A path continues north and",
"south along the cliff. Also, a narrow path"
} print_more_text() text={
"continues east through the rocks."
}
enter_loc_flag[19][1]=1
elsif enter_loc_flag[19][1]=1 then
text={
"Cliff:"
} end if --end area 19 enterloc
end if --end location 19 if



if location=20 then 
  if enter_loc_flag[20][1]=0 then
text={
"Dead End:",
"The path becomes thinner, and then comes to an",
"end at the edge of the cliff."
} if check_dropitems("Stick") then print_more_text() text={
"A stick with a piece of cloth tied to it to show",
"danger is standing here."
} end if
enter_loc_flag[20][1]=1
elsif enter_loc_flag[20][1]=1 then
text={
"Dead End:"
} end if --end area 20 enterloc
end if --end location 20 if


if location=21 then 
  if enter_loc_flag[21][1]=0 then
text={
"Rocky Area:",
"A large rock that was once covered in moss is",
"sitting here. It looks like Amia can go north or",
"east by walking along the rocks."
} print_more_text() 
text={
"To the south, a path continues along the cliff."
} enter_loc_flag[21][1]=1
elsif enter_loc_flag[21][1]=1 then
text={
"Cliff:"
} end if --end area 21 enterloc
end if --end location 21 if


if location=22 then 
  if enter_loc_flag[22][1]=0 then
text={
"Rocky Area:",
"The entire area is littered with large rocks.",
"Amia can continue east or south along the rocks." 
} 
if crow_hp>0 then print_more_text() text={
"The cry of an animal an animal can be heard from",
"the east."
} end if
enter_loc_flag[22][1]=1
elsif enter_loc_flag[22][1]=1 then
text={
"Rocky Area:"
} end if --end area 22 enterloc
end if --end location 22 if

if location=23 then 
                            if enter_loc_flag[23][1]=0 then
text={
"Rocky Area:",
"There is a Motavian Crow nest in a hollow in the",
"rocks." } 
     if crow_hp>1 then print_more_text() text={
"A Motavian Crow is rustling about in the",
"nest while crying out. It looks as if it is about",
"to attack Amia."
} end if
enter_loc_flag[23][1]=1
elsif enter_loc_flag[23][1]=1 then
text={
"Rocky Area:"
}                        end if --end area 23 enterloc
end if --end location 23 if




if location=25 then 
  if enter_loc_flag[25][1]=0 then
text={
"Rocky Area:",
"The entire area is littered with large rocks.",
"Amia can continue east, west, or north along the",
"rocks"
} print_more_text()
if crow_hp>0 then print_more_text() text={
"The cry of an animal an animal can be heard from",
"the north."
} end if
enter_loc_flag[25][1]=1
elsif enter_loc_flag[25][1]=1 then
text={
"Rocky Area:"
} end if --end area 25 enterloc
end if --end location 25 if


if location=26 then 
  if enter_loc_flag[26][1]=0 then
text={
"Man-Made Passage:",
"Rock walls rise steeply on both sides of the",
"passage. The passage runs east and west." }
if trapSprung26=0 and check_lookall("Something")=1 then print_more_text() text={
"There is a large metal something in the middle of",
"the passage."
} elsif trapSprung26=0 and check_lookall("Something") !=1 then print_more_text() text={
"There is a large metal bear trap in the middle of",
"the passage."
} end if

enter_loc_flag[26][1]=1
elsif enter_loc_flag[26][1]=1 then
text={
"Man-Made Passage:"
} end if --end area 26 enterloc
end if --end location 26 if

if location=27 then 
  if enter_loc_flag[27][1]=0 then
  
if trapSprung26=0 then  text={
"The bear trap that was set in the man-made",
"passage springs up and closes with a loud noise.",
"Amia suffers a wound on her leg."
}  hp=floor(hp/2) trapSprung26=1 delete_areaall("Something") delete_areaall("Bear trap") print_more_text() end if
text={
"Cave Entrance:",
"There is an entrance to a cave in the south. The",
"man-made passage continues west."
}
enter_loc_flag[27][1]=1
elsif enter_loc_flag[27][1]=1 then
text={
"Cliff:"
} end if --end area 27 enterloc
end if --end location 27 if

if location=28 then 
--Infrared scope
--text={"blahblahblah"}

  if enter_loc_flag[28][1]=0 then
    if checkInventory("Infrared scope")=1 then 
text={
"Darkness:",
"It is pitch black. Amia wouldn’t know even if a",
"Bio-Monster were here." }
  elsif checkInventory("Infrared scope")=0 then
text={
"Tunnel:",
"The tunnel continues east, and the exit is to the",
"north. There is a wooden door in the west wall.",
"There is a knothole in one of the boards of the"
} print_more_text() text={"door."} enter_loc_flag[28][1]=1
     end if
elsif enter_loc_flag[28][1]=1 then
text={
"Tunnel:"
} end if --end area 28 enterloc
if checkInventory("Infrared scope")=0 then
exitall[28]={27,29,0,30,0,0,0}
elsif checkInventory("Infrared scope")=1 then
exitall[28]={27,0,0,0,0,0,0}
end if

end if --end location 29 if

if location=29 then 
  if enter_loc_flag[29][1]=0 then
    if checkInventory("Infrared scope")=1 then 
text={
"Darkness:",
"It is pitch black. Amia wouldn’t know even if a",
"Bio-Monster were here." } lookall[29]={"blank"}
  elsif checkInventory("Infrared scope")=0 then
text={
"Tunnel:",
"The tunnel comes to an end here. There are doors",
"in the north, south, and east walls. A pleasant",
"smell is coming from the north."
}
 enter_loc_flag[29][1]=1
     end if
elsif enter_loc_flag[29][1]=1 then
text={
"Tunnel:"
} end if --end area 29 enterloc
if checkInventory("Infrared scope")=1 then
exitall[29]={31,0,0,0,0,0,0}
elsif checkInventory("Infrared scope")=0 then
exitall[29]={31,32,33,28,0,0,0}
end if

if checkInventory("Infrared scope")=1 then
lookall[29]={"blank"} 
elsif checkInventory("Infrared scope")=0 then
lookall[29]={"Knothole"}
end if


end if --end location 29 if

if location=30 then 
  if enter_loc_flag[30][1]=0 then
text={
"Motavian Residence:",
"There are many Motavians in this room. Amia is",
"immediately surrounded by the Motavians."
} print_more_text() text={
"Suddenly, everything goes black in front of her",
"eyes and Amia feels her body rise into the air.",
"The Motavians chant, “SUTERE! POI! SUTERE! POI!”"
} print_more_text()
text={
"It appears Amia has been bagged and thrown away",
"somewhere…"
} 
print_more_text()
location=15 enterArea()
--enter_loc_flag[30][1]=1
elsif enter_loc_flag[30][1]=1 then
text={
"Motavian Residence:"
} end if --end area 30 enterloc
end if --end location 30 if

if location=31 then 
  if enter_loc_flag[31][1]=0 then
text={
"Cafeteria:",
"Chairs are arranged around the table in the",
"proper manner. This appears to be the Motavians’",
"cafeteria. There is no one here right now."
} 
if check_dropitems("Food") then
print_more_text() 
text={
"There is a plate of food on the table."
} end if
 enter_loc_flag[31][1]=1
elsif enter_loc_flag[31][1]=1 then
text={
"Cafeteria:"
} end if --end area 31 enterloc
end if --end location 31 if

if location=32 then 
  if enter_loc_flag[32][1]=0 then
text={
"Storeroom:",
"Various large and small boxes are randomly piled",
"up throughout the room." 
} 
if check_dropitems("Boomerang") then
print_more_text()
text={
"There is a boomerang here."
} end if
 enter_loc_flag[32][1]=1
elsif enter_loc_flag[32][1]=1 then
text={
"Storeroom:"
} end if --end area 32 enterloc
end if --end location 32 if


if location=33 then 
  if enter_loc_flag[33][1]=0 then
text={
"Hack’s Room:",
"The Hack is here!"
} print_more_text() text={
"The Hack looks at Amia, but doesn’t appear",
"surprised. Instead, he laughs impudently. There",
"is a door in the south of this room, but the Hack",
"is blocking it."
}
enter_loc_flag[33][1]=1
elsif enter_loc_flag[33][1]=1 then
text={
"Hack’s Room:"
} end if --end area 33 enterloc
end if --end location 33 if

if location=34 then 
  if enter_loc_flag[34][1]=0 then
text={
"Outside of Cave:",
"The cave exits to a slope of rough, rugged rock.",
"The wooden door to the cave is attached to the",
"northern part of the slope. From here, Amia can"
} print_more_text() text={
"walk down the slope to the west or the south."
}
enter_loc_flag[34][1]=1
elsif enter_loc_flag[34][1]=1 then
text={
"Outside of Cave:"
} end if --end area 34 enterloc
end if --end location 34 if

if location=35 then 
  if enter_loc_flag[35][1]=0 then
text={
"Rocky Area:",
"The slope of rough, rugged rock continues north",
"and west. From behind a rock, the Hack is",
"playfully waving at Amia to come over. When Amia" }
print_more_text() text={
"begins to approach, tentacles spring out from the",
"countless holes in the ground. A Hole Worm has",
"come out of the holes in the ground."
}
enter_loc_flag[35][1]=1
elsif enter_loc_flag[35][1]=1 then
text={
"Rocky Area:",
"A Hole Worm has come out of the holes in the",
"ground."
} if HoleWormHP<1 then HoleWormHP=10 add_lookall("Hole Worm",location) exitall[35]={34,0,0,0,0,0,0}  end if   
end if --end area 35 enterloc
end if --end location 35 if

if location=36 then 
  if enter_loc_flag[36][1]=0 then
text={
"Rocky Area:",
"The slope of rough, rugged rock continues east",
"and south. From beyond a rock, the Hack is",
"playfully waving at Amia to come over."
} print_more_text() text={
"When Amia begins to approach, something suddenly",
"flies up from Amia’s feet. A Rock Bee has",
"appeared."
}
enter_loc_flag[36][1]=1
elsif enter_loc_flag[36][1]=1 then
text={
"Rocky Area:",
"A Rock Bee has appeared."
} if RockBeeHP<1 then RockBeeHP=10 add_lookall("Rock Bee",location) exitall[36]={0,34,0,0,0,0,0} end if   
end if --end area 36 enterloc
end if --end location 36 if

if location=37 then 
  if enter_loc_flag[37][1]=0 then
text={
"Cliff:",
"From here, a path follows the cliff west. There",
"are rocky areas to the north and the east. To the",
"south, the desert expands from the base of the"
} print_more_text() text={
"cliff. A fierce wind is blowing up from the base",
"of the cliff."
}
enter_loc_flag[37][1]=1
elsif enter_loc_flag[37][1]=1 then
text={
"Cliff:"
} end if --end area 37 enterloc
end if --end location 37 if

if location=38 then 
  if enter_loc_flag[38][1]=0 then
text={
"Cliff:",
"A path runs east and west along the cliff. To the",
"south, the desert expands from the base of the",
"cliff. The wind is blowing."
}
enter_loc_flag[38][1]=1
elsif enter_loc_flag[38][1]=1 then
text={
"Cliff:"
} end if --end area 38 enterloc
end if --end location 38 if



if location=39 then 
  if enter_loc_flag[39][1]=0 then
text={
"Open Area:",
"Here the path running along the cliff comes to an",
"end. In the north of this area there is an",
"abandoned cabin."
}
enter_loc_flag[39][1]=1
elsif enter_loc_flag[39][1]=1 then
text={
"Open Area:"
} end if --end area 39 enterloc
end if --end location 39 if



if location=40 then 
                if enter_loc_flag[40][1]=0 then
text={
"Cabin:",
"The inside of the cabin is completely empty. The",
"only way in or out is the door to the south."
} if check_lookall("Cloth") then print_more_text() text={
"On one of the walls, something that looks like a",
"large piece of cloth is hanging down."} end if
if check_dropitems("Hang glider")=1 then print_more_text() text={
"There is a hang glider here."} end if
enter_loc_flag[40][1]=1
elsif enter_loc_flag[40][1]=1 then
text={
"Cabin:"
} end if --end area 40 enterloc
end if --end location 40 if


if location=41 then 
  if enter_loc_flag[41][1]=0 then
text={
"Sandy Soil Area:",
"A rocky mountain towers to the north. The rest of",
"the landscape is filled with large sand dunes. A",
"solitary rock can be seen in the west."
}
enter_loc_flag[41][1]=1
elsif enter_loc_flag[41][1]=1 then
text={
"Sandy Soil Area:"
} end if --end area 41 enterloc
end if --end location 41 if

if location=42 then 
  if enter_loc_flag[42][1]=0 then
text={
"Stony Plain:",
"An innumerable number of small rocks littered",
"about and mixed with the sand throughout this",
"area. It is difficult to walk and impossible to"
} print_more_text() text={
"progress any further. Additionally, there are",
"many sun-bleached bones scattered about between",
"the rocks."
}enter_loc_flag[42][1]=1
elsif enter_loc_flag[42][1]=1 then
text={
"Stony Plain:"
} end if --end area 42 enterloc
end if --end location 42 if


if location=43 then 
  if enter_loc_flag[43][1]=0 then
text={
"Stone Stage:",
"There is a strange rock with a smooth top here. A",
"long, narrow box has been placed in the shade",
"behind the rock." 
} if check_dropitems("Sand-skis")=1 then print_more_text() text={
"A pair of sand-skis is here." 
} end if
enter_loc_flag[43][1]=1
elsif enter_loc_flag[43][1]=1 then
text={
"Stone Stage:"
} end if --end area 43 enterloc
end if --end location 43 if



if location=44 then 
  if enter_loc_flag[44][1]=0 then 
    if checkInventory("Sand-skis")=1 then --if don't have skis 
    exitall[44]={0,0,0,41,0,0,0}
text={
"Dune of Quicksand:",
"The surface of the dune is constantly changing.",
"The sand billows, as if it were water in an",
"ocean." } print_more_text() text={
"If Amia tries to go east or south, her legs sink",
"into the sand and she becomes unable to walk very",
"well. A green hill can be seen in the south."
} elsif checkInventory("Sand-skis")=0 then --have skis 
exitall[44]={0,46,45,41,0,0,0}
text={
"Dune of Quicksand:",
"The surface of the dune is constantly changing.",
"The sand billows, as if it were water in an",
"ocean. The quicksand appears to be flowing east."
} print_more_text() text={
"A green hill can be seen in the south."
} end if  --end for inventory check

enter_loc_flag[44][1]=1
elsif enter_loc_flag[44][1]=1 then
text={
"Dune of Quicksand:"
} end if --end area 44 enterloc
end if --end location 44 if

if location=45 then 
  if enter_loc_flag[45][1]=0 then
text={
"Cactus Field:",
"Cactuses are growing everywhere in this area. The",
"long thorns of the cactuses look like they will",
"stick Amia, so she can't go forward."
} 
enter_loc_flag[45][1]=1
elsif enter_loc_flag[45][1]=1 then
text={
"Cactus Field:"
} end if --end area 45 enterloc
end if --end location 45 if

if location=46 then 
  if enter_loc_flag[46][1]=0 then
text={
"Dune of Quicksand:",
"In this region, rocks jut out of the sand here",
"and there like icebergs in the ocean. Because of",
"this, it looks dangerous to go any further east."
} print_more_text() text={
"The sand undulates south. Past the undulating",
"sand, a human figure can be seen!"
} 
enter_loc_flag[46][1]=1
elsif enter_loc_flag[46][1]=1 then
text={
"Dune of Quicksand:"
} end if --end area 46 enterloc
end if --end location 46 if

if location=47 then 
  if enter_loc_flag[47][1]=0 then
text={
"Vortex of Quicksand",
"The Hack is standing motionless. To his rear,",
"there is an enormous vortex of quicksand. It",
"looks like the pits that Ant Lions usually wait"
} print_more_text() text={
"for their prey in. It looks like Amia has finally",
"cornered the Hack!"
} print_more_text() text={
"…But, in the next moment a group of Motavians",
"suddenly comes from out of nowhere. The Motavians",
"had been lying in wait for Amia. Now, in the",
"exact opposite of the position she was just in,"
}
print_more_text() text={
"Amia is cornered at the edge of the vortex of",
"quicksand. The Hack is approaching. It looks like",
"he is coming to overpower Amia."
}
enter_loc_flag[47][1]=1
elsif enter_loc_flag[47][1]=1 then
text={
"Dune of Quicksand:"
} end if --end area 47 enterloc
end if --end location 47 if

if location=48 then 
  if enter_loc_flag[48][1]=0 then
text={
"In the Quicksand Vortex:",
"Amia’s body is quickly becoming buried in the",
"sand. The Motavians are all yelling something in",
"unison, and the Hack is on his knees at the edge"
} print_more_text() text={
" of the vortex."
}
enter_loc_flag[48][1]=1
elsif enter_loc_flag[48][1]=1 then
text={
"In the Quicksand Vortex:"
} end if --end area 48 enterloc
end if --end location 48 if

if location=49 then 
  if enter_loc_flag[49][1]=0 then
text={
"Cave of Luminescent Moss:",
"Amia wakes up. She doesn’t appear to be hurt, but",
"her entire body is covered with sand. She is in a",
"cave that is extends east and west. The moss on"
} print_more_text() text={
"the walls is radiating light, so the area is",
"dimly lit. In the pale light emitted by the moss,",
"Amia sees the Hack lying on the ground."
} print_more_text()
enter_loc_flag[49][1]=1
elsif enter_loc_flag[49][1]=1 then
text={
"Cave of Luminescent Moss:"
} end if --end area 49 enterloc
end if --end location 49 if

if location=50 then 
  if enter_loc_flag[50][1]=0 then
text={
"Cave’s Sand Dune:",
"A mountain of sand is blocking the end of the",
"cave. Every now and then, sand pours in from the",
"ceiling with a swish-swish sound."
} if 
check_dropitems("Knife") and 
check_dropitems("Handcuffs") and
check_dropitems("Boomerang") then 
print_more_text() 
text=
{
"There is a knife, a pair of handcuffs, and a",
"boomerang here." 
} 
elsif 
check_dropitems("Knife") !=1 and 
check_dropitems("Handcuffs") and
check_dropitems("Boomerang") then 
print_more_text() 
text=
{
"There is a pair of handcuffs, and a",
"boomerang here." 
} 
elsif 
check_dropitems("Knife") !=1 and 
check_dropitems("Handcuffs") !=1 and
check_dropitems("Boomerang") then 
print_more_text() 
text=
{
"There is a boomerang here."
} 

end if
enter_loc_flag[50][1]=1
elsif enter_loc_flag[50][1]=1 then
text={
"Cave’s Sand Dune:"
} end if --end area 50 enterloc
end if --end location 50 if


if location=51 then 
  if enter_loc_flag[51][1]=0 then
text={
"Bog",
"The air is thick with fog, and Amia cannot even",
"see three feet in front of her. She can tell that",
"there is an entrance to a cave in the rocky area"
} print_more_text() text={
"to the east."
}
------do the sound here
print_more_text() text={
"This area is a bog. By walking, Amia sinks to her",
"ankles in the mud. She can hear a rumbling sound",
"coming from somewhere. Maybe it is lightning, or",
"maybe it is the growl of a monster?"
} if captured=16 then print_more_text() text={
"The Hack is reluctantly following."
} end if
enter_loc_flag[51][1]=1
elsif enter_loc_flag[51][1]=1 then
text={
"Bog:"
} end if --end area 51 enterloc
end if --end location 51 if

if location=52 then 
  if enter_loc_flag[52][1]=0 then
text={
"Bog:",
"The area is overgrown with tall grass. One area",
"of the grass is indented, and has become",
"something that looks like some sort of a nest." 
}
if captured=16 and check_dropitems("Egg")=1 then
print_more_text() text={
"There is an egg here. The Hack looks like he",
"wants to say something."
} elsif captured=16 and check_dropitems("Egg")=0 then print_more_text() text={
"The Hack looks like he wants to say something." 
}
elsif captured=15 and check_dropitems("Egg")=1 then print_more_text() text={
"There is an egg here."
}
end if

enter_loc_flag[52][1]=1
elsif enter_loc_flag[52][1]=1 then
text={
"Bog:"
} end if --end area 52 enterloc
end if --end location 52 if

if location=53 then 
  if enter_loc_flag[53][1]=0 then
text={
"Swamp Bank:",
"There is a swamp to the south. There is not even",
"one aquatic plant floating on the jet-black",
"surface of the water." 
} if captured=16 then print_more_text() text={
"The Hack scolds Amia: “Just where are you",
"planning to go? That is a bottomless swamp. Are",
"you going to try and take me in there with you?”"
} end if
enter_loc_flag[53][1]=1
elsif enter_loc_flag[53][1]=1 then
text={
"Swamp Bank:"
} end if --end area 53 enterloc
end if --end location 53 if



if location=54 then 
  if enter_loc_flag[54][1]=0 then
text={
"Bottomless Swamp:",
"Oh no! Amia has lost her footing and is now up to",
"her neck in the bottomless swamp."
} print_more_text() text={
"The more she struggles the worse it becomes…"
} if captured=15 then
text={
"Amia grabs the vine on a nearby tree and is",
"finally able to climb out. She was just about to",
"drown in the dangerous bottomless swamp."
} hp=hp/2
elsif captured=16 then
text={
"The Hack becomes a rescuer and pulls Amia out of",
"the swamp. Amia was just about to sink to the",
"bottom of the dangerous swamp."
} hp=hp/2
end if print_more_text() location=53
if captured=16 then text={
"Swamp Bank:",
"“Don’t come near this swamp ever again!” The Hack",
"is angry."
} elsif captured=15 then
text={
"Swamp Bank:"
} end if

enter_loc_flag[54][1]=1
elsif enter_loc_flag[54][1]=1 then
text={
"In the Quicksand Vortex:"
} end if --end area 54 enterloc
end if --end location 54 if


if location=55 then 
  if enter_loc_flag[55][1]=0 then
text={
"Bog:",
"Rain is falling. It likely that Amia has ended up",
"under a rain cloud. In the middle of the pouring",
"rain, a Kolgen is positioned in a way that blocks any"
} print_more_text() 
text={
"forward progress. Eggshells are scattered throughout",
"the area. The sagging throat of the Kolgen is",
"quivering and emitting an unearthly call. It is",
"threatening this way."
}
enter_loc_flag[55][1]=1
elsif enter_loc_flag[55][1]=1 then
text={
"Bog:"
} end if --end area 55 enterloc
end if --end location 55 if

if location=56 then 
  if enter_loc_flag[56][1]=0 then
text={
"Shrine Entrance:",
"The rain is becoming more and more severe. The",
"ice-cold raindrops pass right through Amia’s",
"light clothes and mercilessly pound upon her skin."
} print_more_text() text={
"Amia is dead tired from fatigue and the cold.",
"Suddenly, lightning flashes across the sky with",
"an earsplitting thunderclap."
} 
blah=Play("BogAsound.ogg")

print_more_text()
 if captured=16 then
 text={
"The entire area becomes as bright as day for an",
"instant, and a small shrine can be seen in the",
"rocky area to the west. The Hack nestles up close",
"to Amia."
}
elsif captured=15 then
 text={
"The entire area becomes as bright as day for an",
"instant, and a small shrine can be seen in the",
"rocky area to the west."
} end if
enter_loc_flag[56][1]=1
elsif enter_loc_flag[56][1]=1 then
text={
"Shrine Entrance:"
} end if --end area 56 enterloc
end if --end location 56 if

if location=57 then 
  if enter_loc_flag[57][1]=0 then 
 if captured=15 then 
text={
"Small Shrine:",
"The inside of the shrine is terribly tight, but",
"it is protecting Amia from the rain. If she",
"doesn’t squat down, she will hit the ceiling with"
} print_more_text() text={
"her head."
} elsif captured=16 then text={
"The inside of the shrine is so tight that Amia’s",
"and the Hack’s shoulders are touching." 
} end if
enter_loc_flag[57][1]=1
elsif enter_loc_flag[57][1]=1 then
text={
"Small Shrine:"
} end if --end area 57 enterloc
end if --end location 57 if


if location=58 then 
  if enter_loc_flag[58][1]=0 then
text={
"Beerock Village:",
"The village is dead silent. The doors on the",
"houses are tightly closed. It is still the",
"villagers’ time to sleep. The light on the house"
} print_more_text() text={
"in the south is dimly floating in the morning",
"mists."
}
enter_loc_flag[58][1]=1
elsif enter_loc_flag[58][1]=1 then
text={
"Beerock Village:"
} end if --end area 58 enterloc
end if --end location 58 if

if location=59 then 
  if enter_loc_flag[59][1]=0 then
text={
"Villager’s House:",
"When the agent’s contact sees Amia and the Hack,",
"he says shocked, “Hey, Amia. You already out on a",
"date with your boyfriend this early in the"
} print_more_text() text={
"morning? If you have that much time on your",
"hands, don’t you think you should hurry up and",
"catch that Motavian!?”"
}
enter_loc_flag[59][1]=1
elsif enter_loc_flag[59][1]=1 then
text={
"Villager’s House:"
} end if --end area 59 enterloc
end if --end location 59 if

if location=60 then 
  if enter_loc_flag[60][1]=0 then
text={
"Dome Farm Entrance:",
"There is a door to the Dome Farm here. No one is",
"in the area."
}
enter_loc_flag[60][1]=1
elsif enter_loc_flag[60][1]=1 then
text={
"Dome Farm Entrance:"
} end if --end area 60 enterloc
end if --end location 60 if

if location=61 then 
  if enter_loc_flag[61][1]=0 then
text={
"Dome Farm:",
"The inside of the dome is completely silent."
}
enter_loc_flag[61][1]=1
elsif enter_loc_flag[61][1]=1 then
text={
"Dome Farm:"
} end if --end area 61 enterloc
end if --end location 61 if

if location=62 then 
  if enter_loc_flag[62][1]=0 then
text={
"Storehouse:",
"The inside of the storehouse is completely",
"silent."
}
enter_loc_flag[62][1]=1
elsif enter_loc_flag[62][1]=1 then
text={
"Storehouse:"
} end if --end area 62 enterloc
end if --end location 62 if

if location=63 then 
  if enter_loc_flag[63][1]=0 then
text={
"Dome Control Room:",
"“Thank you for bringing me this far, Amia. I",
"finally figured out the keyword just a short time",
"ago.” After speaking, the Hack stands in front of"
} print_more_text() text={
"the computer operation board. He soon hacks into",
"the network. Information concerning the Hack’s",
"family is coming up on the monitor."
}
enter_loc_flag[63][1]=1
elsif enter_loc_flag[63][1]=1 then
text={
"Dome Control Room:"
} end if --end area 63 enterloc
end if --end location 63 if







end procedure
------*****LOOK**********

function look(sequence lookseq)
integer spki,spki2
spki2=1

       if location=1 then
spki=compare("Surroundings",lookseq ) if spki=0 then
text={
"Amia is in the driver’s seat of her beloved car.",
"Sitting here, with the control panel just to her",
"front, she feels relaxed and calm. The car’s",
"dashboard is situated next to the steering wheel."
} 
if check_dropitems("Knife") and check_dropitems("Wanted Poster") !=1 then
print_more_text()
text={
"There is a knife in the dashboard."
} 
elsif check_dropitems("Wanted Poster") and check_dropitems("Knife") !=1 then
print_more_text()
text={
"A wanted poster has arrived from the agent."
} 


elsif check_dropitems("Knife") and check_dropitems("Wanted Poster") then
print_more_text()
text={
"There is a knife in the dashboard. A wanted",
"poster has arrived from the agent."
} end if


end if 


spki=compare("Dashboard",lookseq )
if spki=0 then
if extra_loc_flag[1][1]=0 then
text={
"There is a knife in the dashboard."
} 

if extra_loc_flag[1][3]=0 then
add_dropitem("Knife")
extra_loc_flag[1][3]=1
end if

elsif extra_loc_flag[1][1]=1 then
text={
"The dashboard is completely empty."
}
end if  --end the knife check
end if --end the compare of dashboard

spki=compare("Control Panel",lookseq )
if spki=0 then
if extra_loc_flag[1][2]=0 then
text={
"In addition to computer-controlled auto-driving,",
"it can also be used to send and receive data. A",
"wanted poster of the leader of the Motavian",
"thieves, the “Motavian Hack,” has just arrived"
}print_more_text()
text={
"from the agent."
}
if extra_loc_flag[1][4]=0 then
add_dropitem("Wanted Poster")
extra_loc_flag[1][4]=1
end if


elsif extra_loc_flag[1][2]=1 then
text={
"In addition to computer-controlled auto-driving,",
"it can also be used to send and receive data."
}
end if  --end the knife check


end if



spki=compare("Wilderness",lookseq )
if spki=0 then
text={
"The horizon itself seems to shimmer and undulate",
"in the blistering heat.  Nei recalls her days of",
"roaming the wasteland, chased by Biomonsters,",
"and wonders if she'll have to keep up this "
}
print_more_text()
text={"life forever..."}end if



spki=compare("Tower",lookseq )
if spki=0 then
text={
"The magnificent tower that graces Motavia's",
"capital. Nei has heard stories of it from her",
"foster parents, and just as they told her,",
"its bold beauty seems to instill a sense of"
}
print_more_text()
text={
"awe and courage within all who look upon it."
}
end if

end if --end location 1


if location=2 then 

spki=compare("Surroundings",lookseq )
   if spki=0 then
text={
"Hill:",
"From the hill Beerock Village, the enormous Dome",
"Farm, and the mountain area behind it can be",
"taken in in one glance. From here, the road leads"
}
print_more_text()
text={
"to the Dome Farm, and then continues east to the",
"village. There is a Jet Buggy parked in the",
"bushes along the road."
} end if

spki=compare("Village",lookseq ) 
if spki=0 then 
text={ 
"The village is dotted with small houses. There is",
"a sense of poorness there."
} end if


spki=compare("Dome Farm",lookseq )
if spki=0 then
text={
"Here agricultural products are produced based on",
"control data from the Mother Brain. These",
"facilities are where Motavia’s food supply comes",
"from. Compared with Amia’s impression of the"
} print_more_text()
text={
"village, it is very modern."
}

--print_more_text()
end if

spki=compare("Mountain Area",lookseq )
if spki=0 then
text={
"It is a very steep looking mountain range.",
"Looking across the mountains, Amia cannot see",
"even one trace of greenery. The naked, bare rocks",
"cast eerie, jet-black shadows."
}


end if


end if --end location 2

if location=3 then
spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Farm Entrance:",
"Amia is in front of the Dome Farm. A road runs",
"east and west from here. Going east leads to the",
"village and going west leads to a small hill."
} print_more_text()
text={
"A steep mountain range lies to the north. The",
"mountains almost appear to be heaped on top of",
"each other."
} end if

spki=compare("Dome Farm",lookseq )
if spki=0 then
text={
"The automatic door at the front has been",
"destroyed and is open."
}
end if


spki=compare("Mountain Range",lookseq)
if spki=0 then
text={
"The mountain range almost looks like it is rooted",
"to the expanse of land in the north. The",
"mountains tower ominously."
}

end if

end if --end location 3 if

if location=4 then
spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Base of the Mountain:",
"The steep rock of the mountain towers above Amia.",
"It doesn’t look like even a master of rock",
"climbing could climb this mountain."
}
end if --end surroundings if 

end if --end loc 4 if

if location=5 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Farm:",
"The computer here seems to be out of order.",
"Inside the dome many edible plants have been",
"cultivated, but most of them are withered and"
} print_more_text()
text={
"dying. There is a storehouse in the south, and",
"the room to the west is the Dome Control Room."
}
end if --end surroundings if 

spki=compare("Storehouse",lookseq )
if spki=0 then 
text={
"There is no one inside."
} end if

spki=compare("Dome Control Room",lookseq )
if spki=0 then 
text={
"There is no one inside."
} end if

end if --end loc 4 if

if location=6 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Storehouse:",
"Harvested vegetables, fertilizers, and the like",
"are stored here."
} end if

spki=compare("Vegetables",lookseq )
if spki=0 then 
text={
"Due to bad management, they have spoiled. It",
"looks like the villagers haven’t been working for",
"a while."
} end if


end if --end location 6

if location=7 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Control Room:",
"Lots of monitors are lined up. The computer here",
"receives commands directly from the Mother Brain,",
"and controls everything in the dome."
} end if
end if --end location 7 if

if location=8 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Beerock Village:",
"It is a gloomy village. The doors on most of the",
"houses here are tightly shut. However, the door",
"on the house in the south is open. The village"
} print_more_text()
text={
"square is north of here."
} end if

end if --end location 8 if

if location=9 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

if check_lookall("Man") !=1 then
text={
"There are several villagers here."
}
else text={
"A man and a middle-aged woman are looking this",
"way."
}
end if  end if

spki=compare("Villagers",lookseq )
if spki=0 then 
text={
"There is a man that appears to be a farmer. He",
"stops talking and looks back at Amia. From behind,",
"him there is a middle-aged woman looking this way."
} lookall[9]={"Man","Middle-aged woman"} end if

spki=compare("Man",lookseq )
if spki=0 then 
text={
"“Those Motavian bastards keep crashing in, so I",
"am too scared to go anywhere near the place I",
"work. Even today, I bet there are there now.”"
}  end if

spki=compare("Middle-aged woman",lookseq )
if spki=0 then 
text={
"The middle-aged woman speaks to Amia. “My husband",
"is not going off to work and it's going to cost",
"him his job. You, you gotta do something!”"
}  end if

end if --end location 9 if

if location=10 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

if extra_loc_flag[10][1]=0 then
text={
"A man is drinking alone. He is looking at Amia",
"with suspicious eyes."
}
else text={
"The man is still drinking (alcohol.)"
}
end if  end if

spki=compare("Man",lookseq )
if spki=0 then 

if extra_loc_flag[10][1]=0 then
text={
"While staring dead at Amia, the man says, “I",
"haven’t seen your face around here before. You",
"want something, don’t you?”"
}
else text={
"The man bluntly says, “I’m waiting for a good",
"outcome,” and then begins drinking again."
}
end if  end if



end if --end location 10 if

if location=11 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Farm:",
"From the storehouse in the south, the buzzing of",
"voices can be heard. A faint noise can be heard",
"from the Dome Control Room in the west."
}
end if  

spki=compare("Storehouse",lookseq )
if spki=0 then 
text={
"The Motavians are walking around inside. Entering",
"the storehouse right now would be dangerous."
}
end if  

spki=compare("Dome Control Room",lookseq )
if spki=0 then 
text={
"The sound of someone tapping on a keyboard can be",
"heard."
}
end if  

end if --end location 11 if

if location=12 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Control Room:",
"The Hack is looking this way."
} end if  

spki=compare("Hack",lookseq )
if spki=0 then 
text={
"From inside his hood, the glass eyes of his",
"infrared goggles gleam with light. He is staring",
"fixedly at Amia."
} end if  



end if --end location 12 if

if location=13 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Control Room:",
"Lots of monitors are lined up. It appears that",
"the Hack infiltrated the Mother Brain’s network",
"from this computer."
} lookall[13]={"Computer"} end if  

spki=compare("Computer",lookseq )
if spki=0 then 
text={
"The switch is off. The Hack must have turned it",
"off when he escaped. Just what was he trying to",
"do here?"
} end if  

end if --end location 13 if

if location=14 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Farm:",
"There is no longer anyone inside the dome. There",
"is a storehouse to the south, and the Dome",
"Control Room is to the west."
} end if  

spki=compare("Storehouse",lookseq )
if spki=0 then 
text={
"It is quiet."
} end if  

spki=compare("Dome Control Room",lookseq )
if spki=0 then 
text={
"It is quiet."
} end if  

end if --end location 14 if

if location=15 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Base of the Mountain:",
"The steep rock of the mountain towers above Amia.",
"There are Motavian footprints on the ground!"
} end if  

spki=compare("Footprints",lookseq )
if spki=0 then 
text={
"By following the footprints, Amia finds an",
"opening between the rocks. A narrow path leads",
"north."
} exitall[15][1]=16           end if  

end if --end location 15

if location=16 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Fork in the Road:",
"Between the rocks, a narrow path continues. From",
"here, it splits to the east, west, and south.",
"Beyond the path to the east, a dark shadow of"
} print_more_text()
text={
"some sort appears to have just moved."
} end if  


spki=compare("Dark Shadow",lookseq )
if spki=0 then 
text={
"From here it is impossible to tell what the",
"shadow is."
} end if  


end if --end location 16 if

if location=17 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"In the rocky area, Bat Monsters have flocked",
"together and are flying about."
} print_more_text()
text={
"The shadow was not a shadow, but a Bat Monster",
"that is nesting in the rocky area."
} end if  

spki=compare("Bat Monster",lookseq )
if spki=0 then 
text={
"It is a small Bio-Monster that resembles a bat.",
"The head looks just like a human head, which is",
"quite creepy."
} end if  


end if --end location 17 if

if location=18 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"There are rocks everywhere, so it is impossible",
"to go any further."
} 
if check_dropitems("Mushroom") then text={
"There are rocks everywhere, so it is impossible",
"to go any further. A mushroom is growing near",
"Amia’s feet."
} end if

end if  



end if --end location 18 if

if location=19 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"There is a precipice to the west. Below it, there",
"is a deep valley. A path continues north and",
"south along the cliff. Also, a narrow path",
"continues east through the rocks."
}end if  

spki=compare("Dark Shadow",lookseq )
if spki=0 then 
text={
"From here it is impossible to tell what the",
"shadow is."
} end if  

end if --end location 18 if


if location=20 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dead End:",
"The path becomes thinner, and then comes to an",
"end at the edge of the cliff."
} if check_lookall("Stick") then print_more_text() text={
"A stick with a piece of cloth tied to it to show",
"danger is standing here."
} end if


end if  

end if --end location 21 if

if location=21 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Rocky Area:",
"A large rock that was once covered in moss is",
"sitting here. It looks like Amia can go north or",
"east by walking along the rocks."
} print_more_text() 
text={
"To the south, a path continues along the cliff."
}
end if  

spki=compare("Moss",lookseq )
if spki=0 then 
text={
"Moss:",
"The moss seems to have been rubbed off in some",
"places by something. The area where the moss has",
"been rubbed off leads east."
}
end if  

end if --end location 21 if

if location=22 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Rocky Area:",
"The entire area is littered with large rocks.",
"Amia can continue east or south along the rocks." 
} print_more_text()
if crow_hp>0 then print_more_text() text={
"The cry of an animal an animal can be heard from",
"the east."
} 
end if  
end if

end if --end location 22 if


if location=23 then

spki=compare("Surroundings",lookseq )
if spki=0 then 


text={
"Rocky Area:",
"There is a Motavian Crow nest in a hollow in the",
"rocks." } 
     if crow_hp>1 then print_more_text() text={
"A Motavian Crow is rustling about in the",
"nest while crying out. It looks as if it is about",
"to attack Amia." }
elsif crow_hp<1 then
   if check_dropitems("Infrared scope")=1 then text={
"Rocky Area:",
"There is an infrared scope inside the nest."
} end if
    end if



end if

spki=compare("Nest",lookseq )
if spki=0 then 
text={
"It is a large nest. Since the Motavian Crow is in",
"it, Amia can’t see the inside."
} 
 
if crow_hp<1 then
 text={
 "It is a large nest. There is an infrared scope",
 "inside the nest."
}     add_dropitem("Infrared scope") delete_areaall("Nest") 

end if end if




end if --end location 23 if

if location=25 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Rocky Area:",
"The entire area is littered with large rocks.",
"Amia can continue east, west, or north along the",
"rocks"
} print_more_text()
if crow_hp>0 then print_more_text() text={
"The cry of an animal an animal can be heard from",
"the north."
} end if

end if

end if --end location 25 if

if location=26 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Man-Made Passage:",
"Rock walls rise steeply on both sides of the",
"passage. The passage runs east and west." }
if trapSprung26=0 and check_lookall("Something")=1 then print_more_text() text={
"There is a large metal something in the middle of",
"the passage."
} elsif trapSprung26=0 and check_lookall("Something") !=1 then print_more_text() text={
"There is a large metal bear trap in the middle of",
"the passage."
}  end if
end if

spki=compare("Something",lookseq )
if spki=0 then 
text={
"It is a large bear trap! Someone set this trap to",
"catch monsters. Even a person could be caught in",
"it very easily."
}  delete_areaall("Something") lookall[26]={"Bear trap"}
end if

spki=compare("Bear trap",lookseq )
if spki=0 then 
text={
"It is a large bear trap! Someone set this trap to",
"catch monsters. Even a person could be caught in",
"it very easily."
}  
end if


spki=compare("Rock Walls",lookseq )
if spki=0 then 
text={
"The marks of a pickaxe are left. The Motavians",
"probably made this passage."
}
end if


end if --end location 26 if

if location=27 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Cave Entrance:",
"There is an entrance to a cave in the south. The",
"man-made passage continues west."
}
end if


end if --end location 27 if

if location=28 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

    if checkInventory("Infrared scope")=1 then 
text={
"Darkness:",
"It is pitch black. Amia wouldn’t know even if a",
"Bio-Monster were here." }
  elsif checkInventory("Infrared scope")=0 then
text={
"Tunnel:",
"The tunnel continues east, and the exit is to the",
"north. There is a wooden door in the west wall.",
"There is a knothole in one of the boards of the"
} print_more_text() text={"door."} enter_loc_flag[28][1]=1
     end if


end if


end if --end location 28 if

if location=29 then

spki=compare("Surroundings",lookseq )
if spki=0 then 


    if checkInventory("Infrared scope")=1 then 
text={
"Darkness:",
"It is pitch black. Amia wouldn’t know even if a",
"Bio-Monster were here." }
  elsif checkInventory("Infrared scope")=0 then
text={
"Tunnel:",
"The tunnel comes to an end here. There are doors",
"in the north, south, and east walls. A pleasant",
"smell is coming from the north."
} end if


end if


end if --end location 29 if


if location=31 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

text={
"Cafeteria:",
"Chairs are arranged around the table in the",
"proper manner. This appears to be the Motavians’",
"cafeteria. There is no one here right now."
} print_more_text() 
 if check_dropitems("Food") then 
text={
"There is a plate of food on the table."
} end if

end if

spki=compare("Table",lookseq )
if spki=0 then 
text={
"There is some graffiti on the table. The names",
"Gebirin and Apuru are written together inside a",
"heart."
}
end if

end if --end 31 if

if location=32 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

text={
"Storeroom:",
"Various large and small boxes are randomly piled",
"up throughout the room." 
} print_more_text() 
if check_dropitems("Boomerang") then
print_more_text()
text={
"There is a boomerang here."
} end if

end if

spki=compare("Boxes",lookseq )
if spki=0 then 


  if check_dropitems("Boomerang") !=1 
  and checkInventory("Boomerang") !=0   --0 means is there
  then
text={
"All the boxes are filled with junk. There is an",
"antique boomerang mixed in with the junk." 
} add_dropitem("Boomerang")
    else
text={
    "All the boxes are filled with junk."
     } end if
     
     

end if


--___________________________
end if --end location 31 if


if location=33 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
  if extra_loc_flag[33][1]=0 then
text={
"Hack’s Room:",
"The Hack is here!"
} print_more_text() text={
"The Hack looks at Amia, but doesn’t appear",
"surprised. Instead, he laughs impudently. There",
"is a door in the south of this room, but the Hack",
"is blocking it."}
elsif extra_loc_flag[33][1]=1 then text={
"Hack’s Room:",
"It is a very desolate room. This room has doors",
"in two places, one in the north and one in the",
"south."
} end if 

end if --end spki


spki=compare("Hack",lookseq )
if spki=0 then 
text={
"He seems to hold humans in contempt. Since she",
"was so easily defeated in the Dome Farm, the Hack",
"doesn’t appear to consider Amia a threat."
}
end if

--___________________________
end if --end location 33 if

if location=34 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Outside of Cave:",
"The cave exits to a slope of rough, rugged rock.",
"The wooden door to the cave is attached to the",
"northern part of the slope. From here, Amia can"
} print_more_text() text={
"walk down the slope to the west or the south."
}
end if

--___________________________
end if --end location 34 if

if location=35 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
 if HoleWormHP>0 then text={
"The slope of rough, rugged rock continues north",
"and west. A Hole Worm has come out of the holes",
"in the ground."
} elsif HoleWormHP<1 then text={
"The slope of rough, rugged rock continues north",
"and west."
} end if
      end if
      
spki=compare("Hole Worm",lookseq )
if spki=0 then   
text={
"Its tentacles are sticking out of the holes in",
"the ground. They are saturated with powerful",
"acid."
} end if
    

--___________________________
end if --end location 35 if

if location=36 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
 if RockBeeHP>0 then text={
"The slope of rough, rugged rock continues east",
"and south. A Rock Bee has appeared."
} elsif RockBeeHP<1 then text={
"The slope of rough, rugged rock continues east",
"and south."
} end if
      end if
      
spki=compare("Rock Bee",lookseq )
if spki=0 then   
text={
"It is a wasp common to the mountains of this",
"area. A large, jagged stinger juts out from its",
"abdomen."
} end if
    

--___________________________
end if --end location 36 if


if location=37 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
 if RockBeeHP>0 then text={
"The slope of rough, rugged rock continues east",
"and south. A Rock Bee has appeared."
} elsif RockBeeHP<1 then text={
"The slope of rough, rugged rock continues east",
"and south."
} end if
      end if
      
spki=compare("Desert",lookseq )
if spki=0 then   
text={
"The desert continues off into the distance. Just",
"by looking at it, Amia feels a sense of",
"hopelessness."
} end if

spki=compare("Wind",lookseq )
if spki=0 then   
text={
"It is a strong wind. It is almost strong enough",
"to blow Amia’s body toward the rocky area."
} end if
    

--___________________________
end if --end location 37 if

if location=38 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Cliff:",
"A path runs east and west along the cliff. To the",
"south, the desert expands from the base of the",
"cliff. The wind is blowing."
}
end if
      
spki=compare("Base of the Cliff",lookseq )
if spki=0 then   
  if extra_loc_flag[37][1]=0 then text={
"The Hack is at the base of the cliff! He gives a",
"large wave with his hands and then runs off to",
"the east."
} extra_loc_flag[37][1]=1  elsif extra_loc_flag[37][1]=1 then
text={
"The desert widens from here. The Hack can no",
"longer be seen."
} end if
end if

spki=compare("Wind",lookseq )
if spki=0 then   
text={
"It is a pleasant breeze. Amia finds herself",
"wanting to fly a paper airplane or something."
} end if

spki=compare("Desert",lookseq )
if spki=0 then   
text={
"The desert continues off into the distance. Just",
"by looking at it, Amia feels a sense of",
"hopelessness."
} end if
    

--___________________________
end if --end location 38 if




if location=39 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Open Area:",
"Here the path running along the cliff comes to an",
"end. In the north of this area there is an",
"abandoned cabin."
} end if

spki=compare("Cabin",lookseq )
if spki=0 then 
text={
"It is a large cabin that appears to have been",
"here for a long time."
} end if

--___________________________
end if --end location 39 if



if location=40 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Cabin:",
"The inside of the cabin is completely empty. The",
"only way in or out is the door to the south."
} if check_lookall("Cloth") then print_more_text() text={
"On one of the walls, something that looks like a",
"large piece of cloth is hanging down."} end if
if check_dropitems("Hang glider")=1 then print_more_text() text={
"There is a hang glider here."} end if
 end if

spki=compare("Cloth",lookseq )
if spki=0 and location= 40 then 
text={
"Tree branches are tied to the cloth at its edges.",
"Upon opening it up, Amia discovers it was a hang",
"glider."} delete_areaall("Cloth") add_dropitem("Hang glider")
 end if

--___________________________
end if --end location 40 if

if location=41 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Sandy Soil Area:",
"A rocky mountain towers to the north. The rest of",
"the landscape is filled with large sand dunes. A",
"solitary rock can be seen in the west."
} end if


--___________________________
end if --end location 41 if


if location=42 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
  if check_dropitems("Silver Key")=0 then
text={
"Stony Plain:",
"An innumerable number of small rocks littered",
"about and mixed with the sand throughout this",
"area. It is difficult to walk and impossible to"
} print_more_text() text={
"progress any further. Additionally, there are",
"many sun-bleached bones scattered about between",
"the rocks."}
elsif check_dropitems("Silver Key")=1 then text={
"Stony Plain:",
"An innumerable number of small rocks littered",
"about and mixed with the sand throughout this",
"area. It is difficult to walk and impossible to"
} print_more_text() text={
"progress any further. Additionally, there are",
"many sun-bleached bones scattered about between",
"the rocks. There is a silver key here."
} end if
        end if

spki=compare("Sun-bleached bones",lookseq )
if spki=0 then 
text={
"These are the bones of the hand of a skeleton.",
"The bones are still holding on to something that",
"is glittering in the sunlight. It is a silver",
"key." 
}  add_dropitem("Silver Key") end if



--___________________________
end if --end location 42 if


if location=43 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Stone Stage:",
"There is a strange rock with a smooth top here. A",
"long, narrow box has been placed in the shade",
"behind the rock." 
} if check_dropitems("Sand-skis")=1 then print_more_text() text={
"A pair of sand-skis is here." 
} end if

 end if


spki=compare("Box",lookseq )
if spki=0 then 
   if extra_loc_flag[43][1]=0 then
text={
"It is locked."
}  elsif extra_loc_flag[43][1]=1 then text={
"The inside of the box is completely empty." 
} end if


end if

spki=compare("Rock",lookseq )
if spki=0 then 
text={
"It may be an ancient ruin. However, Amia doesn’t",
"have time for sightseeing right now."
}  end if

--___________________________
end if --end location 43 if


if location=44 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

  if checkInventory("Sand-skis")=1 then --if don't have skis 
    exitall[44]={0,0,0,41,0,0,0}
text={
"Dune of Quicksand:",
"The surface of the dune is constantly changing.",
"The sand billows, as if it were water in an",
"ocean." } print_more_text() text={
"If Amia tries to go east or south, her legs sink",
"into the sand and she becomes unable to walk very",
"well. A green hill can be seen in the south."
} elsif checkInventory("Sand-skis")=0 then --have skis 
exitall[44]={0,46,45,41,0,0,0}
text={
"Dune of Quicksand:",
"The surface of the dune is constantly changing.",
"The sand billows, as if it were water in an",
"ocean. The quicksand appears to be flowing east."
} print_more_text() text={
"A green hill can be seen in the south."
} end if  --end for inventory check

 end if

spki=compare("Sand",lookseq )
if spki=0 then 
text={
"The sand is as fine as powdered sugar."
}  end if

spki=compare("Green Hill",lookseq )
if spki=0 then 
text={
"Plants appear to be living in clusters, but from",
"here they can't be seen very well."
}  end if

--___________________________
end if --end location 44 if


if location=45 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Cactus Field:",
"Cactuses are growing everywhere in this area. The",
"long thorns of the cactuses look like they will",
"stick Amia, so she can't go forward."
} end if

spki=compare("Cactuses",lookseq )
if spki=0 then 
text={
"They look juicy and delicious."
} end if

spki=compare("Thorns",lookseq )
if spki=0 then 
text={
"They look like they will stick Amia in the eye."
} end if


--___________________________
end if --end location 45 if

if location=46 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dune of Quicksand:",
"In this region, rocks jut out of the sand here",
"and there like icebergs in the ocean. Because of",
"this, it looks dangerous to go any further east."
} print_more_text() text={
"The sand undulates south. Past the undulating",
"sand, a human figure can be seen!"
}  end if

spki=compare("Human Figure",lookseq )
if spki=0 then 
text={
"Amia is a little too far away to see it very",
"well, but that very tall silhouette is definitely",
"belongs to the Hack."
} end if


--___________________________
end if --end location 46 if

if location=47 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"The Hack is approaching. Motavians are standing",
"all around. To Amia's rear, there is a vortex of",
"quicksand that looks like the pits Ant Lions",
"usually wait for their prey in."
}  end if

spki=compare("Vortex",lookseq )
if spki=0 then 
text={
"The center of the vortex is sunken in the shape",
"of a cone. It is rapidly sucking in sand from all",
"around."
} end if

spki=compare("Motavians",lookseq )
if spki=0 then 
text={
"There are 30 of them in total. The odds look",
"quite bad!"
} end if

spki=compare("Hack",lookseq )
if spki=0 then 
text={
"He looks like he is going to capture Amia."
} end if


--___________________________
end if --end location 47 if


if location=48 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"In the Quicksand Vortex:",
"Amia’s body is quickly becoming buried in the",
"sand. The Motavians are all yelling something in",
"unison, and the Hack is on his knees at the edge"
} print_more_text() text={
" of the vortex."
}  end if

spki=compare("Motavians",lookseq )
if spki=0 then 
text={
"The Motavians are lined up around the vortex.",
"They are making quite a lot of noise."
} end if

spki=compare("Hack",lookseq )
if spki=0 then 
Stop() blah=Play("InsideQuicksandHack.ogg")
text={
"“Hey, grab on!”",
"The Hack holds his hand out toward Amia. Even",
"though he should be an enemy, he is trying to",
"help Amia. Amia clings on to his large hand, as"
} print_more_text() text={
"if in a trance. But, in the next moment the",
"Hack’s body flips over and both of them are",
"sucked into the center of the vortex…"
}
print_more_text() 
text={""}  
print_more_text()
text={""}

location=50
--do have=0
if checkInventory("Knife")=0 then add_dropitem("Knife") end if
if checkInventory("Handcuffs")=0 then add_dropitem("Handcuffs") end if
if checkInventory("Boomerang")=0 then add_dropitem("Boomerang") end if


 if checkInventory("Mushroom")=0 then    
items={"Mushroom"}
else items={"blank"} end if 
location=49 

Stop() blah=Play("AmiaMain.ogg")

enterArea()
end if


--___________________________
end if --end location 48 if


if location=49 then


                           
spki=compare("Surroundings",lookseq )
if spki=0 then 
  if captured=15 then
text={
"Cave of Luminescent Moss:",
"The cave continues east. The exit can be seen to",
"the west."
} 
elsif captured=16 then
text={
"The cave continues east. The exit can be seen to",
"the west."
} 


   end if


end if

spki=compare("Hack",lookseq )
if spki=0 then 
text={
"The Hack is unconscious on the ground. When he",
"fell into the cave, he may have been hit",
"somewhere. Amia is not injured at all, and this",
"is because the Hack held and protected her as"
} print_more_text() text={
"they fell into the cave."
} end if

--___________________________
end if --end location 49 if


if location=50 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Cave’s Sand Dune:",
"A mountain of sand is blocking the end of the",
"cave. Every now and then, sand pours in from the",
"ceiling with a swish-swish sound."
} if 
check_dropitems("Knife") and 
check_dropitems("Handcuffs") and
check_dropitems("Boomerang") then 
print_more_text() 
text=
{
"There is a knife, a pair of handcuffs, and a",
"boomerang here." 
} 
elsif 
check_dropitems("Knife") !=1 and 
check_dropitems("Handcuffs") and
check_dropitems("Boomerang") then 
print_more_text() 
text=
{
"There is a pair of handcuffs, and a",
"boomerang here." 
} 
elsif 
check_dropitems("Knife") !=1 and 
check_dropitems("Handcuffs") !=1 and
check_dropitems("Boomerang") then 
print_more_text() 
text=
{
"There is a boomerang here."
} 

end if



end if

spki=compare("Ceiling",lookseq )
if spki=0 then 
text={
"Sand is spilling in from the areas between the",
"rocks. Amia and the Hack must have fallen in from",
"there too."
} end if



--___________________________
end if --end location 50 if


if location=51 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Bog:",
"The air is thick with fog, and Amia cannot even",
"see three feet in front of her. She can tell that",
"there is an entrance to a cave in the rocky area"
} print_more_text() text={
"to the east."
}
------do the sound here
print_more_text() text={
"This area is a bog. By walking, Amia sinks to her",
"ankles in the mud. She can hear a rumbling sound",
"coming from somewhere. Maybe it is lightning, or",
"maybe it is the growl of a monster?"
} if captured=16 then print_more_text() text={
"The Hack is reluctantly following."
} end if
end if

spki=compare("Hack",lookseq )
if spki=0 then 
  if extra_loc_flag[51][1]=0 then
text={
"“Well, just which way should we go? You arrest me",
"without even knowing where you are, what a joke.”"
} extra_loc_flag[51][1]=1 elsif extra_loc_flag[51][1]=1 then text={
"“Even if you look at me like that, I still won’t",
"give you directions!”"
} end if
end if



--___________________________
end if --end location 51 if


if location=52 then

spki=compare("Surroundings",lookseq )
if spki=0 then 

text={
"Bog:",
"The area is overgrown with tall grass. One area",
"of the grass is indented, and has become",
"something that looks like some sort of a nest." 
}
if captured=16 and check_dropitems("Egg")=1 then
print_more_text() text={
"There is an egg here. The Hack looks like he",
"wants to say something."
} elsif captured=16 and check_dropitems("Egg")=0 then print_more_text() text={
"The Hack looks like he wants to say something." 
}
elsif captured=15 and check_dropitems("Egg")=1 then print_more_text() text={
"There is an egg here."
}
end if

end if


spki=compare("Nest",lookseq )
if spki=0 then 
text={
"Some sort of egg is inside it. The egg is large,",
"and of an eerie color."
} 
delete_areaall("Nest") add_dropitem("Egg")

end if

spki=compare("Hack",lookseq )
if spki=0 then 
text={
"“Because of this disaster, we will either die out",
"here, or be eaten by a monster. Whichever",
"happens, you won’t be going home ever again.",
"Although you are a woman, this will be"
} print_more_text() text=
{
"retribution for your life as a bounty hunter.”"
}

end if



--___________________________
end if --end location 52 if


if location=53 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
if extra_loc_flag[53][1]=0 then
text={
"Swamp Bank:",
"There is a swamp to the south. There is not even",
"one aquatic plant floating on the jet-black",
"surface of the water." 
} if captured=16 then print_more_text() text={
"The Hack scolds Amia: “Just where are you",
"planning to go? That is a bottomless swamp. Are",
"you going to try and take me in there with you?”"
} elsif extra_loc_flag[53][1]=1 then text={
"Swamp Bank:",
"“Don’t come near this swamp ever again!” The Hack",
"is angry."
}end if  end if 
end if

spki=compare("Swamp",lookseq )
if spki=0 then 
text={
"Just by looking at it, Amia feels like she will",
"be pulled into the swamp. She senses danger."
} end if

spki=compare("Surface of the Water",lookseq )
if spki=0 then 
text={
"It emits a certain kind of weirdness."
} end if

--___________________________
end if --end location 53 if



if location=55 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
if extra_loc_flag[55][1]=0 then
text={
"Bog:",
"Rain is falling. It likely that Amia has ended up",
"under a rain cloud. In the middle of the pouring",
"rain, a Kolgen is positioned in a way that blocks any"
} print_more_text() 
text={
"forward progress. Eggshells are scattered throughout",
"the area. The sagging throat of the Kolgen is",
"quivering and emitting an unearthly call. It is",
"threatening this way."
} 
elsif extra_loc_flag[55][1]=1 and captured=0 then
text={
"Bog:",
"A Kolgen is sleeping in the pouring rain. By slipping",
"by the Kolgen, Amia can move north or east."
}
elsif extra_loc_flag[55][1]=1 and captured=16 then
text={
"Bog:",
"A Kolgen is sleeping in the pouring rain. By slipping",
"by the Kolgen, Amia can move north or east. The",
"Hack is checking out Amia’s condition."
} end if

end if

spki=compare("Hack",lookseq )
if spki=0 then 
if extra_loc_flag[55][2]=0 then
text={
"The Hack spits out the following words, “What is up",
"with us hanging out in this rain? I wish you would",
"just stop fooling around already.”"
} extra_loc_flag[55][2]=1 
elsif extra_loc_flag[55][2]=1 then
text={
"“So now what are you going to do? You’re screwed.",
"Whether you’re a human or a Motavian, you just",
"can’t understand what the hell a woman is",
"thinking.”"
} end if
end if


spki=compare("Rain",lookseq )
if spki=0 then 
text={
"It appears to be getting harder and harder."
} end if

spki=compare("Kolgen",lookseq )
if spki=0 then 
text={
"It is a large frog monster one size bigger than a",
"Licker. It has no bellybutton."
} end if

--___________________________
end if --end location 55 if


if location=56 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
if captured=16 then
text={
"The cold rain continues to fall severely. There",
"is a small shrine in the rocky area to the west.",
"The Hack nestles up close to Amia."
}
elsif captured=15 then
text={
"The cold rain continues to fall severely. There",
"is a small shrine in the rocky area to the west."
} end if

end if

spki=compare("Small Shrine",lookseq )
if spki=0 then 
text={
"From looking at it, it appears to be a very",
"narrow cave, but it looks like it can be used as",
"shelter from the rain."
} end if

spki=compare("Hack",lookseq )
if spki=0 then 
text={
"The Hack is pointing toward the small shrine.",
"“Hey, hurry up, let’s get in there! If we stay",
"out here, we are sure to die!”"
} end if

--___________________________
end if --end location 56 if





if location=57 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
if captured=16 and extra_loc_flag[57][1]=0 then
text={
"The inside of the shrine is so tight that Amia’s",
"and the Hack’s shoulders are touching." 
}
elsif captured=16 and extra_loc_flag[57][1]=1 then
if check_areaall("Hack") !=1 then add_lookall("Hack",57) end if

text={
"The inside of the shrine is so tight that Amia’s",
"and the Hack’s shoulders are touching. There is a",
"picture here." 
} 
elsif captured=15 then text={
"Small Shrine:",
"The inside of the shrine is terribly tight, but",
"it is protecting Amia from the rain. If she",
"doesn’t squat down, she will hit the ceiling with"
} print_more_text() text={
"her head."
}
end if

end if

spki=compare("Rain",lookseq )
if spki=0 then 
text={
"The rain is falling so hard that it looks like a",
"waterfall. It doesn’t look like it will stop",
"anytime soon."
} end if

spki=compare("Fissure in the rock",lookseq )
if spki=0 then 
text={
"Through the fissure in the rock the outside",
"landscape can be seen. All of Beerock Village can",
"be seen below, still shrouded in the morning",
"mists. Without realizing it, the two of them have"
} print_more_text() text={
"come quite close to the village. From here it",
"looks like they can go straight down to the",
"village."
} if extra_loc_flag[57][2]=1 then print_more_text() text={
"However, another large rock is blocking the",
"fissure. It doesn’t look like Amia can pass",
"through." 
} if check_areaall("Large Rock") !=1 then add_lookall("Large Rock",57) end if
   end if 
end if

spki=compare("Large Rock",lookseq )
if spki=0 then 
text={
"It is too heavy for Amia to move."
} extra_loc_flag[57][2]=2 end if


spki=compare("Picture",lookseq )
if spki=0 then 
text={
"It is a picture of a human couple. Since the Hack",
"has been carrying it for a long time, it is",
"tattered and torn."
} end if

spki=compare("Hack",lookseq )
if spki=0 then 
if extra_loc_flag[57][1]=0 and extra_loc_flag[57][2]=0 then
text={
"“You should try to get warm.” As the Hack says",
"this, he takes off the cloak his was wearing and",
"puts it on the shivering Amia. What is this?! By",
"taking off the cloak, the Hack shows his face for"
} print_more_text() text={
"the first time…He is not a Motavian, but a",
"robust, young man! When the Hack took off his",
"cloak, an old picture fell to the ground."
} 
add_dropitem("Picture") 
 extra_loc_flag[57][1]=1
elsif extra_loc_flag[57][1]=1 and extra_loc_flag[57][2]=0 then text={
"He seems to be staring at Amia with a sense of",
"concern. There is sadness somewhere in his eyes."
} 
elsif extra_loc_flag[57][1]=1 and extra_loc_flag[57][2]=1 then
text={
"He is just looking at Amia."
} elsif extra_loc_flag[57][1]=1 and extra_loc_flag[57][2]=2
then text={
"The Hack understands what Amia is thinking and",
"uses all his strength to move the large rock."
} exitall[57]={0,56,0,58,0,0,0} delete_areaall("Large Rock") extra_loc_flag[57][2]=3
elsif extra_loc_flag[57][1]=1 and extra_loc_flag[57][2]=3 then
text={
"Oh! …The Hack draws Amia close and softly presses",
"his lips to hers."
} delete_areaall("Hack") 
end if
 end if

--___________________________
end if --end location 57 if


if location=58 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Beerock Village:",
"The village is dead silent. The doors on the",
"houses are tightly closed. It is still the",
"villagers’ time to sleep. The light on the house"
} print_more_text() text={
"in the south is dimly floating in the morning",
"mists."
}end if  


--___________________________
end if --end location 58 if

if location=59 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Villager’s House:",
"When the agent’s contact sees Amia and the Hack,",
"he says shocked, “Hey, Amia. You already out on a",
"date with your boyfriend this early in the"
} print_more_text() text={
"morning? If you have that much time on your",
"hands, don’t you think you should hurry up and",
"catch that Motavian!?”"
}

end if  


--___________________________
end if --end location 59 if


if location=60 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Farm Entrance:",
"There is a door to the Dome Farm here. No one is",
"in the area."
}

end if  


--___________________________
end if --end location 60 if


if location=61 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Dome Farm:",
"The inside of the dome is completely silent."
}

end if  


--___________________________
end if --end location 61 if

if location=62 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Storehouse:",
"The inside of the storehouse is completely",
"silent."
}

end if  


--___________________________
end if --end location 62 if

if location=63 then

spki=compare("Surroundings",lookseq )
if spki=0 then 
text={
"Information concerning the Hack’s family is",
"coming up on the monitor. The Hack’s hands are",
"trembling slightly."
}
end if  


spki=compare("Monitor",lookseq )
if spki=0 then 
text={
"Information stating that the Hack’s parents died",
"in a car accident in AW1265 is displayed on the",
"monitor. The accident occurred in Beerock."
} print_more_text() text={
"AW1265 is the year that the Hack was picked up by",
"the Motavians."
} print_more_text() text={
"The Hack looks back at Amia and says,",
"“They died…” Tears are welling up in his eyes.",
"“But, this is for the best. I wasn’t abandoned",
"after all. Now I no longer have to live such a"
} print_more_text() text={
"sordid existence. I put my friends, the",
"Motavians, up to stealing, but I was wrong… Well,",
"please take me to your boss. It’s time I make up",
"for what I have done.”"
} print_more_text() text={
"But Amia just removes the handcuffs from the",
"Hack. He has already suffered enough. And, if he",
"doesn’t return to them, the Motavians will",
"probably continue to attack the village."
} print_more_text() text={
"It is obvious; the only one who can stop them is",
"their leader, the “Motavian Hack…”"
} print_more_text() text={
"“Goodbye… I hope we will be able to meet again.",
"And then, let’s show our true feelings…”"
} print_more_text() text={
"",
""
} print_more_text() text={
"Amia returns to her beloved jet buggy and",
"reports: “Capture of the Motavian Hack FAILED,”",
"to the agent."
} print_more_text() text={
"…And so, this case becomes the first and only",
"time up until even now that Amia, the",
"self-proclaimed crackerjack counter hunter, let",
"the prize get away."
} print_more_text() text={
"THE END",
"",
"Copyright SEGA 1990"
} print_more_text()
text={
"Game Scenario",
"Ryoko Sekishima",
"Keizo Kikushima"
} print_more_text()
text={
"English translation",
"A very talented person who wishs to remain",
"annomyous for the moment"
} print_more_text()
text={
"PC conversion",
"Naflign"
} 
print_more_text()
exotica_abort(1) Stop() ClosePlug(1)
end if  



--___________________________
end if --end location 63 if

----------------------END LOCATION SPECIFIC LOOKS-------------

spki=compare("Egg",lookseq)
if spki=0 then
text={
"It is large and of an eerie color."
} end if



spki=compare("Infrared scope",lookseq)
if spki=0 then
text={
"By wearing this, Amia can see in the darkness as",
"if it was bright as day."
} end if


spki=compare("Hang glider",lookseq)
if spki=0 then
text={
"It looks like the wings of a bat. Even Amia can",
"fly with the sky as long as she has this."
} end if


spki=compare("Knife",lookseq)
if spki=0 then
text={
"It is small knife made of a titanium alloy."
} end if


spki=compare("Handcuffs",lookseq)
if spki=0 then
text={
"This is a new type of handcuffs that doesn’t have",
"a chain connecting the cuffs. If the prisoner",
"leaves the set area of the signal coming from the",
"bracelet on Amia’s arm, his or her nervous system"
} print_more_text()
text={
"will be temporarily paralyzed. They are quite",
"useful for freely leading a prisoner around on",
"foot."
} end if

spki=compare("Knife",lookseq)
if spki=0 then
text={
"It is small knife made of a titanium alloy."
} end if

spki=compare("Boomerang",lookseq)
if spki=0 then
text={
"It is a simple boomerang that bends in the middle",
"like the Japanese hiragana “ku.” There is an",
"engraving on the top."
} end if

spki=compare("Stick",lookseq)
if spki=0 then
text={
"It is a tree branch with a red piece of cloth",
"attached to one end."
} end if

spki=compare("Knife",lookseq)
if spki=0 then
text={
"It is small knife made of a titanium alloy."
} end if

spki=compare("Wanted Poster",lookseq)
if spki=0 then
text={
"On the poster there is a picture of a lanky",
"Motavian covered from head to toe in a cloak.",
"“Motavian Hack” is written below the picture."
}end if--end sweet if

spki=compare("Silver bullet",lookseq)
if spki=0 then
text={
"It's a pendant fashioned from a silver bullet,",
"hanging from a silver chain."
} end if--end Silver Bullet if

spki=compare("Silver Key",lookseq)
if spki=0 then
text={
"The key is not all that old."
} end if--end Silver Key if

--***********************END LOOK STUFF*********************
item_menu01_pos=1  --Reset menu location for the look menu
return 0





end function



procedure move_menu_animate()
integer pixil_moving


for x=1 to 61 do

display_background(1)
----------------ICON---------
if trans_blitfast(NEIICON, 247, 242) then exotica_abort(1) end if
----------------NORTH--------
if exitall[location][1] then
if trans_blitfast(ARW_N, 322, -308+(x*8)  ) then exotica_abort(1) end if  --word
if trans_blitfast(ARW_UP_Y, 245, -311+(x*8)) then exotica_abort(1) end if
end if
----------------EAST---------
if exitall[location][2] then
--if trans_blitfast(ARW_E, 569-x, 256) then exotica_abort(1) end if
if trans_blitfast(ARW_E, 877-(x*8)  , -236+(x*8)  ) then exotica_abort(1) end if
if trans_blitfast(ARW_R_Y, 802-(x*8), 737-(x*8) ) then exotica_abort(1) end if
end if
-------------SOUTH-----------
if exitall[location][3] then
if trans_blitfast(ARW_S, 321, 812-(x*8) ) then exotica_abort(1) end if
if trans_blitfast(ARW_D_Y, 243, 811-(x*8) ) then exotica_abort(1) end if
end if

-------------WEST-----------
if exitall[location][4] then
if trans_blitfast(ARW_W, -413+(x*8),740-(x*8) ) then exotica_abort(1) end if
if trans_blitfast(ARW_L_Y, -312+(x*8), -236+(x*8) ) then exotica_abort(1) end if
end if
-----------




if surface_flip() then exotica_abort(1) end if
end for
end procedure

procedure move_menu_UNanimate()
integer pixil_moving


for x=1 to 61 do

display_background(1)
----------------ICON---------
if trans_blitfast(NEIICON, 247, 242) then exotica_abort(1) end if
----------------NORTH--------
if exitall[location][1] then
if trans_blitfast(ARW_N, 322, 180-(x*8)  ) then exotica_abort(1) end if  --word
if trans_blitfast(ARW_UP_Y, 245, 177-(x*8)) then exotica_abort(1) end if
end if
----------------EAST---------
if exitall[location][2] then
if trans_blitfast(ARW_E,389+(x*8)  , 252-(x*8)  ) then exotica_abort(1) end if
if trans_blitfast(ARW_R_Y, 314+(x*8), 249+(x*8) ) then exotica_abort(1) end if
end if
-------------SOUTH-----------
if exitall[location][3] then
if trans_blitfast(ARW_S, 321, 324+(x*8) ) then exotica_abort(1) end if
if trans_blitfast(ARW_D_Y, 243, 323+(x*8) ) then exotica_abort(1) end if
end if

-------------WEST-----------
if exitall[location][4] then
if trans_blitfast(ARW_W, 75-(x*8),252+(x*8) ) then exotica_abort(1) end if
if trans_blitfast(ARW_L_Y, 176-(x*8), 248-(x*8) ) then exotica_abort(1) end if
end if
-----------




if surface_flip() then exotica_abort(1) end if
end for
end procedure


procedure draw_move(atom UpArrow,atom RightArrow,atom DownArrow,atom LeftArrow)

display_background(1)
----------------ICON---------
if trans_blitfast(NEIICON, 247, 242) then exotica_abort(1) end if
----------------NORTH--------
if exitall[location][1] then
if trans_blitfast(ARW_N, 322, 180  ) then exotica_abort(1) end if  --word
if trans_blitfast(UpArrow, 245, 177) then exotica_abort(1) end if
end if
----------------EAST---------
if exitall[location][2] then
--if trans_blitfast(ARW_E, 569-x, 256) then exotica_abort(1) end if
if trans_blitfast(ARW_E, 389  , 252  ) then exotica_abort(1) end if
if trans_blitfast(RightArrow, 314, 249) then exotica_abort(1) end if
end if
-------------SOUTH-----------
if exitall[location][3] then
if trans_blitfast(ARW_S, 321, 324 ) then exotica_abort(1) end if
if trans_blitfast(DownArrow, 243, 323 ) then exotica_abort(1) end if
end if

-------------WEST-----------
if exitall[location][4] then
if trans_blitfast(ARW_W, 75,252 ) then exotica_abort(1) end if
if trans_blitfast(LeftArrow, 176, 248 ) then exotica_abort(1) end if
end if
-----------
   if surface_flip() then exotica_abort(1) end if
end procedure

procedure moving()
atom UpAr,RtAr,DwAr,LfAr
integer move_direction
UpAr=ARW_UP_Y RtAr=ARW_R_Y DwAr=ARW_D_Y LfAr=ARW_L_Y
move_direction=0

move_menu_animate()
new_input()
while new_enter !=1 do
new_input()

if new_up=1 and exitall[location][1] then
UpAr=ARW_UP_Y RtAr=ARW_R_Y DwAr=ARW_D_Y LfAr=ARW_L_Y
move_direction=1 UpAr=ARW_UP_W
end if

if new_right=1 and exitall[location][2] then
UpAr=ARW_UP_Y RtAr=ARW_R_Y DwAr=ARW_D_Y LfAr=ARW_L_Y
move_direction=2 RtAr=ARW_RIGHT_W
end if

if new_left=1 and exitall[location][4] then
UpAr=ARW_UP_Y RtAr=ARW_R_Y DwAr=ARW_D_Y LfAr=ARW_L_Y
move_direction=4 LfAr=ARW_LEFT_W
end if

if new_down=1 and exitall[location][3] then
UpAr=ARW_UP_Y RtAr=ARW_R_Y DwAr=ARW_D_Y LfAr=ARW_L_Y
move_direction=3 DwAr=ARW_DOWN_W
end if

draw_move(UpAr,RtAr,DwAr,LfAr)

if  new_space=1 then move_menu_UNanimate() return end if
end while
while new_enter=1 do new_input() end while


if move_direction then move_menu_UNanimate() location=exitall[location][move_direction] enterArea() end if

end procedure




procedure blit_item01Menu()

display_background(1)
if trans_blitfast(USEWIN,155, 42) then exotica_abort(1) end if
if gdi_textout(247, 57,"ITEMS",c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
for x=1 to length(item_list_one) do 

if trans_blitfast(USE_NULPOINT,155, IM1_plaq_loc[x]) then exotica_abort(1) end if
if gdi_textout(202, IM1_plaq_loc[x]+15,item_list_one[x],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end for

feh=display_main_pointer2({181, IM1_pnt_loc[item_menu01_pos]})
if surface_flip() then exotica_abort(1) end if

end procedure

procedure blit_item02Menu()
sequence itm2plc

itm2plc={
{46,114},{46,183},{46,252},{46,321},{46,390},
{338,114},{338,183},{338,252},{338,321},{338,390}
}

display_background(1)
if trans_blitfast(USEWIN,155, 42) then exotica_abort(1) end if
if gdi_textout(247, 55,"ITEMS",c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
for x=1 to length(item_list) do 
if trans_blitfast(USE_NULPOINT,itm2plc[x][1], itm2plc[x][2]) then exotica_abort(1) end if
if gdi_textout(itm2plc[x][1]+46, itm2plc[x][2]+15,item_list[x],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end for
--feh=display_main_pointer3({itm2plc[x][1], IM2_pnt_loc[item_menu02_pos]})
feh=display_main_pointer3({itm2plc[item_menu02_pos][1]+26, itm2plc[item_menu02_pos][2]+8})
if surface_flip() then exotica_abort(1) end if

end procedure




procedure item_menu_01()
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then return end if
if new_down=1 and item_menu01_pos<length(item_list_one) then
item_menu01_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item01Menu() end while
end if
if new_up=1 and item_menu01_pos>1 then
item_menu01_pos -=1
while new_up=1 do new_input() blit_item01Menu() end while
end if
blit_item01Menu()
end while
while new_enter=1 do new_input() end while
feh=look(item_list_one[item_menu01_pos])
end procedure

procedure item_menu_02()
item_menu02_pos=1
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then return end if
if new_down=1 and item_menu02_pos<length(item_list) then
item_menu02_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item02Menu() end while
end if
if new_up=1 and item_menu02_pos>1 then
item_menu02_pos -=1
while new_up=1 do new_input() blit_item02Menu() end while
end if
blit_item02Menu()
end while
while new_enter=1 do new_input() end while
feh=look(item_list[item_menu02_pos])
end procedure

procedure main_menu()
if new_down=1 and main_menu_po<5 then
main_menu_po=main_menu_po+1
while new_down=1 do
c_proc( DINPUT_UPDATE,{NULL})
new_input()
end while
end if

if new_up=1 and main_menu_po>1 then
main_menu_po=main_menu_po-1
while new_up=1 do
c_proc( DINPUT_UPDATE,{NULL})
new_input()
end while
end if

end procedure

procedure move()


end procedure

procedure intro()
Stop() start_time=0
new_input()
while new_enter=0 do
music_intro()
new_input()
if trans_blitfast(NEITITLE, 0, 0) then exotica_abort(1) end if
if surface_flip() then exotica_abort(1) end if
end while
while new_enter=1 do new_input() end while
Stop() start_time=0
text={
"TIME: Autumn, A.W.1282",
"PLACE: Beerock Village, Motavia",
"CHARACTER: Amia Amiruski"
}
print_more_text()
text={
"Beerock, land on the edge of the planet Motavia.", 
"Amia Amiruski, the young and dazzlingly beautiful",
"counter hunter. An incredibly skilled hunter, she",
"has already caught 15 criminals."
} print_more_text()
text={
"She has come to Beerock under the orders of an",
"agent. Her target this time is a group of",
"Motavian thieves that have been frequenting",
"Beerock Village. They have destroyed the food"
} print_more_text()
text={
"source of the area, the Dome Farm. In addition to",
"this, they have illegally accessed the Mother",
"Brain. This is a computer crime of the highest",
"degree. And so, just for that the price on their"
} print_more_text()
text={
"heads is high. Amia has parked her beloved sand",
"buggy near the village. First of all, she must",
"meet the agent's contact in the village."
}
shown_intro=1
end procedure

procedure build_look_list()

item_list={"Surroundings"}
testvar1=compare("blank",lookall[location][1])
if testvar1 !=0 then
item_list=item_list&lookall[location]
end if
testvar1=compare("blank",items[1])
if testvar1 !=0 then
item_list=item_list&items
end if
testvar1=compare("blank",dropitems[location][1])
if testvar1 !=0 then
item_list=item_list&dropitems[location]
end if

end procedure

procedure item_menu_one()
item_list_one=item_list
for x=1 to 61 do
display_background(1)
----------------ICON---------
if trans_blitfast(USEWIN, 640-(x*8), 42) then exotica_abort(1) end if --edit this x*to increase speed
if gdi_textout(732-(x*8), 57,"ITEMS",c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if

if length(item_list_one)>=1 then
if trans_blitfast(USE_NULPOINT,-337 +(x*8), 114) then exotica_abort(1) end if
if gdi_textout(-310+(x*8)+20, 129,item_list_one[1],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(item_list_one)>=2 then
if trans_blitfast(USE_NULPOINT,630 -(x*8), 183) then exotica_abort(1) end if
if gdi_textout(657-(x*8)+20, 198,item_list_one[2],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if length(item_list_one)>=3 then
if trans_blitfast(USE_NULPOINT,-337 +(x*8), 252) then exotica_abort(1) end if
if gdi_textout(-310+(x*8)+20, 267,item_list_one[3],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(item_list_one)>=4 then
if trans_blitfast(USE_NULPOINT,630 -(x*8), 321) then exotica_abort(1) end if
if gdi_textout(657-(x*8)+20, 336,item_list_one[4],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(item_list_one)>=5 then
if trans_blitfast(USE_NULPOINT,-337 +(x*8), 390) then exotica_abort(1) end if
if gdi_textout(-310+(x*8)+20, 405,item_list_one[5],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if surface_flip() then exotica_abort(1) end if
end for

item_menu_01()


end procedure


procedure item_menu_twoV2()
integer nafFixVal
nafFixVal=25


--testvar1=compare("blank",dropitems[location][1])
--if testvar1 !=0 then
--item_list=item_list&dropitems[location]
--end if

build_look_list()

for x=1 to 61 do
display_background(1)
----------------ICON---------
if trans_blitfast(USEWIN, 640-(x*8), 42) then exotica_abort(1) end if --edit this x*to increase speed
if gdi_textout(732-(x*8), 55,"ITEMS",c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


-------------window 1
if trans_blitfast(USE_NULPOINT,-442 +(x*8), 114) then exotica_abort(1) end if
if gdi_textout(-415+(x*8)+nafFixVal, 125+4,item_list[1],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if --415

------------window 2
if trans_blitfast(USE_NULPOINT,534 -(x*8), 183) then exotica_abort(1) end if
if gdi_textout(552-(x*8)+nafFixVal, 198,item_list[2],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 3
if trans_blitfast(USE_NULPOINT,-442 +(x*8), 252) then exotica_abort(1) end if
if gdi_textout(-415+(x*8)+nafFixVal, 267,item_list[3],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 4
if trans_blitfast(USE_NULPOINT,534 -(x*8), 321) then exotica_abort(1) end if
if gdi_textout(552-(x*8)+nafFixVal, 336,item_list[4],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 5
if trans_blitfast(USE_NULPOINT,-442 +(x*8), 390) then exotica_abort(1) end if
if gdi_textout(-415+(x*8)+nafFixVal, 405,item_list[5],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


if length(item_list)>=6 then
if trans_blitfast(USE_NULPOINT,-150 +(x*8), 114) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(-120+(x*8)+nafFixVal, 125+4,item_list[6],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(item_list)>=7 then
if trans_blitfast(USE_NULPOINT,826 -(x*8), 183) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(844-(x*8)+nafFixVal, 198,item_list[7],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if length(item_list)>=8 then
if trans_blitfast(USE_NULPOINT,-150 +(x*8), 252) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(-120+(x*8)+nafFixVal, 267,item_list[8],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(item_list)>=9 then
if trans_blitfast(USE_NULPOINT,826 -(x*8), 321) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(844-(x*8)+nafFixVal, 336,item_list[9],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(item_list)>=10 then
if trans_blitfast(USE_NULPOINT,-150 +(x*8), 390) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(-120+(x*8)+nafFixVal, 405,item_list[10],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if surface_flip() then exotica_abort(1) end if
end for

item_menu_02()

end procedure

procedure animate_two_row_stuff(sequence row2_stuff, sequence plaqName)
integer nafFixVal
nafFixVal=25



for x=1 to 61 do
display_background(1)
----------------ICON---------
if blitfast(USEWIN, 640-(x*8), 42) then exotica_abort(1) end if --edit this x*to increase speed
if gdi_textout(732-(x*8), 55,plaqName,c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


-------------window 1
if blitfast(USE_NULPOINT,-442 +(x*8), 114) then exotica_abort(1) end if
if gdi_textout(-415+(x*8)+nafFixVal, 125+4,row2_stuff[1],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if --415

------------window 2
if blitfast(USE_NULPOINT,534 -(x*8), 183) then exotica_abort(1) end if
if gdi_textout(552-(x*8)+nafFixVal, 198,row2_stuff[2],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 3
if blitfast(USE_NULPOINT,-442 +(x*8), 252) then exotica_abort(1) end if
if gdi_textout(-415+(x*8)+nafFixVal, 267,row2_stuff[3],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 4
if blitfast(USE_NULPOINT,534 -(x*8), 321) then exotica_abort(1) end if
if gdi_textout(552-(x*8)+nafFixVal, 336,row2_stuff[4],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 5
if blitfast(USE_NULPOINT,-442 +(x*8), 390) then exotica_abort(1) end if
if gdi_textout(-415+(x*8)+nafFixVal, 405,row2_stuff[5],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


if length(row2_stuff)>=6 then
if blitfast(USE_NULPOINT,-150 +(x*8), 114) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(-120+(x*8)+nafFixVal, 125+4,row2_stuff[6],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row2_stuff)>=7 then
if blitfast(USE_NULPOINT,826 -(x*8), 183) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(844-(x*8)+nafFixVal, 198,row2_stuff[7],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if length(row2_stuff)>=8 then
if blitfast(USE_NULPOINT,-150 +(x*8), 252) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(-120+(x*8)+nafFixVal, 267,row2_stuff[8],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row2_stuff)>=9 then
if blitfast(USE_NULPOINT,826 -(x*8), 321) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(844-(x*8)+nafFixVal, 336,row2_stuff[9],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row2_stuff)>=10 then
if blitfast(USE_NULPOINT,-150 +(x*8), 390) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(-120+(x*8)+nafFixVal, 405,row2_stuff[10],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if surface_flip() then exotica_abort(1) end if
end for
end procedure

procedure UNanimate_two_row_stuff(sequence row2_stuff, sequence plaqName)
integer nafFixVal
nafFixVal=25



for x=1 to 61 do
display_background(1)
----------------ICON---------
if blitfast(USEWIN, 152+(x*8), 42) then exotica_abort(1) end if --edit this x*to increase speed
if gdi_textout(244+(x*8), 55,plaqName,c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


-------------window 1
if blitfast(USE_NULPOINT,46-(x*8), 114) then exotica_abort(1) end if
if gdi_textout(73-(x*8)+nafFixVal, 125+4,row2_stuff[1],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if --415
--gdi+27
------------window 2
if blitfast(USE_NULPOINT,46+(x*8), 183) then exotica_abort(1) end if
if gdi_textout(73+(x*8)+nafFixVal, 198,row2_stuff[2],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 3
if blitfast(USE_NULPOINT,46-(x*8), 252) then exotica_abort(1) end if
if gdi_textout(73-(x*8)+nafFixVal, 267,row2_stuff[3],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 4
if blitfast(USE_NULPOINT,46+(x*8), 321) then exotica_abort(1) end if
if gdi_textout(73+(x*8)+nafFixVal, 336,row2_stuff[4],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
------------window 5
if blitfast(USE_NULPOINT,46-(x*8), 390) then exotica_abort(1) end if
if gdi_textout(73-(x*8)+nafFixVal, 405,row2_stuff[5],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


if length(row2_stuff)>=6 then
if blitfast(USE_NULPOINT,329-(x*8), 114) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(356-(x*8)+nafFixVal, 125+4,row2_stuff[6],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row2_stuff)>=7 then
if blitfast(USE_NULPOINT,329+(x*8), 183) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(356+(x*8)+nafFixVal, 198,row2_stuff[7],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if length(row2_stuff)>=8 then
if blitfast(USE_NULPOINT,329-(x*8), 252) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(356-(x*8)+nafFixVal, 267,row2_stuff[8],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row2_stuff)>=9 then
if blitfast(USE_NULPOINT,329+(x*8), 321) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(356+(x*8)+nafFixVal, 336,row2_stuff[9],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row2_stuff)>=10 then
if blitfast(USE_NULPOINT,329-(x*8), 390) then exotica_abort(1) end if --row 1 item 2
if gdi_textout(356-(x*8)+nafFixVal, 405,row2_stuff[10],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if surface_flip() then exotica_abort(1) end if
end for
end procedure

procedure animate_one_row_stuff(sequence row1_stuff,sequence plaqName)

--for x=1 to 61 do
for x=1 to 57 do
display_background(1)
----------------ICON---------
if blitfast(USEWIN, 640-(x*8), 42) then exotica_abort(1) end if --edit this x*to increase speed
if gdi_textout(732-(x*8), 57,plaqName,c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if

if length(row1_stuff)>=1 then
if blitfast(USE_NULPOINT,-337 +(x*8), 114) then exotica_abort(1) end if
if gdi_textout(-310+(x*8)+20, 129,row1_stuff[1],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row1_stuff)>=2 then
if blitfast(USE_NULPOINT,630 -(x*8), 183) then exotica_abort(1) end if
if gdi_textout(657-(x*8)+20, 198,row1_stuff[2],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if length(row1_stuff)>=3 then
if blitfast(USE_NULPOINT,-337 +(x*8), 252) then exotica_abort(1) end if
if gdi_textout(-310+(x*8)+20, 267,row1_stuff[3],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row1_stuff)>=4 then
if blitfast(USE_NULPOINT,630 -(x*8), 321) then exotica_abort(1) end if
if gdi_textout(657-(x*8)+20, 336,row1_stuff[4],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row1_stuff)>=5 then
if blitfast(USE_NULPOINT,-337 +(x*8), 390) then exotica_abort(1) end if
if gdi_textout(-310+(x*8)+20, 405,row1_stuff[5],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if surface_flip() then exotica_abort(1) end if
end for

end procedure

procedure UNanimate_one_row_stuff(sequence row1_stuff,sequence plaqName)


for x=1 to 66 do
display_background(1)
----------------ICON---------
if blitfast(USEWIN, 152+(x*8), 42) then exotica_abort(1) end if --edit this x*to increase speed
if gdi_textout(244+(x*8), 57,plaqName,c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
--gdi1,+92

if length(row1_stuff)>=1 then
if blitfast(USE_NULPOINT,46 -(x*8), 114) then exotica_abort(1) end if
if gdi_textout(73-(x*8)+20, 129,row1_stuff[1],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if
--gdi+27

if length(row1_stuff)>=2 then
if blitfast(USE_NULPOINT,46+(x*8), 183) then exotica_abort(1) end if
if gdi_textout(73+(x*8)+20, 198,row1_stuff[2],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if



if length(row1_stuff)>=3 then
if blitfast(USE_NULPOINT,46-(x*8), 252) then exotica_abort(1) end if
if gdi_textout(73-(x*8)+20, 267,row1_stuff[3],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row1_stuff)>=4 then
if blitfast(USE_NULPOINT,46+(x*8), 321) then exotica_abort(1) end if
if gdi_textout(73+(x*8)+20, 336,row1_stuff[4],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if length(row1_stuff)>=5 then
if blitfast(USE_NULPOINT,46-(x*8), 390) then exotica_abort(1) end if
if gdi_textout(73-(x*8)+20, 405,row1_stuff[5],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end if

if surface_flip() then exotica_abort(1) end if
end for

end procedure


procedure blit_item02Stuff(sequence row1_stuff,sequence plaqName)

sequence itm2plc

itm2plc={
{46,114},{46,183},{46,252},{46,321},{46,390},
{338,114},{338,183},{338,252},{338,321},{338,390}
}

display_background(1)
if blitfast(USEWIN,155, 42) then exotica_abort(1) end if
if gdi_textout(247, 55,plaqName,c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
for x=1 to length(row1_stuff) do 
if blitfast(USE_NULPOINT,itm2plc[x][1], itm2plc[x][2]) then exotica_abort(1) end if
if gdi_textout(itm2plc[x][1]+46, itm2plc[x][2]+15,row1_stuff[x],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end for
--feh=display_main_pointer3({itm2plc[x][1], IM2_pnt_loc[item_menu02_pos]})
feh=display_main_pointer3({itm2plc[item_menu02_pos][1]+26, itm2plc[item_menu02_pos][2]+8})
if surface_flip() then exotica_abort(1) end if


end procedure


procedure blit_item01Stuff(sequence row1_stuff,sequence plaqName)

display_background(1)
if blitfast(USEWIN,155, 42) then exotica_abort(1) end if
if gdi_textout(247, 57,plaqName,c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
for x=1 to length(row1_stuff) do 

if blitfast(USE_NULPOINT,155, IM1_plaq_loc[x]) then exotica_abort(1) end if
if gdi_textout(202, IM1_plaq_loc[x]+15,row1_stuff[x],c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if
end for

feh=display_main_pointer2({181, IM1_pnt_loc[item_menu01_pos]})

if surface_flip() then exotica_abort(1) end if

end procedure




procedure deletegrounditem(sequence deleteditem)
sequence dropitems2
dropitems2={}
for x=1 to length(dropitems[location]) do
testvar1=compare(deleteditem,dropitems[location][x])
if testvar1=0 then
end if
if testvar1 !=0 then
dropitems2=append(dropitems2,dropitems[location][x])
end if
end for
dropitems[location]=dropitems2
testvar1=compare("",dropitems[location])
if testvar1=0 then
dropitems[location]={"blank"}
end if
end procedure



procedure drop_tworow()
item_menu02_pos=1
animate_two_row_stuff(items,"Drop")
blit_item02Stuff(items,"Drop")

new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_two_row_stuff(items,"Drop") return end if
if new_down=1 and item_menu02_pos<length(items) then
item_menu02_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item02Stuff(items,"Drop") end while
end if
if new_up=1 and item_menu02_pos>1 then
item_menu02_pos -=1
while new_up=1 do new_input() blit_item02Stuff(items,"Drop") end while
end if
blit_item02Stuff(items,"Drop")
end while
UNanimate_two_row_stuff(items,"Drop")
while new_enter=1 do new_input() end while
deleteitem(items[item_menu02_pos])

end procedure

procedure drop_onerow()
item_menu01_pos=1
animate_one_row_stuff(items,"Drop")
blit_item01Stuff(items,"Drop")
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_one_row_stuff(items,"Drop") return end if
if new_down=1 and item_menu01_pos<length(items) then
item_menu01_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item01Stuff(items,"Drop") end while
end if
if new_up=1 and item_menu01_pos>1 then
item_menu01_pos -=1
while new_up=1 do new_input() blit_item01Stuff(items,"Drop") end while
end if
blit_item01Stuff(items,"Drop")
end while
while new_enter=1 do new_input() end while
UNanimate_one_row_stuff(items,"Drop")
if compare(dropitems[location][1],"blank")=0 then dropitems[location]={items[item_menu01_pos]} end if
deleteitem(items[item_menu01_pos])

end procedure

procedure take_onerow()
item_menu01_pos=1
animate_one_row_stuff(dropitems[location],"Take")
blit_item01Stuff(dropitems[location],"Take")
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_one_row_stuff(dropitems[location],"Take") return end if
if new_down=1 and item_menu01_pos<length(dropitems[location]) then
item_menu01_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item01Stuff(dropitems[location],"Take") end while
end if
if new_up=1 and item_menu01_pos>1 then
item_menu01_pos -=1
while new_up=1 do new_input() blit_item01Stuff(dropitems[location],"Take") end while
end if
blit_item01Stuff(dropitems[location],"Take")
end while
while new_enter=1 do new_input() end while

if compare("blank",items[1])=0 then items={dropitems[location][item_menu01_pos]} else
items=append(items,dropitems[location][item_menu01_pos])
end if
take_description_text(dropitems[location][item_menu01_pos])
deletegrounditem(dropitems[location][item_menu01_pos])


end procedure

procedure take_tworow()
item_menu02_pos=1
animate_two_row_stuff(dropitems[location],"Take")
blit_item02Stuff(dropitems[location],"Take")

new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_two_row_stuff(dropitems[location],"Take") return end if
if new_down=1 and item_menu02_pos<length(dropitems[location]) then
item_menu02_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item02Stuff(dropitems[location],"Take") end while
end if
if new_up=1 and item_menu02_pos>1 then
item_menu02_pos -=1
while new_up=1 do new_input() blit_item02Stuff(dropitems[location],"Take") end while
end if
blit_item02Stuff(dropitems[location],"Take")
end while
while new_enter=1 do new_input() end while

if compare("blank",items[1])=0 then items={dropitems[location][item_menu02_pos]} else
items=append(items,dropitems[location][item_menu02_pos])
end if
take_description_text(dropitems[location][item_menu02_pos])
deletegrounditem(dropitems[location][item_menu02_pos])


end procedure


function deleteitem2(sequence deleteditem,sequence deletedFrom)
sequence dropitems2
dropitems2={}
for x=1 to length(deletedFrom) do
testvar1=compare(deleteditem,deletedFrom[x])
if testvar1=0 then
end if
if testvar1 !=0 then
dropitems2=append(dropitems2,deletedFrom[x])
end if
end for
--items=dropitems2
if compare(items,{})=0 then items={"blank"} end if
return dropitems2
end function

procedure HackRoomRun()
text={
"“Give it up, princess. I will never, ever be",
"caught by a stupid human!” The Hack then",
"disappears through the southern door with a",
"laugh." } 
print_more_text()
text={""} print_more_text() text={
"…That was quite a voice for a Motavian. It was",
"almost like a voice of a human male!?"
} exitall[33]={29,0,34,0,0,0,0} extra_loc_flag[33][1]=1 delete_areaall("Hack")

end procedure


--************************************************************************************************8
procedure use_item(sequence used,sequence used_on)
integer itcki


----------------
itcki=compare("Picture",used)
if itcki=0 then
-----

if compare("Hack",used_on)=0 then
text={
"Amia returns the picture to the Hack. He gazes at",
"the people in the picture for a bit, and then",
"lifts his face. Then he spits out the following,",
"“These are my real parents. They abandoned me"
} print_more_text() text={
"when I was still very young. They were heartless.",
"All humans are. Motavians are nice. They took",
"care of me and raised me…” Amia understands how",
"the Hack feels. She also feels that she"
} print_more_text() text={
"understands why he turned to crime. This is",
"because Amia also lost her parents when she was",
"very young and felt a similar sadness. The Hack’s",
"hatred for all humans stems from his suppressing"
} print_more_text() text={
"his longing for his parents. Amia kindly consoles",
"the Hack, “But in spite of all that, I still have",
"to take you back. It’s my job.” The Hack laughs",
"powerlessly."
}  print_more_text() text={
"",
""
} print_more_text() text={
"Amia then notices light is shining through a",
"fissure in the rock at the back of the shrine.",
"The night has ended without her even realizing",
"it."
} add_lookall("Fissure in the rock",57) 
extra_loc_flag[57][2]=1
end if




end if ---end EGG



----------------
itcki=compare("Egg",used)
if itcki=0 then
-----

if compare("Kolgen",used_on)=0 then
text={
"The Kolgen eagerly swallows the egg whole. It",
"closes it eyes and finally stops moving. It seems",
"that it is taking an after dinner nap. It doesn’t",
"look like it will wake up for a while."
}  delete_areaall("Kolgen") add_lookall("Hack",55) extra_loc_flag[55][1]=1 exitall[55]={56,51,0,0,0,0,0}   
deleteitem("Egg")
  end if

if compare("Hack",used_on)=0 then
text={
"Amia tries to give the egg to the Hack, but he",
"refuses to take it."
} end if




end if ---end EGG


----------------
itcki=compare("Knife",used)
if itcki=0 then
-----

if compare("Cactuses",used_on)=0 then
text={
"Amia cuts off a piece of one of the cactuses and",
"eats it."} hp=max_hp print_more_text() text={
"The cactus contained a lot of water, so Amia's",
"throat is not dry anymore."
} end if


if compare("Hack",used_on)=0 and location=33 then
text={
"Amia thrusts upward with the knife. The Hack",
"nimbly evades her attack and says,"
} print_more_text() HackRoomRun() end if

if compare("Wanted Poster",used_on)=0 then
text={
"Amia uses the first object on the second object,",
"but nothing happens."
} end if

if compare("Dashboard",used_on)=0 then
text={
"Amia uses the first object on the second object,",
"but nothing happens."
} end if

if compare("Vegetables",used_on)=0 then
text={
"“I’ll get a stomachache.”"
} end if

if compare("Hack",used_on)=0 and location=7 then
text={
"Just as Amia raises the knife, the Motavians rush",
"into the room. Shortly after preparing to take on",
"the Motavians, Amia is suddenly hit in the head",
"from behind and knocked out…"
}
print_more_text()
text={
""
} print_more_text()
text={
"When Amia regains consciousness, there is no one",
"in the area."
} 
location=13 exitall[3][1]=15 exitall[3][3]=14 exitall[6]={14,0,0,0,0,0,0}


end if 


-------------april fools last minute edit-------------
if compare("Hack",used_on)=0 and location=12 then
text={
"Just as Amia raises the knife, the Motavians rush",
"into the room. Shortly after preparing to take on",
"the Motavians, Amia is suddenly hit in the head",
"from behind and knocked out…"
}
print_more_text()
text={
""
} print_more_text()
text={
"When Amia regains consciousness, there is no one",
"in the area."
} 
location=13 exitall[3][1]=15 exitall[3][3]=14 exitall[6]={14,0,0,0,0,0,0}
  end if
---------------------------------------------


if compare("Motavian Crow",used_on)=0 then
ap=1 combat=1
text={
"Amia slashes at the opponent with the knife."
}
damage=rand(5)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the crow.", damage )
} print_more_text() crow_hp=crow_hp-damage
if crow_hp<=0 then
text={
"The Motavian Crow lets out a terrible shriek loud",
"enough to echo through the entire valley, falls",
"out of the nest and stops breathing."
} 
print_more_text()
ap=0 combat=0 delete_areaall("Motavian Crow") exitall[23]={0,0,25,22,0,0,0}
else
damage=rand(5)+1
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The crow inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Motavian Crow attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if


if compare("Kolgen",used_on)=0 then
ap=1 combat=1
text={
"Amia slashes at the opponent with the knife."
}
damage=rand(5)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the kolgen.", damage )
} print_more_text() kolgen_hp=kolgen_hp-damage
if kolgen_hp<=0 then
text={
"Victory:",
"The Motavian Crow lets out a terrible shriek loud",
"enough to echo through the entire valley, falls",
"out of the nest and stops breathing."
} 
print_more_text()
location=55 ap=0 combat=0
else
damage=rand(12)+2
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The kolgen inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The kolgen attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if


----------*********Worm Vs. Knife*******
if compare("Hole Worm",used_on)=0 then
ap=1 combat=1
text={
"Amia slashes at the opponent with the knife."
}
damage=rand(5)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the Hole Worm.", damage )
} print_more_text() HoleWormHP=HoleWormHP-damage
if HoleWormHP<=0 then
text={
"At last, the Hole Worm retreats back into the",
"ground. However, it may come back at any time."
} delete_areaall("Hole Worm") exitall[35]={34,0,0,36,0,0,0}
print_more_text()
if extra_loc_flag[35][1]=0 then text={
"Amia suddenly notices that the Hack has",
"disappeared."
}  extra_loc_flag[35][1]=1 end if
ap=0 combat=0
else
damage=rand(12)+2
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The Hole Worm inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Hole Worm attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if

----------*********Rock Bee Vs. Knife*******
if compare("Rock Bee",used_on)=0 then
ap=1 combat=1
text={
"Amia slashes at the opponent with the knife."
}
damage=rand(5)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the Rock Bee.", damage )
} print_more_text() RockBeeHP=RockBeeHP-damage
if RockBeeHP<=0 then
text={
"The Rock Bee vomits pebbles from its mouth and",
"behind. Then it flutters off to the sky."
} exitall[36]={0,34,37,0,0,0,0} delete_areaall("Rock Bee")
print_more_text()
if extra_loc_flag[36][1]=0 then text={
"Amia suddenly notices that the Hack has",
"disappeared."
}  extra_loc_flag[36][1]=1 end if
ap=0 combat=0
else
damage=rand(12)+2
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The Rock Bee inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Rock Bee attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if




----------*********Bat Vs. Knife*******
if compare("Bat Monster",used_on)=0 then
ap=1 combat=1
text={
"Amia slashes at the opponent with the knife."
}
damage=rand(5)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the Bat Monster.", damage )
} print_more_text() batHP=batHP-damage
if batHP<=0 then
text={
"While shrieking, the bat escapes past the edge of",
"the rocky area."
} 
ap=0 combat=0 exitall[17]={0,0,0,16,0,0,0} 
delete_areaall("Bat Monster")
location=16 delete_areaall("Dark Shadow")
location=18
else
damage=rand(11)+1
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The Bat Monster inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Bat Monster attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if









used_on="lalala"
end if --end knife if

-----------------
itcki=compare("Wanted Poster",used)
if itcki=0 then
-----
if compare("Control Panel",used_on)=0 then
text={
"Amia uses the first object on the second object,",
"but nothing happens."
} end if

if compare("Dashboard",used_on)=0 then
text={
"Amia uses the first object on the second object,",
"but nothing happens."
} end if

if compare("Man",used_on)=0 and location=10 then
text={
"The man takes the wanted poster and says, “I see,",
"you are Amia? I heard about you from the agent.",
"Here, take these handcuffs. You’ll need these to",
"take the enemy prisoner won’t you?”"
}
print_more_text()
text={
"“Well, good luck.”",
"Amia receives the handcuffs."
} exitall[5]={3,0,0,7,0,0,0} deleteitem("Wanted Poster") 
if compare("blank",items[1])=0 then items={"Handcuffs"} else items=append(items,"Handcuffs") end if
extra_loc_flag[10][1]=1 exitall[3][3]=11 exitall[6][1]=11
end if



end if --end poster if

-----------------
itcki=compare("Stick",used)
if itcki=0 then
------------------

if compare("Rock Bee",used_on)=0 then
text={
"Amia jabs the opponent with the stick, but she",
"can’t fight with it like she had thought."
} 
end if


if compare("Hole Worm",used_on)=0 then
text={
"Amia jabs the opponent with the stick. But she",
"can’t fight with it like she had thought."
} 
damage=rand(12)+2
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The crow inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Hole Worm attacks and misses."
   } end if


end if


if compare("Hack",used_on)=0 then
text={
"This is no time to do something like that."
} end if

if compare("Control Panel",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

if compare("Dashboard",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if


if compare("Something",used_on)=0 then
text={
"Amia thrusts the stick into the bear trap. The",
"trap closes with a clatter."
} delete_areaall("Something") lookall[26]={"blank"} deleteitem("Stick")  trapSprung26=1 end if 

if compare("Bear trap",used_on)=0 then
text={
"Amia thrusts the stick into the bear trap. The",
"trap closes with a clatter."
} delete_areaall("Bear trap") lookall[26]={"blank"} deleteitem("Stick") trapSprung26=1 end if 

end if --end stick if

-----------------
itcki=compare("Handcuffs",used)
if itcki=0 then
-----

text={
"This is no time to do something like that."
}


if compare("Hack",used_on)=0 and location=49 then
captured=16
blah=Play("BogAsound.ogg")
text={
"Amia puts the handcuffs on the Hack’s wrist. As",
"she does this, he wakes up. He looks at the",
"handcuffs and the glares are Amia. “What is this”",
"Humans don’t know any mercy at all! Do you really"
} print_more_text() text={
"think you can safely take me back to the village",
"in the first place? You have no fear after all,",
"really…”"
}  add_hack("Hack") location=53 delete_areaall("Hack") location=55 delete_areaall("Hack") 
enter_loc_flag[57][1]=0 location=49
 end if

if compare("Hack",used_on)=0 and location=47 then
text={
"As soon as Amia takes out the handcuffs, she",
"loses her balance and tumbles into the vortex." 
} location=48 enterArea() end if

if compare("Hack",used_on)=0 and location=33 then
text={
"Amia gets out the handcuffs. The Hack takes a",
"step back and says,"
} HackRoomRun() end if

if compare("Control Panel",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

if compare("Dashboard",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

if compare("Hack",used_on)=0 and location=7 then
text={
"Just as Amia takes out the handcuffs, the",
"Motavians rush into the room. Shortly after",
"preparing to take on the Motavians, Amia is"
}
print_more_text()
text={
"suddenly hit in the head from behind and",
"knocked out…"
}
print_more_text()
text={
""
} print_more_text()
text={
"When Amia regains consciousness, there is no one",
"in the area."
} location=13 location=13 exitall[3][1]=15 end if


------------------april fools last minute edit----------------
if compare("Hack",used_on)=0 and location=12 then
text={
"Just as Amia takes out the handcuffs, the",
"Motavians rush into the room. Shortly after",
"preparing to take on the Motavians, Amia is"
}
print_more_text()
text={
"suddenly hit in the head from behind and",
"knocked out…"
}
print_more_text()
text={
""
} print_more_text()
text={
"When Amia regains consciousness, there is no one",
"in the area."
} location=13 exitall[3][1]=15 exitall[3][3]=14 exitall[6]={14,0,0,0,0,0,0} end if
----------------------------------------------------



end if --end handcuffs if

-----------------
itcki=compare("Boomerang",used)
if itcki=0 then
-----

----------*********Rock Bee Vs. Boomerang*******
if compare("Rock Bee",used_on)=0 then
ap=2 combat=1
text={
"Amia hurls the boomerang."
}
damage=rand(11)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the Rock Bee.", damage )
} print_more_text() RockBeeHP=RockBeeHP-damage
if RockBeeHP<=0 then
text={
"The Rock Bee vomits pebbles from its mouth and",
"behind. Then it flutters off to the sky."
} exitall[36]={0,34,37,0,0,0,0} delete_areaall("Rock Bee")
print_more_text()
if extra_loc_flag[36][1]=0 then text={
"Amia suddenly notices that the Hack has",
"disappeared."
}  extra_loc_flag[36][1]=1 end if
ap=0 combat=0
else
damage=rand(12)+2
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The Rock Bee inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Rock Bee attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if



----------*********Rock Bee Vs. Boomerang*******
if compare("Kolgen",used_on)=0 then
ap=1 combat=1
text={
"Amia hurls the boomerang."
}
damage=rand(11)+1
print_more_text()
text={
sprintf("Amia inflicted %g damage points upon the kolgen.", damage )
} print_more_text() kolgen_hp=kolgen_hp-damage
if kolgen_hp<=0 then
text={
"The Rock Bee vomits pebbles from its mouth and",
"behind. Then it flutters off to the sky."
} exitall[36]={0,34,37,0,0,0,0} delete_areaall("Rock Bee")
print_more_text()
if extra_loc_flag[36][1]=0 then text={
"Amia suddenly notices that the Hack has",
"disappeared."
}  extra_loc_flag[36][1]=1 end if
ap=0 combat=0
else
damage=rand(12)+2
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The kolgen inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The kolgen attacks and misses."
   } end if


end if --rat hp=0

end if --end if rat if




if compare("Hole Worm",used_on)=0 then
text={
"As soon as the Hole Worm hears the sound of the",
"spinning boomerang, it immediately retracts its",
"tentacles back into the ground. As soon as the",
"boomerang has passed by, the Hole Worm once again"
} print_more_text()
text={
"sticks it tentacles out of the ground."
}
print_more_text()
damage=rand(11)+1
if damage !=2 and damage !=3 and damage !=4 then
text={
sprintf("The Hole Worm inflicted %g damage points upon Amia.", damage )
}  print_more_text()
if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0
hp=hp-damage
   else text={
   "The Hole Worm attacks and misses."
   } end if
print_more_text() text={
"The boomerang seems to be totally ineffective",
"here."
}   



 end if


if compare("Hack",used_on)=0 and location=33 then
text={
"Amia hurls the boomerang but the Hack deftly",
"dodges it and says,"
} HackRoomRun() end if

if compare("Control Panel",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

if compare("Dashboard",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

end if --end Boomerang if


-----------------
itcki=compare("Silver Key",used)
if itcki=0 then
-----

if compare("Box",used_on)=0 then
text={
"The silver key fits the keyhole on the box",
"perfectly. After lifting the lid, Amia sees a",
"pair of sand-skis in the box."} extra_loc_flag[43][1]=1 deleteitem("Silver Key") add_dropitem("Sand-skis")   end if

end if



-----------------
itcki=compare("Hang glider",used)
if itcki=0 then
-----

if compare("Wind",used_on)=0 and location=38 then
text={
"Amia straps on the hang glider and takes off.",
"While slowly circling, she descends. Before long,",
"she touches down in the desert." 
} print_more_text() location=41 deleteitem("Hang glider")  enterArea() end if

if compare("Wind",used_on)=0 and location=37 then
text={
"Amia straps on the hang glider and takes off.",
"Propelled by the wind, she cannot control the",
"hang glider as she had thought. After spinning",
"out of control, she touches down somewhere." 
} print_more_text() location=35 enterArea() end if

if compare("Control Panel",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

if compare("Dashboard",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t",
"help."
} end if

end if --end Hang glider if


----------*****************Common Event Text--------**************
if compare("Village",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Dome Farm",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Mountain Area",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Dome Farm",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Mountain Range",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Storehouse",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Dome Control Room",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if

if compare("Vegetables",used_on)=0 then
text={
"Amia feels that even if she does this, it won’t help."
}
end if


end procedure

function checkOneUseItem(sequence ItemChecked)
sequence OneUseItems
OneUseItems={"Jerky","Sweet","Grass"}

for x=1 to length(OneUseItems) do
if compare(ItemChecked,OneUseItems[x])=0 then
use_item(ItemChecked,"Self")
return 1
end if
end for
return 0
end function

procedure use_onerow()
sequence item_used,useOn_list
item_used={"blank","blank"}
item_menu01_pos=1
item_menu02_pos=1
animate_one_row_stuff(items,"Use")
blit_item01Stuff(items,"Use")
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_one_row_stuff(items,"Use") return end if
if new_down=1 and item_menu01_pos<length(items) then
item_menu01_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item01Stuff(items,"Use") end while
end if
if new_up=1 and item_menu01_pos>1 then
item_menu01_pos -=1
while new_up=1 do new_input() blit_item01Stuff(items,"Use") end while
end if
blit_item01Stuff(items,"Use")
end while
while new_enter=1 do new_input() end while
item_used[1]=items[item_menu01_pos]
------------------
build_look_list()
useOn_list=deleteitem2("Surroundings",item_list) useOn_list=deleteitem2(item_used[1],useOn_list)

if checkOneUseItem(item_used[1]) then return end if 

item_menu01_pos=1
item_menu02_pos=1

UNanimate_one_row_stuff(items,"Use")
animate_one_row_stuff(useOn_list,"Use on")
-----------------------------
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if

new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_one_row_stuff(useOn_list,"Use on") return end if
if new_down=1 and item_menu01_pos<length(useOn_list) and item_menu02_pos<length(useOn_list) then
item_menu01_pos +=1  item_menu02_pos +=1 --+1= is equivilent to ++
while new_down=1 do new_input() 
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if
end while
end if
if new_up=1 and item_menu01_pos>1 and item_menu02_pos>1 then
item_menu01_pos -=1 item_menu02_pos -=1
while new_up=1 do new_input() 
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if
end while
end if
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if
end while
while new_enter=1 do new_input() end while
UNanimate_one_row_stuff(useOn_list,"Use on")
item_used[2]=useOn_list[item_menu01_pos]
use_item(item_used[1],item_used[2])
end procedure

procedure use_tworow()
sequence item_used,useOn_list
item_used={"blank","blank"}
item_menu02_pos=1
animate_two_row_stuff(items,"Use")
blit_item02Stuff(items,"Use")
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_two_row_stuff(items,"Use") return end if
if new_down=1 and item_menu02_pos<length(items) then
item_menu02_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item02Stuff(items,"Use") end while
end if
if new_up=1 and item_menu02_pos>1 then
item_menu02_pos -=1
while new_up=1 do new_input() blit_item02Stuff(items,"Use") end while
end if
blit_item02Stuff(items,"Use")
end while
while new_enter=1 do new_input() end while
UNanimate_two_row_stuff(items,"Use")
item_used[1]=items[item_menu02_pos]
------------------
build_look_list()
useOn_list=deleteitem2("Surroundings",item_list) useOn_list=deleteitem2(item_used[1],useOn_list)

if checkOneUseItem(item_used[1]) then return end if 

item_menu01_pos=1
item_menu02_pos=1
animate_one_row_stuff(useOn_list,"Use on")
-----------------------------
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if

new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_one_row_stuff(useOn_list,"Use on") return end if
if new_down=1 and item_menu01_pos<length(useOn_list) and item_menu02_pos<length(useOn_list) then
item_menu01_pos +=1  item_menu02_pos +=1 --+1= is equivilent to ++
while new_down=1 do new_input() 
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if
end while
end if
if new_up=1 and item_menu01_pos>1 and item_menu02_pos>1 then
item_menu01_pos -=1 item_menu02_pos -=1
while new_up=1 do new_input() 
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if
end while
end if
if length(useOn_list)<=5 then blit_item01Stuff(useOn_list,"Use on") 
elsif length(useOn_list)>=6 and length(useOn_list)<=10 then blit_item02Stuff(useOn_list,"Use on")
end if
end while
UNanimate_one_row_stuff(useOn_list,"Use on")
while new_enter=1 do new_input() end while
item_used[2]=useOn_list[item_menu01_pos]  --This line changed april 9 , useOn_list was item_used[2]=items[item_menu01_pos]



use_item(item_used[1],item_used[2])

--text={item_used[2],item_used[1] } print_more_text()


end procedure



procedure item_menu_oneV3()
animate_one_row_stuff(item_list,"Look")
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_one_row_stuff(item_list,"Look") return end if
if new_down=1 and item_menu01_pos<length(item_list) then
item_menu01_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item01Stuff(item_list,"Look") end while
end if
if new_up=1 and item_menu01_pos>1 then
item_menu01_pos -=1
while new_up=1 do new_input() blit_item01Stuff(item_list,"Look") end while
end if
blit_item01Stuff(item_list,"Look")
end while
while new_enter=1 do new_input() end while
UNanimate_one_row_stuff(item_list,"Look")
feh=look(item_list[item_menu01_pos])
end procedure


procedure item_menu_twoV3()
item_menu02_pos=1
animate_two_row_stuff(item_list,"Look")
new_input()
while new_enter !=1 do
new_input()
if  new_space=1 then UNanimate_two_row_stuff(item_list,"Look") return end if
if new_down=1 and item_menu02_pos<length(item_list) then
item_menu02_pos +=1  --+1= is equivilent to ++
while new_down=1 do new_input() blit_item02Stuff(item_list,"Look") end while
end if
if new_up=1 and item_menu02_pos>1 then
item_menu02_pos -=1
while new_up=1 do new_input() blit_item02Stuff(item_list,"Look") end while
end if
blit_item02Stuff(item_list,"Look")
end while
while new_enter=1 do new_input() end while
UNanimate_two_row_stuff(item_list,"Look")
feh=look(item_list[item_menu02_pos])

end procedure

procedure use()
if  compare("blank",items[1]) =0 then text={"Nothing to use."} end if
if length(items)<=5 and compare("blank",items[1]) !=0 then use_onerow() end if
if length(items)>5 then use_tworow() end if
end procedure

procedure drop()
if compare("blank",items[1]) =0 then text={"Nothing to drop."} end if
if length(items)<=5 and compare("blank",items[1]) !=0 then drop_onerow() end if
if length(items)>5 then drop_tworow() end if
end procedure

procedure take()
if compare("blank",dropitems[location][1]) =0 then text={"There's nothing to take here."} end if
if length(dropitems[location])<=5 and compare("blank",dropitems[location][1]) !=0 then take_onerow() takemodarea() end if
if length(dropitems[location])>5 then take_tworow() takemodarea() end if


end procedure


-----------------------------------------------------------------------------
-- Main
          

while not keyboard_keystate(DIK_ESCAPE) do
if aActive then
if clear_surface(0) then exotica_abort(1) end if


if introduction=1 and shown_intro=0 then
intro() 
end if

dinput_update() 
new_input()
main_menu()
display_background(0)
display_main_pointer()



if hp<=0 then
exotica_abort(1) Stop() ClosePlug(1)
end if --end if neihp0


if new_enter=1 then
  if main_menu_po=1 then moving() end if
    if main_menu_po=2 and compare("blankReal",lookall[location][1]) then 
    build_look_list()
       if length(item_list)<6  then item_menu_oneV3()
       else item_menu_twoV3()
       end if
    end if
    if main_menu_po=5 then   drop()               end if
        if main_menu_po=3 then   take()               end if
                if main_menu_po=4 then   use()               end if
end if


if c_func(KEYBOARD_KEYSTATE,{DIK_S})=1 then
AmiaSavegame()
end if

if c_func(KEYBOARD_KEYSTATE,{DIK_L})=1 then
AmiaLoadgame()
end if

if c_func(KEYBOARD_KEYSTATE,{DIK_Z})=1 then
text={
"Location=",
sprintf("%d", location)
}
end if

if c_func(KEYBOARD_KEYSTATE,{DIK_X})=1 then
text={
"exitall=",
sprintf("%d", exitall[2])
}
end if


--if gdi_textout(380,247,sprintf("%d", captured),c_func(MAKE_RGB,{255,255,255}),1) then exotica_abort(1) end if


   if surface_flip() then exotica_abort(1) end if

end if -- aActive end


   if exotica_error() then exotica_abort(1) Stop() ClosePlug(1) end if
     


      
end while

Stop() ClosePlug(1)
exotica_exit()