<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>&lt;undefined&gt;</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>-10000001</depth>
  <persistent>0</persistent>
  <parentName>parDeactivator</parentName>
  <maskName>&lt;undefined&gt;</maskName>
  <events>
    <event eventtype="0" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>//This object shows a list of the items in the store
//Everything else is done by the instance that called it

object = noone
shop_index = -1
shop_items = 0
bought = 0
num = 0
ok = 0

x = view_xview[0]+v_offset
y = view_yview[0]

for (var i=0; i&lt;10; i++)
{
    _y[i+1]=y+40+i*12;
}

cursor_y = _y[1];
cursor_image_index = 0;
cursor_timer = 0;

x1 = 0+v_offset
x2 = 23+v_offset
x3 = 46+v_offset
x4 = 69+v_offset
cursor_x2 = x1

with instance_create(view_xview,view_yview+176,objHealthBar) { pl = 1 }
with instance_create(view_xview,view_yview+176,objHealthBar) { pl = 2 }
with instance_create(view_xview,view_yview+176,objHealthBar) { pl = 3 }
with instance_create(view_xview,view_yview+176,objHealthBar) { pl = 4 }

alarm[0] = 1
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="1" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>with objAilmentsBubble { instance_destroy() }
with objHealthBar { instance_destroy() }
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="1">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>event_user(0)
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>ok = 1
shop_items = array_length_2d(global.shop, shop_index)
num = global.shop[shop_index,0]
alarm[1] = 1
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="3" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>///Keyboard controls
if ok {
    if keyboard_check_pressed(global.kb_q) {
        audio_play_sound(sndselect,0,0)    
        switch global.pl_count {
            case 0: 
            case 1:
                cursor_x2 = x1
                global.current_inv = 0
                break;
            case 2:
                if cursor_x2 = x1 { cursor_x2 = x2; global.current_inv = 1 }
                else { cursor_x2 = x1; global.current_inv = 0 }
                break;
            case 3:
                if cursor_x2 = x1 { cursor_x2 = x3; global.current_inv = 2 }
                else if cursor_x2 = x3 { cursor_x2 = x2; global.current_inv = 1 }
                else { cursor_x2 = x1; global.current_inv = 0 }
                break;
            case 4:
                if cursor_x2 = x1 { cursor_x2 = x4; global.current_inv = 3 }
                else if cursor_x2 = x2 { cursor_x2 = x1; global.current_inv = 0 }
                else if cursor_x2 = x3 { cursor_x2 = x2; global.current_inv = 1 }
                else if cursor_x2 = x4 { cursor_x2 = x3; global.current_inv = 2 }
                break;
        }
        event_user(0)
    } else if keyboard_check_pressed(global.kb_w) {
        audio_play_sound(sndselect,0,0)
        switch global.pl_count {
            case 0: 
            case 1:
                cursor_x2 = x1
                global.current_inv = 0
                break;
            case 2:
                if cursor_x2 = x1 { cursor_x2 = x2; global.current_inv = 1 }
                else { cursor_x2 = x1; global.current_inv = 0 }
                break;
            case 3:
                if cursor_x2 = x2 { cursor_x2 = x3; global.current_inv = 2 }
                else if cursor_x2 = x1 { cursor_x2 = x2; global.current_inv = 1 }
                else { cursor_x2 = x1; global.current_inv = 0 }
                break;
            case 4:
                if cursor_x2 = x3 { cursor_x2 = x4; global.current_inv = 3 }
                else if cursor_x2 = x4 { cursor_x2 = x1; global.current_inv = 0 }
                else if cursor_x2 = x1 { cursor_x2 = x2; global.current_inv = 1 }
                else if cursor_x2 = x2 { cursor_x2 = x3; global.current_inv = 2 }
                break;
        }
        event_user(0)
    } else if keyboard_check_pressed(global.kb_back) {
        object.happy = bought;
        global.current_inv = 0
        audio_play_sound(sndback,0,0)
        instance_destroy()
    } else if keyboard_check_pressed(global.kb_choose) {
        if num !=0 and global.pl_count != 0 {
            keyboard_clear(global.kb_choose)
            if (item_exists_at_slot(global.current_inv,19)) or (global.money &lt; global.item[num,19]) {
                audio_play_sound(snderror,0,0)
            } else {
                if add_item(num,global.current_inv) != -1 {
                    global.money -= global.item[num,19];
                    audio_play_sound(sndBuy,0,0)
                    bought = 1
                }
            }
        }
    } else if keyboard_check_pressed(vk_up) {
        audio_play_sound(sndselect2,0,0)
        if cursor_y = _y[1] {
            cursor_y = _y[10]
            if (shop_items &gt; 9) { num = global.shop[shop_index,9] } else { num = 0 }
        } else if cursor_y = _y[2] {
            cursor_y = _y[1]
            num = global.shop[shop_index,0]
        }
        else if cursor_y = _y[3]{
            cursor_y = _y[2]
            if (shop_items &gt; 1) { num = global.shop[shop_index,1] } else { num = 0 }
        }else if cursor_y = _y[4]{
            cursor_y = _y[3]
            if (shop_items &gt; 2) { num = global.shop[shop_index,2] } else { num = 0 }
        }else if cursor_y = _y[5]{
            cursor_y = _y[4]
            if (shop_items &gt; 3) { num = global.shop[shop_index,3] } else { num = 0 }
        }else if cursor_y = _y[6]{
            cursor_y = _y[5]
            if (shop_items &gt; 4) { num = global.shop[shop_index,4] } else { num = 0 }
        }else if cursor_y = _y[7]{
            cursor_y = _y[6]
            if (shop_items &gt; 5) { num = global.shop[shop_index,5] } else { num = 0 }
        }else if cursor_y = _y[8]{
            cursor_y = _y[7]
            if (shop_items &gt; 6) { num = global.shop[shop_index,6] } else { num = 0 }
        }else if cursor_y = _y[9]{
            cursor_y = _y[8]
            if (shop_items &gt; 7) { num = global.shop[shop_index,7] } else { num = 0 }
        }else if cursor_y = _y[10]{
            cursor_y = _y[9]
            if (shop_items &gt; 8) { num = global.shop[shop_index,8] } else { num = 0 }
        }
        event_user(0)
    } else if keyboard_check_pressed(vk_down) {
        audio_play_sound(sndselect2,0,0)
        if cursor_y = _y[1]{
            cursor_y = _y[2]
            if (shop_items &gt; 1) { num = global.shop[shop_index,1] } else { num = 0 }
        }else if cursor_y = _y[2]{
            cursor_y = _y[3]
            if (shop_items &gt; 2) { num = global.shop[shop_index,2] } else { num = 0 }
        }else if cursor_y = _y[3]{
            cursor_y = _y[4]
            if (shop_items &gt; 3) { num = global.shop[shop_index,3] } else { num = 0 }
        }else if cursor_y = _y[4]{
            cursor_y = _y[5]
            if (shop_items &gt; 4) { num = global.shop[shop_index,4] } else { num = 0 }
        }else if cursor_y = _y[5]{
            cursor_y = _y[6]
            if (shop_items &gt; 5) { num = global.shop[shop_index,5] } else { num = 0 }
        }else if cursor_y = _y[6]{
            cursor_y = _y[7]
            if (shop_items &gt; 6) { num = global.shop[shop_index,6] } else { num = 0 }
        }else if cursor_y = _y[7]{
            cursor_y = _y[8]
            if (shop_items &gt; 7) { num = global.shop[shop_index,7] } else { num = 0 }
        }else if cursor_y = _y[8]{
            cursor_y = _y[9]
            if (shop_items &gt; 8) { num = global.shop[shop_index,8] } else { num = 0 }
        }else if cursor_y = _y[9] {
            cursor_y = _y[10]
            if (shop_items &gt; 9) { num = global.shop[shop_index,9] } else { num = 0 }
        } else if cursor_y = _y[10] {
            cursor_y = _y[1]
            num = global.shop[shop_index,0]
        }
        event_user(0)
    }
}
</string>
          </argument>
        </arguments>
      </action>
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>cursor_timer +=0.25

if cursor_timer = 1
{
cursor_image_index +=1
cursor_timer = 0
}


</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="10">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>for (var i=1;i&lt;global.pl_count+1;i++) {
    with global.healthbar[i] { image_blend = c_white; alarm[2] = 0 } 
}

if global.item[num,4] &gt; 0 {
    for (var i=1;i&lt;global.pl_count+1;i++) {
        if global.item[num,5] = -1 or global.item[num,5] = i {
            if global.s_baseoff[i]+global.item[num,6] &gt; global.s_off[i]
            or global.s_basedef[i]+global.item[num,7] &gt; global.s_def[i] 
            or global.s_baseguts[i]+global.item[num,8] &gt; global.s_guts[i] 
            or global.s_basespeed[i]+global.item[num,9] &gt; global.s_speed[i] 
            or global.s_baseiq[i]+global.item[num,20] &gt; global.s_iq[i] 
            {
                with global.healthbar[i] { alarm[2] = room_speed/6 }
            }
        } else {
            with global.healthbar[i] { image_blend = c_gray; alarm[2] = 0 }
        }
    }
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="8" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>draw_set_alpha(1)
draw_set_font(global.thenfont2)
draw_set_color(c_white)

if ok {
    draw_window(x+160,view_yview+32,19,17)
    draw_window(x+8,view_yview+32,18,iff(global.item[num,21] &gt; 0 or global.item[num,22] &gt; 0,13,10))
    draw_window(x+8,view_yview+136,7,4)
    
    for (var i=0;i&lt;10;i++){
        if shop_items &gt; i {
            //Gray out items if no space left or not enough money
            if (item_exists_at_slot(global.current_inv,19)) or (global.money &lt; global.item[global.shop[shop_index,i],19]) {
                draw_set_color(make_color_rgb(100,100,100))
            } else {
                draw_set_color(c_white)
            }
        
            draw_set_halign(fa_left)
            draw_text(x+172,_y[i+1],global.item[global.shop[shop_index,i],1])
            draw_set_halign(fa_right)
            draw_text(x+300,_y[i+1],"$"+string(global.item[global.shop[shop_index,i],19]))
        }
    }

    draw_set_color(c_white)
    draw_set_halign(fa_left)
    draw_sprite(spr_cursor,cursor_image_index,x+169,cursor_y+8)
    draw_set_halign(fa_right)
    draw_text(x+56,view_yview+146,"$"+string(global.money))
    
    draw_set_halign(fa_left)
    draw_text_ext(x+20,y+41,"Offense"+"#"+"Defense"+"#"+"Speed"+"#"+"Guts"+"#"+"IQ#"+
                            iff(global.item[num,21] &gt; 0 or global.item[num,22] &gt; 0,"When consumed you recover#","")+
                            iff(global.item[num,21] &gt; 0,"      "+string(global.item[num,21])+" HP","")+
                            iff(global.item[num,22] &gt; 0,"      "+string(global.item[num,22])+" PP",""),12,500)
    draw_set_halign(fa_right)
    draw_text_ext(x+116,y+41,string(global.s_off[global.current_inv+1])+"#"+string(global.s_def[global.current_inv+1])+"#"+string(global.s_speed[global.current_inv+1])+"#"+string(global.s_guts[global.current_inv+1])+"#"+string(global.s_iq[global.current_inv+1]),12,100)
    draw_set_halign(fa_left)
    
    //If the player can equip the item
    //Awful code warning
    if global.item[num,5] = global.current_inv+1 or global.item[num,5] = -1 {
            draw_text_ext(x+117,y+41,iff(global.s_baseoff[global.current_inv+1]+global.item[num,6]+
                                         global.item[global.weap_equip[global.current_inv+1],6]+
                                         global.item[global.body_equip[global.current_inv+1],6]+
                                         global.item[global.arm_equip[global.current_inv+1],6]+
                                         global.item[global.other_equip[global.current_inv+1],6] &lt;=
                                         global.s_baseoff[global.current_inv+1]+
                                         global.item[global.weap_equip[global.current_inv+1],6]+
                                         global.item[global.body_equip[global.current_inv+1],6]+
                                         global.item[global.arm_equip[global.current_inv+1],6]+
                                         global.item[global.other_equip[global.current_inv+1],6] or global.weap_equip[global.current_inv+1] = num or global.body_equip[global.current_inv+1] = num or global.arm_equip[global.current_inv+1] = num or global.other_equip[global.current_inv+1] = num 
                                         ,"","`"+string(global.s_baseoff[global.current_inv+1]+global.item[num,6]+
                                             iff(global.item[num,4] = 1,0,global.item[global.weap_equip[global.current_inv+1],6])+
                                             iff(global.item[num,4] = 2,0,global.item[global.body_equip[global.current_inv+1],6])+
                                             iff(global.item[num,4] = 3,0,global.item[global.arm_equip[global.current_inv+1],6])+
                                             iff(global.item[num,4] = 4,0,global.item[global.other_equip[global.current_inv+1],6])))+
                                 iff(global.s_basedef[global.current_inv+1]+global.item[num,7]+
                                         global.item[global.weap_equip[global.current_inv+1],7]+
                                         global.item[global.body_equip[global.current_inv+1],7]+
                                         global.item[global.arm_equip[global.current_inv+1],7]+
                                         global.item[global.other_equip[global.current_inv+1],7] &lt;=
                                         global.s_basedef[global.current_inv+1]+
                                         global.item[global.weap_equip[global.current_inv+1],7]+
                                         global.item[global.body_equip[global.current_inv+1],7]+
                                         global.item[global.arm_equip[global.current_inv+1],7]+
                                         global.item[global.other_equip[global.current_inv+1],7] or global.weap_equip[global.current_inv+1] = num or global.body_equip[global.current_inv+1] = num or global.arm_equip[global.current_inv+1] = num or global.other_equip[global.current_inv+1] = num 
                                         ,"#","#`"+string(global.s_basedef[global.current_inv+1]+global.item[num,7]+
                                             iff(global.item[num,4] = 1,0,global.item[global.weap_equip[global.current_inv+1],7])+
                                             iff(global.item[num,4] = 2,0,global.item[global.body_equip[global.current_inv+1],7])+
                                             iff(global.item[num,4] = 3,0,global.item[global.arm_equip[global.current_inv+1],7])+
                                             iff(global.item[num,4] = 4,0,global.item[global.other_equip[global.current_inv+1],7])))+
                                 iff(global.s_basespeed[global.current_inv+1]+global.item[num,9]+
                                         global.item[global.weap_equip[global.current_inv+1],9]+
                                         global.item[global.body_equip[global.current_inv+1],9]+
                                         global.item[global.arm_equip[global.current_inv+1],9]+
                                         global.item[global.other_equip[global.current_inv+1],9] &lt;=
                                         global.s_basespeed[global.current_inv+1]+
                                         global.item[global.weap_equip[global.current_inv+1],9]+
                                         global.item[global.body_equip[global.current_inv+1],9]+
                                         global.item[global.arm_equip[global.current_inv+1],9]+
                                         global.item[global.other_equip[global.current_inv+1],9] or global.weap_equip[global.current_inv+1] = num or global.body_equip[global.current_inv+1] = num or global.arm_equip[global.current_inv+1] = num or global.other_equip[global.current_inv+1] = num 
                                         ,"#","#`"+string(global.s_basespeed[global.current_inv+1]+global.item[num,9]+
                                             iff(global.item[num,4] = 1,0,global.item[global.weap_equip[global.current_inv+1],9])+
                                             iff(global.item[num,4] = 2,0,global.item[global.body_equip[global.current_inv+1],9])+
                                             iff(global.item[num,4] = 3,0,global.item[global.arm_equip[global.current_inv+1],9])+
                                             iff(global.item[num,4] = 4,0,global.item[global.other_equip[global.current_inv+1],9])))+
                                 iff(global.s_baseguts[global.current_inv+1]+global.item[num,8]+
                                         global.item[global.weap_equip[global.current_inv+1],8]+
                                         global.item[global.body_equip[global.current_inv+1],8]+
                                         global.item[global.arm_equip[global.current_inv+1],8]+
                                         global.item[global.other_equip[global.current_inv+1],8] &lt;=
                                         global.s_baseguts[global.current_inv+1]+
                                         global.item[global.weap_equip[global.current_inv+1],8]+
                                         global.item[global.body_equip[global.current_inv+1],8]+
                                         global.item[global.arm_equip[global.current_inv+1],8]+
                                         global.item[global.other_equip[global.current_inv+1],8] or global.weap_equip[global.current_inv+1] = num or global.body_equip[global.current_inv+1] = num or global.arm_equip[global.current_inv+1] = num or global.other_equip[global.current_inv+1] = num 
                                         ,"#","#`"+string(global.s_baseguts[global.current_inv+1]+global.item[num,8]+
                                             iff(global.item[num,4] = 1,0,global.item[global.weap_equip[global.current_inv+1],8])+
                                             iff(global.item[num,4] = 2,0,global.item[global.body_equip[global.current_inv+1],8])+
                                             iff(global.item[num,4] = 3,0,global.item[global.arm_equip[global.current_inv+1],8])+
                                             iff(global.item[num,4] = 4,0,global.item[global.other_equip[global.current_inv+1],8])))+
                                 iff(global.s_baseiq[global.current_inv+1]+global.item[num,20]+
                                         global.item[global.weap_equip[global.current_inv+1],20]+
                                         global.item[global.body_equip[global.current_inv+1],20]+
                                         global.item[global.arm_equip[global.current_inv+1],20]+
                                         global.item[global.other_equip[global.current_inv+1],20] &lt;=
                                         global.s_baseiq[global.current_inv+1]+
                                         global.item[global.weap_equip[global.current_inv+1],20]+
                                         global.item[global.body_equip[global.current_inv+1],20]+
                                         global.item[global.arm_equip[global.current_inv+1],20]+
                                         global.item[global.other_equip[global.current_inv+1],20] or global.weap_equip[global.current_inv+1] = num or global.body_equip[global.current_inv+1] = num or global.arm_equip[global.current_inv+1] = num or global.other_equip[global.current_inv+1] = num 
                                         ,"#","#`"+string(global.s_baseiq[global.current_inv+1]+global.item[num,20]+
                                             iff(global.item[num,4] = 1,0,global.item[global.weap_equip[global.current_inv+1],20])+
                                             iff(global.item[num,4] = 2,0,global.item[global.body_equip[global.current_inv+1],20])+
                                             iff(global.item[num,4] = 3,0,global.item[global.arm_equip[global.current_inv+1],20])+
                                             iff(global.item[num,4] = 4,0,global.item[global.other_equip[global.current_inv+1],20])))
                                 ,12,100)
    }
    
    switch global.pl_count {
    case 0: 
        draw_sprite(sprPortraits,3,x+8,y+8);
        break;
    case 1:
        draw_sprite(sprPortraits,0,x+8,y+8);
        break;
    case 2:
        draw_sprite(sprPortraits,0,x+8,y+8);
        draw_sprite(sprPortraits,1,x+8+23,y+8);
        break;
    case 3:
        draw_sprite(sprPortraits,0,x+8,y+8);
        draw_sprite(sprPortraits,1,x+8+23,y+8);
        draw_sprite(sprPortraits,2,x+8+46,y+8);
        break;
    case 4:
        draw_sprite(sprPortraits,0,x+8,y+8);
        draw_sprite(sprPortraits,1,x+8+23,y+8);
        draw_sprite(sprPortraits,2,x+8+46,y+8);
        draw_sprite(sprPortraits,2,x+8+69,y+8);
        break;
    }
    
    draw_sprite(sprInvSel,0,view_xview+8+cursor_x2,y+8)
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
  </events>
  <PhysicsObject>0</PhysicsObject>
  <PhysicsObjectSensor>0</PhysicsObjectSensor>
  <PhysicsObjectShape>0</PhysicsObjectShape>
  <PhysicsObjectDensity>0.5</PhysicsObjectDensity>
  <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
  <PhysicsObjectGroup>0</PhysicsObjectGroup>
  <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
  <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
  <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
  <PhysicsObjectAwake>-1</PhysicsObjectAwake>
  <PhysicsObjectKinematic>0</PhysicsObjectKinematic>
  <PhysicsShapePoints/>
</object>
