<!--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>psimode = 0 // 0 - OFF, 1 - RECOVER, 2 - ASSIST, 3 - PASSIVE
mode = 0 // 0 - If PSI user: Selecting off, rec, ass, pas skills 
         //     If non PSI user: Browsing skills
         // 1 - Browsing PSI
         // 2 - Selecting player
lifeup = 0
global.current_inv = 0
num = 1
use = 1
ok = 0
type = 0 // 0- Lifeup; 1- Healing

x = view_xview+v_offset

//Mode 0
_x[1]=84
//Mode 1
_x[2]=144
_x[3]=204+22
_x[4]=220+22
_x[5]=236+22
_x[6]=252+22
//Mode 2

//Mode 0 &amp; 1
_y[1]=7+32
_y[2]=21+32
_y[3]=35+32
_y[4]=49+32
_y[5]=63+32
//Mode 2

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

cursor_x  = _x[1]
cursor_y  = _y[1]
cursor_x2 = x1
cursor_image_index = 0
cursor_timer = 0

message = ""

event_user(0)

alarm[0] = 1
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="11">
      <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>///Lifeup all characters

if use &lt; global.pl_count+1 {
    if global.dead[use] {
        use++;
        alarm[11] = 1;
        exit;
    }
    if (lifeup+global.s_hp[use]) &gt; global.s_hpmax[use] {
        lifeup = global.s_hpmax[use]-global.s_hp[use];
    }
    
    if global.s_hp[use] &gt;= 0 {
        global.s_hp[use] += lifeup
    } else {
        if lifeup &gt; global.s_hpmax[use] {
            global.s_hp[use] = global.s_hpmax[use]
        } else {
            global.s_hp[use] = lifeup
        }
    }
    
    if lifeup &gt; 0 {
        if global.s_hp[use] = global.s_hpmax[use] {
            message = "@ " + global.s_name[use] + "'s HP are#   maxed out!"
        } else {
            message = "@ " + global.s_name[use] + " recovered#   " + string(lifeup) + " HP!"
        }
        audio_play_sound(sndheal1,0,0)
    } else {
        message = "@ It had no effect on "+global.s_name[use]+"!"
    }
    
    use++;
    alarm[11] = 60;
} else {
    alarm[9] = 60;
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" 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>///Lifeup or heal one character

alarm[9] = 60

if type = 0 {
    if !global.dead[use] {
        if (lifeup+global.s_hp[use]) &gt; global.s_hpmax[use] {
            lifeup = global.s_hpmax[use]-global.s_hp[use];
        }
        
        if global.s_hp[use] &gt;= 0 {
            global.s_hp[use] += lifeup
        } else {
            if lifeup &gt; global.s_hpmax[use] {
                global.s_hp[use] = global.s_hpmax[use]
            } else {
                global.s_hp[use] = lifeup
            }
        }
    } else {
        lifeup = 0
    }
    
    if lifeup &gt; 0 {
        if global.s_hp[use] = global.s_hpmax[use] {
            message = "@ " + global.s_name[use] + "'s HP are#   maxed out!"
        } else {
            message = "@ " + global.s_name[use] + " recovered#   " + string(lifeup) + " HP!"
        }
        audio_play_sound(sndheal1,0,0)
    } else {
        message = "@ It had no effect on "+global.s_name[use]+"!"
    }
} else {

    var msg, list, ailment, failed;
    ailment = ""
    msg = ""
    failed = 0
    list = ds_list_create();
    
    switch skillact[num] {
        case "healing_a":
            if !global.dead[use] {
                if global.s_crying[use] { ds_list_add(list,"crying"); }
                if global.s_asleep[use] { ds_list_add(list,"asleep"); }
            } else {
                failed = 1
            }
            break;
        case "healing_b":
            if !global.dead[use] {
                if global.s_crying[use]   { ds_list_add(list,"crying"); }
                if global.s_asleep[use]   { ds_list_add(list,"asleep"); }
                if global.s_poison[use]   { ds_list_add(list,"poison"); }
                if global.s_infected[use] { ds_list_add(list,"infected"); }
                if global.s_strange[use]  { ds_list_add(list,"strange");  }
            } else {
                failed = 1
            }
            break;
        case "healing_g":
        case "healing_o":
            if !global.dead[use] {
                if global.s_crying[use]   { ds_list_add(list,"crying"); }
                if global.s_asleep[use]   { ds_list_add(list,"asleep"); }
                if global.s_poison[use]   { ds_list_add(list,"poison"); }
                if global.s_infected[use] { ds_list_add(list,"infected"); }
                if global.s_strange[use]  { ds_list_add(list,"strange");  }
                if global.s_shocked[use]  { ds_list_add(list,"shocked");  }
                if global.s_numb[use]  { ds_list_add(list,"numb");  }
            } else {
                ailment = "death"
            }
            break;
    }
    
    ds_list_shuffle(list);
    if !ds_list_empty(list) {ailment = ds_list_find_value(list, 0);}
    ds_list_destroy(list);
    
    if ailment = "death" and skillact[num] = "healing_g" {
        failed = (random(4) &lt; 1)
    }
    
    if ailment != "" and !failed {
        switch ailment {
            case "crying":
                global.s_crying[use] = 0
                msg = global.s_name[use] + " finally stopped crying!"
                break
            case "asleep":
                global.s_asleep[use] = 0
                msg = global.s_name[use] + " woke up!"
                break;
            case "poison":
                global.s_poison[use] = 0
                msg = "The poison was removed from#   " + global.s_name[use] + "'s body!"
                break;
            case "infected":
                global.s_infected[use] = 0
                msg = "The "+choose("biohazard","infection","infectious agent","pathogen")+" was removed from#   " + global.s_name[use] + "'s body!"
                break;
            case "strange":
                global.s_strange[use] = 0
                msg = global.s_name[use] + " stopped feeling strange!"
                break;
            case "shocked":
                global.s_shocked[use] = 0
                msg = global.s_name[use] + " got over the shock!"
                break;
            case "numb":
                global.s_shocked[use] = 0
                msg = "The "+choose("numbness","paralysis")+" faded from#   "+global.s_name[use] + "'s body!"
                break;  
            case "death":
                global.dead[use] = 0
                msg = global.s_name[use] + choose(" was revived!"," is back!")
                if type = 2 {
                    global.s_hp[use] = ceil(global.s_hpmax[use]/2)
                } else {
                    global.s_hp[use] = global.s_hpmax[use]
                }
                break;
        }
        message = "@ " + msg
        audio_play_sound(sndheal2,0,0)
    } else {
        message = "@ It had no effect on "+global.s_name[use] + "!";
    }

}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="9">
      <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>mode = 1
cursor_x = _x[3]
cursor_y = _y[1]
ok = 1
use = 1
type = 0
message = ""
</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;
</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) {
        if mode !=2 {
            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;
            }
            mode = 0
            psimode = 0
            cursor_x = _x[1]
            cursor_y = _y[1]
            event_user(0)
        }
    } else if keyboard_check_pressed(global.kb_w) {
        if mode !=2 {
            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;
            }
            mode = 0
            psimode = 0
            cursor_x = _x[1]
            cursor_y = _y[1]
            event_user(0)
        }
    } else if keyboard_check_pressed(global.kb_back) {
        audio_play_sound(sndback,0,0)
        if mode = 0 {
            with objInGameMenu {alarm[0] = 1}
            global.current_inv = 0
            audio_play_sound(sndback,0,0)
            instance_destroy()
        } else if mode = 1 {
            mode = 0
            cursor_x = _x[1]
            if global.psiuser[global.current_inv+1] {
                cursor_y = _y[psimode+1]
            } else {
                cursor_y = _y[(psimode == 3)+1]
            }
        } else {
            mode = 1
            cursor_x = _x[3]
            cursor_y = _y[1]
        }
    } else if keyboard_check_pressed(global.kb_choose) {
        if num !=0 {
            if mode = 0 {
                ok = 0
                alarm[0] = 1
                mode = 1
                if global.psiuser[global.current_inv+1] or psimode = 3 {
                    cursor_x = _x[3]
                    cursor_y = _y[1]
                } else {
                    cursor_x = _x[1]+64
                    cursor_y = _y[1]
                }
                
                audio_play_sound(sndchoose,0,0)
            } else if mode = 1 and global.psiuser[global.current_inv+1] {
                if skillcost[num] &lt;= global.s_pp[global.current_inv+1] and skillname[num] != "" and skilllearnt[num] and !global.dead[global.current_inv+1]
                and skillact[num] = "lifeup_a" or skillact[num] = "lifeup_b" or skillact[num] = "lifeup_g" or skillact[num] = "lifeup_o" or skillact[num] = "healing_a" or skillact[num] = "healing_b" or skillact[num] = "healing_g" or skillact[num] = "healing_o" {
                    //act[objBattleController._turn] = skillact[num];
                    //global.remove_pp[objBattleController._turn] = skillcost[num];
                    audio_play_sound(sndchoose,0,0)
                    if skilltarget[num] = 0 {
                        if skillact[num] = "lifeup_a" { lifeup = lifeup_effect(0) ; type = 0 }
                        else if skillact[num] = "lifeup_b" { lifeup = lifeup_effect(1); type = 0 }
                        else if skillact[num] = "lifeup_g" { lifeup = lifeup_effect(2); type = 0 }
                        else if skillact[num] = "healing_a" or skillact[num] = "healing_b" or skillact[num] = "healing_g" or skillact[num] = "healing_o" { type = 1 }
                        ok = 0
                        alarm[0] = 1
                        cursor_x = _x[3]
                        cursor_y = _y[1]
                        mode = 2
                    } else if skilltarget[num] = 1 {
                        global.s_pp[global.current_inv+1] -= skillcost[num]
                        if skillact[num] = "lifeup_o" { lifeup = lifeup_effect(3)}
                        ok = 0
                        audio_play_sound(sndppsi,0,0)
                        message = "@ " + global.s_name[global.current_inv+1] + " tried#   "+skillname[num]+" "+skillletter[num]+"!"
                        alarm[11] = 40
                    }
                } else {
                    audio_play_sound(snderror,0,0)
                }
            } else {
                if global.psiuser[global.current_inv+1] {
                    if cursor_y = _y[1] {
                        use = 1;
                    } else if cursor_y = _y[2] {
                        use = 2;
                    } else if cursor_y = _y[3] {
                        use = 3;
                    } else if cursor_y = _y[4] {
                        use = 4;
                    }
                    global.s_pp[global.current_inv+1] -= skillcost[num]
                    audio_play_sound(sndppsi,0,0)
                    message = "@ " + global.s_name[global.current_inv+1] + " tried#   "+skillname[num]+" "+skillletter[num]+"!"
                    ok = 0
                    alarm[10] = 40
                }
            }
        }
    } else if keyboard_check_pressed(vk_left) {
        audio_play_sound(sndselect,0,0)
        if mode = 1 {
            if global.psiuser[global.current_inv+1] or psimode = 3 {
                if cursor_x = _x[4] {
                    cursor_x = _x[3]
                } else if cursor_x = _x[5] {
                    cursor_x = _x[4]
                } else if cursor_x = _x[6] {
                    cursor_x = _x[5]
                } else if cursor_x = _x[3] {
                    cursor_x = _x[6]
                }
            } else {
                if cursor_x = _x[1]+64 {
                    cursor_x = _x[2]+72
                } else {
                    cursor_x = _x[1]+64
                }
            }
        }
    } else if keyboard_check_pressed(vk_up) {
        audio_play_sound(sndselect2,0,0)
        if mode = 0 {
            if global.psiuser[global.current_inv+1] {
                if cursor_y = _y[1] {
                    cursor_y = _y[4]; psimode = 3;
                } else if cursor_y = _y[2] {
                    cursor_y = _y[1]; psimode = 0; 
                } else if cursor_y = _y[3] {
                    cursor_y = _y[2]; psimode = 1;
                } else if cursor_y = _y[4] {
                    cursor_y = _y[3]; psimode = 2;
                }
            } else {
                if cursor_y = _y[1] {
                    cursor_y = _y[2]; psimode = 3;
                } else if cursor_y = _y[2] {
                    cursor_y = _y[1]; psimode = 0; 
                } 
            }
        } else if mode = 1 {
            if global.psiuser[global.current_inv+1] or psimode = 3 {
                if cursor_y = _y[1] {
                    cursor_y = _y[4];
                } else if cursor_y = _y[2] {
                    cursor_y = _y[1];
                } else if cursor_y = _y[3] {
                    cursor_y = _y[2];
                } else if cursor_y = _y[4] {
                    cursor_y = _y[3];
                }
            } else {
                if cursor_y = _y[1] {
                    cursor_y = _y[5];
                } else if cursor_y = _y[2] {
                    cursor_y = _y[1];
                } else if cursor_y = _y[3] {
                    cursor_y = _y[2];
                } else if cursor_y = _y[4] {
                    cursor_y = _y[3];
                } else if cursor_y = _y[5] {
                    cursor_y = _y[4];
                }
            }
        } else {
            switch global.pl_count {
                case 2:
                    if cursor_y = _y[1] {
                        cursor_y = _y[2];
                    } else if cursor_y = _y[2] {
                        cursor_y = _y[1];
                    }
                    break;
                case 3:
                    if cursor_y = _y[1] {
                        cursor_y = _y[3];
                    } else if cursor_y = _y[2] {
                        cursor_y = _y[1];
                    } else if cursor_y = _y[3] {
                        cursor_y = _y[2];
                    }
                    break;
                case 4:
                    if cursor_y = _y[1] {
                        cursor_y = _y[4];
                    } else if cursor_y = _y[2] {
                        cursor_y = _y[1];
                    } else if cursor_y = _y[3] {
                        cursor_y = _y[2];
                    } else if cursor_y = _y[4] {
                        cursor_y = _y[3];
                    }
                    break;
            }
        }
    } else if keyboard_check_pressed(vk_right) {
        audio_play_sound(sndselect,0,0)
        if mode = 1 {
            if global.psiuser[global.current_inv+1] or psimode = 3 {
                if cursor_x = _x[3] {
                    cursor_x = _x[4]
                } else if cursor_x = _x[4] {
                    cursor_x = _x[5]
                } else if cursor_x = _x[5] {
                    cursor_x = _x[6]
                } else if cursor_x = _x[6] {
                    cursor_x = _x[3]
                }
            } else {
                if cursor_x = _x[1]+64 {
                    cursor_x = _x[2]+72
                } else {
                    cursor_x = _x[1]+64
                }
            }
        } 
    } else if keyboard_check_pressed(vk_down) {
        audio_play_sound(sndselect2,0,0)
        if mode = 0 {
            if global.psiuser[global.current_inv+1] {
                if cursor_y = _y[1] {
                    cursor_y = _y[2]; psimode = 1;
                } else if cursor_y = _y[2] {
                    cursor_y = _y[3]; psimode = 2;
                } else if cursor_y = _y[3] {
                    cursor_y = _y[4]; psimode = 3;
                } else if cursor_y = _y[4] {
                    cursor_y = _y[1]; psimode = 0;
                }
            } else {
                if cursor_y = _y[1] {
                    cursor_y = _y[2]; psimode = 3;
                } else if cursor_y = _y[2] {
                    cursor_y = _y[1]; psimode = 0;
                }
            }
        } else if mode = 1 {
            if global.psiuser[global.current_inv+1] or psimode = 3{
                if cursor_y = _y[1] {
                    cursor_y = _y[2];
                } else if cursor_y = _y[2] {
                    cursor_y = _y[3];
                } else if cursor_y = _y[3] {
                    cursor_y = _y[4];
                } else if cursor_y = _y[4] {
                    cursor_y = _y[1];
                }
            } else {
                if cursor_y = _y[1] {
                    cursor_y = _y[2];
                } else if cursor_y = _y[2] {
                    cursor_y = _y[3];
                } else if cursor_y = _y[3] {
                    cursor_y = _y[4];
                } else if cursor_y = _y[4] {
                    cursor_y = _y[5];
                } else if cursor_y = _y[5] {
                    cursor_y = _y[1];
                }
            }
        } else {
            switch global.pl_count {
                case 2:
                    if cursor_y = _y[1] {
                        cursor_y = _y[2];
                    } else if cursor_y = _y[2] {
                        cursor_y = _y[1];
                    }
                    break;
                case 3:
                    if cursor_y = _y[1] {
                        cursor_y = _y[2];
                    } else if cursor_y = _y[2] {
                        cursor_y = _y[3];
                    } else if cursor_y = _y[3] {
                        cursor_y = _y[1];
                    }
                    break;
                case 4:
                    if cursor_y = _y[1] {
                        cursor_y = _y[2];
                    } else if cursor_y = _y[2] {
                        cursor_y = _y[3];
                    } else if cursor_y = _y[3] {
                        cursor_y = _y[4];
                    } else if cursor_y = _y[4] {
                        cursor_y = _y[1];
                    }
                    break;
            }
        }
    }
}
</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>
      <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>if mode = 1 {
    if global.psiuser[global.current_inv+1] {
        if cursor_x = _x[3] {
                num = 1+16*psimode+4*(cursor_y = _y[2])+8*(cursor_y = _y[3])+12*(cursor_y = _y[4]);
        } else if cursor_x = _x[4] {
                num = 2+16*psimode+4*(cursor_y = _y[2])+8*(cursor_y = _y[3])+12*(cursor_y = _y[4]);
        } else if cursor_x = _x[5] {
                num = 3+16*psimode+4*(cursor_y = _y[2])+8*(cursor_y = _y[3])+12*(cursor_y = _y[4]);
        } else if cursor_x = _x[6] {
                num = 4+16*psimode+4*(cursor_y = _y[2])+8*(cursor_y = _y[3])+12*(cursor_y = _y[4]);
        }
    } else {
        if cursor_x = _x[1]+64 {
            if cursor_y = _y[1] { num = 1 }
            else if cursor_y = _y[2] { num = 3 }
            else if cursor_y = _y[3] { num = 5 }
            else if cursor_y = _y[4] { num = 7 }
            else if cursor_y = _y[5] { num = 9 }
        } else {
            if cursor_y = _y[1] { num = 2 }
            else if cursor_y = _y[2] { num = 4 }
            else if cursor_y = _y[3] { num = 6 }
            else if cursor_y = _y[4] { num = 8 }
            else if cursor_y = _y[5] { num = 10 }
        }
    }
} 


</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;=64; i++) {
    skillname[i] = global.skill[global.s_skill[global.current_inv+1,i],0]
    skillact[i] = global.skill[global.s_skill[global.current_inv+1,i],1]
    skillcost[i] = global.skill[global.s_skill[global.current_inv+1,i],2]
    skilltarget[i] = global.skill[global.s_skill[global.current_inv+1,i],3]
    skilldesc[i] = global.skill[global.s_skill[global.current_inv+1,i],4]
    skillletter[i] = global.skill[global.s_skill[global.current_inv+1,i],5]
    skilllearnt[i] = global.s_skill_learnt[global.current_inv+1,i]
}
</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.thenfont)
draw_set_halign(fa_left)
draw_set_color(c_white)

if global.psiuser[global.current_inv+1] {
    draw_window(x+72,y+32,8,9)
    draw_window(x+136,y+32,19,9)
    draw_text(x+_x[1],y+_y[1],"Offense")
    draw_text(x+_x[1],y+_y[2],"Assist")
    draw_text(x+_x[1],y+_y[3],"Recover")
    draw_text(x+_x[1],y+_y[4],"Passive")
    
    if skilllearnt[1+16*psimode]  or skilllearnt[2+16*psimode]  or skilllearnt[3+16*psimode]  or skilllearnt[4+16*psimode]  { draw_text(x+_x[2],y+_y[1],skillname[1+16*psimode])  }
    if skilllearnt[5+16*psimode]  or skilllearnt[6+16*psimode]  or skilllearnt[7+16*psimode]  or skilllearnt[8+16*psimode]  { draw_text(x+_x[2],y+_y[2],skillname[5+16*psimode])  }
    if skilllearnt[9+16*psimode]  or skilllearnt[10+16*psimode] or skilllearnt[11+16*psimode] or skilllearnt[12+16*psimode] { draw_text(x+_x[2],y+_y[3],skillname[9+16*psimode])  }
    if skilllearnt[13+16*psimode] or skilllearnt[14+16*psimode] or skilllearnt[15+16*psimode] or skilllearnt[16+16*psimode] { draw_text(x+_x[2],y+_y[4],skillname[13+16*psimode]) }
    
    if skilllearnt[1+16*psimode] { draw_text(x+_x[3],y+_y[1],skillletter[1+16*psimode]) }
    if skilllearnt[5+16*psimode] { draw_text(x+_x[3],y+_y[2],skillletter[5+16*psimode]) }
    if skilllearnt[9+16*psimode] { draw_text(x+_x[3],y+_y[3],skillletter[9+16*psimode]) }
    if skilllearnt[13+16*psimode] { draw_text(x+_x[3],y+_y[4],skillletter[13+16*psimode]) }
    
    if skilllearnt[2+16*psimode] { draw_text(x+_x[4],y+_y[1],skillletter[2+16*psimode]) } 
    if skilllearnt[6+16*psimode] { draw_text(x+_x[4],y+_y[2],skillletter[6+16*psimode]) }
    if skilllearnt[10+16*psimode] { draw_text(x+_x[4],y+_y[3],skillletter[10+16*psimode]) }
    if skilllearnt[14+16*psimode] { draw_text(x+_x[4],y+_y[4],skillletter[14+16*psimode]) }
    
    if skilllearnt[3+16*psimode] { draw_text(x+_x[5],y+_y[1],skillletter[3+16*psimode]) }
    if skilllearnt[7+16*psimode] { draw_text(x+_x[5],y+_y[2],skillletter[7+16*psimode]) }
    if skilllearnt[11+16*psimode] { draw_text(x+_x[5],y+_y[3],skillletter[11+16*psimode]) }
    if skilllearnt[15+16*psimode] { draw_text(x+_x[5],y+_y[4],skillletter[15+16*psimode]) }
    
    if skilllearnt[4+16*psimode] { draw_text(x+_x[6],y+_y[1],skillletter[4+16*psimode]) }
    if skilllearnt[8+16*psimode] { draw_text(x+_x[6],y+_y[2],skillletter[8+16*psimode]) }
    if skilllearnt[12+16*psimode] { draw_text(x+_x[6],y+_y[3],skillletter[12+16*psimode]) }
    if skilllearnt[16+16*psimode] { draw_text(x+_x[6],y+_y[4],skillletter[16+16*psimode]) }
    
    if mode &gt; 0 and skillname[num] !="" and skilllearnt[num] {
        if psimode != 3 {
            draw_window(x+56,y+56,10,6)
            if skilltarget[num] = 0 {
                draw_text(x+64,y+_y[3],"To one of us")
            } else if skilltarget[num] = 1 {
                draw_text(x+64,y+_y[3],"To all of us")
            } else if skilltarget[num] = 2 {
                draw_text(x+64,y+_y[3],"To one enemy")
            } else if skilltarget[num] = 3 {
                draw_text(x+64,y+_y[3],"To all enemies")
            }
            draw_text(x+64,y+_y[4],"PP Cost: "+string(skillcost[num]))
        }
        draw_window(x+72,y+104,27,7)
        
        if message = "" {
            draw_text(x+_x[1],y+112,skilldesc[num])
        } else {
            draw_text(x+_x[1],y+112,message)
        }
    }
} else {
    draw_window(x+72,y+32,8,5)
    if psimode = 0 {
        draw_window(x+136,y+32,19,11)
    } else {
        draw_window(x+136,y+32,19,9)
    }
    
    draw_text(x+_x[1],y+_y[1],"Normal")
    draw_text(x+_x[1],y+_y[2],"Passive")
    
    if psimode = 0 {
        if skilllearnt[1] { draw_text(x+_x[1]+64,y+_y[1],skillname[1]) }
        if skilllearnt[2] { draw_text(x+_x[2]+72,y+_y[1],skillname[2]) }
        if skilllearnt[3] { draw_text(x+_x[1]+64,y+_y[2],skillname[3]) }
        if skilllearnt[4] { draw_text(x+_x[2]+72,y+_y[2],skillname[4]) }
        if skilllearnt[5] { draw_text(x+_x[1]+64,y+_y[3],skillname[5]) }
        if skilllearnt[6] { draw_text(x+_x[2]+72,y+_y[3],skillname[6]) }
        if skilllearnt[7] { draw_text(x+_x[1]+64,y+_y[4],skillname[7]) }
        if skilllearnt[8] { draw_text(x+_x[2]+72,y+_y[4],skillname[8]) }
        if skilllearnt[9] { draw_text(x+_x[1]+64,y+_y[5],skillname[9]) }
        if skilllearnt[10] { draw_text(x+_x[2]+72,y+_y[5],skillname[10]) }
    } else {
        if skilllearnt[1+16*psimode]  or skilllearnt[2+16*psimode]  or skilllearnt[3+16*psimode]  or skilllearnt[4+16*psimode]  { draw_text(x+_x[2],y+_y[1],skillname[1+16*psimode])  }
        if skilllearnt[5+16*psimode]  or skilllearnt[6+16*psimode]  or skilllearnt[7+16*psimode]  or skilllearnt[8+16*psimode]  { draw_text(x+_x[2],y+_y[2],skillname[5+16*psimode])  }
        if skilllearnt[9+16*psimode]  or skilllearnt[10+16*psimode] or skilllearnt[11+16*psimode] or skilllearnt[12+16*psimode] { draw_text(x+_x[2],y+_y[3],skillname[9+16*psimode])  }
        if skilllearnt[13+16*psimode] or skilllearnt[14+16*psimode] or skilllearnt[15+16*psimode] or skilllearnt[16+16*psimode] { draw_text(x+_x[2],y+_y[4],skillname[13+16*psimode]) }
        
        if skilllearnt[1+16*psimode] { draw_text(x+_x[3],y+_y[1],skillletter[1+16*psimode]) }
        if skilllearnt[5+16*psimode] { draw_text(x+_x[3],y+_y[2],skillletter[5+16*psimode]) }
        if skilllearnt[9+16*psimode] { draw_text(x+_x[3],y+_y[3],skillletter[9+16*psimode]) }
        if skilllearnt[13+16*psimode] { draw_text(x+_x[3],y+_y[4],skillletter[13+16*psimode]) }
        
        if skilllearnt[2+16*psimode] { draw_text(x+_x[4],y+_y[1],skillletter[2+16*psimode]) } 
        if skilllearnt[6+16*psimode] { draw_text(x+_x[4],y+_y[2],skillletter[6+16*psimode]) }
        if skilllearnt[10+16*psimode] { draw_text(x+_x[4],y+_y[3],skillletter[10+16*psimode]) }
        if skilllearnt[14+16*psimode] { draw_text(x+_x[4],y+_y[4],skillletter[14+16*psimode]) }
        
        if skilllearnt[3+16*psimode] { draw_text(x+_x[5],y+_y[1],skillletter[3+16*psimode]) }
        if skilllearnt[7+16*psimode] { draw_text(x+_x[5],y+_y[2],skillletter[7+16*psimode]) }
        if skilllearnt[11+16*psimode] { draw_text(x+_x[5],y+_y[3],skillletter[11+16*psimode]) }
        if skilllearnt[15+16*psimode] { draw_text(x+_x[5],y+_y[4],skillletter[15+16*psimode]) }
        
        if skilllearnt[4+16*psimode] { draw_text(x+_x[6],y+_y[1],skillletter[4+16*psimode]) }
        if skilllearnt[8+16*psimode] { draw_text(x+_x[6],y+_y[2],skillletter[8+16*psimode]) }
        if skilllearnt[12+16*psimode] { draw_text(x+_x[6],y+_y[3],skillletter[12+16*psimode]) }
        if skilllearnt[16+16*psimode] { draw_text(x+_x[6],y+_y[4],skillletter[16+16*psimode]) }
    }
    
    if mode = 1 {
        if skilllearnt[num] {
            //draw_window(x+56,y+56,10,6)
            if psimode = 0 {
                draw_window(x+72,y+120,27,7)
                draw_text(x+_x[1],y+127,skilldesc[num])
            } else {
                draw_window(x+72,y+104,27,7)
                draw_text(x+_x[1],y+112,skilldesc[num])
            }
            /*if skilltarget[num] = 0 {
                draw_text(x+64,y+_y[3],"To one of us")
            } else if skilltarget[num] = 1 {
                draw_text(x+64,y+_y[3],"To all of us")
            } else if skilltarget[num] = 2 {
                draw_text(x+64,y+_y[3],"To one enemy")
            } else if skilltarget[num] = 3 {
                draw_text(x+64,y+_y[3],"To all enemies")
            }
            draw_text(x+64,y+_y[4],"PP Cost: "+string(skillcost[num]))
            draw_text(x+_x[1],y+126,skilldesc[num])*/
        }
    }
}

if mode == 2 {
    draw_window(x+216,y+32,9,8)
    switch global.pl_count {
        case 1:
            draw_text(x+_x[3],y+_y[1],global.s_name[1])
            break;
        case 2:
            draw_text(x+_x[3],y+_y[1],global.s_name[1])
            draw_text(x+_x[3],y+_y[2],global.s_name[2])
            break;
        case 3:
            draw_text(x+_x[3],y+_y[1],global.s_name[1])
            draw_text(x+_x[3],y+_y[2],global.s_name[2])
            draw_text(x+_x[3],y+_y[3],global.s_name[3])
            break;
        case 4:
            draw_text(x+_x[3],y+_y[1],global.s_name[1])
            draw_text(x+_x[3],y+_y[2],global.s_name[2])
            draw_text(x+_x[3],y+_y[3],global.s_name[3])
            draw_text(x+_x[3],y+_y[4],global.s_name[4])
            break;
    }
}

draw_sprite(spr_cursor,cursor_image_index,x+cursor_x-3,y+cursor_y+8)

switch global.pl_count {
    case 0: 
        draw_sprite(sprPortraits,3,x+72,y+8);
        break;
    case 1:
        draw_sprite(sprPortraits,0,x+72,y+8);
        break;
    case 2:
        draw_sprite(sprPortraits,0,x+72,y+8);
        draw_sprite(sprPortraits,1,x+72+23,y+8);
        break;
    case 3:
        draw_sprite(sprPortraits,0,x+72,y+8);
        draw_sprite(sprPortraits,1,x+72+23,y+8);
        draw_sprite(sprPortraits,2,x+72+46,y+8);
        break;
    case 4:
        draw_sprite(sprPortraits,0,x+72,y+8);
        draw_sprite(sprPortraits,1,x+72+23,y+8);
        draw_sprite(sprPortraits,2,x+72+46,y+8);
        draw_sprite(sprPortraits,2,x+72+69,y+8);
        break;
}

draw_sprite(sprInvSel,0,view_xview+72+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>
    <point>0,0</point>
    <point>144,144</point>
  </PhysicsShapePoints>
</object>
