Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_npc_producer_Step_0

(view raw script w/o annotations or w/e)
1
if (keyboard_multicheck_pressed(0) && scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state) { var pl_dir = obj_pl.direction var pl_x = 0 var pl_y = 0 var check_distance_x = 0 var check_distance_y = 0 switch pl_dir { case 0: pl_x = obj_pl.bbox_right pl_y = obj_pl.bbox_top + 1 check_distance_x = 20 break case 180: pl_x = obj_pl.bbox_left pl_y = obj_pl.bbox_top + 1 check_distance_x = -20 break case 90: pl_x = obj_pl.x pl_y = obj_pl.bbox_top check_distance_y = -20 break case 270: pl_x = obj_pl.x pl_y = obj_pl.bbox_bottom check_distance_y = 20 break } if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false) return true; } }
() == true && interact_count == 0)
2
{
3
    is_talking = true
4
    interact_count = 1
5
    return;
6
}
7
if (interact_count == 1)
8
{
9
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
10
    if (npc_flag == 1)
11
    {
12
        with (msg)
13
        {
14
            message[0] = "* Let me feel sorry for myself,#  please."
15
            message[1] = "* I will not let it go."
16
        }
17
        interact_count = 0
18
        return;
19
    }
20
    with (msg)
21
    {
22
        message[0] = "* What do ya want?"
23
        ch_msg = 0
24
        ch[1] = "What's\nwrong?"
25
        ch[2] = "Nothing"
26
        if (outcome == 1)
27
        {
28
            message[1] = "* I'll tell ya what's wrong!"
29
            other.interact_count = 2
30
        }
31
        if (outcome == 2)
32
        {
33
            message[1] = "* Then leave me be, will ya?"
34
            message[2] = "* ..."
35
            other.interact_count = 0
36
        }
37
    }
38
}
39
if (interact_count == 2 && (!global.dialogue_open))
40
{
41
    scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
42
    sprite_index = spr_npc_producer_turn
43
    image_speed = 0.3
44
    if (image_index >= (image_number - 1))
45
    {
46
        sprite_index = spr_npc_producer_turn_talk
47
        image_speed = 0
48
        timer = 10
49
        interact_count += 1
50
    }
51
}
52
if (interact_count == 3)
53
{
54
    if (!scr_timer
scr_timer

function scr_timer() //gml_Script_scr_timer { if (timer > 0) { timer-- return false; } else return true; }
())
55
        return;
56
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
57
    with (msg)
58
    {
59
        message[0] = "* My life's a wreck!"
60
        message[1] = "* Wasted, woeful, washed up!"
61
        message[2] = "* I was supposed to make it big!"
62
        message[3] = "* I was gonna be a big time#  producer!"
63
        message[4] = "* Ya know, show business!"
64
        message[5] = "* I couldn't tell ya where it#  went wrong."
65
        message[6] = "* I studied hard, I graduated#  middle school, what else do ya#  need?"
66
        message[7] = "* Snuck my way into gig booking#  at a joint in Hotland with#  potential in my eyes."
67
        message[8] = "* One day, this robot fella#  rolled up to me and asked if#  I've ever produced an artist."
68
        message[9] = "* Now, I'm a great producer. Make#  hot beats on my computer every#  weekend."
69
        message[10] = "* I had the talent, but I lacked#  the vision."
70
        message[11] = "* I told that one-wheeled#  television they wouldn't make#  it in the industry."
71
        message[12] = "* What an IDIOT I was!"
72
        message[13] = "* They soon garnered a following#  and totally exploded!"
73
        message[14] = "* ...Not literally... maybe."
74
        message[15] = "* Look, kid, I'll tell ya this:"
75
        message[16] = "* Sometimes, it's like we don't#  control our lives."
76
        message[17] = "* Fate has a cruel way of#  teachin' us lessons."
77
        message[18] = "* Have a little foresight and try#  not to grow arrogant like I did."
78
        message[19] = "* Don't you forget that."
79
    }
80
    if (!global.dialogue_open)
81
    {
82
        interact_count += 1
83
        sprite_index = spr_npc_producer_turn
84
        image_index = 5
85
        image_speed = -0.3
86
    }
87
}
88
if (interact_count == 4)
89
{
90
    if ((image_index + image_speed) <= 0)
91
    {
92
        sprite_index = spr_npc_producer
93
        image_speed = 0
94
        npc_flag += 1
95
        interact_count = 0
96
        is_talking = false
97
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
98
    }
99
}
100
if (ds_map_find_value(global.npc_map, npc_id) != npc_flag)
101
    ds_map_replace(global.npc_map, npc_id, npc_flag)
102
if (sprite_index != spr_npc_producer && sprite_index != spr_npc_producer_turn_talk)
103
    return;
104
if (instance_exists(obj_dialogue) && is_talking == true)
105
{
106
    if (obj_dialogue.cutoff == string_length(obj_dialogue.message[obj_dialogue.message_current]))
107
    {
108
        image_speed = 0
109
        image_index = 0
110
    }
111
    else
112
        image_speed = 0.2
113
}
114
else
115
{
116
    image_speed = 0
117
    is_talking = false
118
}