Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_foreteller_npc_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited()
2
if interact
3
    can_talk = true
4
if (can_talk == true)
5
{
6
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
7
    is_talking = 1
8
    with (msg)
9
    {
10
        dialogue_is_minishop = true
11
        portrait = false
12
        sndfnt = 99
13
        if (other.npc_flag == 0)
14
        {
15
            message[0] = "* Hello, traveler!"
16
            message[1] = "* Would you be interested in#  having your fortune told?"
17
            message[2] = "* Only 5G per fortune!"
18
            message[3] = "* Now, you may be thinking that#  price is a little low."
19
            message[4] = "* What quality fortune from an#  experienced fortune teller#  costs 5G?"
20
            message[5] = "* Well, your suspicions would be#  correct!"
21
            message[6] = "* See, I'm a fortune teller in#  training, so I'm selling tiny#  fortunes!"
22
            message[7] = "* Practice, you see."
23
            message[8] = "* So, can I interest you in a#  bite-sized fortune?"
24
            ch_msg = 8
25
        }
26
        else if (other.npc_flag <= 5)
27
        {
28
            message[0] = "* Tiny fortunes, still only 5G!"
29
            message[1] = "* Would you like one?"
30
            ch_msg = 1
31
        }
32
        else if (other.npc_flag == 6)
33
        {
34
            message[0] = "* Oh, I am sorry but I cannot#  give anymore fortunes now."
35
            message[1] = "* As part of my training, I can#  only see the future four times#  a day."
36
            message[2] = "* You may come back tomorrow!"
37
            other.can_talk = false
38
            other.npc_flag++
39
        }
40
        else if (other.npc_flag == 7)
41
        {
42
            message[0] = "* Is it tomorrow already?"
43
            message[1] = "* I am never sure."
44
            message[2] = "* It is hard to tell when you#  cannot see the sun go down."
45
            message[3] = "* I do not think it is tomorrow#  yet, so I will assume it is not."
46
            other.can_talk = false
47
        }
48
        ch[1] = "Sure"
49
        ch[2] = "Nope"
50
        if (outcome == 1)
51
        {
52
            if (global.player_gold >= 5)
53
            {
54
                message[(message_current + 1)] = "* Let us see what the world has#  in store for you..."
55
                global.cutscene = true
56
                global.player_gold -= 5
57
                if (other.npc_flag == 0)
58
                    other.npc_flag++
59
                other.fortune_ready = true
60
                other.npc_flag++
61
                audio_sound_gain(obj_oasis_indoors_dynamic_music.dynamic_mus, 0, 300)
62
            }
63
            else
64
                message[(message_current + 1)] = "* (Not enough G)"
65
            other.can_talk = false
66
        }
67
        if (outcome == 2)
68
        {
69
            message[(message_current + 1)] = "* If you change your mind, I'll#  be here."
70
            message[(message_current + 2)] = "* Otherwise, I may never get#  better."
71
            other.can_talk = false
72
            if (other.npc_flag == 0)
73
                other.npc_flag += 1
74
        }
75
    }
76
}
77
if (fortune_ready == true && (!global.dialogue_open))
78
{
79
    alarm[0] = 45
alarm[0]

sprite_index = spr_fortune_teller_open audio_play_sound(snd_mirrorbreak, 1, 0) var screenshake = instance_create(0, 0, obj_screenshake) screenshake.timer = 15 screenshake.intensity = 1 alarm[1] = 75
80
    fortune_ready = false
81
}
82
if (fortune == true)
83
{
84
    scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
85
    is_talking = true
86
    switch npc_flag
87
    {
88
        case 2:
89
            with (msg)
90
            {
91
                message[0] = "* Hmmmm-Oh dear!"
92
                message[1] = "* The future seems to indicate#  you're in for a tumble!"
93
                message[2] = "* Oh nonono, it looks like a big#  one too!"
94
                message[3] = "* It will happen very soon!"
95
                message[4] = "* Hang on..."
96
                message[5] = "* Oh... tumbleWEED."
97
                message[6] = "* I guess I got a little excited#  and missed that second part."
98
                message[7] = "* Sorry for the scare, looks like#  everything is fine after all."
99
            }
100
            break
101
        case 3:
102
            with (msg)
103
            {
104
                var cur_hour = current_hour
105
                var cur_minute = current_minute + 2
106
                if (cur_minute >= 60)
107
                {
108
                    cur_minute = cur_minute - 60
109
                    cur_hour += 1
110
                }
111
                message[0] = "* Hmmmm... ah yes, here we go!"
112
                message[1] = "* A very specific reading too,#  these are rare!"
113
                message[2] = "* In approximately two minutes..."
114
                message[3] = "* It will be " + string(cur_hour) + ":" + string(cur_minute) + "!"
115
                message[4] = "* Well, I hope that knowledge is#  helpful!"
116
            }
117
            break
118
        case 4:
119
            with (msg)
120
            {
121
                message[0] = "* Hmmmm-Gah!"
122
                message[1] = "* I have never seen a fortune#  this dark before!"
123
                message[2] = "* I-I, are you sure you want to#  hear it?"
124
                message[3] = "* Wha-what am I saying? You have#  a right to hear it!"
125
                message[4] = "* Umm... hold on let me steel#  myself first."
126
                message[5] = "* Okay."
127
                message[6] = "* I see death in your future."
128
                message[7] = "* Uh-but do not worry too much!#  There is no time given and,#  well, everyone dies eventually!"
129
                message[8] = "* Maybe I am seeing a hundred#  years from now-or two-hundred!#  That is even better!"
130
            }
131
            break
132
        case 5:
133
            with (msg)
134
            {
135
                message[0] = "* Hmmm... Oh! I got something!"
136
                message[1] = "* Oh goodie, it is you!"
137
                message[2] = "* I see you and-oh this is#  exciting-you are walking!"
138
                message[3] = "* Walking past a big, clear water#  cooler in..."
139
                message[4] = "* Oh wait, hold on. You don't#  wear stripes do you?"
140
                message[5] = "* That doesn't look like you at#  all."
141
                message[6] = "* Sorry, no charge on that one,#  cause it wasn't about you."
142
            }
143
            global.player_gold += 5
144
            npc_flag++
145
            break
146
    }
147
148
    if (!global.dialogue_open)
149
    {
150
        audio_sound_gain(obj_oasis_indoors_dynamic_music.dynamic_mus, 1, 300)
151
        sprite_index = spr_fortune_teller
152
        global.cutscene = false
153
        fortune = false
154
    }
155
}
156
depth = y