Deltarune (Chapter 1) script viewer

← back to main script listing

gml_GlobalScript_scr_lrecoitem

(view raw script w/o annotations or w/e)
1
function 
scr_lrecoitem
scr_lrecoitem

function
scr_lrecoitem(arg0)
{
scr_lrecover(arg0);
global.item[8] = recovered; if (maxedout == 1) global.item[8] = 9999; global.msg[0] +=

scr_84_get_lang_string("scr_lrecoitem_slash_scr_lrecoitem_gml_11_0")
;
if (global.item[8] < 999) global.msg[0] +=
scr_84_get_subst_string(
* You recovered ~1 HP!Wait for inputClose Message
scr_84_get_lang_string("scr_lrecoitem_slash_scr_lrecoitem_gml_14_0")
, string(global.item[8]));
else global.msg[0] +=
* Your HP was maxed out.Wait for inputClose Message
scr_84_get_lang_string("scr_lrecoitem_slash_scr_lrecoitem_gml_16_0")
;
script_execute(scr_writetext, 0, "x", 0, 0); }
(arg0)
2
{
3
    
scr_lrecover
scr_lrecover

function
scr_lrecover(arg0)
{ recovered = arg0; maxedout = 0; if (global.lhp < global.lmaxhp) global.lhp += arg0; else maxedout = 1; if (global.lhp >= global.lmaxhp && maxedout == 0) { global.lhp = global.lmaxhp; maxedout = 1; } }
(arg0);
4
    global.item[8] = recovered;
5
    if (maxedout == 1)
6
        global.item[8] = 9999;
7
    global.msg[0] += 

scr_84_get_lang_string
scr_84_get_lang_string

function
scr_84_get_lang_string(arg0)
{ return ds_map_find_value(global.lang_map, arg0); }
("scr_lrecoitem_slash_scr_lrecoitem_gml_11_0")
;
8
    if (global.item[8] < 999)
9
        global.msg[0] += 
scr_84_get_subst_string
scr_84_get_subst_string

function
scr_84_get_subst_string()
{ var str = argument[0]; var sub_id = 1; length = string_length(str); pos = 0; while (sub_id < argument_count) { var sub = "~" + string(sub_id); str = string_replace_all(str, sub, argument[sub_id]); sub_id = sub_id + 1; } return str; }
(
* You recovered ~1 HP!Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function
scr_84_get_lang_string(arg0)
{ return ds_map_find_value(global.lang_map, arg0); }
("scr_lrecoitem_slash_scr_lrecoitem_gml_14_0")
, string(global.item[8]));
10
    else
11
        global.msg[0] += 
* Your HP was maxed out.Wait for inputClose Message
scr_84_get_lang_string
scr_84_get_lang_string

function
scr_84_get_lang_string(arg0)
{ return ds_map_find_value(global.lang_map, arg0); }
("scr_lrecoitem_slash_scr_lrecoitem_gml_16_0")
;
12
    script_execute(scr_writetext, 0, "x", 0, 0);
13
}