1 |
event_inherited() |
2 |
var dialogue_type = 1 |
3 |
if (global.dunes_flag[4] >= 1) |
4 |
dialogue_type = 2 |
5 |
if ((global.dunes_flag[4] >= 2 || scr_item_exists_checkscr_item_exists_checkfunction scr_item_exists_check(argument0) //gml_Script_scr_item_exists_check
{
var i = 1
while (i <= 8)
{
if (global.item_slot[i] == argument0)
return true;
else
{
if (i == 8)
return false;
i += 1
continue
}
}
} ("Pickaxe")) && npc_flag < 4) |
6 |
{ |
7 |
if interact |
8 |
{ |
9 |
scr_textscr_textfunction scr_text() //gml_Script_scr_text
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue)
} () |
10 |
with (msg) |
11 |
message[0] = "* (He's too wrapped up in his# work to speak with you.)" |
12 |
} |
13 |
} |
14 |
else if (dialogue_type == 1 && interact) |
15 |
{ |
16 |
scr_textscr_textfunction scr_text() //gml_Script_scr_text
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue)
} () |
17 |
is_talking = 1 |
18 |
switch npc_flag |
19 |
{ |
20 |
case 0: |
21 |
with (msg) |
22 |
{ |
23 |
portrait = false |
24 |
sndfnt = 99 |
25 |
message[0] = "* You a new hire?" |
26 |
message[1] = "* If I were you, I'd turn back# now." |
27 |
message[2] = "* I've been workin' this job for# twelve years and I've about had# enough." |
28 |
message[3] = "* I'm probably the only monster# that does their job 'round here." |
29 |
} |
30 |
npc_flag = 1 |
31 |
break |
32 |
case 1: |
33 |
with (msg) |
34 |
{ |
35 |
portrait = false |
36 |
sndfnt = 99 |
37 |
message[0] = "* If you need work, go talk to# the Foreman on the third level." |
38 |
message[1] = "* Not sure you'll get far with# him, though." |
39 |
} |
40 |
break |
41 |
} |
42 |
|
43 |
} |
44 |
else if (dialogue_type == 2) |
45 |
{ |
46 |
if interact |
47 |
{ |
48 |
scr_textscr_textfunction scr_text() //gml_Script_scr_text
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue)
} () |
49 |
is_talking = 1 |
50 |
} |
51 |
if is_talking |
52 |
{ |
53 |
if (npc_flag < 2) |
54 |
{ |
55 |
with (msg) |
56 |
{ |
57 |
message[0] = "* What do ya want?" |
58 |
ch_msg = 0 |
59 |
ch[1] = "Elevator" |
60 |
ch[2] = "Nothing" |
61 |
if (outcome != 0) |
62 |
other.branch = outcome |
63 |
if (other.branch == 1) |
64 |
{ |
65 |
message[1] = "* It's jammed again?" |
66 |
message[2] = "* I swear, nothing ever works# here." |
67 |
message[3] = "* I'm busy, kid." |
68 |
if (!global.dialogue_open) |
69 |
{ |
70 |
other.npc_flag = 2 |
71 |
return; |
72 |
} |
73 |
} |
74 |
if (other.branch == 2) |
75 |
message[1] = "* Go bug someone else then." |
76 |
} |
77 |
} |
78 |
if (npc_flag == 2 || npc_flag == 3) |
79 |
{ |
80 |
with (msg) |
81 |
{ |
82 |
if (other.npc_flag == 2) |
83 |
{ |
84 |
message[0] = "* Ugh. Fine." |
85 |
message[1] = "* I'll lend you my pickaxe...# for a price." |
86 |
message[2] = "* How's 30G sound?" |
87 |
} |
88 |
else |
89 |
{ |
90 |
if (message_current == 0) |
91 |
message_current = 2 |
92 |
message[2] = "* 30G, kid." |
93 |
} |
94 |
ch_msg = 2 |
95 |
ch[1] = "Good" |
96 |
ch[2] = "No way" |
97 |
if (outcome != 0) |
98 |
other.branch = outcome |
99 |
if (other.branch == 1) |
100 |
{ |
101 |
if (global.player_gold >= 30) |
102 |
{ |
103 |
if scr_inventory_check_space() |
104 |
{ |
105 |
message[3] = "* Verrry nice!" |
106 |
message[4] = "* Here ya go!" |
107 |
message[5] = "* Keep it. I don't need it no# more." |
108 |
message[6] = "* Cause I have a spare! Heh heh." |
109 |
message[7] = "* (Obtained Pickaxe!)" |
110 |
if (message_current == 7) |
111 |
{ |
112 |
if (!scr_item_exists_checkscr_item_exists_checkfunction scr_item_exists_check(argument0) //gml_Script_scr_item_exists_check
{
var i = 1
while (i <= 8)
{
if (global.item_slot[i] == argument0)
return true;
else
{
if (i == 8)
return false;
i += 1
continue
}
}
} ("Pickaxe")) |
113 |
{ |
114 |
scr_itemscr_itemfunction 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
}
}
} ("Pickaxe") |
115 |
other.is_talking = false |
116 |
other.npc_flag = 4 |
117 |
global.player_gold -= 30 |
118 |
} |
119 |
} |
120 |
} |
121 |
else |
122 |
{ |
123 |
message[3] = "* You can't lug around a pick!" |
124 |
message[4] = "* Go lighten your load." |
125 |
if (!global.dialogue_open) |
126 |
other.npc_flag = 3 |
127 |
} |
128 |
} |
129 |
else |
130 |
{ |
131 |
message[3] = "* Quit wastin' my time." |
132 |
message[4] = "* Come back when you have the G." |
133 |
if (!global.dialogue_open) |
134 |
other.npc_flag = 3 |
135 |
} |
136 |
} |
137 |
if (other.branch == 2) |
138 |
{ |
139 |
message[3] = "* Then I can't help ya." |
140 |
message[4] = "* Find another way to fix it." |
141 |
if (!global.dialogue_open) |
142 |
other.npc_flag = 3 |
143 |
} |
144 |
} |
145 |
} |
146 |
if (npc_flag == 4) |
147 |
{ |
148 |
with (msg) |
149 |
message[0] = "* Thanks for the G, kid." |
150 |
} |
151 |
} |
152 |
} |
153 |
if (!is_talking) |
154 |
{ |
155 |
branch = 0 |
156 |
sprite_index = spr_slime_mine |
157 |
image_speed = 0.4 |
158 |
if (floor(image_index) == 3) |
159 |
{ |
160 |
if point_in_rectangle(x, y, __view_get((0 << 0), 0), __view_get((1 << 0), 0), ((__view_get((0 << 0), 0)) + (__view_get((2 << 0), 0))), ((__view_get((1 << 0), 0)) + (__view_get((3 << 0), 0)))) |
161 |
{ |
162 |
if ((!audio_is_playing(snd_pickaxe_ding)) && (!audio_is_playing(snd_pickaxe_ding2))) |
163 |
audio_play_sound(choose(268, 269), 1, 0) |
164 |
} |
165 |
} |
166 |
} |
167 |
else |
168 |
{ |
169 |
sprite_index = spr_slime_talk |
170 |
image_speed = 0.2 |
171 |
} |