Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_tablenpc_snowdin_14b_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited()
2
var current_song = obj_rodney_snowdin_14b_overworld_yellow.song
3
var fav_song = 145
4
message_repeating[0] = "* (You got the band merch pin.)"
5
message_repeating[1] = "* That one's super rare, so don't#  you lose it!"
6
message_repeating[2] = "* Only was sold at the concert#  they did at the dump that one#  time!"
7
message_repeating[3] = "* Man, that was so grungy..."
8
if (interact == 1 && waiter == 0)
9
{
10
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
11
    is_talking = 1
12
    waiter = 1
13
}
14
if (waiter == 1 && (!instance_exists(obj_dialogue)))
15
    waiter = 0
16
if (waiter == 1)
17
{
18
    with (msg)
19
    {
20
        portrait = false
21
        switch other.npc_flag
22
        {
23
            case 0:
24
                message[0] = "* Are you enjoying the tunes as#  much as I am?"
25
                message[1] = "* Actually. Don't answer that.#  You're not."
26
                message[2] = "* I used to be one of those#  superfans you hear about."
27
                message[3] = "* Followed the band around from#  place to place,"
28
                message[4] = "* Learned all the aliases they#  used in hotels,"
29
                message[5] = "* Watched them buy their favorite#  brands of cereal."
30
                message[6] = "* I'm reformed now though."
31
                message[7] = "* Now I'm content to sit and#  listen."
32
                if (!global.dialogue_open)
33
                    other.npc_flag += 1
34
                break
35
            case 1:
36
                message[0] = "* Nothing could beat this..."
37
                message[1] = "* Actually. That's a lie."
38
                message[2] = "* If they were playing my#  favorite song,"
39
                message[3] = "* That would beat this easy."
40
                message[4] = "* Mind asking them to play it for#  me?"
41
                message[5] = "* I'll make it worth your while."
42
                if (!global.dialogue_open)
43
                    other.npc_flag += 1
44
                break
45
            case 2:
46
                if (current_song != fav_song)
47
                {
48
                    message[0] = "* Hmm, nice tune."
49
                    message[1] = "* Boy, do I remember the first#  time I heard this song."
50
                    message[2] = "* Not my favorite though."
51
                }
52
                else
53
                {
54
                    message[0] = "* My gosh, I haven't heard this#  song in forever!"
55
                    message[1] = "* Definitely my favorite! Hands#  down!"
56
                    message[2] = "* Thank you so so so much!"
57
                    message[3] = "* What can I give you..."
58
                    message[4] = "* I know! Here! You can put it on#  your hat!"
59
                    if (other.item_got == false && scr_item
scr_item

function scr_item(argument0) //gml_Script_scr_item { nm = argument0 var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") { global.item_slot[i] = nm return true; } else { if (i == 8) return false; i++ continue } } }
("Band Merch Pin"))
60
                    {
61
                        message[5] = message_repeating[0]
62
                        message[6] = message_repeating[1]
63
                        message[7] = message_repeating[2]
64
                        message[8] = message_repeating[3]
65
                        other.item_got = true
66
                    }
67
                    else if (other.item_got == true)
68
                    {
69
                        if (message_current == 5 && other.is_talking == true)
70
                        {
71
                            other.is_talking = false
72
                            audio_play_sound(snd_success, 20, 0)
73
                        }
74
                        else if (message_current > 5)
75
                            other.is_talking = true
76
                        if (!global.dialogue_open)
77
                            other.npc_flag = 4
78
                    }
79
                    else
80
                    {
81
                        message[5] = "  (Inventory Full)"
82
                        message[6] = "* Wait... are you telling me you#  have too much stuff to take#  this?"
83
                        message[7] = "* You think the boring stuff you#  have can possibly compare to#  this?!"
84
                        message[8] = "* This is a concert exclusive#  piece of memorabilia!"
85
                        message[9] = "* Come back when you can#  appreciate that, okay bozo?"
86
                        if (message_current == 5 && other.is_talking == true)
87
                        {
88
                            audio_play_sound(snd_fail, 20, 0)
89
                            other.waiter = 0
90
                            other.npc_flag = 3
91
                        }
92
                    }
93
                }
94
                break
95
            case 3:
96
                if (other.item_got == false && scr_item
scr_item

function scr_item(argument0) //gml_Script_scr_item { nm = argument0 var i = 1 while (i <= 8) { if (global.item_slot[i] == "Nothing") { global.item_slot[i] = nm return true; } else { if (i == 8) return false; i++ continue } } }
("Band Merch Pin"))
97
                {
98
                    message[0] = "* Oh, have you come to your#  senses?"
99
                    message[1] = "* Fine, the pin is yours."
100
                    message[2] = "* You better be thankful for that,#  you got that?"
101
                    message[3] = message_repeating[0]
102
                    message[4] = message_repeating[1]
103
                    message[5] = message_repeating[2]
104
                    message[6] = message_repeating[3]
105
                    other.item_got = true
106
                }
107
                else if (other.item_got == true)
108
                {
109
                    if (message_current == 3 && other.is_talking == true)
110
                    {
111
                        other.is_talking = false
112
                        audio_play_sound(snd_success, 20, 0)
113
                    }
114
                    else if (message_current > 3)
115
                        other.is_talking = true
116
                    if (!global.dialogue_open)
117
                        other.npc_flag = 4
118
                }
119
                else
120
                {
121
                    message[0] = "* Still no space?"
122
                    message[1] = "* This is a concert exclusive#  piece of memorabilia!"
123
                    message[2] = "* Come back when you can#  appreciate that, okay bozo?"
124
                }
125
                break
126
            case 4:
127
                message[0] = "* This day is the best."
128
                message[1] = "* I wish I could go to their next#  concert too..."
129
                message[2] = "* Actually. No. That's how you#  get addicted."
130
                message[3] = "* Guess I'll just have to be#  content here."
131
                break
132
        }
133
134
    }
135
}