| 1 | if (live_call()) | 
    
    
        | 2 |     return global.live_result; | 
    
    
        | 3 | if (message_current > (array_length_1d(prt) - 1) || prt[message_current] == 0) | 
    
    
        | 4 |     portrait = false; | 
    
    
        | 5 | else | 
    
    
        | 6 |     portrait = true; | 
    
    
        | 7 | if (position == 0) | 
    
    
        | 8 |     yy = 160; | 
    
    
        | 9 | else | 
    
    
        | 10 |     yy = 5; | 
    
    
        | 11 | var xx = 30; | 
    
    
        | 12 | if (portrait == true) | 
    
    
        | 13 |     xx = 88; | 
    
    
        | 14 | var portrait_xx = 52; | 
    
    
        | 15 | var line_sep = 18; | 
    
    
        | 16 | draw_set_font(dialogue_font); | 
    
    
        | 17 | draw_set_color(c_white); | 
    
    
        | 18 | draw_set_halign(fa_left); | 
    
    
        | 19 | message_actual = string_copy(message[message_current], 0, cutoff); | 
    
    
        | 20 | if (portrait == true) | 
    
    
        | 21 | { | 
    
    
        | 22 |     var prt_animate; | 
    
    
        | 23 |     if (cutoff < string_length(message[message_current]) && portrait_can_animate == true) | 
    
    
        | 24 |         prt_animate = -1; | 
    
    
        | 25 |     else | 
    
    
        | 26 |         prt_animate = 0; | 
    
    
        | 27 |     var portrait_y_disjoint = yy + (sprite_get_height(prt[message_current]) / 3) + 28; | 
    
    
        | 28 |     draw_sprite_ext(prt[message_current], prt_animate, portrait_xx, portrait_y_disjoint, 0.5, 0.5, 0, c_white, 1); | 
    
    
        | 29 |     if (prt_animate == 0) | 
    
    
        | 30 |     { | 
    
    
        | 31 |         switch (prt[message_current]) | 
    
    
        | 32 |         { | 
    
    
        | 33 |             case 343: | 
    
    
        | 34 |                 if (portrait_idle_animated == 0 && irandom(40) == 1) | 
    
    
        | 35 |                 { | 
    
    
        | 36 |                     portrait_idle_animated = 346; | 
    
    
        | 37 |                     portrait_idle_frame = 0; | 
    
    
        | 38 |                 } | 
    
    
        | 39 |                 if (portrait_idle_animated != 0) | 
    
    
        | 40 |                 { | 
    
    
        | 41 |                     draw_sprite_ext(portrait_idle_animated, portrait_idle_frame, portrait_xx, portrait_y_disjoint, 0.5, 0.5, 0, c_white, 1); | 
    
    
        | 42 |                     portrait_idle_frame += 0.2; | 
    
    
        | 43 |                 } | 
    
    
        | 44 |                 if (portrait_idle_frame >= sprite_get_number(portrait_idle_animated)) | 
    
    
        | 45 |                 { | 
    
    
        | 46 |                     portrait_idle_animated = 0; | 
    
    
        | 47 |                     portrait_idle_frame = 0; | 
    
    
        | 48 |                 } | 
    
    
        | 49 |                 break; | 
    
    
        | 50 |             case 3232: | 
    
    
        | 51 |                 if (portrait_idle_animated == 0 && irandom(30) == 1) | 
    
    
        | 52 |                 { | 
    
    
        | 53 |                     portrait_idle_animated = 3182; | 
    
    
        | 54 |                     portrait_idle_frame = 0; | 
    
    
        | 55 |                 } | 
    
    
        | 56 |                 if (portrait_idle_animated != 0) | 
    
    
        | 57 |                 { | 
    
    
        | 58 |                     draw_sprite_ext(portrait_idle_animated, portrait_idle_frame, portrait_xx, portrait_y_disjoint, 0.5, 0.5, 0, c_white, 1); | 
    
    
        | 59 |                     portrait_idle_frame += 0.2; | 
    
    
        | 60 |                 } | 
    
    
        | 61 |                 if (portrait_idle_frame >= sprite_get_number(portrait_idle_animated)) | 
    
    
        | 62 |                 { | 
    
    
        | 63 |                     portrait_idle_animated = 0; | 
    
    
        | 64 |                     portrait_idle_frame = 0; | 
    
    
        | 65 |                 } | 
    
    
        | 66 |                 break; | 
    
    
        | 67 |         } | 
    
    
        | 68 |     } | 
    
    
        | 69 | } | 
    
    
        | 70 | draw_set_alpha(image_alpha); | 
    
    
        | 71 | var text_yy = 20; | 
    
    
        | 72 | draw_set_color(c_black); | 
    
    
        | 73 | draw_text_ext(xx + 1, text_yy, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 74 | draw_text_ext(xx + 1, text_yy + 1, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 75 | draw_text_ext(xx, text_yy + 1, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 76 | draw_text_ext(xx - 1, text_yy + 1, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 77 | draw_text_ext(xx - 1, text_yy, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 78 | draw_text_ext(xx - 1, text_yy - 1, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 79 | draw_text_ext(xx, text_yy - 1, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 80 | draw_text_ext(xx + 1, text_yy - 1, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 81 | draw_set_color(c_white); | 
    
    
        | 82 | draw_text_ext(xx, text_yy, string_hash_to_newline(message_actual), line_sep, -1); | 
    
    
        | 83 | draw_set_alpha(1); | 
    
    
        | 84 | if (color == true) | 
    
    
        | 85 | { | 
    
    
        | 86 |     if (color_set == false) | 
    
    
        | 87 |     { | 
    
    
        | 88 |         for (var i = 0; i < (array_length_1d(message) - 1); i++) | 
    
    
        | 89 |         { | 
    
    
        | 90 |             var len = array_length_2d(message_col, i); | 
    
    
        | 91 |             if (len == 0) | 
    
    
        | 92 |             { | 
    
    
        | 93 |                 message_col[i][0] = ""; | 
    
    
        | 94 |             } | 
    
    
        | 95 |             else if (len > 0) | 
    
    
        | 96 |             { | 
    
    
        | 97 |                 for (var j = 0; j < (array_length_1d(col_modif) - 1); j++) | 
    
    
        | 98 |                 { | 
    
    
        | 99 |                     if (j < array_length_2d(message_col, i) && message_col[i][j] == 0) | 
    
    
        | 100 |                         message_col[i][j] = ""; | 
    
    
        | 101 |                 } | 
    
    
        | 102 |             } | 
    
    
        | 103 |         } | 
    
    
        | 104 |         color_set = true; | 
    
    
        | 105 |     } | 
    
    
        | 106 |     for (var j = 0; j < array_length_2d(message_col, message_current); j++) | 
    
    
        | 107 |     { | 
    
    
        | 108 |         message_actual_col[j] = string_copy(message_col[message_current][j], 0, cutoff); | 
    
    
        | 109 |         draw_set_color(col_modif[j]); | 
    
    
        | 110 |         draw_text_ext(xx, yy + 10, string_hash_to_newline(message_actual_col[j]), line_sep, -1); | 
    
    
        | 111 |     } | 
    
    
        | 112 | } | 
    
    
        | 113 | draw_set_color(c_white); | 
    
    
        | 114 | if (dialogue_is_minishop == true) | 
    
    
        | 115 | { | 
    
    
        | 116 |     var minishop_box_xx = 204; | 
    
    
        | 117 |     var minishop_box_yy = 92; | 
    
    
        | 118 |     draw_set_color(c_white); | 
    
    
        | 119 |     draw_rectangle(minishop_box_xx, minishop_box_yy, minishop_box_xx + 100, minishop_box_yy + 53, false); | 
    
    
        | 120 |     draw_set_color(c_black); | 
    
    
        | 121 |     draw_rectangle(minishop_box_xx + 3, minishop_box_yy + 3, (minishop_box_xx + 100) - 3, (minishop_box_yy + 53) - 3, false); | 
    
    
        | 122 |     draw_set_font(fnt_battle); | 
    
    
        | 123 |     draw_set_color(c_white); | 
    
    
        | 124 |     var item_count; | 
    
    
        | 125 |     for (item_count = 1; item_count <= 8; item_count++) | 
    
    
        | 126 |     { | 
    
    
        | 127 |         if (global.item_slot[item_count] == "Nothing") | 
    
    
        | 128 |             break; | 
    
    
        | 129 |     } | 
    
    
        | 130 |     draw_text(217, 100, string_hash_to_newline("$ - " + string(global.player_gold) + "#SPACE - " + string(item_count - 1) + "/8")); | 
    
    
        | 131 | } | 
    
    
        | 132 | if (choice == false && alpha_fade == false) | 
    
    
        | 133 |     exit; | 
    
    
        | 134 | xx = 100; | 
    
    
        | 135 | var spacing = 0.25; | 
    
    
        | 136 | if (ch[4] != "") | 
    
    
        | 137 |     spacing = 0.5; | 
    
    
        | 138 | if (portrait) | 
    
    
        | 139 |     spacing = 0.15; | 
    
    
        | 140 | var ypos1, ypos2; | 
    
    
        | 141 | if (position == 0) | 
    
    
        | 142 | { | 
    
    
        | 143 |     ypos1 = 190; | 
    
    
        | 144 |     if (ch[3] == "") | 
    
    
        | 145 |         ypos1 = 210; | 
    
    
        | 146 |     ypos2 = 210; | 
    
    
        | 147 | } | 
    
    
        | 148 | else | 
    
    
        | 149 | { | 
    
    
        | 150 |     ypos1 = 32; | 
    
    
        | 151 |     if (ch[3] == "") | 
    
    
        | 152 |         ypos1 = 56; | 
    
    
        | 153 |     ypos2 = 56; | 
    
    
        | 154 | } | 
    
    
        | 155 | if (ch[4] != "") | 
    
    
        | 156 |     xx -= 30; | 
    
    
        | 157 | var xpos1 = xx; | 
    
    
        | 158 | var xpos2 = xx + 122; | 
    
    
        | 159 | if (portrait == true) | 
    
    
        | 160 |     xpos1 += 20; | 
    
    
        | 161 | var xpos3 = xpos1; | 
    
    
        | 162 | var xpos4 = xpos2; | 
    
    
        | 163 | if (ch[2] == "") | 
    
    
        | 164 |     xpos1 = xpos1 + 56; | 
    
    
        | 165 | if (ch[4] == "") | 
    
    
        | 166 |     xpos3 = xpos1 + 56; | 
    
    
        | 167 | draw_set_alpha(ch_alpha); | 
    
    
        | 168 | if (cutoff >= string_length(message[message_current]) && global.dialogue_open == true) | 
    
    
        | 169 | { | 
    
    
        | 170 |     draw_set_halign(fa_center); | 
    
    
        | 171 |     if (ch[4] != "") | 
    
    
        | 172 |         draw_set_halign(fa_left); | 
    
    
        | 173 |     draw_text(xpos1, ypos1, string_hash_to_newline(ch[1])); | 
    
    
        | 174 |     if (ch[2] != "") | 
    
    
        | 175 |         draw_text(xpos2, ypos1, string_hash_to_newline(ch[2])); | 
    
    
        | 176 |     if (ch[3] != "") | 
    
    
        | 177 |         draw_text(xpos3, ypos2, string_hash_to_newline(ch[3])); | 
    
    
        | 178 |     if (ch[4] != "") | 
    
    
        | 179 |         draw_text(xpos4, ypos2, string_hash_to_newline(ch[4])); | 
    
    
        | 180 |     draw_set_halign(fa_center); | 
    
    
        | 181 |     var soul_offset = string_width(string_hash_to_newline(ch[p])) * 0.5; | 
    
    
        | 182 |     if (ch[4] != "") | 
    
    
        | 183 |         soul_offset = 0; | 
    
    
        | 184 |     var soul_x, soul_y; | 
    
    
        | 185 |     switch (p) | 
    
    
        | 186 |     { | 
    
    
        | 187 |         case 1: | 
    
    
        | 188 |             soul_x = xpos1 - soul_offset - 8; | 
    
    
        | 189 |             soul_y = ypos1 + 8; | 
    
    
        | 190 |             break; | 
    
    
        | 191 |         case 2: | 
    
    
        | 192 |             soul_x = xpos2 - soul_offset - 8; | 
    
    
        | 193 |             soul_y = ypos1 + 8; | 
    
    
        | 194 |             break; | 
    
    
        | 195 |         case 3: | 
    
    
        | 196 |             soul_x = xpos3 - soul_offset - 8; | 
    
    
        | 197 |             soul_y = ypos2 + 8; | 
    
    
        | 198 |             break; | 
    
    
        | 199 |         case 4: | 
    
    
        | 200 |             soul_x = xpos4 - soul_offset - 8; | 
    
    
        | 201 |             soul_y = ypos2 + 8; | 
    
    
        | 202 |             break; | 
    
    
        | 203 |     } | 
    
    
        | 204 |     draw_sprite(spr_heart_yellow_overworld, 0, soul_x, soul_y); | 
    
    
        | 205 | } | 
    
    
        | 206 | draw_set_alpha(1); | 
    
    
        | 207 | draw_set_halign(fa_left); |