Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_sell_shop_Step_0

(view raw script w/o annotations or w/e)
1
var shop_name = global.shop_name
2
if (action[message_current] != "Override")
3
{
4
    script_execute(gml_Script_scr_controls_text)
5
    if key_revert_pressed
6
    {
7
        if (shop_name == "Hotel Shop")
8
        {
9
            var message_og_length = string_length(message[message_current])
10
            if (characters < message_og_length)
11
                characters = message_og_length
12
            else
13
                characters = message_length
14
            message_draw_alt = string_copy(message_alt[message_current], 0, characters)
15
        }
16
        else
17
            characters = message_length
18
        message_draw = string_copy(message[message_current], 0, characters)
19
    }
20
    if (characters < message_length)
21
    {
22
        if (counter == 0)
23
        {
24
            script_execute(gml_Script_scr_text_increase)
25
            if (shop_name == "Hotel Shop")
26
            {
27
                message_draw_alt = string_copy(message_alt[message_current], 0, characters)
28
                var message_alt_length = string_length(message_alt[message_current])
29
                message_og_length = string_length(message[message_current])
30
                if (message_alt_length > message_og_length)
31
                    current_char = string_char_at(message_draw_alt, characters)
32
            }
33
            script_execute(talk_script[message_current])
34
        }
35
        else
36
            can_talk = false
37
    }
38
    else
39
    {
40
        can_talk = false
41
        if key_select_pressed
42
        {
43
            if (message_current < message_end)
44
            {
45
                message_current += 1
46
                message_length = string_length(message[message_current])
47
                characters = 0
48
                message_draw = ""
49
                if (shop_name == "Hotel Shop")
50
                {
51
                    message_alt_length = string_length(message_alt[message_current])
52
                    if (message_alt_length > message_length)
53
                        message_length = message_alt_length
54
                    message_draw_alt = ""
55
                }
56
            }
57
            else
58
            {
59
                if (global.sell_count < 1)
60
                    global.sell_count += 1
61
                instance_create(0, 120, obj_main_screen_shop)
62
                instance_create((obj_main_screen_shop.x + 210), obj_main_screen_shop.y, obj_item_description_screen_shop)
63
                instance_create((obj_main_screen_shop.x + 20), (obj_main_screen_shop.y + 10), obj_dialogue_main_screen_shop)
64
                instance_create((obj_main_screen_shop.x + 240), (obj_main_screen_shop.y + 10), obj_text_main_screen_shop)
65
                instance_create((obj_main_screen_shop.x + 229), (obj_main_screen_shop.y + 59), obj_heart_main_screen_shop)
66
                with (obj_talk_screen_shop)
67
                    instance_destroy()
68
                instance_destroy()
69
            }
70
        }
71
    }
72
    script_execute(gml_Script_scr_text_counter)
73
}