| 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_check("Pickaxe")) && npc_flag < 4) |
| 6 |
{ |
| 7 |
if (interact) |
| 8 |
{ |
| 9 |
scr_textscr_textfunction 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()
{
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 |
else if (dialogue_type == 2) |
| 44 |
{ |
| 45 |
if (interact) |
| 46 |
{ |
| 47 |
scr_textscr_textfunction scr_text()
{
if (!instance_exists(obj_dialogue))
msg = instance_create(x, y, obj_dialogue);
} (); |
| 48 |
is_talking = 1; |
| 49 |
} |
| 50 |
if (is_talking) |
| 51 |
{ |
| 52 |
if (npc_flag < 2) |
| 53 |
{ |
| 54 |
with (msg) |
| 55 |
{ |
| 56 |
message[0] = "* What do ya want?"; |
| 57 |
ch_msg = 0; |
| 58 |
ch[1] = "Elevator"; |
| 59 |
ch[2] = "Nothing"; |
| 60 |
if (outcome != 0) |
| 61 |
other.branch = outcome; |
| 62 |
if (other.branch == 1) |
| 63 |
{ |
| 64 |
message[1] = "* It's jammed again?"; |
| 65 |
message[2] = "* I swear, nothing ever works# here."; |
| 66 |
message[3] = "* I'm busy, kid."; |
| 67 |
if (!global.dialogue_open) |
| 68 |
{ |
| 69 |
other.npc_flag = 2; |
| 70 |
exit; |
| 71 |
} |
| 72 |
} |
| 73 |
if (other.branch == 2) |
| 74 |
message[1] = "* Go bug someone else then."; |
| 75 |
} |
| 76 |
} |
| 77 |
if (npc_flag == 2 || npc_flag == 3) |
| 78 |
{ |
| 79 |
with (msg) |
| 80 |
{ |
| 81 |
if (other.npc_flag == 2) |
| 82 |
{ |
| 83 |
message[0] = "* Ugh. Fine."; |
| 84 |
message[1] = "* I'll lend you my pickaxe...# for a price."; |
| 85 |
message[2] = "* How's 30G sound?"; |
| 86 |
} |
| 87 |
else |
| 88 |
{ |
| 89 |
if (message_current == 0) |
| 90 |
message_current = 2; |
| 91 |
message[2] = "* 30G, kid."; |
| 92 |
} |
| 93 |
ch_msg = 2; |
| 94 |
ch[1] = "Good"; |
| 95 |
ch[2] = "No way"; |
| 96 |
if (outcome != 0) |
| 97 |
other.branch = outcome; |
| 98 |
if (other.branch == 1) |
| 99 |
{ |
| 100 |
if (global.player_gold >= 30) |
| 101 |
{ |
| 102 |
if (scr_inventory_check_space()) |
| 103 |
{ |
| 104 |
message[3] = "* Verrry nice!"; |
| 105 |
message[4] = "* Here ya go!"; |
| 106 |
message[5] = "* Keep it. I don't need it no# more."; |
| 107 |
message[6] = "* Cause I have a spare! Heh heh."; |
| 108 |
message[7] = "* (Obtained Pickaxe!)"; |
| 109 |
if (message_current == 7) |
| 110 |
{ |
| 111 |
if (!scr_item_exists_check("Pickaxe")) |
| 112 |
{ |
| 113 |
scr_itemscr_itemfunction scr_item(arg0)
{
nm = arg0;
for (var i = 1; i <= 8; i++)
{
if (global.item_slot[i] == "Nothing")
{
global.item_slot[i] = nm;
return true;
break;
}
else if (i == 8)
{
return false;
}
}
} ("Pickaxe"); |
| 114 |
other.is_talking = false; |
| 115 |
other.npc_flag = 4; |
| 116 |
global.player_gold -= 30; |
| 117 |
} |
| 118 |
} |
| 119 |
} |
| 120 |
else |
| 121 |
{ |
| 122 |
message[3] = "* You can't lug around a pick!"; |
| 123 |
message[4] = "* Go lighten your load."; |
| 124 |
if (!global.dialogue_open) |
| 125 |
other.npc_flag = 3; |
| 126 |
} |
| 127 |
} |
| 128 |
else |
| 129 |
{ |
| 130 |
message[3] = "* Quit wastin' my time."; |
| 131 |
message[4] = "* Come back when you have the G."; |
| 132 |
if (!global.dialogue_open) |
| 133 |
other.npc_flag = 3; |
| 134 |
} |
| 135 |
} |
| 136 |
if (other.branch == 2) |
| 137 |
{ |
| 138 |
message[3] = "* Then I can't help ya."; |
| 139 |
message[4] = "* Find another way to fix it."; |
| 140 |
if (!global.dialogue_open) |
| 141 |
other.npc_flag = 3; |
| 142 |
} |
| 143 |
} |
| 144 |
} |
| 145 |
if (npc_flag == 4) |
| 146 |
{ |
| 147 |
with (msg) |
| 148 |
message[0] = "* Thanks for the G, kid."; |
| 149 |
} |
| 150 |
} |
| 151 |
} |
| 152 |
if (!is_talking) |
| 153 |
{ |
| 154 |
branch = 0; |
| 155 |
sprite_index = spr_slime_mine; |
| 156 |
image_speed = 0.4; |
| 157 |
if (floor(image_index) == 3) |
| 158 |
{ |
| 159 |
if (point_in_rectangle(x, y, __view_get(e__VW.XView, 0), __view_get(e__VW.YView, 0), __view_get(e__VW.XView, 0) + __view_get(e__VW.WView, 0), __view_get(e__VW.YView, 0) + __view_get(e__VW.HView, 0))) |
| 160 |
{ |
| 161 |
if (!audio_is_playing(snd_pickaxe_ding) && !audio_is_playing(snd_pickaxe_ding2)) |
| 162 |
audio_play_sound(choose(snd_pickaxe_ding, snd_pickaxe_ding2), 1, 0); |
| 163 |
} |
| 164 |
} |
| 165 |
} |
| 166 |
else |
| 167 |
{ |
| 168 |
sprite_index = spr_slime_talk; |
| 169 |
image_speed = 0.2; |
| 170 |
} |
| 171 |
|
| 172 |
enum e__VW |
| 173 |
{ |
| 174 |
XView, |
| 175 |
YView, |
| 176 |
WView, |
| 177 |
HView, |
| 178 |
Angle, |
| 179 |
HBorder, |
| 180 |
VBorder, |
| 181 |
HSpeed, |
| 182 |
VSpeed, |
| 183 |
Object, |
| 184 |
Visible, |
| 185 |
XPort, |
| 186 |
YPort, |
| 187 |
WPort, |
| 188 |
HPort, |
| 189 |
Camera, |
| 190 |
SurfaceID |
| 191 |
} |