-------------- card 31 --------------


On opencard 31
put random(10) into hotarusu
put 0 into grassopened
if game_on is not 1 then
wait 1 seconds
play nakani1
put 3 into ntx
naratoranimex
opengrass
wait 5 seconds
opengrass
play bokuwo
put 4 into ntx
naratoranimex

end if

end opencard


On hotar_come
if grassopened = 1 then
  opengrass
end if

if grassopened = 0 then
   play flicker
   hotaruflyin
    QuizDlg4 "Cuntas lucirnagas quedan detrs de la hierba?", hotarusu
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
        if math_answer is  -1 then
              play  uhoh2
        else
              play jawharp
          showwitch_surprised
          opengrass
          wait 5 seconds
          opengrass
        end if
       else
           play good
           show_frog_good
          opengrass
          wait 5 seconds
          opengrass
 
      end if

end if

End hotar_come



On opengrass

if grassopened = 0 then
     lock screen
     hide  btn 15
     repeat with xxx = 2 to 11
       hide btn %xxx%
     end repeat
     repeat with xxx = 2 to 2 + hotarusu -1
          show btn %xxx%
     end repeat
       unlock screen
     put 1 into grassopened

else

     lock screen
      show btn 15
      unlock screen
     put 0 into grassopened
  end if
end opengrass

on hotaruflyin
if grassopened = 1 then 
  exit hotaruflyin
end if
if hotarusu = 10 then
  hotaruflyout
  exit hotaruflyin
end if
 put random(10) into targethotarusu
 if targethotarusu + hotarusu  > 10 then
    put random( 10 - hotarusu) into targethotarusu
 end if

repeat targethotarusu times
  hotaruflyin1time
end repeat
end hotaruflyin

 
on hotaruflyout
if grassopened = 1 then 
  exit hotaruflyout
end if
if hotarusu = 0 then
  hotarflyin
  exit hotaruflyout
end if
 put random(hotarusu) into targethotarusu

repeat targethotarusu times
  hotaruflyout1time
end repeat
end hotaruflyout






on hotaruflyin1time
if grassopened = 1 then
  exit hotaruflyin1time
end if
set the loc of btn hotarfly to 581,169
set bitmap of btn hotarfly to hotarfly
show btn hotarfly
wait 10 ticks
set the loc of btn hotarfly to 455,312 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 407, 208 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 310,260 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 263,313 + random(10)
wait 10 ticks
hide btn hotarfly
put hotarusu + 1 into hotarusu
end hotaruflyin1time

on hotaruflyout1time
if grassopened = 1 then
  exit hotaruflyout1time
end if
set the loc of btn hotarfly to 263,313 + random(10)
set bitmap of btn hotarfly to hotarflr
show btn hotarfly
wait 10 ticks
set the loc of btn hotarfly to 310,260 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 407, 208 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 455,312 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 581,169
wait 10 ticks
hide btn hotarfly
put hotarusu - 1 into hotarusu
end hotaruflyout1time






-------------- end card 31 ---------

